From a56d717ea84bdef436bbd71cee909f9d35bb13bc Mon Sep 17 00:00:00 2001 From: Greg Fitzgerald Date: Fri, 22 Feb 2019 13:41:31 -0700 Subject: [PATCH] Add a check that shows why the storage program is failing --- programs/native/storage/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/programs/native/storage/src/lib.rs b/programs/native/storage/src/lib.rs index 397956830e..c1a9c76597 100644 --- a/programs/native/storage/src/lib.rs +++ b/programs/native/storage/src/lib.rs @@ -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: {:?}",