| Crates.io | test_utils_solana |
| lib.rs | test_utils_solana |
| version | 0.7.3 |
| created_at | 2024-09-13 09:40:40.620025+00 |
| updated_at | 2025-03-14 17:45:37.598885+00 |
| description | Utilities and extensions for testing solana in wasm compatible environments |
| homepage | https://github.com/ifiokjr/wasm_solana |
| repository | https://github.com/ifiokjr/wasm_solana |
| max_upload_size | |
| id | 1373530 |
| size | 306,297 |
Utilities and extensions for testing solana in wasm compatible environments.
To install you can used the following command:
cargo add --dev test_utils_solana
Or directly add the following to your Cargo.toml:
[dev-dependencies]
test_utils_solana = "0.1" # replace with the latest version
| Feature | Description |
|---|---|
test_validator |
Enables the test_validator feature for the solana_test_validator crate. |
The following requires the test_validator feature to be enabled.
use solana_sdk::pubkey;
use test_utils_solana::TestValidatorRunner;
use test_utils_solana::TestValidatorRunnerProps;
async fn run() -> TestValidatorRunner {
let pubkey = pubkey!("99P8ZgtJYe1buSK8JXkvpLh8xPsCFuLYhz9hQFNw93WJ");
let props = TestValidatorRunnerProps::builder()
.pubkeys(vec![pubkey]) // pubkeys to fund with an amount of sol each
.initial_lamports(1_000_000_000) // initial lamports to add to each pubkey account
.namespace("tests") // namespace to use for the validator client rpc
.build();
TestValidatorRunner::run(props).await
}