From 04d178eedd0e1566993b9da480a15ea94583c53d Mon Sep 17 00:00:00 2001 From: Andre Miras Date: Fri, 26 Apr 2024 23:40:50 +0200 Subject: [PATCH 1/5] Update OpenZeppelin Codecov example link (#887) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a658f45d..7fe9bab3 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ hre.__SOLIDITY_COVERAGE_RUNNING === true ``` ## Example reports -+ [openzeppelin-solidity][10](Codecov) ++ [openzeppelin-contracts][10] (Codecov) ## Funding @@ -170,7 +170,7 @@ $ yarn [7]: https://github.com/sc-forks/solidity-coverage/blob/master/docs/faq.md#continuous-integration [8]: https://github.com/sc-forks/solidity-coverage/blob/master/docs/faq.md#notes-on-branch-coverage [9]: https://sc-forks.github.io/metacoin/ -[10]: https://coveralls.io/github/OpenZeppelin/openzeppelin-solidity?branch=master +[10]: https://app.codecov.io/gh/OpenZeppelin/openzeppelin-contracts [11]: https://github.com/sc-forks/solidity-coverage/tree/master/test/units [12]: https://github.com/sc-forks/solidity-coverage/issues [13]: https://github.com/sc-forks/solidity-coverage/blob/master/docs/faq.md#notes-on-gas-distortion From adaeb542300b183ad772a492e0063ee058bcf8f6 Mon Sep 17 00:00:00 2001 From: area Date: Thu, 4 Jul 2024 06:25:43 +0100 Subject: [PATCH 2/5] Error if solcoverjs passed but nonexistent (#889) --- plugins/resources/plugin.utils.js | 5 ++++- test/integration/errors.js | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/plugins/resources/plugin.utils.js b/plugins/resources/plugin.utils.js index 9d333db7..04c66324 100644 --- a/plugins/resources/plugin.utils.js +++ b/plugins/resources/plugin.utils.js @@ -222,7 +222,10 @@ function loadSolcoverJS(config={}){ throw new Error(error) } - // Config is optional + // Config is optional, but if passed and not found, error + } else if (config.solcoverjs) { + const message = ui.generate('solcoverjs-fail') + " --solcoverjs flag was set but no file was found"; + throw new Error(message); } else { coverageConfig = {}; } diff --git a/test/integration/errors.js b/test/integration/errors.js index b78b268f..d5938f2a 100644 --- a/test/integration/errors.js +++ b/test/integration/errors.js @@ -46,6 +46,26 @@ describe('Hardhat Plugin: error cases', function() { verify.coverageNotGenerated(hardhatConfig); }) + it('.solcover.js is not found', async function(){ + const taskArgs = { + solcoverjs: "./file-that-does-not-exist.js" + } + + mock.install('Simple', 'simple.js', solcoverConfig); + mock.hardhatSetupEnv(this); + + try { + await this.env.run("coverage", taskArgs); + assert.fail() + } catch (err) { + assert( + err.message.includes('--solcoverjs flag was set but no file was found'), + `Should error if --solcoverjs passed but not found: ${err.message}` + ); + } + }) + + it('.solcover.js has incorrectly formatted option', async function(){ solcoverConfig.port = "Antwerpen"; From fcf858f54ab520fa9ea5e052b4f9c87807ac7752 Mon Sep 17 00:00:00 2001 From: Elias Rad <146735585+nnsW3@users.noreply.github.com> Date: Thu, 29 Aug 2024 01:02:57 +0300 Subject: [PATCH 3/5] Docs: fix additional spelling issues (#892) --- CHANGELOG.md | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f26b787..9393b641 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,7 +63,7 @@ * Update contributor list (https://github.com/sc-forks/solidity-coverage/issues/812) * Add dependabot config (https://github.com/sc-forks/solidity-coverage/issues/759) * Add a package description to package.json (https://github.com/sc-forks/solidity-coverage/issues/775) - * change .solcoverjs occurencies to .solcover.js (https://github.com/sc-forks/solidity-coverage/issues/777) + * change .solcoverjs occurrences to .solcover.js (https://github.com/sc-forks/solidity-coverage/issues/777) * Remove all mentions to buidler (https://github.com/sc-forks/solidity-coverage/issues/778) * Update HH dev dep & fix Zeppelin E2E test (https://github.com/sc-forks/solidity-coverage/issues/811) * Update mocha version to 10.2.0, fix deprecated debug package (https://github.com/sc-forks/solidity-coverage/issues/810) @@ -353,7 +353,7 @@ 0.4.0 / 2017-11-08 (Compatible with testrpc >= 6.0 / pragma 0.4.18 and above) ================== - * Bug fix to accomodate strict enforcement of constant and view modifiers in pragma 0.4.18 + * Bug fix to accommodate strict enforcement of constant and view modifiers in pragma 0.4.18 0.3.5 / 2017-11-07 (Compatible with testrpc >= 6.0 / pragma 0.4.17 and below) ================== diff --git a/README.md b/README.md index 7fe9bab3..284fa570 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ module.exports = { | onIstanbulComplete[*][14] | *Function* | | Hook run *after* the Istanbul reports are generated, *before* the coverage task completes. Useful if you need to clean resources up. [More...][23]| | **:warning: DEPRECATED** | | | | | configureYulOptimizer | *Boolean* | false | **(Deprecated since 0.8.7)** Setting to `true` should resolve "stack too deep" compiler errors in large projects using ABIEncoderV2 | -| solcOptimizerDetails | *Object* | `undefined` |**(Deprecated since 0.8.7))** Must be used in combination with `configureYulOptimizer`. Allows you configure solc's [optimizer details][1001]. Useful if the default remedy for stack-too-deep errors doesn't work in your case (See [FAQ: Running out of stack][1002] ). | +| solcOptimizerDetails | *Object* | `undefined` |**(Deprecated since 0.8.7))** Must be used in combination with `configureYulOptimizer`. Allows you to configure solc's [optimizer details][1001]. Useful if the default remedy for stack-too-deep errors doesn't work in your case (See [FAQ: Running out of stack][1002] ). | [* Advanced use][14] From df1df120d1787517d593875b0809cfbb4f04f21b Mon Sep 17 00:00:00 2001 From: cgewecke Date: Wed, 28 Aug 2024 21:26:31 -0700 Subject: [PATCH 4/5] Stop overwriting forking config in extendConfig (#893) --- plugins/hardhat.plugin.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/plugins/hardhat.plugin.js b/plugins/hardhat.plugin.js index c14dc82d..9bb18fb4 100644 --- a/plugins/hardhat.plugin.js +++ b/plugins/hardhat.plugin.js @@ -24,16 +24,11 @@ const ui = new PluginUI(); // Workaround for hardhat-viem-plugin and other provider redefinition conflicts extendConfig((config, userConfig) => { if (Boolean(process.env.SOLIDITY_COVERAGE)) { - const { cloneDeep } = require("lodash"); const { configureHardhatEVMGas } = require('./resources/nomiclabs.utils'); const API = require('./../lib/api'); const api = new API({}); - let hardhatNetworkForCoverage = {}; - if (userConfig.networks && userConfig.networks.hardhat) { - hardhatNetworkForCoverage = cloneDeep(userConfig.networks.hardhat); - }; - + const hardhatNetworkForCoverage = {}; configureHardhatEVMGas(hardhatNetworkForCoverage, api); config.networks.hardhat = Object.assign(config.networks.hardhat, hardhatNetworkForCoverage); } From 97dadf86853e93fa7b98c3a18bc10974940b7f2c Mon Sep 17 00:00:00 2001 From: cgewecke Date: Wed, 28 Aug 2024 21:36:22 -0700 Subject: [PATCH 5/5] 0.8.13 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2c149108..39e5a278 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "solidity-coverage", - "version": "0.8.12", + "version": "0.8.13", "description": "Code coverage for Solidity testing", "main": "plugins/nomiclabs.plugin.js", "bin": {