Try multiple times to confirm a non-zero balance

This commit is contained in:
Michael Vines
2018-08-03 14:23:20 -07:00
parent c998199954
commit 1a9e6ffdd7

View File

@ -105,9 +105,15 @@ fn main() -> () {
) )
}); });
let balance = client.poll_get_balance(&leader_pubkey).unwrap(); // Try multiple times to confirm a non-zero balance. |poll_get_balance| currently times
eprintln!("new balance is {}", balance); // out after 1 second, and sometimes this is not enough time while the network is
assert!(balance > 0); // booting
let balance_ok = (0..30).any(|i| {
let balance = client.poll_get_balance(&leader_pubkey).unwrap();
eprintln!("new balance is {} (attempt #{})", balance, i);
balance > 0
});
assert!(balance_ok, "0 balance, airdrop failed?");
} }
fullnode.join().expect("join"); fullnode.join().expect("join");