mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
test(net): speedup network tests (#1337)
This commit is contained in:
@ -158,9 +158,8 @@ impl Testnet<NoopProvider> {
|
||||
/// Creates a new [`Testnet`] with the given number of peers
|
||||
pub async fn try_create(num_peers: usize) -> Result<Self, NetworkError> {
|
||||
let mut this = Testnet::default();
|
||||
for _ in 0..num_peers {
|
||||
this.add_peer().await?;
|
||||
}
|
||||
|
||||
this.extend_peer_with_config((0..num_peers).map(|_| Default::default())).await?;
|
||||
Ok(this)
|
||||
}
|
||||
|
||||
|
||||
@ -15,7 +15,6 @@ async fn test_session_established_with_highest_version() {
|
||||
reth_tracing::init_test_tracing();
|
||||
|
||||
let net = Testnet::create(2).await;
|
||||
|
||||
net.for_each(|peer| assert_eq!(0, peer.num_peers()));
|
||||
|
||||
let mut handles = net.handles();
|
||||
@ -37,12 +36,11 @@ async fn test_session_established_with_highest_version() {
|
||||
assert_eq!(handle1.peer_id(), &peer_id);
|
||||
assert_eq!(status.version, EthVersion::Eth67 as u8);
|
||||
}
|
||||
_ => {
|
||||
panic!("unexpected event")
|
||||
ev => {
|
||||
panic!("unexpected event {ev:?}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
handle.terminate().await;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user