You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
it("should accept a bet if there is enough in contract to cover it", async function(){ let instance = await CoinFlip.deployed(); await web3.eth.sendTransaction({from: accounts[0], to: "0x842F796082c5E6716B98C0d175F7C2EabE768e9b", value: web3.utils.toWei("15", "ether")}); await truffleAssert.passes(instance.bet(0, {from: accounts[1], value: web3.utils.toWei("2", "ether")}), truffleAssert.ErrorType.REVERT); });
When I do the truffle assert fails as follows:
1) Contract: CoinFlip should accept a bet if there is enough in contract to cover it: AssertionError: revert : Failed with Error: Returned error: VM Exception while processing transaction: revert Sorry, the contract cannot cover this bet. -- Reason given: Sorry, the contract cannot cover this bet.. at passes (node_modules\truffle-assertions\index.js:142:11) at processTicksAndRejections (internal/process/task_queues.js:97:5)
I then go into Ganache and attempt to click on the transaction that sent the 15 ether to the contract. When I click on this, Ganache gives the below error.
PLATFORM: win32
GANACHE VERSION: 2.5.4
EXCEPTION:
TypeError: Cannot read property 'stack' of undefined
at IpcMainImpl.<anonymous> (C:\Program Files\WindowsApps\GanacheUI_2.5.4.0_x64__5dg5pnz03psnj\app\resources\app.asar\webpack:\src\integrations\ethereum\index.js:96:31)
The text was updated successfully, but these errors were encountered:
I'm trying to run the folllowing test in truffle:
it("should accept a bet if there is enough in contract to cover it", async function(){ let instance = await CoinFlip.deployed(); await web3.eth.sendTransaction({from: accounts[0], to: "0x842F796082c5E6716B98C0d175F7C2EabE768e9b", value: web3.utils.toWei("15", "ether")}); await truffleAssert.passes(instance.bet(0, {from: accounts[1], value: web3.utils.toWei("2", "ether")}), truffleAssert.ErrorType.REVERT); });
When I do the truffle assert fails as follows:
1) Contract: CoinFlip should accept a bet if there is enough in contract to cover it: AssertionError: revert : Failed with Error: Returned error: VM Exception while processing transaction: revert Sorry, the contract cannot cover this bet. -- Reason given: Sorry, the contract cannot cover this bet.. at passes (node_modules\truffle-assertions\index.js:142:11) at processTicksAndRejections (internal/process/task_queues.js:97:5)
I then go into Ganache and attempt to click on the transaction that sent the 15 ether to the contract. When I click on this, Ganache gives the below error.
PLATFORM: win32
GANACHE VERSION: 2.5.4
EXCEPTION:
The text was updated successfully, but these errors were encountered: