solidity-coverage: InvalidInputError: sender doesn't have enough funds to send tx.
tests runs fine without coverage, but when using coverage I get a strange error.
1) 1_Whitelist.ts =================================================================
"before all" hook for "set hasWhitelisting to true":
InvalidInputError: sender doesn't have enough funds to send tx. The upfront cost is: 8796093022200000000000 and the sender's account only has: 2000000000000000000
at TxPool._validateTransaction (node_modules/hardhat/src/internal/hardhat-network/provider/TxPool.ts:426:13)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at runNextTicks (internal/process/task_queues.js:66:3)
at listOnTimeout (internal/timers.js:523:9)
at processTimers (internal/timers.js:497:7)
at TxPool.addTransaction (node_modules/hardhat/src/internal/hardhat-network/provider/TxPool.ts:102:5)
at HardhatNode._addPendingTransaction (node_modules/hardhat/src/internal/hardhat-network/provider/node.ts:1103:5)
at HardhatNode._mineTransaction (node_modules/hardhat/src/internal/hardhat-network/provider/node.ts:1111:5)
at EthModule._sendTransactionAndReturnHash (node_modules/hardhat/src/internal/hardhat-network/provider/modules/eth.ts:1379:18)
at HardhatNetworkProvider.request (node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:105:18)
strangely it looks like as if it depends on how I deploy the contract …
https://github.com/paulrberg/solidity-template/discussions/50#discussioncomment-1085160
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 3
- Comments: 16 (1 by maintainers)
Edit: I found what was the problem in my case.
In my
hardhat.config.ts, I set thedefaultNetworktopolygon_mumbai. But from what I understand, the tests have to run on the hardhat local network.So, while keeping the
defaultNetworkin my config, I had to specify in my command that I want to use the hardhat network:npx hardhat coverage --network hardhat