During test run, web3.currentProvider is undefined.
Just console.log(web3.currentProvider)
Expected to have a value other than undefined.
I am trying to execute
await web3.currentProvider.send({
jsonrpc: "2.0",
method: "evm_increaseTime",
params: 10,
id: 0
});
To increase evm time inside the test. But because of currentProvider is undefined, I can't.
Result:
TypeError: Cannot read property 'send' of undefined
truffle version): 5.0.0node --version): 10.14.2npm --version): 6.5.0Hey @ferittuncer, thanks for reporting this!
Can you provide a repo link? I notice in the gitter you were trying to use sendAsync (which shouldn't work anymore in v5 since we upgraded to web3 1.0).
@CruzMolina Yeah, I figured out sendAsync doesn't exist anymore but there is send. We can close the issue.
import Web3 from 'web3';
const web3=new Web3(window.web3.currentProvider); //i got error here cannot read property of undefined currentProvider
const address='0x23BD82c94d40daeF4B013316690732C050D36028';
Most helpful comment
@CruzMolina Yeah, I figured out
sendAsyncdoesn't exist anymore but there issend. We can close the issue.