Guest User

Untitled

a guest
Jun 25th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. // Sends increateTime instruction, mines block and returns a Promise.
  2. function increaseTime (addSeconds) {
  3. web3.currentProvider.sendAsync({
  4. jsonrpc: '2.0',
  5. method: 'evm_increaseTime',
  6. params: [addSeconds],
  7. id: new Date().getSeconds()
  8. }, (err) => {
  9. if (!err) {
  10. web3.currentProvider.send({
  11. jsonrpc: '2.0',
  12. method: 'evm_mine',
  13. params: [],
  14. id: new Date().getSeconds()
  15. });
  16. }
  17. });
  18. }
Add Comment
Please, Sign In to add comment