Executing await time.increase(123) throws
TypeError: web3.currentProvider.sendAsync is not a function
馃捇 Environment
Using [email protected] and trying to execute the statement above inside a truffle test run. OS is Ubuntu 18.04.1 with [email protected]
馃摑 Details
Console-logging web3.currentProvider returns undefined.
馃敘 Code to reproduce bug
Just a Truffle JS test file including following lines.
const time = require("openzeppelin-solidity/test/helpers/time");
await time.increase(123);
Hey there @ferittuncer, thanks for reporting this!
It looks like this is one of the web3 1.0.0 breaking changes, sendAsync is no more, and we should now use send. I've actually extracted the testing helpers into their own package (https://github.com/OpenZeppelin/openzeppelin-test-helpers - still in beta, I plan on releasing a non-beta version either this or next week, after I migrate all of OpenZeppelin to use it) where that issue has been fixed. There's no documentation yet, but if you're courageous, you can install it via npm, and take a look at the test files to see how each function is used. time.increase should require no changes on your side :)
Cheers!
Most helpful comment
Hey there @ferittuncer, thanks for reporting this!
It looks like this is one of the
web31.0.0 breaking changes,sendAsyncis no more, and we should now usesend. I've actually extracted the testing helpers into their own package (https://github.com/OpenZeppelin/openzeppelin-test-helpers - still in beta, I plan on releasing a non-beta version either this or next week, after I migrate all of OpenZeppelin to use it) where that issue has been fixed. There's no documentation yet, but if you're courageous, you can install it via npm, and take a look at the test files to see how each function is used.time.increaseshould require no changes on your side :)Cheers!