Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

v1.17: SDK: update error variants in Feature::from_account_info (backport of #33750) #33780

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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