Struct solana_sdk::process_instruction::MockInvokeContext[][src]

pub struct MockInvokeContext {
    pub key: Pubkey,
    pub logger: MockLogger,
    pub bpf_compute_budget: BpfComputeBudget,
    pub compute_meter: MockComputeMeter,
    pub programs: Vec<(Pubkey, ProcessInstructionWithContext)>,
    pub accounts: Vec<(Pubkey, Rc<RefCell<AccountSharedData>>)>,
    pub invoke_depth: usize,
    pub sysvars: Vec<(Pubkey, Option<Rc<Vec<u8>>>)>,
}

Fields

key: Pubkeylogger: MockLoggerbpf_compute_budget: BpfComputeBudgetcompute_meter: MockComputeMeterprograms: Vec<(Pubkey, ProcessInstructionWithContext)>accounts: Vec<(Pubkey, Rc<RefCell<AccountSharedData>>)>invoke_depth: usizesysvars: Vec<(Pubkey, Option<Rc<Vec<u8>>>)>

Trait Implementations

impl Default for MockInvokeContext[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

impl InvokeContext for MockInvokeContext[src]

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 Read more

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(&self, id: &Pubkey) -> Option<Rc<Vec<u8>>>[src]

Get sysvar data

Auto Trait Implementations

Blanket Implementations

impl<T> AbiExample for T[src]

pub default fn example() -> T[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V