Refactor time helper and remove custom error helper. (#4803)

Co-authored-by: ernestognw <ernestognw@gmail.com>
This commit is contained in:
Hadrien Croubois
2023-12-22 20:50:25 +01:00
committed by GitHub
parent be0572a8dc
commit 015ef69287
32 changed files with 158 additions and 209 deletions

View File

@ -595,7 +595,7 @@ describe('GovernorTimelockAccess', function () {
.to.emit(this.mock, 'ProposalCanceled')
.withArgs(original.currentProposal.id);
await time.clock.timestamp().then(clock => time.forward.timestamp(max(clock + 1n, eta)));
await time.clock.timestamp().then(clock => time.increaseTo.timestamp(max(clock + 1n, eta)));
await expect(original.execute())
.to.be.revertedWithCustomError(this.mock, 'GovernorUnexpectedProposalState')
@ -621,7 +621,7 @@ describe('GovernorTimelockAccess', function () {
.to.emit(this.mock, 'ProposalCanceled')
.withArgs(this.proposal.id);
await time.clock.timestamp().then(clock => time.forward.timestamp(max(clock + 1n, eta)));
await time.clock.timestamp().then(clock => time.increaseTo.timestamp(max(clock + 1n, eta)));
await expect(this.helper.execute())
.to.be.revertedWithCustomError(this.mock, 'GovernorUnexpectedProposalState')
@ -639,14 +639,11 @@ describe('GovernorTimelockAccess', function () {
await this.helper.waitForSnapshot();
await this.helper.connect(this.voter1).vote({ support: Enums.VoteType.For });
await this.helper.waitForDeadline();
// await this.helper.queue();
// const eta = await this.mock.proposalEta(this.proposal.id);
await expect(this.helper.cancel('internal'))
.to.emit(this.mock, 'ProposalCanceled')
.withArgs(this.proposal.id);
// await time.forward.timestamp(eta);
await expect(this.helper.execute())
.to.be.revertedWithCustomError(this.mock, 'GovernorUnexpectedProposalState')
.withArgs(