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> { ... }
}
๐Ÿ‘ŽDeprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
Expand description

Callback used by InvokeContext in SVM

Provided Methodsยง

Source

fn get_epoch_stake(&self) -> u64

๐Ÿ‘ŽDeprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

Returns the total current epoch stake for the network.

Source

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

๐Ÿ‘ŽDeprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

Returns the current epoch stake for the given vote account.

Source

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

๐Ÿ‘ŽDeprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

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>

๐Ÿ‘ŽDeprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

Calls the precompiled program corresponding to the given program ID.

Implementorsยง