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 cc6dbaa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sdk/program/src/feature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ 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 cc6dbaa

Please sign in to comment.