Unverified Commit fb36326a by Hadrien Croubois Committed by GitHub

Support london with coverage using initialBaseFee = 0 (#2838)

parent 9b4326d9
/// ENVVAR /// ENVVAR
// - ENABLE_GAS_REPORT // - CI: output gas report to file instead of stdout
// - CI // - COVERAGE: enable coverage report
// - COMPILE_MODE // - ENABLE_GAS_REPORT: enable gas report
// - COMPILE_MODE: production modes enables optimizations (default: development)
// - COMPILE_VERSION: compiler version (default: 0.8.3)
// - COINMARKETCAP: coinmarkercat api key for USD value in gas report
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const path = require('path');
...@@ -12,6 +15,10 @@ const argv = require('yargs/yargs')() ...@@ -12,6 +15,10 @@ const argv = require('yargs/yargs')()
type: 'boolean', type: 'boolean',
default: false, default: false,
}, },
coverage: {
type: 'boolean',
default: false,
},
gas: { gas: {
alias: 'enableGasReport', alias: 'enableGasReport',
type: 'boolean', type: 'boolean',
...@@ -28,11 +35,14 @@ const argv = require('yargs/yargs')() ...@@ -28,11 +35,14 @@ const argv = require('yargs/yargs')()
type: 'string', type: 'string',
default: '0.8.3', default: '0.8.3',
}, },
coinmarketcap: {
alias: 'coinmarketcapApiKey',
type: 'string',
},
}) })
.argv; .argv;
require('@nomiclabs/hardhat-truffle5'); require('@nomiclabs/hardhat-truffle5');
require('solidity-coverage');
if (argv.enableGasReport) { if (argv.enableGasReport) {
require('hardhat-gas-reporter'); require('hardhat-gas-reporter');
...@@ -59,7 +69,6 @@ module.exports = { ...@@ -59,7 +69,6 @@ module.exports = {
}, },
networks: { networks: {
hardhat: { hardhat: {
hardfork: process.env.COVERAGE ? 'berlin' : 'london',
blockGasLimit: 10000000, blockGasLimit: 10000000,
allowUnlimitedContractSize: !withOptimizations, allowUnlimitedContractSize: !withOptimizations,
}, },
...@@ -67,5 +76,11 @@ module.exports = { ...@@ -67,5 +76,11 @@ module.exports = {
gasReporter: { gasReporter: {
currency: 'USD', currency: 'USD',
outputFile: argv.ci ? 'gas-report.txt' : undefined, outputFile: argv.ci ? 'gas-report.txt' : undefined,
coinmarketcap: argv.coinmarketcap,
}, },
}; };
if (argv.coverage) {
require('solidity-coverage');
module.exports.networks.hardhat.initialBaseFeePerGas = 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment