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

Add support for events and errors in forge selectors upload #6205

Merged
merged 2 commits into from
Nov 3, 2023

Conversation

klkvr
Copy link
Member

@klkvr klkvr commented Nov 3, 2023

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.

image

@Evalir Evalir self-requested a review November 3, 2023 14:34
Copy link
Member

@mattsse mattsse left a 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

Comment on lines 308 to 310
func.signature().split(':').next().unwrap_or("").to_string()
})
.chain(abi.abi.errors().map(|error| error.signature()))
Copy link
Member

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 ?

Copy link
Member

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

Copy link
Member

@Evalir Evalir left a comment

Choose a reason for hiding this comment

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

nice!

Comment on lines 308 to 310
func.signature().split(':').next().unwrap_or("").to_string()
})
.chain(abi.abi.errors().map(|error| error.signature()))
Copy link
Member

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

@klkvr
Copy link
Member Author

klkvr commented Nov 3, 2023

Hey @Evalir @mattsse removed the split

@mattsse mattsse merged commit 8d513dc into foundry-rs:master Nov 3, 2023
16 checks passed
@guidanoli
Copy link

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. :-)

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.

Make forge selectors up handle errors and events
4 participants