Module test_utils

Source
Expand description

Common helpers for network testing. Common helpers for network testing.

Modules§

transactions
Test helper impls for transactions

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§

buffer_hash_to_tx_fetcher
Directly buffer hahs into tx fetcher for testing.
enr_to_peer_id
Obtains a PeerId from an ENR. In this case, the PeerId represents the public key contained in the ENR.
new_mock_session
Mock a new session, returns (peer, channel-to-send-get-pooled-tx-response-on).
new_tx_manager
A new tx manager for testing.
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