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

Unit test cleanup #574

Merged
merged 1 commit into from
Sep 25, 2024
Merged

Unit test cleanup #574

merged 1 commit into from
Sep 25, 2024

Conversation

geoff-vball
Copy link
Contributor

Why this should be merged

Refactors a lot of our testing code. Simplifies creating the first validator and delegator for tests that should start out with them.

How this works

How this was tested

Existing tests

How is this documented

@geoff-vball geoff-vball changed the base branch from main to validator-manager September 25, 2024 15:38
Copy link
Contributor

@cam-schultz cam-schultz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just one question about the necessity of separating out some of the helpers.

return delegationID;
}

function _setUpInitializeEndDelegation(
function _initializeEndDelegationValidatorActiveWithChecks(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a specific use case you have in mind that would be better served by having separate WithChecks functions? It looks like the functions without the checks are not called directly anywhere else.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you expect the code to revert somewhere inside of _initializeEndDelegationValidatorActive, you can call vm.expectRevert before calling it. If you used _initializeEndDelegationValidatorActiveWithChecks in the same situation, your test would probably fail because it failed to emit an event that it was expecting, due to the early revert.

@geoff-vball geoff-vball merged commit 0b5e0e2 into validator-manager Sep 25, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants