Improve TestValidator instantiation (#13627)

* Add TestValidator::new_with_fees constructor, and warning for low bootstrap_validator_lamports

* Add logging to solana-tokens integration test to help catch low bootstrap_validator_lamports in the future

* Reasonable TestValidator mint_lamports
This commit is contained in:
Tyera Eulberg
2020-11-16 23:27:36 -07:00
committed by GitHub
parent bde1e3d004
commit ef99689592
8 changed files with 62 additions and 50 deletions

View File

@ -1,22 +1,19 @@
use solana_banks_client::start_tcp_client;
use solana_core::test_validator::{TestValidator, TestValidatorOptions};
use solana_sdk::native_token::sol_to_lamports;
use solana_core::test_validator::TestValidator;
use solana_tokens::commands::test_process_distribute_tokens_with_client;
use std::fs::remove_dir_all;
use tokio::runtime::Runtime;
#[test]
fn test_process_distribute_with_rpc_client() {
solana_logger::setup();
let TestValidator {
server,
leader_data,
alice,
ledger_path,
..
} = TestValidator::run_with_options(TestValidatorOptions {
mint_lamports: sol_to_lamports(9_000_000.0),
..TestValidatorOptions::default()
});
} = TestValidator::run();
Runtime::new().unwrap().block_on(async {
let mut banks_client = start_tcp_client(leader_data.rpc_banks).await.unwrap();