add increseTime

This commit is contained in:
Ricardo Guilherme Schmidt 2018-05-15 16:03:40 -03:00
parent 0923267e66
commit a4ab1cbe11
1 changed files with 16 additions and 0 deletions

View File

@ -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)
}
)
}