-
Notifications
You must be signed in to change notification settings - Fork 11.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add state
getter in TimelockController using OperationState
enum
#4316
Comments
Hi there, I have been taking a look at this task and, have some concerns regarding it. openzeppelin-contracts/contracts/governance/extensions/GovernorTimelockControl.sol Lines 65 to 66 in cd48b3e
A solution for that case using a state-getter could be to check if the operation is either pending or ready like is being done in the proposed PR, but by doing it more checks will be needed to do the same. So in general, Even though I agree it will be more descriptive and clean, it will likely increase the amount of checks needed to do the same that is being done at this time. |
We could rename "Pending" into "Waiting" in the enum, and consider that @ernestognw WDYT? |
That will definitely work, but due to "Ready" and "Pending" being opposite it could sound contradictory. Maybe going with |
Remember that the governor does a So again, either an option would be for the governor to do function isOperationActiveWithFallback(bytes32 queueId) private view returns (bool) {
try _timelock.isOperationActive(queueId) returns (bool isActive) {
return isActive;
} catch {
// assume old governor
return _timelock.isOperationPending(queueId);
}
} Before any decision is made, we should discuss that with the team |
Yeap, you are right, changing to |
The current documentation says this
So whatever is the final decision on the names I will update the documents as wel |
Description
We introduced an enum of
OperationState
s for custom errors in #4261. However, it feels weird that such enum is only used for custom errors.We should use the same enum for retrieving the state. We might also want to replace the state getters with this new
state(bytes32 id)
getter.The text was updated successfully, but these errors were encountered: