From a4ab1cbe1106e371aacea182f91c128bf2f18d46 Mon Sep 17 00:00:00 2001 From: Ricardo Guilherme Schmidt <3esmit@gmail.com> Date: Tue, 15 May 2018 16:03:40 -0300 Subject: [PATCH] add increseTime --- utils/testUtils.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/utils/testUtils.js b/utils/testUtils.js index 00a9af8..0186af4 100644 --- a/utils/testUtils.js +++ b/utils/testUtils.js @@ -195,3 +195,19 @@ function isException(error) { let strError = error.toString(); return strError.includes('invalid opcode') || strError.includes('invalid JUMP') || strError.includes('revert'); } + +exports.increaseTime = async (web3, amount) => { + web3.currentProvider.sendAsync( + { + jsonrpc: '2.0', + method: 'evm_increaseTime', + params: [amount], + id: new Date().getSeconds() + }, + (err, resp) => { + console.log(err) + console.log(resp) + } + ) + +} \ No newline at end of file