Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expectRevert is raising connection error. #194

Open
miratcan opened this issue Feb 20, 2023 · 1 comment
Open

expectRevert is raising connection error. #194

miratcan opened this issue Feb 20, 2023 · 1 comment

Comments

@miratcan
Copy link

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?

@CbFarmer
Copy link

Having the same issue as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants