Module test_utils
Available on crate features
network
and test-utils
only.Expand description
Common helpers for network testing. Common helpers for network testing.
Structs§
- Network
Event Stream - A helper type to await network events
- Peer
- A peer in the
Testnet
. - Peer
Config - A helper config for setting up the reth networking stack.
- Peer
Handle - A handle to a peer in the
Testnet
. - Testnet
- A test network consisting of multiple peers.
- Testnet
Handle - A handle to a
Testnet
that can be shared.
Constants§
- GETH_
TIMEOUT - The timeout for tests that create a
GethInstance
Functions§
- enr_
to_ peer_ id - Obtains a
PeerId
from an ENR. In this case, thePeerId
represents the public key contained in the ENR. - unused_
port - A bit of hack to find an unused TCP port.
- unused_
tcp_ addr - Finds an unused tcp address
- unused_
tcp_ and_ udp_ port - Finds a single port that is unused for both TCP and UDP.
- unused_
tcp_ udp - Creates two unused
SocketAddrs
, intended for use as the p2p (TCP) and discovery ports (UDP) for new reth instances. - unused_
udp_ addr - Finds an unused udp address
- unused_
udp_ port - Finds an unused udp port