pub trait InvokeContextCallback {
// Provided methods
fn get_epoch_stake(&self) -> u64 { ... }
fn get_epoch_stake_for_vote_account(&self, _vote_address: &Pubkey) -> u64 { ... }
fn is_precompile(&self, _program_id: &Pubkey) -> bool { ... }
fn process_precompile(
&self,
_program_id: &Pubkey,
_data: &[u8],
_instruction_datas: Vec<&[u8]>,
) -> Result<(), PrecompileError> { ... }
}
Expand description
Callback used by InvokeContext in SVM
Provided Methods§
Sourcefn get_epoch_stake(&self) -> u64
fn get_epoch_stake(&self) -> u64
Returns the total current epoch stake for the network.
Sourcefn get_epoch_stake_for_vote_account(&self, _vote_address: &Pubkey) -> u64
fn get_epoch_stake_for_vote_account(&self, _vote_address: &Pubkey) -> u64
Returns the current epoch stake for the given vote account.
Sourcefn is_precompile(&self, _program_id: &Pubkey) -> bool
fn is_precompile(&self, _program_id: &Pubkey) -> bool
Returns true if the program_id corresponds to a precompiled program
Sourcefn process_precompile(
&self,
_program_id: &Pubkey,
_data: &[u8],
_instruction_datas: Vec<&[u8]>,
) -> Result<(), PrecompileError>
fn process_precompile( &self, _program_id: &Pubkey, _data: &[u8], _instruction_datas: Vec<&[u8]>, ) -> Result<(), PrecompileError>
Calls the precompiled program corresponding to the given program ID.