Struct solana_program_test::InvokeContext [−][src]
pub struct InvokeContext<'a> {
pub sysvars: &'a [(Pubkey, Vec<u8, Global>)],
pub instruction_recorder: Option<&'a InstructionRecorder>,
pub feature_set: Arc<FeatureSet>,
pub timings: ExecuteDetailsTimings,
pub blockhash: Hash,
pub lamports_per_signature: u64,
pub return_data: (Pubkey, Vec<u8, Global>),
// some fields omitted
}
Fields
sysvars: &'a [(Pubkey, Vec<u8, Global>)]
instruction_recorder: Option<&'a InstructionRecorder>
feature_set: Arc<FeatureSet>
timings: ExecuteDetailsTimings
blockhash: Hash
lamports_per_signature: u64
return_data: (Pubkey, Vec<u8, Global>)
Implementations
pub fn new(
rent: Rent,
accounts: &'a [(Pubkey, Rc<RefCell<AccountSharedData>>)],
builtin_programs: &'a [BuiltinProgram],
sysvars: &'a [(Pubkey, Vec<u8, Global>)],
log_collector: Option<Rc<RefCell<LogCollector>>>,
compute_budget: ComputeBudget,
executors: Rc<RefCell<HashMap<Pubkey, TransactionExecutor, RandomState>>>,
feature_set: Arc<FeatureSet>,
blockhash: Hash,
lamports_per_signature: u64,
current_accounts_data_len: u64
) -> InvokeContext<'a>
pub fn new_mock(
accounts: &'a [(Pubkey, Rc<RefCell<AccountSharedData>>)],
builtin_programs: &'a [BuiltinProgram]
) -> InvokeContext<'a>
Push a stack frame onto the invocation stack
Current depth of the invocation stack
Entrypoint for a cross-program invocation from a builtin program
Helper to prepare for process_instruction()
pub fn process_instruction(
&mut self,
message: &SanitizedMessage,
instruction: &CompiledInstruction,
program_indices: &[usize],
account_indices: &[usize],
caller_write_privileges: &[bool],
timings: &mut ExecuteTimings
) -> ProcessInstructionResult
pub fn process_instruction(
&mut self,
message: &SanitizedMessage,
instruction: &CompiledInstruction,
program_indices: &[usize],
account_indices: &[usize],
caller_write_privileges: &[bool],
timings: &mut ExecuteTimings
) -> ProcessInstructionResult
Processes a cross-program instruction and returns how many compute units were used
Get the program ID of the currently executing program
Get the owner of the currently executing program
👎 Deprecated since 1.9.0: To be removed together with remove_native_loader
To be removed together with remove_native_loader
Removes the first keyed account
Get the list of keyed accounts
Get the list of keyed accounts without the chain of program accounts
Note: This only contains the KeyedAccount
s passed by the caller.
Get this invocation’s LogCollector
Get this invocation’s ComputeMeter
Get this invocation’s AccountsDataMeter
Cache an executor that wasn’t found in the cache
Cache an executor that has changed
Get the completed loader work that can be re-used across execution
Find an account_index and account by its key
Get this invocation’s compute budget
Get the value of a sysvar by its id
Auto Trait Implementations
impl<'a> !RefUnwindSafe for InvokeContext<'a>
impl<'a> !Send for InvokeContext<'a>
impl<'a> !Sync for InvokeContext<'a>
impl<'a> Unpin for InvokeContext<'a>
impl<'a> !UnwindSafe for InvokeContext<'a>
Blanket Implementations
pub default fn example() -> T
Mutably borrows from an owned value. Read more
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more