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

Various Improvements and Refactors to Test Suite #7

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

apbendi
Copy link
Member

@apbendi apbendi commented Feb 2, 2024

Hey @garyghayrat, rather than cause too much churn on your PR, I did some cleanup and refactoring to your PR in my own branch. You can review it, leave feedback, and once you're ok with my changes, we can merge it in to your branch. Then we can ask Matt & Tony for final sign off on your PR before merging it into main and getting community input in advance of the audit. Thanks for bearing with me in this process!

Also note, the only non-test change was to update the DOMAIN_SEPARATOR to correctly confirm to the spec. The name of the param should always be verifyingContract.

resolves #6

@apbendi apbendi changed the base branch from erc-5564-use-address-only to erc-6538-use-address-only February 2, 2024 02:34
@apbendi apbendi changed the title Tweaks Various Improvements and Refactors to Test Suite Feb 2, 2024
@apbendi apbendi requested a review from garyghayrat February 2, 2024 02:36
@apbendi apbendi marked this pull request as ready for review February 2, 2024 02:38
return (address(0), RecoverError.InvalidSignatureS, s);
}
chainId1 = bound(chainId1, 1, 2 ** 64 - 1);
chainId2 = bound(chainId2, 1, 2 ** 64 - 1);
Copy link
Member

@garyghayrat garyghayrat Feb 2, 2024

Choose a reason for hiding this comment

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

why do we wanna use 2 ** 64 - 1 here?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the highest supported chainId so there's no reason not to fuzz across the whole range.

Copy link
Member

@garyghayrat garyghayrat left a comment

Choose a reason for hiding this comment

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

I see how this greatly simplifies the test suite, and I learned a couple tricks along the way. Curious about a number that you chose, otherwise looks good to me. Thank you!

* Test internal variable initialization in registry constructor tests
* Improvements to domain separator test
* Improvements to the RegisteryKeys tests
* Naming improvements to registerKeysOnBehalf tests
* Update test imports and remove duplicated import
* Refactor signature test helpers for test simplicity
* Simplify mock contract for ERC1271 signatures
* Remove redundant test and add missing ones for register on behalf
* Minor cleanup to increment nonce test
* Update the EIP712Domain separator to match the spec
* Simplify Announcer test names
* Use `vm.expectRevert("")` instead of `vm.expectRevert()`
@apbendi apbendi merged commit 471d3be into erc-6538-use-address-only Feb 5, 2024
6 checks passed
Copy link

github-actions bot commented Feb 5, 2024

Coverage after merging tweaks into erc-6538-use-address-only will be

100.00%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   ERC5564Announcer.sol100%100%100%100%
   ERC6538Registry.sol96.55%75%100%100%90

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants