OpenZeppelin / openzeppelin-test-helpers

Assertion library for Ethereum smart contract testing
https://docs.openzeppelin.com/test-helpers
MIT License
416 stars 132 forks source link

expectRevert is raising connection error. #194

Open miratcan opened 1 year ago

miratcan commented 1 year ago

I am using openzeppelin-test-helpers to test my project, expectEvent etc is working as I expected but when I call expectRevert, this error is being raised:

  1) Contract: Flipa Bets
     Player can NOT attend to high side if the bet amount is too low.:
     Error: CONNECTION ERROR: Couldn't connect to node http://localhost:8545.
      at Object.ConnectionError (node_modules/web3-core-helpers/lib/errors.js:66:23)
      at Object.InvalidConnection (node_modules/web3-core-helpers/lib/errors.js:36:21)
      at HttpProvider.failed (node_modules/web3-providers-http/lib/index.js:139:25)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)

The way I call expectRevert is this:

         It('Player can NOT attend to the high side if the bet amount is too low.', async () => {
        receipt = flipa.attend(HIGH, {
            from: player1, value: minBetAmount.sub(new BN('100'))
        });
        await expectRevert(receipt, 'Bet amount is too low');
    });

The versions that I am using:

Are there anyone that can help me about this?

CbFarmer commented 1 year ago

Having the same issue as well