Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P-chain - Cleaned up fork switch in UTs #2746

Merged
merged 7 commits into from
Feb 19, 2024

Conversation

abi87
Copy link
Contributor

@abi87 abi87 commented Feb 18, 2024

Why this should be merged

In a few platformvm sub-packages, we set forks in unit test via a bunch of booleans, like

env := newEnvironment(t, false /*=postBanff*/, false /*=postCortina*/, false /*=postDurango*/)

This is annoying for a few reasons:

  1. The boolean tuple gets longer with new forks
  2. We can't easily signal we want the specific unit test to be valid for the latest fork, instead of specific one.

With Durango, we cleaned up unit tests in platformvm package to use an enum instead of the boolean tuples already. This PR completes the cleanup for other packages.

How this works

Just replace a tuple of boolean parameters with an enum

How this was tested

CI

@abi87 abi87 self-assigned this Feb 18, 2024
@abi87 abi87 linked an issue Feb 18, 2024 that may be closed by this pull request
5 tasks
vms/platformvm/block/builder/helpers_test.go Outdated Show resolved Hide resolved
vms/platformvm/block/builder/helpers_test.go Outdated Show resolved Hide resolved
vms/platformvm/block/executor/helpers_test.go Outdated Show resolved Hide resolved
vms/platformvm/txs/executor/helpers_test.go Outdated Show resolved Hide resolved
@StephenButtolph StephenButtolph added this to the v1.11.0 milestone Feb 19, 2024
@StephenButtolph StephenButtolph added testing This primarily focuses on testing cleanup Code quality improvement labels Feb 19, 2024
@StephenButtolph StephenButtolph added this pull request to the merge queue Feb 19, 2024
Merged via the queue into master with commit 8dcec61 Feb 19, 2024
17 checks passed
@StephenButtolph StephenButtolph deleted the p-chain_fork_switch_UTs branch February 19, 2024 17:33
mboben pushed a commit to mboben/avalanchego that referenced this pull request Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Code quality improvement testing This primarily focuses on testing
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

P-chain - Dynamic Fees
4 participants