LiteSVM Docs

Quick Reference

Quick reference table and getting started guide

Quick Reference

MethodDescription
LiteSVM::new()Create new LiteSVM basic test environment
LiteSVM::default()Returns the "default value" for a type
airdrop(&Address, lamports)Funds the account with the lamports specified
get_account(&Address)Returns all information associated with the account of the provided address
set_account(Address, Account)Sets all information associated with the account of the provided address
get_balance(&Address)Gets the lamport balance of the provided account address
minimum_balance_for_rent_exemption(data_len)Returns minimum balance required to make an account with specified data length rent exempt
add_program(program_id, &bytes)Adds an SBF program to the test environment
add_program_from_file(program_id, path)Adds an SBF program to the test environment from the file specified
send_transaction(tx)Submits a signed transaction
simulate_transaction(tx)Simulates a transaction without modifying state
get_transaction(&signature)Gets a transaction from history
latest_blockhash()Gets current blockhash
expire_blockhash()Force blockhash expiration on the current blockhash
warp_to_slot(slot)Warps the clock to the specified slot
get_sysvar<T>()Gets a sysvar from the test environment
set_sysvar<T>(&value)Sets the sysvar to the test environment
with_feature_accounts()Includes feature gate accounts in the test environment
set_invocation_inspect_callback(callback)Registers a pre/post invocation callback (requires invocation-inspect-callback feature)

On this page