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

Error: The method evm_increaseTime does not exist/is not available #191

Open
chukwujike opened this issue Jul 14, 2022 · 0 comments
Open

Comments

@chukwujike
Copy link

chukwujike commented Jul 14, 2022

I tried to use openzeppelin test-helpers' increaseTo function to forward time while testing a time-dependent code with truffle as shown in the code snippet below

`
const { time } = require('@openzeppelin/test-helpers');

let duration = time.duration.seconds(90500);
let latest_time = time.latest();
const timeAdvance = web3.utils.toBN(currenBlockTS).add(latest_time)
await time.increaseTo(timeAdvance);

`

I got the following errors

Error: The method evm_increaseTime does not exist/is not available
at WebsocketSubprovider._handleSocketMessage (node_modules@trufflesuite\web3-provider-engine\subproviders\websocket.js:121:18)
at WebSocket.onMessage (node_modules\ws\lib\event-target.js:120:16)
at WebSocket.emit (node:events:527:28)
at Receiver.receiverOnMessage (node_modules\ws\lib\websocket.js:720:20)
at Receiver.emit (node:events:527:28)
at Receiver.dataMessage (node_modules\ws\lib\receiver.js:414:14)
at C:\Users\User\Documents\blockchain\jb_lottery\node_modules\ws\lib\receiver.js:371:23
at C:\Users\User\Documents\blockchain\jb_lottery\node_modules\ws\lib\permessage-deflate.js:307:9
at C:\Users\User\Documents\blockchain\jb_lottery\node_modules\ws\lib\permessage-deflate.js:389:7
at afterWrite (node:internal/streams/writable:497:5)
at onwrite (node:internal/streams/writable:477:7)
at Zlib.cb (node:internal/streams/transform:202:7)
at Zlib.processCallback (node:zlib:611:8)

Error: json: cannot unmarshal number into Go struct field params.fromBlock of type string
at WebsocketSubprovider._handleSocketMessage (node_modules@trufflesuite\web3-provider-engine\subproviders\websocket.js:121:18)
at WebSocket.onMessage (node_modules\ws\lib\event-target.js:120:16)
at WebSocket.emit (node:events:527:28)
at Receiver.receiverOnMessage (node_modules\ws\lib\websocket.js:720:20)
at Receiver.emit (node:events:527:28)
at Receiver.dataMessage (node_modules\ws\lib\receiver.js:414:14)
at C:\Users\User\Documents\blockchain\jb_lottery\node_modules\ws\lib\receiver.js:371:23
at C:\Users\User\Documents\blockchain\jb_lottery\node_modules\ws\lib\permessage-deflate.js:307:9
at C:\Users\User\Documents\blockchain\jb_lottery\node_modules\ws\lib\permessage-deflate.js:389:7
at afterWrite (node:internal/streams/writable:497:5)
at onwrite (node:internal/streams/writable:477:7)
at Zlib.cb (node:internal/streams/transform:202:7)
at Zlib.processCallback (node:zlib:611:8)

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

1 participant