-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 support for events and errors in forge selectors upload
#6205
Add support for events and errors in forge selectors upload
#6205
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.
nice, lgtm pending @Evalir
crates/common/src/selectors.rs
Outdated
func.signature().split(':').next().unwrap_or("").to_string() | ||
}) | ||
.chain(abi.abi.errors().map(|error| error.signature())) |
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.
I don't think this split is needed anymore, right @Evalir ?
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.
Yep I think it might not be needed anymore—now the actual abi comes from alloy
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.
nice!
crates/common/src/selectors.rs
Outdated
func.signature().split(':').next().unwrap_or("").to_string() | ||
}) | ||
.chain(abi.abi.errors().map(|error| error.signature())) |
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.
Yep I think it might not be needed anymore—now the actual abi comes from alloy
Thanks a lot for the effort, guys! This is really important for us, smart contract developers wanting to adopt custom errors and wanting to display them nicely in the front-end of applications. :-) |
Motivation
Currently
forge selectors upload
command does not upload errors and events.Closes #5924, #5241 and maybe #5012
Solution
Upload errors and events also. openchain.xyz API does not have a separate field for errors, so functions and errors are uploaded together. Same solution is used by openchain.xyz "Import" page, so it seems to be considered a correct way which does not pollute the database.