Logo
Explore Help
Sign In
gaspersic/solana
1
0
Fork 0
You've already forked solana
Code Issues Pull Requests Projects Releases Wiki Activity
solana/cli/src/test_utils.rs

17 lines
498 B
Rust
Raw Normal View History

Reduce rpc test code (#9413) automerge
2020-04-09 18:05:56 -07:00
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| {
Cli: transfer ALL; check spend+fee in client (#10012) * lamports->SOL in user-facing error msg * Check for sufficient balance for spend and fee * Add ALL option to solana transfer * Rework TransferAmount to check for sign_only in parse * Refactor TransferAmount & fee-check handling to be more general * Add addl checks mechanism * Move checks out of cli.rs * Rename to SpendAmount to be more general & move * Impl ALL/spend helpers for create-nonce-account * Impl spend helpers for create-vote-account * Impl ALL/spend helpers for create-stake-account * Impl spend helpers for ping * Impl ALL/spend helpers for pay * Impl spend helpers for validator-info * Remove unused fns * Remove retry_get_balance * Add a couple unit tests * Rework send_util fn signatures
2020-05-14 12:24:14 -06:00
let balance = client.get_balance(pubkey).unwrap();
Reduce rpc test code (#9413) automerge
2020-04-09 18:05:56 -07:00
if balance == expected_balance {
return;
}
if tries == 4 {
assert_eq!(balance, expected_balance);
}
sleep(Duration::from_millis(500));
});
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 544ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API