Add built-in programs to InvokeContext (#10383)

automerge
This commit is contained in:
Michael Vines
2020-06-03 12:48:19 -07:00
committed by GitHub
parent ea9b958dff
commit a4cd96609c
7 changed files with 36 additions and 14 deletions

View File

@ -146,6 +146,8 @@ macro_rules! declare_loader(
)
);
pub type ProcessInstruction = fn(&Pubkey, &[KeyedAccount], &[u8]) -> Result<(), InstructionError>;
/// Cross-program invocation context passed to loaders
pub trait InvokeContext {
fn push(&mut self, key: &Pubkey) -> Result<(), InstructionError>;
@ -157,4 +159,5 @@ pub trait InvokeContext {
accounts: &[Rc<RefCell<Account>>],
) -> Result<(), InstructionError>;
fn get_caller(&self) -> Result<&Pubkey, InstructionError>;
fn get_programs(&self) -> &[(Pubkey, ProcessInstruction)];
}