From cf88641f998d2aab4fa26d129e2e58e7711d8539 Mon Sep 17 00:00:00 2001 From: keorn Date: Tue, 27 Sep 2016 12:13:21 +0200 Subject: [PATCH] more mocknet tests --- sync/src/tests/auth_round.rs | 15 ++++++++++++++- sync/src/tests/mocknet.rs | 1 - 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/sync/src/tests/auth_round.rs b/sync/src/tests/auth_round.rs index 4f8a8cbc4..dbca507f8 100644 --- a/sync/src/tests/auth_round.rs +++ b/sync/src/tests/auth_round.rs @@ -24,10 +24,23 @@ use ethcore::client::BlockChainClient; fn authorities() -> Vec { vec!["1".sha3(), "2".sha3()] } #[test] -fn three_peer_tx_seal() { +fn two_auth() { ::env_logger::init().ok(); let mut net = MockNet::new_with_spec(2, authorities(), &Spec::new_test_round); net.peer(1).issue_rand_tx(); + net.sync(); + sleep(Duration::from_secs(1)); + net.sync(); + println!("{:?}", net.peer(0).client.chain_info()); + println!("{:?}", net.peer(1).client.chain_info()); + net.is_synced(1); +} + +#[test] +fn one_auth_missing() { + ::env_logger::init().ok(); + let mut net = MockNet::new_with_spec(2, vec!["1".sha3()], &Spec::new_test_round); + net.peer(1).issue_rand_tx(); sleep(Duration::from_secs(1)); net.sync(); sleep(Duration::from_secs(1)); diff --git a/sync/src/tests/mocknet.rs b/sync/src/tests/mocknet.rs index 2ed204243..2febdb4b8 100644 --- a/sync/src/tests/mocknet.rs +++ b/sync/src/tests/mocknet.rs @@ -325,7 +325,6 @@ impl MockNet { } pub fn is_synced(&self, block: BlockNumber) { - println!("Is block {:?}", &block); let hash = self.peer(0).client.chain_info().best_block_hash; for p in &self.peers { let ci = p.client.chain_info();