Improve Wallet coverage (#2385)

* Add trait for RpcRequestHandler trait for RpcClient and add MockRpcClient for unit tests

* Add request_airdrop integration test

* Add timestamp_tx, witness_tx, and cancel_tx to wallet integration tests; add wallet integration tests to test-stable

* Add test cases

* Ignore plentiful sleeps in unit tests
This commit is contained in:
Tyera Eulberg
2019-01-14 00:10:03 -07:00
committed by GitHub
parent 780360834d
commit 8af61f561b
13 changed files with 894 additions and 612 deletions

View File

@@ -7,7 +7,7 @@ use crate::db_ledger::DbLedger;
use crate::gossip_service::GossipService;
use crate::leader_scheduler::LeaderScheduler;
use crate::result::Result;
use crate::rpc_request::{RpcClient, RpcRequest};
use crate::rpc_request::{RpcClient, RpcRequest, RpcRequestHandler};
use crate::service::Service;
use crate::storage_stage::ENTRIES_PER_SEGMENT;
use crate::streamer::BlobReceiver;
@@ -144,12 +144,12 @@ impl Replicator {
RpcClient::new_from_socket(rpc_peers[node_idx].rpc)
};
storage_last_id = RpcRequest::GetStorageMiningLastId
.make_rpc_request(&rpc_client, 2, None)
storage_last_id = rpc_client
.make_rpc_request(2, RpcRequest::GetStorageMiningLastId, None)
.expect("rpc request")
.to_string();
storage_entry_height = RpcRequest::GetStorageMiningEntryHeight
.make_rpc_request(&rpc_client, 2, None)
storage_entry_height = rpc_client
.make_rpc_request(2, RpcRequest::GetStorageMiningEntryHeight, None)
.expect("rpc request")
.as_u64()
.unwrap();