Skip to content

Commit

Permalink
Fix unused variable
Browse files Browse the repository at this point in the history
  • Loading branch information
ackintosh committed Nov 29, 2024
1 parent 2d7a679 commit aa57e8b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions beacon_node/lighthouse_network/src/rpc/self_limiter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,13 @@ mod tests {
})),
RequestType::Ping(Ping { data: i as u64 }),
);

// Check that the limiter allows the first two requests.
if i <= 2 {
assert!(result.is_ok());
} else {
assert!(result.is_err());
}
}
}

Expand All @@ -455,6 +462,7 @@ mod tests {
.get(&(peer2, Protocol::Ping))
.is_some());

// Check that the limiter returns the IDs of pending requests and that the IDs are ordered correctly.
let mut failed_requests = limiter.peer_disconnected(peer1);
for i in 3..=5u32 {
let (request_id, _) = failed_requests.remove(0);
Expand All @@ -472,6 +480,7 @@ mod tests {
.delayed_requests
.get(&(peer1, Protocol::Ping))
.is_none());

assert!(limiter.active_requests.get(&peer2).is_some());
assert!(limiter
.delayed_requests
Expand Down

0 comments on commit aa57e8b

Please sign in to comment.