LiteSvmExtensions

Trait LiteSvmExtensions 

Source
pub trait LiteSvmExtensions {
    // Required method
    fn get_program_accounts(
        &self,
        program_id: &Pubkey,
    ) -> Vec<(Pubkey, Account)>;
}
Expand description

Extension trait for LiteSVM to add utility methods.

This trait provides additional functionality on top of the base LiteSVM, such as querying all accounts owned by a specific program.

Required Methods§

Source

fn get_program_accounts(&self, program_id: &Pubkey) -> Vec<(Pubkey, Account)>

Returns all accounts owned by the provided program id.

This method iterates through the internal accounts database and filters accounts by their owner field.

§Arguments
  • program_id - The program ID to filter accounts by
§Returns

A vector of tuples containing (Pubkey, Account) for all accounts owned by the program

Implementations on Foreign Types§

Source§

impl LiteSvmExtensions for LiteSVM

Source§

fn get_program_accounts(&self, program_id: &Pubkey) -> Vec<(Pubkey, Account)>

Implementors§