When I start ganache-cli
in one terminal window and run ./node_modules/.bin/solidity-coverage
(command from documentation) in another I get
Error: Exceeds block gas limit
at Object.InvalidResponse (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/errors.js:38:1)
at /usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/requestmanager.js:86:1
at /usr/local/lib/node_modules/truffle/build/webpack:/~/truffle-core/~/truffle-migrate/index.js:225:1
at /usr/local/lib/node_modules/truffle/build/webpack:/~/truffle-provider/wrapper.js:134:1
at XMLHttpRequest.request.onreadystatechange (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/httpprovider.js:128:1)
at XMLHttpRequestEventTarget.dispatchEvent (/usr/local/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:64:1)
at XMLHttpRequest._setReadyState (/usr/local/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:354:1)
at XMLHttpRequest._onHttpResponseEnd (/usr/local/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:509:1)
at IncomingMessage. (/usr/local/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:469:1)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
I even deleted all tests and contracts and I still receive this error. truffle test
and truffle migrate
works. Any help appreciated
Here my truffle.js exports
module.exports = {
networks: {
development: {
host: "localhost",
port: 8545,
network_id: "*",
gas: 6700000
},
coverage: {
host: "localhost",
network_id: "*",
port: 8545, // <-- If you change this, also set the port option in .solcover.js.
gas: 0xfffffffffff, // <-- Use this high gas value
gasPrice: 0x01 // <-- Use this low gas price
}
}
};
and my .solcover.js
module.exports = {
port: 8545,
norpc: true,
skipFiles: ['contracts/Migrations.sol'],
copyPackages: ['zeppelin-solidity']
}
Best Answer
Try removing the line norpc: true in solcover.js and set port to 8555