Add a public Governor.cancel function (#3983)

This commit is contained in:
Hadrien Croubois
2023-01-26 20:46:11 +01:00
committed by GitHub
parent 0320a718e8
commit 5e28952cbd
12 changed files with 157 additions and 63 deletions

View File

@ -226,18 +226,18 @@ contract('GovernorCompatibilityBravo', function (accounts) {
describe('cancel', function () {
it('proposer can cancel', async function () {
await this.helper.propose({ from: proposer });
await this.helper.cancel({ from: proposer });
await this.helper.cancel('external', { from: proposer });
});
it('anyone can cancel if proposer drop below threshold', async function () {
await this.helper.propose({ from: proposer });
await this.token.transfer(voter1, web3.utils.toWei('1'), { from: proposer });
await this.helper.cancel();
await this.helper.cancel('external');
});
it('cannot cancel is proposer is still above threshold', async function () {
await this.helper.propose({ from: proposer });
await expectRevert(this.helper.cancel(), 'GovernorBravo: proposer above threshold');
await expectRevert(this.helper.cancel('external'), 'GovernorBravo: proposer above threshold');
});
});
});