Programs can only sign their accounts

This commit is contained in:
Jack May
2020-05-08 12:24:36 -07:00
parent b4b4d6b00d
commit 97e17f9b32
10 changed files with 187 additions and 100 deletions

View File

@ -229,6 +229,11 @@ impl InvokeContext for ThisInvokeContext {
None => Err(InstructionError::GenericError), // Should never happen
}
}
fn get_caller(&self) -> Result<&Pubkey, InstructionError> {
self.program_ids
.last()
.ok_or(InstructionError::GenericError)
}
}
pub type ProcessInstruction = fn(&Pubkey, &[KeyedAccount], &[u8]) -> Result<(), InstructionError>;