瀏覽代碼

test: fix coverage script by enabling the berlin hardfork

Paul Razvan Berg 4 年之前
父節點
當前提交
2e13a21104
共有 2 個文件被更改,包括 3 次插入1 次删除
  1. 2 0
      hardhat.config.ts
  2. 1 1
      package.json

+ 2 - 0
hardhat.config.ts

@@ -63,6 +63,8 @@ const config: HardhatUserConfig = {
         mnemonic,
         mnemonic,
       },
       },
       chainId: chainIds.hardhat,
       chainId: chainIds.hardhat,
+      // See https://github.com/sc-forks/solidity-coverage/issues/652
+      hardfork: process.env.CODE_COVERAGE ? "berlin" : "london",
     },
     },
     goerli: getChainConfig("goerli"),
     goerli: getChainConfig("goerli"),
     kovan: getChainConfig("kovan"),
     kovan: getChainConfig("kovan"),

+ 1 - 1
package.json

@@ -69,7 +69,7 @@
     "clean": "hardhat clean",
     "clean": "hardhat clean",
     "commit": "git-cz",
     "commit": "git-cz",
     "compile": "hardhat compile",
     "compile": "hardhat compile",
-    "coverage": "hardhat coverage --solcoverjs ./.solcover.js --temp artifacts --testfiles \"./test/**/*.ts\"",
+    "coverage": "cross-env CODE_COVERAGE=true hardhat coverage --solcoverjs ./.solcover.js --temp artifacts --testfiles \"./test/**/*.ts\"",
     "deploy": "hardhat deploy:Greeter",
     "deploy": "hardhat deploy:Greeter",
     "lint": "yarn run lint:sol && yarn run lint:ts && yarn run prettier:check",
     "lint": "yarn run lint:sol && yarn run lint:ts && yarn run prettier:check",
     "lint:sol": "solhint --config ./.solhint.json --max-warnings 0 \"contracts/**/*.sol\"",
     "lint:sol": "solhint --config ./.solhint.json --max-warnings 0 \"contracts/**/*.sol\"",