This commit is contained in:
Jack May 2020-05-08 16:05:54 -07:00
parent af84dff9ef
commit bfe179e911
1 changed files with 6 additions and 1 deletions

View File

@ -133,7 +133,9 @@ fn bench_program_alu(bencher: &mut Bencher) {
} }
#[derive(Debug, Default)] #[derive(Debug, Default)]
pub struct MockInvokeContext {} pub struct MockInvokeContext {
key: Pubkey,
}
impl InvokeContext for MockInvokeContext { impl InvokeContext for MockInvokeContext {
fn push(&mut self, _key: &Pubkey) -> Result<(), InstructionError> { fn push(&mut self, _key: &Pubkey) -> Result<(), InstructionError> {
Ok(()) Ok(())
@ -148,4 +150,7 @@ impl InvokeContext for MockInvokeContext {
) -> Result<(), InstructionError> { ) -> Result<(), InstructionError> {
Ok(()) Ok(())
} }
fn get_caller(&self) -> Result<&Pubkey, InstructionError> {
Ok(&self.key)
}
} }