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

[Snyk] Upgrade solidity-coverage from 0.7.22 to 0.8.0 #77

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

snyk-bot
Copy link

Snyk has created this PR to upgrade solidity-coverage from 0.7.22 to 0.8.0.

merge advice
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


  • The recommended version is 5 versions ahead of your current version.
  • The recommended version was released 21 days ago, on 2022-09-05.
Release notes
Package name: solidity-coverage
  • 0.8.0 - 2022-09-05

    Hi!

    ⚠️ This version requires Hardhat >= 2.11.0 (Ethereum Merge)

    New Features

    A central focus of the 0.8.0 release is improving the coverage tool's branch detection.

    Beginning with this version the following syntax is measured as a branch:

    OR conditions

    When a logical expression is composed with the || operator, both sides can be considered branches. To test the entire expression

    if (a == 1 || a == 2)

    ... a must equal 1, 2 and neither of those values. (Thanks to Gnosis engineer @ rmeissner for proposing this in #175)

    Screen Shot 2021-01-12 at 9 41 09 PM

    Ternary Conditionals

    Long ago, when Solidity was 0.4, solidity-coverage treated ternary conditionals like regular if/else statements. Some language improvements v0.5 subsequently made this impossible. Now it's back...

    Screen Shot 2021-01-12 at 9 47 43 PM

    Modifier Invocations

    Solidity-coverage already covers the code within modifier definitions. However, each modifier invocation at the function level should really be considered its own branch. Some of the most critical logic in Solidity contracts is handled this way (ex: onlyOwner). Testing the pass/fail cases for each occurrence of these gates protects you from accidentally removing them during a refactor.

    Because it's possible to write a modifier which performs a preparatory task and never reverts, there's a new option (modifierWhitelist) which allows you to exclude specific modifiers from branch measurement.

    And if you don't like modifier invocation coverage you can turn it off by setting the option measureModifierCoverage to false.

    (Many thanks to OpenZeppelin engineer @ nventuro for proposing this improvement in #286 and helping to design it.)

    Screen Shot 2021-01-12 at 10 07 13 PM

    Test Matrix

    The hardhat and truffle plugins support a new cli flag: --matrix. (Short for "test matrix".)

    This flag generates a JSON object that maps which tests in your suite hit which lines of code. (An example can be seen at docs/matrix.md. More info can be found in the advanced docs, here.)

    This data is useful for many advanced testing applications - Security researcher @ JoranHonig has written two that are worth checking out.

    Coverage is often a core component of fuzzing and generative test strategies because it helps narrow the range of inputs required to traverse every path in the code. If you're working on applications like this and have ideas for how solidity-coverage might serve your ends, please feel free to open an issue.

    Note to Truffle users

    solidity-coverage for Truffle is moving to its own repository and published under a different name (details soon...).

  • 0.8.0-rc.test.0 - 2022-04-26
  • 0.8.0-rc.1 - 2022-03-29
  • 0.8.0-beta.1 - 2022-03-29
  • 0.8.0-beta.0 - 2021-01-13

    Hi!

    This beta contains several new features. A central focus of the next major release is improving the coverage tool's branch detection.

    Beginning with this version the following syntax is measured as a branch:

    OR conditions

    When a logical expression is composed with the || operator, both sides can be considered branches. To test the entire expression

    if (a == 1 || a == 2)

    ... a must equal 1, 2 and neither of those values. (Thanks to Gnosis engineer @ rmeissner for proposing this in #175)

    Screen Shot 2021-01-12 at 9 41 09 PM

    Ternary Conditionals

    Long ago, when Solidity was 0.4, solidity-coverage treated ternary conditionals like regular if/else statements. Some language improvements v0.5 subsequently made this impossible. Now it's back...

    Screen Shot 2021-01-12 at 9 47 43 PM

    Modifier Invocations

    Solidity-coverage already covers the code within modifier definitions. However, each modifier invocation at the function level should really be considered its own branch. Some of the most critical logic in Solidity contracts is handled this way (ex: onlyOwner and nonReentrant). Testing the pass/fail cases for each occurrence of these gates protects you from accidentally removing them during a refactor or emergency patch.

    Because it's possible to write a modifier which performs a preparatory task and never reverts, there's a new option (modifierWhitelist) which allows you to exclude specific modifiers from branch measurement.

    And if you don't like modifier invocation coverage you can turn it off by setting the option measureModifierCoverage to false.

    (Many thanks to OpenZeppelin engineer @ nventuro for proposing this improvement in #286 and helping to design it.)

    Screen Shot 2021-01-12 at 10 07 13 PM

    Test Matrix

    The hardhat and truffle plugins support a new cli flag: --matrix. (Short for "test matrix".)

    This flag generates a JSON object that maps which tests in your suite hit which lines of code. (An example can be seen at docs/matrix.md. More info can be found in the advanced docs, here.)

    This data is useful for many advanced testing applications - Consensys security researcher @ JoranHonig has written two that are worth checking out.

    Coverage is often a core component of fuzzing and generative test strategies because it helps narrow the range of inputs required to traverse every path in the code. If you're working on applications like this and have ideas for how solidity-coverage might serve your ends, please feel free to open an issue.

    What's Coming!

    We're hoping to get a major release out by the beginning of February (2021). It will include two additional features you can run in CI to get better feedback about what's changing in your code from PR to PR.

    • A unified diff of the public API changes in your contracts
    • Natspec documentation coverage
  • 0.7.22 - 2022-09-05
from solidity-coverage GitHub release notes
Commit messages
Package name: solidity-coverage
  • 0a33e13 0.8.0
  • 4c63612 Add hardhat to peerDependencies (#722)
  • 9ce20ff Typo / Grammar fix. (#738)
  • 204a5eb Added a section for the report location. (#739)
  • ed3d504 Fix README for v0.8 release
  • 05ab320 Fixes for Hardhat 2.11.0 (#740)
  • bc7d076 0.8.0 Additional Coverage Measurements & Restructure (Merge)
  • a7db2fe More README changes
  • 16367d1 Remove truffle files from project
  • 26898c1 Remove Builder-E2E test
  • 8ea8ec9 Fix true/false scoped method definition function visibilities
  • 21ca46e Temporarily skip truffle integration tests
  • 22992e1 Fix constructor test
  • cf126ea Fix assert tests
  • 0ba3f11 Remove more buildler things
  • d57a131 Remove buidler
  • 3bcec94 Fix rebase errors & regenerate yarn.lock
  • 88c1d00 Fix loops, modifiers, options and statements tests
  • 0deb001 Fix if/else tests
  • 29c0fdd Fix constructor keyword test
  • d4e8536 Update tests for adjusted statement coverage
  • 3edfd25 Stop injecting statement coverage into conditionals
  • 7eb94a9 Update @ solidity-parser/parser to 0.14.1
  • e9133d7 Generate mocha JSON output with --matrix (#601)

Compare


Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.

For more information:

🧐 View latest project report

🛠 Adjust upgrade PR settings

🔕 Ignore this dependency or unsubscribe from future upgrade PRs

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.

1 participant