InvokeContextCallback

Trait InvokeContextCallback 

Source
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§

Source

fn get_epoch_stake(&self) -> u64

Returns the total current epoch stake for the network.

Source

fn get_epoch_stake_for_vote_account(&self, _vote_address: &Pubkey) -> u64

Returns the current epoch stake for the given vote account.

Source

fn is_precompile(&self, _program_id: &Pubkey) -> bool

Returns true if the program_id corresponds to a precompiled program

Source

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.

Implementors§