Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Created March 26, 2019 00:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miguelmota/7466479e5bed330d8ff466eedb4579af to your computer and use it in GitHub Desktop.
Save miguelmota/7466479e5bed330d8ff466eedb4579af to your computer and use it in GitHub Desktop.
Truffle ganache increase time mine helper function
module.exports = async function mine(durationSeconds) {
return new Promise((resolve, reject) => {
web3.currentProvider.send({
jsonrpc: '2.0',
method: 'evm_increaseTime',
params: [durationSeconds],
id: Date.now()
}, (err, resp) => {
if (err) {
return reject(err)
}
resolve()
})
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment