Skip to content

Commit

Permalink
v1.17: SDK: update error variants in Feature::from_account_info (ba…
Browse files Browse the repository at this point in the history
…ckport of #33750) (#33780)

SDK: update error variants in `Feature::from_account_info` (#33750)

(cherry picked from commit 6b1e9b8)

Co-authored-by: Joe C <joe.caulfield@solana.com>
  • Loading branch information
mergify[bot] and buffalojoec committed Oct 20, 2023
1 parent 423de49 commit 945daef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sdk/program/src/feature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ impl Feature {

pub fn from_account_info(account_info: &AccountInfo) -> Result<Self, ProgramError> {
if *account_info.owner != id() {
return Err(ProgramError::InvalidArgument);
return Err(ProgramError::InvalidAccountOwner);
}
bincode::deserialize(&account_info.data.borrow()).map_err(|_| ProgramError::InvalidArgument)
bincode::deserialize(&account_info.data.borrow())
.map_err(|_| ProgramError::InvalidAccountData)
}
}

Expand Down

0 comments on commit 945daef

Please sign in to comment.