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§

NetworkEventStream
A helper type to await network events
Peer
A peer in the Testnet.
PeerConfig
A helper config for setting up the reth networking stack.
PeerHandle
A handle to a peer in the Testnet.
Testnet
A test network consisting of multiple peers.
TestnetHandle
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, the PeerId 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