Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix test
  • Loading branch information
mattsse committed Feb 19, 2025
commit 557a01724d609cccf81053c8cfd4aed7019e549f
2 changes: 1 addition & 1 deletion crates/net/discv5/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ metrics.workspace = true
[dev-dependencies]
reth-tracing.workspace = true
tokio = { workspace = true, features = ["rt-multi-thread"] }
secp256k1 = { workspace = true, features = ["std"] }
secp256k1 = { workspace = true, features = ["std", "rand"] }
8 changes: 2 additions & 6 deletions crates/net/discv5/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,8 @@ pub async fn lookup(
mod test {
use super::*;
use ::enr::{CombinedKey, EnrKey};
use rand::thread_rng;
use reth_chainspec::MAINNET;
use secp256k1::rand::thread_rng;
use tracing::trace;

fn discv5_noop() -> Discv5 {
Expand Down Expand Up @@ -729,16 +729,12 @@ mod test {
node_1.with_discv5(|discv5| discv5.send_ping(node_2_enr.clone())).await.unwrap();

// verify node_1:discv5 is connected to node_2:discv5 and vv
let event_2_v5 = stream_2.recv().await.unwrap();
let event_1_v5 = stream_1.recv().await.unwrap();

assert!(matches!(
event_1_v5,
discv5::Event::SessionEstablished(node, socket) if node == node_2_enr && socket == node_2_enr.udp4_socket().unwrap().into()
));
assert!(matches!(
event_2_v5,
discv5::Event::SessionEstablished(node, socket) if node == node_1_enr && socket == node_1_enr.udp4_socket().unwrap().into()
));
Comment on lines -738 to -741
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is an internal discv5 event change so this established event is no longer emitted


// verify node_1 is in KBuckets of node_2:discv5
let event_2_v5 = stream_2.recv().await.unwrap();
Expand Down
Loading