Skip to content

Commit

Permalink
refactor: remove proposal Id from queued after execute and cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
GitGuru7 committed Apr 9, 2024
1 parent aca6eee commit 8a98dfb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions contracts/Cross-chain/OmnichainGovernanceExecutor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ contract OmnichainGovernanceExecutor is ReentrancyGuard, BaseOmnichainController
++i;
}
}
delete queued[proposalId_];
}

/**
Expand Down Expand Up @@ -237,6 +238,7 @@ contract OmnichainGovernanceExecutor is ReentrancyGuard, BaseOmnichainController
++i;
}
}
delete queued[proposalId_];
}

/**
Expand Down
3 changes: 3 additions & 0 deletions tests/Cross-chain/Omnichain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ describe("Omnichain: ", async function () {
const proposalId = await getLastRemoteProposalId();
await expect(executor.execute(proposalId)).to.emit(executor, "ProposalExecuted").withArgs(proposalId);
expect(await executor.state(proposalId)).equals(2);
expect(await executor.queued(proposalId)).equals(false);
});

it("Should update delay of timelock on destination", async function () {
Expand All @@ -440,6 +441,7 @@ describe("Omnichain: ", async function () {
mine(4500);

Check warning on line 441 in tests/Cross-chain/Omnichain.ts

View workflow job for this annotation

GitHub Actions / Lint

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
const proposalId = await getLastRemoteProposalId();
await executor.execute(proposalId);
expect(await executor.queued(proposalId)).equals(false);
expect(await NormalTimelock.delay()).to.equals(newDelay);
});

Expand Down Expand Up @@ -515,6 +517,7 @@ describe("Omnichain: ", async function () {
.to.emit(executor, "ProposalCanceled")
.withArgs(proposalId);
expect(await executor.state(proposalId)).equals(0);
expect(await executor.queued(proposalId)).equals(false);
});

it("Reverts when cancel is called after execute", async function () {
Expand Down

0 comments on commit 8a98dfb

Please sign in to comment.