additional consensus test

This commit is contained in:
keorn 2016-09-19 14:33:11 +02:00
parent 49b8e144fd
commit ce3e8750c9
2 changed files with 24 additions and 3 deletions

View File

@ -161,8 +161,7 @@ impl Engine for AuthorityRound {
fn is_sealer(&self, author: &Address) -> Option<bool> {
let ref p = self.our_params;
Some(p.authorities.contains(author));
Some(true)
Some(p.authorities.contains(author))
}
/// Attempt to seal the block internally.

View File

@ -28,10 +28,32 @@ fn issue_tx() {
net.peer(1).issue_rand_tx();
sleep(Duration::from_secs(1));
net.sync();
sleep(Duration::from_secs(1));
net.sync();
net.sync();
net.sync();
println!("{:?}", net.peer(0).client.chain_info());
println!("{:?}", net.peer(1).client.chain_info());
}
#[test]
fn issue_many() {
::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();
net.peer(1).issue_rand_tx();
net.peer(1).issue_rand_tx();
net.peer(1).issue_rand_tx();
net.peer(1).issue_rand_tx();
sleep(Duration::from_secs(1));
net.sync();
net.sync();
net.peer(0).issue_rand_tx();
net.peer(0).issue_rand_tx();
net.peer(0).issue_rand_tx();
net.peer(0).issue_rand_tx();
net.peer(0).issue_rand_tx();
net.sync();
net.sync();
//println!("{:?}", net.peer(0).client.chain_info());
//println!("{:?}", net.peer(1).client.chain_info());
}