Skip to main content

Crate wp_solana_test_utils

Crate wp_solana_test_utils 

Source
Expand description

Solana testing utilities and fixtures

Protocol-specific fixture setup functions. For core test infrastructure (TestContext, execute, fund_token, etc.), use solana-test-core directly.

Re-exports§

pub use wp_solana_test_core;

Modules§

execute
Transaction execution helpers for TestContext.
protocols

Structs§

TestContext
Shared test context that bundles a LiteSVM instance, an RPC client backed by MockRpcSender, and a funded payer keypair.

Functions§

execute
Build, sign, and send a transaction through the mock RPC client.
execute_with_logs
Execute a transaction and return the signature together with program logs.
fund_token
Create an Associated Token Account for owner on mint, then mint amount tokens into it.
fund_wsol
Create an Associated Token Account for WSOL and wrap amount lamports of SOL into it via sync_native.
load_accounts_json
Load multiple accounts from a JSON fixture array into the SVM.
load_program
Load a BPF program into the SVM at program_id.
new_test_context
Create a new TestContext with a fresh LiteSVM, mock RPC client, and a payer funded with 1 000 SOL.
override_mint_authority
Override a SPL-Token mint’s mint_authority to new_authority.
set_account
Set a single account in the SVM at addr.