mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 20:27:58 +00:00
Test syncing to all forks (#1544)
This commit is contained in:
committed by
Gav Wood
parent
1b0d90cdf6
commit
f38aa0d2de
@@ -110,6 +110,23 @@ fn sync_after_fork_works() {
|
||||
assert!(net.peer(2).client.backend().blockchain().canon_equals_to(&peer1_chain));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn syncs_all_forks() {
|
||||
::env_logger::init().ok();
|
||||
let mut net = TestNet::new(4);
|
||||
net.sync_step();
|
||||
net.peer(0).push_blocks(2, false);
|
||||
net.peer(1).push_blocks(2, false);
|
||||
|
||||
net.peer(0).push_blocks(2, true);
|
||||
net.peer(1).push_blocks(4, false);
|
||||
|
||||
net.sync();
|
||||
// Check that all peers have all of the blocks.
|
||||
assert_eq!(9, net.peer(0).client.backend().blockchain().blocks_count());
|
||||
assert_eq!(9, net.peer(1).client.backend().blockchain().blocks_count());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn own_blocks_are_announced() {
|
||||
::env_logger::init().ok();
|
||||
|
||||
Reference in New Issue
Block a user