Skip to content

expectRevert is raising connection error. #194

@miratcan

Description

@miratcan

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:

  • Truffle v5.7.7 (core: 5.7.7)
  • Ganache v7.7.5
  • Solidity - 0.8.18 (solc-js)
  • Node v18.14.0
  • Web3.js v1.8.2

Are there anyone that can help me about this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions