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
  • Loading branch information
buffalojoec committed Oct 20, 2023
1 parent 37d093a commit 6b1e9b8
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 6b1e9b8

Please sign in to comment.