Relieve the caller of having to care about the rpc request id

This commit is contained in:
Michael Vines
2019-03-15 23:49:28 -07:00
parent c2b1010f18
commit bcc34b906c
10 changed files with 51 additions and 55 deletions

View File

@ -357,11 +357,11 @@ impl Replicator {
RpcClient::new_socket(rpc_peers[node_idx].rpc)
};
let storage_blockhash = rpc_client
.make_rpc_request(2, RpcRequest::GetStorageBlockhash, None)
.make_rpc_request(RpcRequest::GetStorageBlockhash, None)
.expect("rpc request")
.to_string();
let storage_entry_height = rpc_client
.make_rpc_request(2, RpcRequest::GetStorageEntryHeight, None)
.make_rpc_request(RpcRequest::GetStorageEntryHeight, None)
.expect("rpc request")
.as_u64()
.unwrap();

View File

@ -30,7 +30,7 @@ impl VoteSigner for RemoteVoteSigner {
let params = json!([pubkey, sig, msg]);
let resp = self
.rpc_client
.retry_make_rpc_request(1, &RpcRequest::RegisterNode, Some(params), 5)
.retry_make_rpc_request(&RpcRequest::RegisterNode, Some(params), 5)
.unwrap();
let vote_account: Pubkey = serde_json::from_value(resp).unwrap();
Ok(vote_account)
@ -44,7 +44,7 @@ impl VoteSigner for RemoteVoteSigner {
let params = json!([pubkey, sig, msg]);
let resp = self
.rpc_client
.retry_make_rpc_request(1, &RpcRequest::SignVote, Some(params), 0)
.retry_make_rpc_request(&RpcRequest::SignVote, Some(params), 0)
.unwrap();
let vote_signature: Signature = serde_json::from_value(resp).unwrap();
Ok(vote_signature)
@ -53,7 +53,7 @@ impl VoteSigner for RemoteVoteSigner {
let params = json!([pubkey, sig, msg]);
let _resp = self
.rpc_client
.retry_make_rpc_request(1, &RpcRequest::DeregisterNode, Some(params), 5)
.retry_make_rpc_request(&RpcRequest::DeregisterNode, Some(params), 5)
.unwrap();
Ok(())
}