diff --git a/.travis.yml b/.travis.yml index 89acb2a..0e4b05e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,11 +14,13 @@ env: - NETWORK=ganache - NETWORK=geth - NETWORK=coverage + - NETWORK=ganache GAS_REPORTER=true matrix: allow_failures: - env: NETWORK=coverage - env: NETWORK=geth + - env: NETWORK=ganache GAS_REPORTER=true install: - npm install diff --git a/package.json b/package.json index 5f6bd49..15d0eb3 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "scripts": { "test": "NETWORK=ganache ./scripts/test.sh", "test:geth": "NETWORK=geth ./scripts/test.sh", + "test:gas": "NETWORK=ganache GAS_REPORTER=true ./scripts/test.sh", "coverage": "./node_modules/.bin/solidity-coverage", "lint": "./node_modules/.bin/solium -d contracts/", "compile": "./node_modules/.bin/darq-truffle compile", @@ -31,7 +32,8 @@ "homepage": "https://github.com/ethpm/escape-truffle#readme", "devDependencies": { "coveralls": "^3.0.0", - "darq-truffle": "^4.1.7-web3-one.5", + "darq-truffle": "4.1.4-next.7", + "eth-gas-reporter": "^0.1.4", "ganache-cli": "^6.1.0", "shelljs": "^0.8.1", "solidity-coverage": "^0.5.0", diff --git a/truffle-config.js b/truffle-config.js index fed5237..502117d 100644 --- a/truffle-config.js +++ b/truffle-config.js @@ -1,3 +1,14 @@ + +// Thanks AragonOS for this conditional reporter logic. +const mochaGasSettings = { + reporter: 'eth-gas-reporter', + reporterOptions : { + onlyCalledMethods: true, + } +} + +const mocha = process.env.GAS_REPORTER ? mochaGasSettings : {} + module.exports = { networks: { ganache: { @@ -10,7 +21,6 @@ module.exports = { host: "127.0.0.1", port: 8546, network_id: "*", - gas: 4000000, websockets: true }, coverage: { @@ -21,5 +31,6 @@ module.exports = { gasPrice: 0x01, websockets: true } - } + }, + mocha, }