Add a check that shows why the storage program is failing

This commit is contained in:
Greg Fitzgerald 2019-02-22 13:41:31 -07:00
parent 11c7aab023
commit a56d717ea8
1 changed files with 5 additions and 0 deletions

View File

@ -45,6 +45,11 @@ fn entrypoint(
Err(ProgramError::GenericError)?;
}
if !check_id(&keyed_accounts[1].account.owner) {
error!("account[1] is not assigned to the STORAGE_PROGRAM");
Err(ProgramError::InvalidArgument)?;
}
if *keyed_accounts[1].unsigned_key() != system_id() {
info!(
"invalid account id owner: {:?} system_id: {:?}",