LiteSVM
📍 Overview
litesvm
is a fast and lightweight library for testing Solana programs. It works by creating an in-process Solana VM optimized for program developers. This makes it much faster to run and compile than alternatives like solana-program-test
and solana-test-validator
. In a further break from tradition, it has an ergonomic API with sane defaults and extensive configurability for those who want it.
🚀 Getting Started
🔧 Installation
🤖 Minimal Example
use LiteSVM;
use ;
use ;
let from_keypair = new;
let from = from_keypair.pubkey;
let to = new_unique;
let mut svm = new;
svm.airdrop.unwrap;
let instruction = transfer;
let tx = new;
let tx_res = svm.send_transaction.unwrap;
let from_account = svm.get_account;
let to_account = svm.get_account;
assert_eq!;
assert_eq!;
🛠️ Developing litesvm
Run the tests
The tests in this repo use some test programs you need to build first (Solana CLI >= 1.18.8 required):
cd test_programs && cargo build-sbf
Then just run cargo test
.