Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Sends increateTime instruction, mines block and returns a Promise.
- function increaseTime (addSeconds) {
- web3.currentProvider.sendAsync({
- jsonrpc: '2.0',
- method: 'evm_increaseTime',
- params: [addSeconds],
- id: new Date().getSeconds()
- }, (err) => {
- if (!err) {
- web3.currentProvider.send({
- jsonrpc: '2.0',
- method: 'evm_mine',
- params: [],
- id: new Date().getSeconds()
- });
- }
- });
- }
Add Comment
Please, Sign In to add comment