Skip to content

Commit

Permalink
Fix flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
emhane committed Apr 19, 2024
1 parent 74e7a24 commit 0f301a4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/net/discv5/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,9 @@ mod tests {
// bucket index ceiled to the next multiple of 4
const fn expected_bucket_index(kbucket_index: usize) -> u64 {
let log2distance = kbucket_index + 1;
if log2distance % 8 == 0 {
return log2distance as u64;
}
let log2distance = log2distance / 8;
((log2distance + 1) * 8) as u64
}
Expand Down

0 comments on commit 0f301a4

Please sign in to comment.