Skip to content

Commit

Permalink
SDK: update error variants in Feature::from_account_info (#33750)
Browse files Browse the repository at this point in the history
(cherry picked from commit 6b1e9b8)
  • Loading branch information
Joe C authored and mergify[bot] committed Oct 20, 2023
1 parent 423de49 commit 8744ece
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 8744ece

Please sign in to comment.