[][src]Trait solana_runtime::process_instruction::InvokeContext

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

Invocation context passed to loaders

Required methods

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

Push a program ID on to the invocation stack

fn pop(&mut self)

Pop a program ID off of the invocation stack

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

Verify and update PreAccount state based on program execution

fn get_caller(&self) -> Result<&Pubkey, InstructionError>

Get the program ID of the currently executing program

fn get_programs(&self) -> &[(Pubkey, ProcessInstruction)]

Get a list of built-in programs

fn get_logger(&self) -> Rc<RefCell<dyn Logger>>

Get this invocation's logger

fn is_cross_program_supported(&self) -> bool

Are cross program invocations supported

fn get_compute_budget(&self) -> ComputeBudget

Get this invocation's compute budget

fn get_compute_meter(&self) -> Rc<RefCell<dyn ComputeMeter>>

Get this invocation's compute meter

fn add_executor(&mut self, pubkey: &Pubkey, executor: Arc<dyn Executor>)

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

fn get_executor(&mut self, pubkey: &Pubkey) -> Option<Arc<dyn Executor>>

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

fn record_instruction(&self, instruction: &Instruction)

Record invoked instruction

Loading content...

Implementors

impl InvokeContext for ThisInvokeContext[src]

Loading content...