Error message is:
- Unit tests Governor mint first nft: Error: VM Exception while processing transaction: reverted with reason string 'Not enough ether to purchase NFTs.' at MyNftToken.approve (@openzeppelin/contracts/token/ERC721/ERC721.sol:114) at MyNftToken.safeMint (contracts/MyNftToken.sol:54) at async HardhatNode._mineBlockWithPendingTxs (node_modules/hardhat/src/internal/hardhat-network/provider/node.ts:1773:23) at async HardhatNode.mineBlock (node_modules/hardhat/src/internal/hardhat-network/provider/node.ts:466:16) at async EthModule._sendTransactionAndReturnHash (node_modules/hardhat/src/internal/hardhat-network/provider/modules/eth.ts:1504:18) at async HardhatNetworkProvider.request (node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:118:18) at async EthersProviderWrapper.send (node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)
Prior to running my test I set the ether balance to 10 ether:
await this.token.deployed();
await hre.network.provider.request({ method: 'hardhat_setBalance', params: [this.signers.admin.address, ethers.utils.parseEther('10').toHexString()] });
I mint setting a a gas limit so I don't get the Unable to estimate gas error:
const myFirstMint = await this.token.safeMint(this.signers.admin.address, {
gasLimit: 250000,
});
await myFirstMint.wait();
Anyone knows what more I can do?