Skip to content

Commit

Permalink
refactor: chores in core; faulty peers tests work, but unstable
Browse files Browse the repository at this point in the history
Signed-off-by: 0x009922 <[email protected]>
  • Loading branch information
0x009922 committed Nov 5, 2024
1 parent 66eea36 commit 1c5fe2b
Show file tree
Hide file tree
Showing 11 changed files with 479 additions and 271 deletions.
8 changes: 4 additions & 4 deletions crates/iroha/tests/extra_functional/connected_peers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async fn connected_peers_with_f(faults: usize) -> Result<()> {

// Unregister a peer: committed with f = `faults` then `status.peers` decrements
let client = randomized_peers.choose(&mut thread_rng()).unwrap().client();
let unregister_peer = Unregister::peer(removed_peer.peer_id());
let unregister_peer = Unregister::peer(removed_peer.id());
spawn_blocking(move || client.submit_blocking(unregister_peer)).await??;
timeout(
network.sync_timeout(),
Expand All @@ -78,7 +78,7 @@ async fn connected_peers_with_f(faults: usize) -> Result<()> {
assert_eq!(status.peers, 0);

// Re-register the peer: committed with f = `faults` - 1 then `status.peers` increments
let register_peer = Register::peer(removed_peer.peer_id());
let register_peer = Register::peer(removed_peer.id());
let client = randomized_peers
.iter()
.choose(&mut thread_rng())
Expand Down Expand Up @@ -109,13 +109,13 @@ async fn assert_peers_status(
status.peers,
expected_peers,
"unexpected peers for {}",
peer.peer_id()
peer.id()
);
assert_eq!(
status.blocks,
expected_blocks,
"expected blocks for {}",
peer.peer_id()
peer.id()
);
})
.collect::<FuturesUnordered<_>>()
Expand Down
Loading

0 comments on commit 1c5fe2b

Please sign in to comment.