Keep track of historical quorum values (#3561)

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
This commit is contained in:
Hadrien Croubois
2022-07-27 18:23:10 +02:00
committed by GitHub
parent 0d91b620b7
commit 8ea1fc87c9
2 changed files with 46 additions and 5 deletions

View File

@ -104,6 +104,13 @@ contract('GovernorVotesQuorumFraction', function (accounts) {
expect(await this.mock.quorumNumerator()).to.be.bignumber.equal(newRatio);
expect(await this.mock.quorumDenominator()).to.be.bignumber.equal('100');
// it takes one block for the new quorum to take effect
expect(await time.latestBlock().then(blockNumber => this.mock.quorum(blockNumber.subn(1))))
.to.be.bignumber.equal(tokenSupply.mul(ratio).divn(100));
await time.advanceBlock();
expect(await time.latestBlock().then(blockNumber => this.mock.quorum(blockNumber.subn(1))))
.to.be.bignumber.equal(tokenSupply.mul(newRatio).divn(100));
});