[][src]Trait solana_sdk::process_instruction::InvokeContext

pub trait InvokeContext {
    pub fn push(&mut self, key: &Pubkey) -> Result<(), InstructionError>;
pub fn pop(&mut self);
pub fn invoke_depth(&self) -> usize;
pub fn verify_and_update(
        &mut self,
        message: &Message,
        instruction: &CompiledInstruction,
        accounts: &[Rc<RefCell<Account>>]
    ) -> Result<(), InstructionError>;
pub fn get_caller(&self) -> Result<&Pubkey, InstructionError>;
pub fn get_programs(&self) -> &[(Pubkey, ProcessInstructionWithContext)];
pub fn get_logger(&self) -> Rc<RefCell<dyn Logger>>;
pub fn get_bpf_compute_budget(&self) -> &BpfComputeBudget;
pub fn get_compute_meter(&self) -> Rc<RefCell<dyn ComputeMeter>>;
pub fn add_executor(&self, pubkey: &Pubkey, executor: Arc<dyn Executor>);
pub fn get_executor(&self, pubkey: &Pubkey) -> Option<Arc<dyn Executor>>;
pub fn record_instruction(&self, instruction: &Instruction);
pub fn is_feature_active(&self, feature_id: &Pubkey) -> bool; }

Invocation context passed to loaders

Required methods

pub fn push(&mut self, key: &Pubkey) -> Result<(), InstructionError>[src]

Push a program ID on to the invocation stack

pub fn pop(&mut self)[src]

Pop a program ID off of the invocation stack

pub fn invoke_depth(&self) -> usize[src]

Current depth of the invocation stake

pub fn verify_and_update(
    &mut self,
    message: &Message,
    instruction: &CompiledInstruction,
    accounts: &[Rc<RefCell<Account>>]
) -> Result<(), InstructionError>
[src]

Verify and update PreAccount state based on program execution

pub fn get_caller(&self) -> Result<&Pubkey, InstructionError>[src]

Get the program ID of the currently executing program

pub fn get_programs(&self) -> &[(Pubkey, ProcessInstructionWithContext)][src]

Get a list of built-in programs

pub fn get_logger(&self) -> Rc<RefCell<dyn Logger>>[src]

Get this invocation's logger

pub fn get_bpf_compute_budget(&self) -> &BpfComputeBudget[src]

Get this invocation's compute budget

pub fn get_compute_meter(&self) -> Rc<RefCell<dyn ComputeMeter>>[src]

Get this invocation's compute meter

pub fn add_executor(&self, pubkey: &Pubkey, executor: Arc<dyn Executor>)[src]

Loaders may need to do work in order to execute a program. Cache the work that can be re-used across executions

pub fn get_executor(&self, pubkey: &Pubkey) -> Option<Arc<dyn Executor>>[src]

Get the completed loader work that can be re-used across executions

pub fn record_instruction(&self, instruction: &Instruction)[src]

Record invoked instruction

pub fn is_feature_active(&self, feature_id: &Pubkey) -> bool[src]

Get the bank's active feature set

Loading content...

Implementors

impl InvokeContext for MockInvokeContext[src]

Loading content...