test_utils_solana

Crates.iotest_utils_solana
lib.rstest_utils_solana
version
sourcesrc
created_at2024-09-13 09:40:40.620025
updated_at2024-12-12 14:35:20.785515
descriptionUtilities and extensions for testing solana in wasm compatible environments
homepagehttps://github.com/ifiokjr/wasm_solana
repositoryhttps://github.com/ifiokjr/wasm_solana
max_upload_size
id1373530
Cargo.toml error:TOML parse error at line 19, column 1 | 19 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Ifiok Jr. (ifiokjr)

documentation

README

test_utils_solana


Utilities and extensions for testing solana in wasm compatible environments.


Crate Docs Status Unlicense codecov

Installation

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

Features

Feature Description
test_validator Enables the test_validator feature for the solana_test_validator crate.

Usage

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
}
Commit count: 218

cargo fmt