This is a first step in refactoring abc_p2p_avalanche.py, because it is testing too many things. The avalanche enabled P2PInterface used in this file will be reused in multiple tests after this is split up into smaller pieces.
This commit does the following:
- move `abc_p2p_avalanche.TestNode` to `test_framework.avatools.AvaP2PInterface`
- move `get_node` (previously defined locally in run_tests) to avatools.py and rename it `get_ava_p2p_interface`
- add a- initialize the `nodeid` attribute in `AvaP2PInterface.setNodeId` method__init__` instead of monkey-patching the object after instantiation. This is a request from the `mypy` linter, This is a way to address a `mypy` linterwhich raised an error because "AvaP2PInterface has no attribute nodeid" when assigning a nodeid in `get_ava_p2p_interface`
Except for the renaming and new method, noNo other code is changed. It does not change the behaviorThe behavior is not changed.