trident_fuzz::fuzz_client

Trait FuzzClient

source
pub trait FuzzClient {
    // Required methods
    fn set_account(&mut self, lamports: u64) -> Keypair;
    fn set_account_custom(
        &mut self,
        address: &Pubkey,
        account: &AccountSharedData,
    );
    fn set_token_account(
        &mut self,
        mint: Pubkey,
        owner: Pubkey,
        amount: u64,
        delegate: Option<Pubkey>,
        is_native: Option<u64>,
        delegated_amount: u64,
        close_authority: Option<Pubkey>,
    ) -> Pubkey;
    fn set_mint_account(
        &mut self,
        decimals: u8,
        owner: &Pubkey,
        freeze_authority: Option<Pubkey>,
    ) -> Pubkey;
    fn payer(&self) -> Keypair;
    fn get_account(
        &mut self,
        key: &Pubkey,
    ) -> Result<Option<Account>, FuzzClientError>;
    fn get_accounts(
        &mut self,
        metas: &[AccountMeta],
    ) -> Result<Vec<Option<Account>>, FuzzClientErrorWithOrigin>;
    fn get_last_blockhash(&self) -> Hash;
    fn get_rent(&mut self) -> Result<Rent, FuzzClientError>;
    fn process_transaction(
        &mut self,
        transaction: impl Into<VersionedTransaction>,
    ) -> Result<(), FuzzClientError>;
}
Expand description

A trait providing methods to read and write (manipulate) accounts

Required Methods§

source

fn set_account(&mut self, lamports: u64) -> Keypair

Create an empty account and add lamports to it

source

fn set_account_custom(&mut self, address: &Pubkey, account: &AccountSharedData)

Create or overwrite a custom account, subverting normal runtime checks.

source

fn set_token_account( &mut self, mint: Pubkey, owner: Pubkey, amount: u64, delegate: Option<Pubkey>, is_native: Option<u64>, delegated_amount: u64, close_authority: Option<Pubkey>, ) -> Pubkey

Create an SPL token account

source

fn set_mint_account( &mut self, decimals: u8, owner: &Pubkey, freeze_authority: Option<Pubkey>, ) -> Pubkey

Create an SPL mint account

source

fn payer(&self) -> Keypair

Get the Keypair of the client’s payer account

source

fn get_account( &mut self, key: &Pubkey, ) -> Result<Option<Account>, FuzzClientError>

Get the account at the given address

source

fn get_accounts( &mut self, metas: &[AccountMeta], ) -> Result<Vec<Option<Account>>, FuzzClientErrorWithOrigin>

Get accounts based on the supplied meta information

source

fn get_last_blockhash(&self) -> Hash

Get last blockhash

source

fn get_rent(&mut self) -> Result<Rent, FuzzClientError>

Get the cluster rent

source

fn process_transaction( &mut self, transaction: impl Into<VersionedTransaction>, ) -> Result<(), FuzzClientError>

Send a transaction and return until the transaction has been finalized or rejected.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§