* 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
(cherry picked from commit ef99689592)
# Conflicts:
#	tokens/Cargo.toml
* Fix conflict
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
			
			
This commit is contained in:
		
							
								
								
									
										1
									
								
								Cargo.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										1
									
								
								Cargo.lock
									
									
									
										generated
									
									
									
								
							@@ -4951,6 +4951,7 @@ dependencies = [
 | 
				
			|||||||
 "solana-cli-config",
 | 
					 "solana-cli-config",
 | 
				
			||||||
 "solana-client",
 | 
					 "solana-client",
 | 
				
			||||||
 "solana-core",
 | 
					 "solana-core",
 | 
				
			||||||
 | 
					 "solana-logger 1.5.0",
 | 
				
			||||||
 "solana-remote-wallet",
 | 
					 "solana-remote-wallet",
 | 
				
			||||||
 "solana-runtime",
 | 
					 "solana-runtime",
 | 
				
			||||||
 "solana-sdk",
 | 
					 "solana-sdk",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,7 +10,7 @@ use solana_client::{
 | 
				
			|||||||
    rpc_client::RpcClient,
 | 
					    rpc_client::RpcClient,
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
use solana_core::contact_info::ContactInfo;
 | 
					use solana_core::contact_info::ContactInfo;
 | 
				
			||||||
use solana_core::test_validator::{TestValidator, TestValidatorOptions};
 | 
					use solana_core::test_validator::TestValidator;
 | 
				
			||||||
use solana_faucet::faucet::run_local_faucet;
 | 
					use solana_faucet::faucet::run_local_faucet;
 | 
				
			||||||
use solana_sdk::{
 | 
					use solana_sdk::{
 | 
				
			||||||
    commitment_config::CommitmentConfig,
 | 
					    commitment_config::CommitmentConfig,
 | 
				
			||||||
@@ -231,17 +231,14 @@ fn full_battery_tests(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#[test]
 | 
					#[test]
 | 
				
			||||||
fn test_create_account_with_seed() {
 | 
					fn test_create_account_with_seed() {
 | 
				
			||||||
 | 
					    solana_logger::setup();
 | 
				
			||||||
    let TestValidator {
 | 
					    let TestValidator {
 | 
				
			||||||
        server,
 | 
					        server,
 | 
				
			||||||
        leader_data,
 | 
					        leader_data,
 | 
				
			||||||
        alice: mint_keypair,
 | 
					        alice: mint_keypair,
 | 
				
			||||||
        ledger_path,
 | 
					        ledger_path,
 | 
				
			||||||
        ..
 | 
					        ..
 | 
				
			||||||
    } = TestValidator::run_with_options(TestValidatorOptions {
 | 
					    } = TestValidator::run_with_fees(1);
 | 
				
			||||||
        fees: 1,
 | 
					 | 
				
			||||||
        bootstrap_validator_lamports: 42_000,
 | 
					 | 
				
			||||||
        ..TestValidatorOptions::default()
 | 
					 | 
				
			||||||
    });
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    let (sender, receiver) = channel();
 | 
					    let (sender, receiver) = channel();
 | 
				
			||||||
    run_local_faucet(mint_keypair, sender, None);
 | 
					    run_local_faucet(mint_keypair, sender, None);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,7 +9,7 @@ use solana_client::{
 | 
				
			|||||||
    nonce_utils,
 | 
					    nonce_utils,
 | 
				
			||||||
    rpc_client::RpcClient,
 | 
					    rpc_client::RpcClient,
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
use solana_core::test_validator::{TestValidator, TestValidatorOptions};
 | 
					use solana_core::test_validator::TestValidator;
 | 
				
			||||||
use solana_faucet::faucet::run_local_faucet;
 | 
					use solana_faucet::faucet::run_local_faucet;
 | 
				
			||||||
use solana_sdk::{
 | 
					use solana_sdk::{
 | 
				
			||||||
    account_utils::StateMut,
 | 
					    account_utils::StateMut,
 | 
				
			||||||
@@ -848,11 +848,7 @@ fn test_stake_authorize_with_fee_payer() {
 | 
				
			|||||||
        alice,
 | 
					        alice,
 | 
				
			||||||
        ledger_path,
 | 
					        ledger_path,
 | 
				
			||||||
        ..
 | 
					        ..
 | 
				
			||||||
    } = TestValidator::run_with_options(TestValidatorOptions {
 | 
					    } = TestValidator::run_with_fees(SIG_FEE);
 | 
				
			||||||
        fees: SIG_FEE,
 | 
					 | 
				
			||||||
        bootstrap_validator_lamports: 42_000,
 | 
					 | 
				
			||||||
        ..TestValidatorOptions::default()
 | 
					 | 
				
			||||||
    });
 | 
					 | 
				
			||||||
    let (sender, receiver) = channel();
 | 
					    let (sender, receiver) = channel();
 | 
				
			||||||
    run_local_faucet(alice, sender, None);
 | 
					    run_local_faucet(alice, sender, None);
 | 
				
			||||||
    let faucet_addr = receiver.recv().unwrap();
 | 
					    let faucet_addr = receiver.recv().unwrap();
 | 
				
			||||||
@@ -985,11 +981,7 @@ fn test_stake_split() {
 | 
				
			|||||||
        alice,
 | 
					        alice,
 | 
				
			||||||
        ledger_path,
 | 
					        ledger_path,
 | 
				
			||||||
        ..
 | 
					        ..
 | 
				
			||||||
    } = TestValidator::run_with_options(TestValidatorOptions {
 | 
					    } = TestValidator::run_with_fees(1);
 | 
				
			||||||
        fees: 1,
 | 
					 | 
				
			||||||
        bootstrap_validator_lamports: 42_000,
 | 
					 | 
				
			||||||
        ..TestValidatorOptions::default()
 | 
					 | 
				
			||||||
    });
 | 
					 | 
				
			||||||
    let (sender, receiver) = channel();
 | 
					    let (sender, receiver) = channel();
 | 
				
			||||||
    run_local_faucet(alice, sender, None);
 | 
					    run_local_faucet(alice, sender, None);
 | 
				
			||||||
    let faucet_addr = receiver.recv().unwrap();
 | 
					    let faucet_addr = receiver.recv().unwrap();
 | 
				
			||||||
@@ -1140,11 +1132,7 @@ fn test_stake_set_lockup() {
 | 
				
			|||||||
        alice,
 | 
					        alice,
 | 
				
			||||||
        ledger_path,
 | 
					        ledger_path,
 | 
				
			||||||
        ..
 | 
					        ..
 | 
				
			||||||
    } = TestValidator::run_with_options(TestValidatorOptions {
 | 
					    } = TestValidator::run_with_fees(1);
 | 
				
			||||||
        fees: 1,
 | 
					 | 
				
			||||||
        bootstrap_validator_lamports: 42_000,
 | 
					 | 
				
			||||||
        ..TestValidatorOptions::default()
 | 
					 | 
				
			||||||
    });
 | 
					 | 
				
			||||||
    let (sender, receiver) = channel();
 | 
					    let (sender, receiver) = channel();
 | 
				
			||||||
    run_local_faucet(alice, sender, None);
 | 
					    run_local_faucet(alice, sender, None);
 | 
				
			||||||
    let faucet_addr = receiver.recv().unwrap();
 | 
					    let faucet_addr = receiver.recv().unwrap();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,7 +9,7 @@ use solana_client::{
 | 
				
			|||||||
    nonce_utils,
 | 
					    nonce_utils,
 | 
				
			||||||
    rpc_client::RpcClient,
 | 
					    rpc_client::RpcClient,
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
use solana_core::test_validator::{TestValidator, TestValidatorOptions};
 | 
					use solana_core::test_validator::TestValidator;
 | 
				
			||||||
use solana_faucet::faucet::run_local_faucet;
 | 
					use solana_faucet::faucet::run_local_faucet;
 | 
				
			||||||
use solana_sdk::{
 | 
					use solana_sdk::{
 | 
				
			||||||
    commitment_config::CommitmentConfig,
 | 
					    commitment_config::CommitmentConfig,
 | 
				
			||||||
@@ -21,17 +21,14 @@ use std::{fs::remove_dir_all, sync::mpsc::channel};
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#[test]
 | 
					#[test]
 | 
				
			||||||
fn test_transfer() {
 | 
					fn test_transfer() {
 | 
				
			||||||
 | 
					    solana_logger::setup();
 | 
				
			||||||
    let TestValidator {
 | 
					    let TestValidator {
 | 
				
			||||||
        server,
 | 
					        server,
 | 
				
			||||||
        leader_data,
 | 
					        leader_data,
 | 
				
			||||||
        alice: mint_keypair,
 | 
					        alice: mint_keypair,
 | 
				
			||||||
        ledger_path,
 | 
					        ledger_path,
 | 
				
			||||||
        ..
 | 
					        ..
 | 
				
			||||||
    } = TestValidator::run_with_options(TestValidatorOptions {
 | 
					    } = TestValidator::run_with_fees(1);
 | 
				
			||||||
        fees: 1,
 | 
					 | 
				
			||||||
        bootstrap_validator_lamports: 42_000,
 | 
					 | 
				
			||||||
        ..TestValidatorOptions::default()
 | 
					 | 
				
			||||||
    });
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    let (sender, receiver) = channel();
 | 
					    let (sender, receiver) = channel();
 | 
				
			||||||
    run_local_faucet(mint_keypair, sender, None);
 | 
					    run_local_faucet(mint_keypair, sender, None);
 | 
				
			||||||
@@ -252,17 +249,14 @@ fn test_transfer() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#[test]
 | 
					#[test]
 | 
				
			||||||
fn test_transfer_multisession_signing() {
 | 
					fn test_transfer_multisession_signing() {
 | 
				
			||||||
 | 
					    solana_logger::setup();
 | 
				
			||||||
    let TestValidator {
 | 
					    let TestValidator {
 | 
				
			||||||
        server,
 | 
					        server,
 | 
				
			||||||
        leader_data,
 | 
					        leader_data,
 | 
				
			||||||
        alice: mint_keypair,
 | 
					        alice: mint_keypair,
 | 
				
			||||||
        ledger_path,
 | 
					        ledger_path,
 | 
				
			||||||
        ..
 | 
					        ..
 | 
				
			||||||
    } = TestValidator::run_with_options(TestValidatorOptions {
 | 
					    } = TestValidator::run_with_fees(1);
 | 
				
			||||||
        fees: 1,
 | 
					 | 
				
			||||||
        bootstrap_validator_lamports: 42_000,
 | 
					 | 
				
			||||||
        ..TestValidatorOptions::default()
 | 
					 | 
				
			||||||
    });
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    let (sender, receiver) = channel();
 | 
					    let (sender, receiver) = channel();
 | 
				
			||||||
    run_local_faucet(mint_keypair, sender, None);
 | 
					    run_local_faucet(mint_keypair, sender, None);
 | 
				
			||||||
@@ -382,17 +376,14 @@ fn test_transfer_multisession_signing() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#[test]
 | 
					#[test]
 | 
				
			||||||
fn test_transfer_all() {
 | 
					fn test_transfer_all() {
 | 
				
			||||||
 | 
					    solana_logger::setup();
 | 
				
			||||||
    let TestValidator {
 | 
					    let TestValidator {
 | 
				
			||||||
        server,
 | 
					        server,
 | 
				
			||||||
        leader_data,
 | 
					        leader_data,
 | 
				
			||||||
        alice: mint_keypair,
 | 
					        alice: mint_keypair,
 | 
				
			||||||
        ledger_path,
 | 
					        ledger_path,
 | 
				
			||||||
        ..
 | 
					        ..
 | 
				
			||||||
    } = TestValidator::run_with_options(TestValidatorOptions {
 | 
					    } = TestValidator::run_with_fees(1);
 | 
				
			||||||
        fees: 1,
 | 
					 | 
				
			||||||
        bootstrap_validator_lamports: 42_000,
 | 
					 | 
				
			||||||
        ..TestValidatorOptions::default()
 | 
					 | 
				
			||||||
    });
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    let (sender, receiver) = channel();
 | 
					    let (sender, receiver) = channel();
 | 
				
			||||||
    run_local_faucet(mint_keypair, sender, None);
 | 
					    run_local_faucet(mint_keypair, sender, None);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,7 +6,9 @@ use crate::{
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
use solana_ledger::create_new_tmp_ledger;
 | 
					use solana_ledger::create_new_tmp_ledger;
 | 
				
			||||||
use solana_sdk::{
 | 
					use solana_sdk::{
 | 
				
			||||||
 | 
					    clock::DEFAULT_DEV_SLOTS_PER_EPOCH,
 | 
				
			||||||
    hash::Hash,
 | 
					    hash::Hash,
 | 
				
			||||||
 | 
					    native_token::sol_to_lamports,
 | 
				
			||||||
    pubkey::Pubkey,
 | 
					    pubkey::Pubkey,
 | 
				
			||||||
    signature::{Keypair, Signer},
 | 
					    signature::{Keypair, Signer},
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
@@ -33,7 +35,7 @@ impl Default for TestValidatorOptions {
 | 
				
			|||||||
        TestValidatorOptions {
 | 
					        TestValidatorOptions {
 | 
				
			||||||
            fees: 0,
 | 
					            fees: 0,
 | 
				
			||||||
            bootstrap_validator_lamports: BOOTSTRAP_VALIDATOR_LAMPORTS,
 | 
					            bootstrap_validator_lamports: BOOTSTRAP_VALIDATOR_LAMPORTS,
 | 
				
			||||||
            mint_lamports: 1_000_000,
 | 
					            mint_lamports: sol_to_lamports(1_000_000.0),
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -43,6 +45,23 @@ impl TestValidator {
 | 
				
			|||||||
        Self::run_with_options(TestValidatorOptions::default())
 | 
					        Self::run_with_options(TestValidatorOptions::default())
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /// Instantiates a TestValidator with custom fees. The bootstrap_validator_lamports will
 | 
				
			||||||
 | 
					    /// default to enough to cover 1 epoch of votes. This is an abitrary value based on current and
 | 
				
			||||||
 | 
					    /// foreseen uses of TestValidator. May need to be bumped if uses change in the future.
 | 
				
			||||||
 | 
					    pub fn run_with_fees(fees: u64) -> Self {
 | 
				
			||||||
 | 
					        let bootstrap_validator_lamports = fees * DEFAULT_DEV_SLOTS_PER_EPOCH * 5;
 | 
				
			||||||
 | 
					        Self::run_with_options(TestValidatorOptions {
 | 
				
			||||||
 | 
					            fees,
 | 
				
			||||||
 | 
					            bootstrap_validator_lamports,
 | 
				
			||||||
 | 
					            ..TestValidatorOptions::default()
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /// Instantiates a TestValidator with completely customized options.
 | 
				
			||||||
 | 
					    ///
 | 
				
			||||||
 | 
					    /// Note: if `fees` are non-zero, be sure to set a value for `bootstrap_validator_lamports`
 | 
				
			||||||
 | 
					    /// that can cover enough vote transaction fees for the test. TestValidatorOptions::default()
 | 
				
			||||||
 | 
					    /// may not be sufficient.
 | 
				
			||||||
    pub fn run_with_options(options: TestValidatorOptions) -> Self {
 | 
					    pub fn run_with_options(options: TestValidatorOptions) -> Self {
 | 
				
			||||||
        use solana_ledger::genesis_utils::{
 | 
					        use solana_ledger::genesis_utils::{
 | 
				
			||||||
            create_genesis_config_with_leader_ex, GenesisConfigInfo,
 | 
					            create_genesis_config_with_leader_ex, GenesisConfigInfo,
 | 
				
			||||||
@@ -58,6 +77,14 @@ impl TestValidator {
 | 
				
			|||||||
        let node = Node::new_localhost_with_pubkey(&node_keypair.pubkey());
 | 
					        let node = Node::new_localhost_with_pubkey(&node_keypair.pubkey());
 | 
				
			||||||
        let contact_info = node.info.clone();
 | 
					        let contact_info = node.info.clone();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if fees > 0 && bootstrap_validator_lamports < fees * DEFAULT_DEV_SLOTS_PER_EPOCH {
 | 
				
			||||||
 | 
					            warn!(
 | 
				
			||||||
 | 
					                "TestValidator::bootstrap_validator_lamports less than one epoch. \
 | 
				
			||||||
 | 
					                Only enough to cover {:?} slots",
 | 
				
			||||||
 | 
					                bootstrap_validator_lamports / fees
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        let GenesisConfigInfo {
 | 
					        let GenesisConfigInfo {
 | 
				
			||||||
            mut genesis_config,
 | 
					            mut genesis_config,
 | 
				
			||||||
            mint_keypair,
 | 
					            mint_keypair,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,7 +12,8 @@ use solana_runtime::{
 | 
				
			|||||||
    genesis_utils::{create_genesis_config, GenesisConfigInfo},
 | 
					    genesis_utils::{create_genesis_config, GenesisConfigInfo},
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
use solana_sdk::{
 | 
					use solana_sdk::{
 | 
				
			||||||
    commitment_config::CommitmentConfig, rpc_port, signature::Signer, system_transaction,
 | 
					    commitment_config::CommitmentConfig, native_token::sol_to_lamports, rpc_port,
 | 
				
			||||||
 | 
					    signature::Signer, system_transaction,
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
use std::{
 | 
					use std::{
 | 
				
			||||||
    fs::remove_dir_all,
 | 
					    fs::remove_dir_all,
 | 
				
			||||||
@@ -50,11 +51,14 @@ fn test_rpc_client() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    assert_eq!(client.get_balance(&bob_pubkey).unwrap(), 0);
 | 
					    assert_eq!(client.get_balance(&bob_pubkey).unwrap(), 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    assert_eq!(client.get_balance(&alice.pubkey()).unwrap(), 1_000_000);
 | 
					    assert_eq!(
 | 
				
			||||||
 | 
					        client.get_balance(&alice.pubkey()).unwrap(),
 | 
				
			||||||
 | 
					        sol_to_lamports(1_000_000.0)
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    let (blockhash, _fee_calculator) = client.get_recent_blockhash().unwrap();
 | 
					    let (blockhash, _fee_calculator) = client.get_recent_blockhash().unwrap();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    let tx = system_transaction::transfer(&alice, &bob_pubkey, 20, blockhash);
 | 
					    let tx = system_transaction::transfer(&alice, &bob_pubkey, sol_to_lamports(20.0), blockhash);
 | 
				
			||||||
    let signature = client.send_transaction(&tx).unwrap();
 | 
					    let signature = client.send_transaction(&tx).unwrap();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    let mut confirmed_tx = false;
 | 
					    let mut confirmed_tx = false;
 | 
				
			||||||
@@ -75,8 +79,14 @@ fn test_rpc_client() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    assert!(confirmed_tx);
 | 
					    assert!(confirmed_tx);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    assert_eq!(client.get_balance(&bob_pubkey).unwrap(), 20);
 | 
					    assert_eq!(
 | 
				
			||||||
    assert_eq!(client.get_balance(&alice.pubkey()).unwrap(), 999_980);
 | 
					        client.get_balance(&bob_pubkey).unwrap(),
 | 
				
			||||||
 | 
					        sol_to_lamports(20.0)
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					    assert_eq!(
 | 
				
			||||||
 | 
					        client.get_balance(&alice.pubkey()).unwrap(),
 | 
				
			||||||
 | 
					        sol_to_lamports(999_980.0)
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    server.close().unwrap();
 | 
					    server.close().unwrap();
 | 
				
			||||||
    remove_dir_all(ledger_path).unwrap();
 | 
					    remove_dir_all(ledger_path).unwrap();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -35,4 +35,5 @@ url = "2.1"
 | 
				
			|||||||
bincode = "1.3.1"
 | 
					bincode = "1.3.1"
 | 
				
			||||||
solana-banks-server = { path = "../banks-server", version = "1.4.9" }
 | 
					solana-banks-server = { path = "../banks-server", version = "1.4.9" }
 | 
				
			||||||
solana-core = { path = "../core", version = "1.4.9" }
 | 
					solana-core = { path = "../core", version = "1.4.9" }
 | 
				
			||||||
 | 
					solana-logger = { path = "../logger", version = "1.4.9" }
 | 
				
			||||||
solana-runtime = { path = "../runtime", version = "1.4.9" }
 | 
					solana-runtime = { path = "../runtime", version = "1.4.9" }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,22 +1,19 @@
 | 
				
			|||||||
use solana_banks_client::start_tcp_client;
 | 
					use solana_banks_client::start_tcp_client;
 | 
				
			||||||
use solana_core::test_validator::{TestValidator, TestValidatorOptions};
 | 
					use solana_core::test_validator::TestValidator;
 | 
				
			||||||
use solana_sdk::native_token::sol_to_lamports;
 | 
					 | 
				
			||||||
use solana_tokens::commands::test_process_distribute_tokens_with_client;
 | 
					use solana_tokens::commands::test_process_distribute_tokens_with_client;
 | 
				
			||||||
use std::fs::remove_dir_all;
 | 
					use std::fs::remove_dir_all;
 | 
				
			||||||
use tokio::runtime::Runtime;
 | 
					use tokio::runtime::Runtime;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#[test]
 | 
					#[test]
 | 
				
			||||||
fn test_process_distribute_with_rpc_client() {
 | 
					fn test_process_distribute_with_rpc_client() {
 | 
				
			||||||
 | 
					    solana_logger::setup();
 | 
				
			||||||
    let TestValidator {
 | 
					    let TestValidator {
 | 
				
			||||||
        server,
 | 
					        server,
 | 
				
			||||||
        leader_data,
 | 
					        leader_data,
 | 
				
			||||||
        alice,
 | 
					        alice,
 | 
				
			||||||
        ledger_path,
 | 
					        ledger_path,
 | 
				
			||||||
        ..
 | 
					        ..
 | 
				
			||||||
    } = TestValidator::run_with_options(TestValidatorOptions {
 | 
					    } = TestValidator::run();
 | 
				
			||||||
        mint_lamports: sol_to_lamports(9_000_000.0),
 | 
					 | 
				
			||||||
        ..TestValidatorOptions::default()
 | 
					 | 
				
			||||||
    });
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Runtime::new().unwrap().block_on(async {
 | 
					    Runtime::new().unwrap().block_on(async {
 | 
				
			||||||
        let mut banks_client = start_tcp_client(leader_data.rpc_banks).await.unwrap();
 | 
					        let mut banks_client = start_tcp_client(leader_data.rpc_banks).await.unwrap();
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user