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

Increase branch Coverage #108

Merged
merged 3 commits into from
Oct 24, 2023
Merged

Increase branch Coverage #108

merged 3 commits into from
Oct 24, 2023

Conversation

nlordell
Copy link
Collaborator

Partially fixes #87

This PR adds unit tests to cover the remaining branches from the SimpleEIP4337Module contract. With this, we should have 100% coverage for the core contracts in the repo (although, not all paths in the test contracts are covered, which should be fine).

In terms of test organisation, I added a EIP4337Module.spec.ts for unit tests directly targeting the module functions (validateUserOp and execUserOp*).

@nlordell nlordell requested a review from a team as a code owner October 24, 2023 06:23
@nlordell nlordell requested review from rmeissner, Uxio0, akshay-ap and mmv08 and removed request for a team October 24, 2023 06:23
@nlordell nlordell force-pushed the feature/increase-test-coverage branch from b48baa4 to d12a91f Compare October 24, 2023 08:18
@coveralls
Copy link

coveralls commented Oct 24, 2023

Pull Request Test Coverage Report for Build 6626570558

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+13.6%) to 100.0%

Totals Coverage Status
Change from base Build 6624176320: 13.6%
Covered Lines: 26
Relevant Lines: 26

💛 - Coveralls

Copy link
Member

@mmv08 mmv08 left a comment

Choose a reason for hiding this comment

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

Looks good, just two minor suggestions

4337/test/eip4337/EIP4337Module.spec.ts Outdated Show resolved Hide resolved
@@ -128,6 +127,22 @@ describe('EIP4337Module - Existing Safe', async () => {
expect(emittedRevert).to.be.true
})

it('executeUserOpWithErrorString should execute contract calls', async () => {
Copy link
Member

Choose a reason for hiding this comment

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

One thing I actually forgot to do in the executeUserOpWithErrorString PR is to add tests for it to the EIP4337ModuleNew.spec.ts 🙈 would be amazing if you add them

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added - the revert propagation test was also missing which I added (asserting that the Safe gets deployed even if the user op reverts).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@nlordell nlordell merged commit 1826c56 into master Oct 24, 2023
4 checks passed
@nlordell nlordell deleted the feature/increase-test-coverage branch October 24, 2023 12:11
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.

[4337 Module] Increase test coverage to 99+%
3 participants