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

pub trait InvokeContext {
Show methods fn push(&mut self, key: &Pubkey) -> Result<(), InstructionError>;
fn pop(&mut self);
fn invoke_depth(&self) -> usize;
fn verify_and_update(
        &mut self,
        message: &Message,
        instruction: &CompiledInstruction,
        accounts: &[Rc<RefCell<AccountSharedData>>],
        caller_pivileges: Option<&[bool]>
    ) -> Result<(), InstructionError>;
fn get_caller(&self) -> Result<&Pubkey, InstructionError>;
fn get_programs(&self) -> &[(Pubkey, ProcessInstructionWithContext)]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
;
fn get_logger(&self) -> Rc<RefCell<dyn Logger>>;
fn get_bpf_compute_budget(&self) -> &BpfComputeBudget;
fn get_compute_meter(&self) -> Rc<RefCell<dyn ComputeMeter>>;
fn add_executor(&self, pubkey: &Pubkey, executor: Arc<dyn Executor>);
fn get_executor(&self, pubkey: &Pubkey) -> Option<Arc<dyn Executor>>;
fn record_instruction(&self, instruction: &Instruction);
fn is_feature_active(&self, feature_id: &Pubkey) -> bool;
fn get_account(
        &self,
        pubkey: &Pubkey
    ) -> Option<Rc<RefCell<AccountSharedData>>>;
fn update_timing(
        &mut self,
        serialize_us: u64,
        create_vm_us: u64,
        execute_us: u64,
        deserialize_us: u64
    );
fn get_sysvar_data(&mut self, id: &Pubkey) -> Option<Rc<Vec<u8>>>;
}

Invocation context passed to loaders

Required methods

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

Push a program ID on to the invocation stack

fn pop(&mut self)[src]

Pop a program ID off of the invocation stack

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

Current depth of the invocation stake

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

Verify and update PreAccount state based on program execution

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

Get the program ID of the currently executing program

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

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Get a list of built-in programs

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

Get this invocation’s logger

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

Get this invocation’s compute budget

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

Get this invocation’s compute meter

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

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

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

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

Record invoked instruction

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

Get the bank’s active feature set

fn get_account(&self, pubkey: &Pubkey) -> Option<Rc<RefCell<AccountSharedData>>>[src]

Get an account from a pre-account

fn update_timing(
    &mut self,
    serialize_us: u64,
    create_vm_us: u64,
    execute_us: u64,
    deserialize_us: u64
)
[src]

Update timing

fn get_sysvar_data(&mut self, id: &Pubkey) -> Option<Rc<Vec<u8>>>[src]

Get sysvar data

Loading content...

Implementors

impl InvokeContext for MockInvokeContext[src]

Loading content...