Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Merge branch 'master' into optimize/governor/timelock-control-execute
  • Loading branch information
Amxx authored Jun 15, 2023
commit 613fc4e0cfb52fcb0c7c58c7fa7e891743cf4b83
11 changes: 7 additions & 4 deletions contracts/governance/extensions/GovernorTimelockControl.sol
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ abstract contract GovernorTimelockControl is IGovernorTimelock, Governor {
// core tracks execution, so we just have to check if successful proposal have been queued.
bytes32 queueid = _timelockIds[proposalId];
if (queueid == bytes32(0)) {
return status;
return currentState;
} else if (_timelock.isOperationDone(queueid)) {
return ProposalState.Executed;
} else if (_timelock.isOperationPending(queueid)) {
return ProposalState.Queued;
} else if (_timelock.isOperationDone(queueid)) {
Expand Down Expand Up @@ -145,12 +147,13 @@ abstract contract GovernorTimelockControl is IGovernorTimelock, Governor {
bytes32 descriptionHash
) internal virtual override returns (uint256) {
uint256 proposalId = super._cancel(targets, values, calldatas, descriptionHash);
bytes32 timelockId = _timelockIds[proposalId];

if (_timelockIds[proposalId] != 0) {
// cancel
_timelock.cancel(_timelockIds[proposalId]);
if (timelockId != 0) {
// cleanup
delete _timelockIds[proposalId];
// cancel
_timelock.cancel(timelockId);
}

return proposalId;
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.