ava-labs / avalanchego

Go implementation of an Avalanche node.
https://avax.network
BSD 3-Clause "New" or "Revised" License
2.12k stars 669 forks source link

Add P2P test utility #3105

Closed joshua-kim closed 3 months ago

joshua-kim commented 3 months ago

Why this should be merged

Currently testing p2p apis is painful and requires mocking the underlying app sender calls to redirect messages to a VM's network handler. This will be used in a future PR when we require testing for the x/sync package's migration to use the p2p package.

How this works

Adds a test utility to remove the boiler plate code and provide a cleaner ux.

How this was tested

Added ut