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:
Hadrien Croubois
2023-02-09 22:33:55 +01:00
committed by GitHub
parent 94cd8ef12e
commit 790cc5b65a
42 changed files with 4081 additions and 3209 deletions

16
test/helpers/time.js Normal file
View 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,
},
};