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: setAuthorization => setAuthorizationWithSig #235

Merged
merged 1 commit into from
Aug 8, 2023

Conversation

julien-devatom
Copy link
Contributor

@julien-devatom julien-devatom commented Aug 8, 2023

Pull request

Remove duplicated function name with different signatures to clarify the interface.

It is harder to type functions in any other language if the function name is the same but the behavior nor parameters are not.

The workaround (used on Morpho Optimizers) is to rename offchain the function, or define a function name more explicit (setAuthorization(address,address,bool) instead of setAutorization for example) when we are interfacing blue, which is less readable.

So to clarify everything, I suggest to have a more explicit function name

@julien-devatom julien-devatom self-assigned this Aug 8, 2023
@julien-devatom julien-devatom requested review from a team, Rubilmax, MerlinEgalite, pakim249CAL, Jean-Grimal, makcandrov, QGarchery and MathisGD and removed request for a team August 8, 2023 11:56
@julien-devatom julien-devatom force-pushed the fix/autorize-function-naming branch from 1831e20 to 8387959 Compare August 8, 2023 11:59
Copy link
Contributor

@QGarchery QGarchery left a comment

Choose a reason for hiding this comment

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

I don't have a strong opinion on this (I approved), but do you have specific reasons for this change ? In solidity, optional arguments are usually implemented using the same function name, and it kind of fits the bill here

@MathisGD
Copy link
Contributor

MathisGD commented Aug 8, 2023

I don't have a strong opinion on this (I approved), but do you have specific reasons for this change ? In solidity, optional arguments are usually implemented using the same function name, and it kind of fits the bill here

It is not really optional arguments neither here. It is more a fundamentally different logic.

@QGarchery
Copy link
Contributor

It is not really optional arguments neither here. It is more a fundamentally different logic.

Yes it's not the same thing, but from a very high level you give the authorization either by being the sender or by providing the additional "optional" arguments authorizer, deadline and signature (the distinction is only syntactic anyway). But I'm fine with either

@MathisGD
Copy link
Contributor

MathisGD commented Aug 8, 2023

Julien also added the technical reasons why he opened the PR

@MerlinEgalite MerlinEgalite merged commit 757adb5 into main Aug 8, 2023
@MerlinEgalite MerlinEgalite deleted the fix/autorize-function-naming branch August 8, 2023 14:27
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.

8 participants