Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions contracts/governance/extensions/GovernorTimelockAccess.sol
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ abstract contract GovernorTimelockAccess is Governor {
function proposalExecutionPlan(
uint256 proposalId
) public view returns (uint32 delay, bool[] memory indirect, bool[] memory withDelay) {
if (proposalSnapshot(proposalId) == 0) {
revert GovernorNonexistentProposal(proposalId);
}

ExecutionPlan storage plan = _executionPlan[proposalId];

uint32 length = plan.length;
Expand Down
7 changes: 7 additions & 0 deletions test/governance/extensions/GovernorTimelockAccess.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,13 @@ describe('GovernorTimelockAccess', function () {
]);
}
});

it('reverts for non-existing proposal', async function () {
const nonExistentProposalId = 999n;
await expect(this.mock.proposalExecutionPlan(nonExistentProposalId))
.to.be.revertedWithCustomError(this.mock, 'GovernorNonexistentProposal')
.withArgs(nonExistentProposalId);
});
});

describe('base delay only', function () {
Expand Down
Loading