Skip to content

Commit

Permalink
feature: update error variant in from_account_info
Browse files Browse the repository at this point in the history
  • Loading branch information
buffalojoec committed Oct 18, 2023
1 parent 785959b commit 35e470f
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::IncorrectProgramId);
}
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 35e470f

Please sign in to comment.