Skip to content

Commit

Permalink
nit: simplify run_until_synced();
Browse files Browse the repository at this point in the history
  • Loading branch information
shawn-zil committed Jan 28, 2025
1 parent dae52d5 commit 4eeb51d
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions zilliqa/tests/it/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1061,17 +1061,12 @@ impl Network {
break i;
}
};
let mut debounce = 0;
let mut old_height = 0;
self.run_until(
|net| {
let syncing = net.get_node(index).consensus.sync.am_syncing().unwrap();
let height_i = net.get_node(index).get_finalized_height().unwrap();
let height_c = net.get_node(check).get_finalized_height().unwrap();
if height_c == height_i && height_i > old_height {
debounce += 1;
old_height = height_i;
}
debounce == 3
height_c == height_i && height_i > 0 && !syncing
},
2000,
)
Expand Down

0 comments on commit 4eeb51d

Please sign in to comment.