Skip to content

Trident's Fuzz Client#

Trident's Client (FuzzClient) is a wrapper around the TridentSVM that provides methods to manipulate with the execution environment during fuzzing.

This section describes the methods that are available in the FuzzClient.

Trident Client Methods#

new_client#

Creates a new instance of the fuzzing client with the specified programs and configuration.

fn new_client(programs: &[ProgramEntrypoint], config: &TridentConfig) -> Self


deploy_native_program#

Deploys a native program to the fuzzing client.

fn deploy_native_program(program: ProgramEntrypoint)


get_sysvar#

Retrieves Sysvars like Rent, Clock, etc.

fn get_sysvar<T: Sysvar>() -> T


warp_to_epoch#

Advances the fuzz test to a specific epoch.

fn warp_to_epoch(warp_epoch: u64)


warp_to_slot#

Advances the fuzz test to a specific slot.

fn warp_to_slot(warp_slot: u64)


warp_to_timestamp#

Sets the fuzz test to a specific timestamp.

fn warp_to_timestamp(warp_timestamp: i64)


forward_in_time#

Advances the fuzz test by the specified number of seconds.

fn forward_in_time(seconds: i64)


set_account_custom#

Creates or overwrites an account at the specified address, bypassing normal runtime checks.

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


get_account#

Retrieves the account data at the specified address.

fn get_account(key: &Pubkey) -> AccountSharedData


payer#

Returns the keypair of the client's payer account.

fn payer() -> Keypair


clear_accounts#

Removes temporary accounts created during the fuzzing iteration.

Warning

This method is called internally by Trident (after each fuzzing iteration, to reset state to default).

fn clear_accounts()

get_last_blockhash#

Retrieves the most recent blockhash.

Warning

Currently, this method is not implemented and call to this method will result in a panic.

fn get_last_blockhash() -> Hash

process_instructions#

Executes a set of instructions and waits for them to be either finalized or rejected.

Warning

This method is called internally by Trident, no need for manual invocation.

fn process_instructions(instructions: &[Instruction]) -> Result<(), TransactionError>