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

Get MagicSpend test coverage to 100% #14

Merged
merged 9 commits into from
Mar 21, 2024

Conversation

stevieraykatz
Copy link
Contributor

@stevieraykatz stevieraykatz commented Mar 20, 2024

This PR implements a number of new tests for Magic Spend and also integrates with Coveralls CI to add automated coverage reporting and checking.

Added the following tests to improve our coverage reporting up to 100%:

  1. Added missing unit tests for the ownerWithdraw() method
  2. Added missing unit tests for the getHash() method
  3. Added missing unit tests for the isValidWithdrawalSignature() method
  4. Added a test case to ValidatePaymasterUserOp for revert case InsufficientBalance

As of this PR, coverage reported by forge coverage shows:

| File                             | % Lines         | % Statements    | % Branches      | % Funcs         |
|----------------------------------|-----------------|-----------------|-----------------|-----------------|
| script/DeployMagicSpend.s.sol    | 0.00% (0/8)     | 0.00% (0/10)    | 100.00% (0/0)   | 0.00% (0/2)     |
| src/MagicSpend.sol               | 100.00% (46/46) | 100.00% (54/54) | 100.00% (20/20) | 100.00% (16/16) |
| test/MagicSpend.t.sol            | 0.00% (0/6)     | 0.00% (0/10)    | 100.00% (0/0)   | 0.00% (0/4)     |
| test/PaymasterMagicSpendBase.sol | 0.00% (0/1)     | 0.00% (0/1)     | 100.00% (0/0)   | 0.00% (0/1)     |
| test/echidna/Fuzz.sol            | 0.00% (0/64)    | 0.00% (0/72)    | 0.00% (0/24)    | 0.00% (0/7)     |
| test/echidna/FuzzSetup.sol       | 0.00% (0/6)     | 0.00% (0/10)    | 100.00% (0/0)   | 0.00% (0/4)     |
| Total                            | 35.11% (46/131) | 34.39% (54/157) | 45.45% (20/44)  | 47.06% (16/34)  |

Copy link
Contributor

@wilsoncusack wilsoncusack left a comment

Choose a reason for hiding this comment

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

thank you!

@stevieraykatz stevieraykatz merged commit 2662df1 into coinbase:main Mar 21, 2024
7 checks passed
@stevieraykatz stevieraykatz deleted the test-coverage branch March 21, 2024 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants