Add timestamp based governor with EIP-6372 and EIP-5805 (#3934)
Co-authored-by: Francisco Giordano <fg@frang.io> Co-authored-by: Ernesto García <ernestognw@gmail.com> Co-authored-by: Francisco <frangio.1@gmail.com>
This commit is contained in:
16
test/helpers/time.js
Normal file
16
test/helpers/time.js
Normal file
@ -0,0 +1,16 @@
|
||||
const { time } = require('@openzeppelin/test-helpers');
|
||||
|
||||
module.exports = {
|
||||
clock: {
|
||||
blocknumber: () => web3.eth.getBlock('latest').then(block => block.number),
|
||||
timestamp: () => web3.eth.getBlock('latest').then(block => block.timestamp),
|
||||
},
|
||||
clockFromReceipt: {
|
||||
blocknumber: receipt => Promise.resolve(receipt.blockNumber),
|
||||
timestamp: receipt => web3.eth.getBlock(receipt.blockNumber).then(block => block.timestamp),
|
||||
},
|
||||
forward: {
|
||||
blocknumber: time.advanceBlockTo,
|
||||
timestamp: time.increaseTo,
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user