Update docs
This commit is contained in:
17
test/helpers/time.js
Normal file
17
test/helpers/time.js
Normal file
@ -0,0 +1,17 @@
|
||||
const ozHelpers = require('@openzeppelin/test-helpers');
|
||||
const helpers = require('@nomicfoundation/hardhat-network-helpers');
|
||||
|
||||
module.exports = {
|
||||
clock: {
|
||||
blocknumber: () => helpers.time.latestBlock(),
|
||||
timestamp: () => helpers.time.latest(),
|
||||
},
|
||||
clockFromReceipt: {
|
||||
blocknumber: receipt => Promise.resolve(receipt.blockNumber),
|
||||
timestamp: receipt => web3.eth.getBlock(receipt.blockNumber).then(block => block.timestamp),
|
||||
},
|
||||
forward: {
|
||||
blocknumber: ozHelpers.time.advanceBlockTo,
|
||||
timestamp: helpers.time.increaseTo,
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user