add increseTime
This commit is contained in:
parent
0923267e66
commit
a4ab1cbe11
|
@ -195,3 +195,19 @@ function isException(error) {
|
||||||
let strError = error.toString();
|
let strError = error.toString();
|
||||||
return strError.includes('invalid opcode') || strError.includes('invalid JUMP') || strError.includes('revert');
|
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)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue