Move generic rpc_client functions from wallet/ to client/

This commit is contained in:
Michael Vines
2019-03-16 17:17:44 -07:00
parent 3ad019a176
commit c498775a3d
10 changed files with 363 additions and 423 deletions

View File

@ -37,7 +37,7 @@ pub fn spend_and_verify_all_nodes(
&funding_keypair,
&random_keypair.pubkey(),
1,
client.get_recent_blockhash(),
client.get_recent_blockhash().unwrap(),
0,
);
let sig = client
@ -62,7 +62,7 @@ pub fn send_many_transactions(node: &ContactInfo, funding_keypair: &Keypair, num
&funding_keypair,
&random_keypair.pubkey(),
1,
client.get_recent_blockhash(),
client.get_recent_blockhash().unwrap(),
0,
);
client
@ -159,7 +159,7 @@ pub fn kill_entry_and_spend_and_verify_rest(
&funding_keypair,
&random_keypair.pubkey(),
1,
client.get_recent_blockhash(),
client.get_recent_blockhash().unwrap(),
0,
);

View File

@ -197,7 +197,7 @@ impl LocalCluster {
lamports: u64,
) -> u64 {
trace!("getting leader blockhash");
let blockhash = client.get_recent_blockhash();
let blockhash = client.get_recent_blockhash().unwrap();
let mut tx =
SystemTransaction::new_account(&source_keypair, dest_pubkey, lamports, blockhash, 0);
info!(
@ -228,7 +228,7 @@ impl LocalCluster {
let mut transaction = VoteTransaction::new_account(
from_account,
&vote_account_pubkey,
client.get_recent_blockhash(),
client.get_recent_blockhash().unwrap(),
amount,
1,
);
@ -243,7 +243,7 @@ impl LocalCluster {
// 2) Set delegate for new vote account
let mut transaction = VoteTransaction::delegate_vote_account(
vote_account,
client.get_recent_blockhash(),
client.get_recent_blockhash().unwrap(),
&delegate_id,
0,
);

View File

@ -316,7 +316,7 @@ impl Replicator {
);
Self::get_airdrop_lamports(&client, &self.keypair, &self.cluster_entrypoint);
let blockhash = client.get_recent_blockhash();
let blockhash = client.get_recent_blockhash().expect("blockhash");
let mut tx = StorageTransaction::new_mining_proof(
&self.keypair,
self.hash,
@ -388,7 +388,7 @@ impl Replicator {
let airdrop_amount = 1;
let blockhash = client.get_recent_blockhash();
let blockhash = client.get_recent_blockhash().expect("blockhash");
match request_airdrop_transaction(
&drone_addr,
&keypair.pubkey(),

View File

@ -242,7 +242,7 @@ impl StorageStage {
let mut blockhash = None;
for _ in 0..10 {
if let Some(new_blockhash) = client.try_get_recent_blockhash(1) {
if let Ok(new_blockhash) = client.get_recent_blockhash() {
blockhash = Some(new_blockhash);
break;
}