avalanchego
avalanchego copied to clipboard
P-chain UTs consolidation 3 - Fork Handling
Why this should be merged
P-chain unit tests needs to be easier to maintain. Specifically I currently find non-trivial to understand what specific fork a unit test is testing and possibly to update the tests to the latest fork. Also fork times do not make sense and vm clock is not set to fullfil them. This PR, centralizes and simplifies fork setting in UTs. It also fixes a few subtly broken UTs. Thanks @joshua-kim and @marun for the discussions that brought me to these changes.
This PR replaces https://github.com/ava-labs/avalanchego/pull/1530, a very similar, previous attempt which lacked centralization of testing utilities in test setup package
How this works
Just refactor tests so that the latest active fork is explictly set upon vm creation and vm.clock is set to make the fork active.
How this was tested
Testing test is tricky. I guess I tested by manual inspection
This PR has become stale because it has been open for 30 days with no activity. Adding the lifecycle/frozen
label will cause this PR to ignore lifecycle events.