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

test: increase Checkpoints lib coverage #191

Merged
merged 3 commits into from
Mar 30, 2023

Conversation

0xrajath
Copy link
Contributor

@0xrajath 0xrajath commented Mar 30, 2023

Motivation:

Currently the coverage report for the Checkpoints Library shows up as 0%.
We need to fix it by refactoring the Checkpoints Mock in Checkpoints.t.sol as stated in foundry-rs/foundry#3128 (comment)

Modifications:

  • Refactoring Checkpoints Mock from:
contract LibHelper {
    function increment(uint256 a) external returns (uint256 r) {
        r = Lib.increment(a);
    }
}

to

contract LibHelper {
    function increment(uint256 a) external returns (uint256) {
        uint256 r = Lib.increment(a);
        return r;
    }
}
  • Removing using for notation in Checkpoints Mock
  • Setting coverage threshold back to 80%

Result:

Increased code coverage for Checkpoints Library. Closes #184

Copy link
Contributor

@dd0sxx dd0sxx left a comment

Choose a reason for hiding this comment

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

nice work!

@dd0sxx
Copy link
Contributor

dd0sxx commented Mar 30, 2023

do you want to change CI to fail again if coverage is below 80/90%?

@0xrajath
Copy link
Contributor Author

do you want to change CI to fail again if coverage is below 80/90%?

Oh yeah good point. Will do

@0xrajath 0xrajath force-pushed the rajath/fix-checkpoints-coverage branch from 8ac1357 to c5bd637 Compare March 30, 2023 20:43
@github-actions
Copy link

Coverage after merging rajath/fix-checkpoints-coverage into main will be

90.12%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   VertexAccount.sol100%100%100%100%
   VertexCore.sol90.55%87.93%80%93.50%264, 271–272, 272, 272–273, 298, 305–306, 306, 306–307, 408, 480, 484
   VertexFactory.sol100%100%100%100%
   VertexLens.sol100%100%100%100%
   VertexPolicy.sol81.25%66.67%84.38%82.98%117, 119–121, 121, 121–122, 141–142, 177–178, 180–181, 271–272, 277, 302, 327, 334, 343, 381, 95
   VertexPolicyMetadata.sol100%100%100%100%
   VertexStrategy.sol97.96%83.33%100%100%149
src/lib
   Checkpoints.sol79.68%72.22%94.44%80.87%105, 204, 216–217, 258–260, 260, 260–261, 263, 266, 294–295, 333–335, 337–339, 341–343, 345–347, 349–351, 353–355, 361–362, 380, 389, 53
   ERC721NonTransferableMinimalProxy.sol92.75%95.45%81.82%94.44%117, 189, 44

@0xrajath 0xrajath merged commit 05e3a18 into main Mar 30, 2023
4 checks passed
@0xrajath 0xrajath deleted the rajath/fix-checkpoints-coverage branch March 30, 2023 21:36
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.

test: Fixing coverage support for Checkpoints Library
2 participants