Skip to content
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

refactor: no revert on revoke #366

Merged

Conversation

MerlinEgalite
Copy link
Contributor

Copy link
Contributor

@MathisGD MathisGD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Just I think that we should adapt this naming (prop: revokePendingXIfAny)

@MerlinEgalite
Copy link
Contributor Author

Great! Just I think that we should adapt this naming (prop: revokePendingXIfAny)

revokePendingXIfAny suggests that the logic changes depending on the case though..

Copy link
Contributor

@Rubilmax Rubilmax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is fine to me to keep the current naming because they are all consistent, but this behavior (that goes against our conventions for software design) should be documented in the natspecs

Something like:
/// @dev This function is guaranteed to not revert.

@MathisGD MathisGD merged commit 3a47e4e into refactor/revert-already-pending Dec 27, 2023
6 checks passed
@MathisGD MathisGD deleted the refactor/no-revert-on-revoke branch December 27, 2023 21:24
@Jean-Grimal Jean-Grimal mentioned this pull request Dec 28, 2023
@StErMi
Copy link

StErMi commented Dec 29, 2023

I understand the reason for the change and it's not a big deal.
The question is: wouldn't be better to leave there the if statement and simply return instead of performing a delete + emit when there's nothing to be revoked?

Leaving aside the average gas cost of the operation in a normal scenario, I would consider not to emit an event when you have not revoked any proposal (because there was any).

@QGarchery
Copy link
Contributor

I would consider not to emit an event when you have not revoked any proposal (because there was any).

I don't think it will be problematic for integrators to have those useless events. So the tradeoff is between event readability and code readability, and I'm in favor of code readability (so the current solution without the if statement)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants