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

@ -185,7 +185,7 @@ contract('GovernorTimelockControl', function (accounts) {
await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 });
await this.helper.waitForDeadline();
expectEvent(await this.helper.cancel(), 'ProposalCanceled', { proposalId: this.proposal.id });
expectEvent(await this.helper.cancel('internal'), 'ProposalCanceled', { proposalId: this.proposal.id });
expect(await this.mock.state(this.proposal.id)).to.be.bignumber.equal(Enums.ProposalState.Canceled);
await expectRevert(this.helper.queue(), 'Governor: proposal not successful');
@ -198,7 +198,7 @@ contract('GovernorTimelockControl', function (accounts) {
await this.helper.waitForDeadline();
await this.helper.queue();
expectEvent(await this.helper.cancel(), 'ProposalCanceled', { proposalId: this.proposal.id });
expectEvent(await this.helper.cancel('internal'), 'ProposalCanceled', { proposalId: this.proposal.id });
expect(await this.mock.state(this.proposal.id)).to.be.bignumber.equal(Enums.ProposalState.Canceled);
await expectRevert(this.helper.execute(), 'Governor: proposal not successful');