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 coverage #624

Merged
merged 19 commits into from
Nov 22, 2024
Merged

Unit test coverage #624

merged 19 commits into from
Nov 22, 2024

Conversation

geoff-vball
Copy link
Contributor

@geoff-vball geoff-vball commented Oct 24, 2024

Why this should be merged

Provides full coverage for all Validator Manager contracts except ValidatorManager.sol (WIP).

There are a couple checks that are currently unreachable, but I think are still good to have for when code changes.

Covecov doesn't seem to be able to handle one of the if, elif, else statements.

How this was tested

Screenshot 2024-10-24 at 10 14 31 AM

How is this documented

N/A

@geoff-vball geoff-vball changed the title Unit test cov Unit test coverage Oct 25, 2024
Base automatically changed from validator-manager to main October 29, 2024 18:29
Copy link
Contributor

@richardpringle richardpringle left a comment

Choose a reason for hiding this comment

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

Not requesting changes (necessarily), so leaving as a "comment" review.

If you don't want to make change, you can just re-request a review and I'll approve, but please respond to that one question first! Just making sure you wanted to do that.

);
}

function testRegisterSubnetValidatorMessageInvalidInputLength() public {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we change the name here? It looks like this test checks 3 different invalid cases and not just InvalidInputLength

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I think the two tests below got copied into this test accidentally on a merge. All fixed now.

}

function testRegisterSubnetValidatorMessageInvalidCodecID() public {
(, bytes memory packed) = ValidatorMessages.packRegisterL1ValidatorMessage(
Copy link
Contributor

Choose a reason for hiding this comment

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

Do this test case and testRegisterSubnetValidatorMessageInvalidTypeID below re-test functionality tested above? I agree that it would make sense to remove it from the above in that case to have a single test for single error state but we should be able to use _getPackedRegisterL1ValidatorMessage() as well

@geoff-vball geoff-vball requested a review from iansuvak November 22, 2024 09:02
@geoff-vball geoff-vball merged commit d4ce977 into main Nov 22, 2024
17 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