@@ -25,5 +25,6 @@ pub mod nonce;
|
||||
pub mod offline;
|
||||
pub mod stake;
|
||||
pub mod storage;
|
||||
pub mod test_utils;
|
||||
pub mod validator_info;
|
||||
pub mod vote;
|
||||
|
@@ -456,8 +456,8 @@ pub fn process_create_nonce_account(
|
||||
lamports: u64,
|
||||
) -> ProcessResult {
|
||||
let nonce_account_pubkey = config.signers[nonce_account].pubkey();
|
||||
let nonce_account_address = if let Some(seed) = seed.clone() {
|
||||
Pubkey::create_with_seed(&nonce_account_pubkey, &seed, &system_program::id())?
|
||||
let nonce_account_address = if let Some(ref seed) = seed {
|
||||
Pubkey::create_with_seed(&nonce_account_pubkey, seed, &system_program::id())?
|
||||
} else {
|
||||
nonce_account_pubkey
|
||||
};
|
||||
|
16
cli/src/test_utils.rs
Normal file
16
cli/src/test_utils.rs
Normal file
@@ -0,0 +1,16 @@
|
||||
use solana_client::rpc_client::RpcClient;
|
||||
use solana_sdk::pubkey::Pubkey;
|
||||
use std::{thread::sleep, time::Duration};
|
||||
|
||||
pub fn check_balance(expected_balance: u64, client: &RpcClient, pubkey: &Pubkey) {
|
||||
(0..5).for_each(|tries| {
|
||||
let balance = client.retry_get_balance(pubkey, 1).unwrap().unwrap();
|
||||
if balance == expected_balance {
|
||||
return;
|
||||
}
|
||||
if tries == 4 {
|
||||
assert_eq!(balance, expected_balance);
|
||||
}
|
||||
sleep(Duration::from_millis(500));
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user