The error occurs right before console.log(1.92) every time in tests on ganache, no matter if I use BN.js or web3.utils.toBN. I've tried looking into every answer but they just tell you basic stuff like not to use .toNumber() which I am not doing. This crashes both ganache-cli and the GUI regardless of which I use. Any ideas?
If I combine e.g. 5 mintings in 1, I just get it after a roughly equivalent number of calls.
await waypoint.mint(investor, new BN("100000000000000000000"))
await waypoint.mint(investor, new BN("100000000000000000000"))
console.log(1.6)
await waypoint.processMints(investor)
console.log(1.7)
result = await waypoint.totalSupply()
assert.equal(result.toString(), tokens('2100'), 'total Supply correct after minting started3 ')
result = await waypoint.balanceOf(investor)
assert.equal(result.toString(),tokens('300'), 'investor WPNT wallet balance correct after minting3')
time.setDate(time.getDate() + 1)
console.log(1.8)
await advanceBlockAtTime(time.getTime())
console.log(1.9)
await waypoint.mint(investor, new BN("100000000000000000000"))
console.log(1.91)
await waypoint.mint(investor, new BN("100000000000000000000"))
console.log(1.92)
function mint(address _to, uint256 _amount) external returns (bool success) {
// for use by the staking contract and cross-chain transfers
// mintings occur after a delay to inform users in advance
require(owners[msg.sender] == true, "request must be made by an owner");
require(totalSupply() + _amount < maxSupply, "the total supply must be lower than the maximum supply");
mintings[_to].push([block.timestamp + mintWait, _amount]);
emit MintStarted(_to, block.timestamp + mintWait, _amount);
return true;
}
Ganache CLI v6.12.2 (ganache-core: 2.13.2)]
node v15.12.0
npm 7.6.3