-
Notifications
You must be signed in to change notification settings - Fork 25
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: [v0.8-develop] invert validation mapping #85
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. This aligns better with most of the use cases, getting selectors through validation.
Another useful quick check could be isSelectorProtectedByValidation(FunctionReference validationFunction)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
3866b0c
to
364e06b
Compare
Changing base to point to #78, so this can be used as a base to build off of while waiting on blocking PRS. |
1e415b1
to
7e76786
Compare
364e06b
to
b78c45b
Compare
7e76786
to
2569ebd
Compare
b78c45b
to
05cea78
Compare
2569ebd
to
1d34450
Compare
05cea78
to
4cfa5bf
Compare
1d34450
to
5fda9a2
Compare
4cfa5bf
to
509ba03
Compare
5fda9a2
to
ce90f55
Compare
509ba03
to
1bfd893
Compare
Motivation
As noted in a comment here, it may be useful to have the loupe functions expose "selectors per validation", rather than "validations per selectors".
Solution
Instead of storing an enumerable mapping
validations
inSelectorData
, we can store an enumerable mapping ofselectors
inValidationData
.This only changes the external loupe function
getValidations(bytes4 selector) external view returns (FunctionReference[] memory)
togetSelectors(FunctionReference validationFunction) external view returns (bytes4[] memory)
. No other account functions or behavior is changed.