close
The Wayback Machine - https://web.archive.org/web/20210810134620/https://github.com/trufflesuite/truffle/issues/2653
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

eth_increaseTime breaks subsequent contract calls #2653

Open
1 task done
coventry opened this issue Dec 3, 2019 · 2 comments
Open
1 task done

eth_increaseTime breaks subsequent contract calls #2653

coventry opened this issue Dec 3, 2019 · 2 comments

Comments

@coventry
Copy link
Task lists! Give feedback

@coventry coventry commented Dec 3, 2019

https://gitter.im/ConsenSys/truffle?at=5de5c3d91659720ca8eb0c4c


Issue

I'm seeing the failure reported here: https://ethereum.stackexchange.com/questions/15101/how-to-use-the-testrpc-evm-increasetime-parameter-from-truffle-console#comment89683_21515

Namely, if I use eth_increaseTime, then invoke a contract, I get Uncaught TypeError: callback is not a function.

There's a test case here: https://github.com/coventry/white_elephant/blob/failing-eth_increaseTime/test/white_elephant_test.js#L117

Remove line 117, and the test passes. Remove lines 115-116, and I get a proper revert from the contract. Only with the two lines together do I get the above error.

Steps to Reproduce

Clone the above white_elephant repo, install truffle, run truffle test. Fails with

Uncaught TypeError: callback is not a function

It's unclear which callback this error is referring to.

Expected Behavior

Revert on the contract transaction on line 117 of white_elephant_test.js.

Actual Results

See above.

Environment

  • Operating System: Ubuntu 18.04
  • Ethereum client: Whatever truffle uses under the hood.
  • Truffle version (truffle version):
$ truffle version
Truffle v5.0.21 (core: 5.0.21)
Solidity - 0.5.1 (solc-js)
Node v10.17.0
Web3.js v1.0.0-beta.37
  • node version (node --version): 10.17.0
  • npm version (npm --version): 6.10.3
@CruzMolina
Copy link
Contributor

@CruzMolina CruzMolina commented Dec 9, 2019

Having difficulty diagnosing this issue, although the error message definitely appears to happen when hitting the web3.currentProvider.send call on line 115.

Can't seem to find an older v5.0.x version of truffle that works with this test because of unpinned Web3 dependencies 😬.

@CruzMolina
Copy link
Contributor

@CruzMolina CruzMolina commented Dec 9, 2019

Okay, so AFAICT, web3.currentProvider.send expects a callback to be passed.

See Synthetix and JoinColony's use of web3.currentProvider in their test helpers :

It would be pretty useful to document this. We can likely also do some things on our end to enable not having to pass a callback.

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

Successfully merging a pull request may close this issue.

None yet
2 participants