-
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
feat: print event definitions #4455
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.
tbh not exactly sure what this does.
@clabby @DaniPopes would appreciate a review
The idea is that you can print information about events. For example, for variables you can already do
and it will give you information about the variable. If you do
nothing is printed. This PR adds support for printing the event's name and most importantly its signature. Regarding requested changes I would wait until all reviews are complete and then do them in a single commit. |
@clabby friendly ping :) |
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.
Also needs cargo +nightly fmt
Implemented the changes. |
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 work!
Co-authored-by: clabby <[email protected]>
Co-authored-by: clabby <[email protected]>
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
Added the missing |
Hey, checking in on this :) |
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! finally getting this in. we can improve on verbosity in subsequent prs
Motivation
Getting information about events, such as their signature, is a useful feature. Cast already offers that through
cast sig-event
, and this PR adds a similar feature for Chisel.Solution
When parsing the latest line with
let line = format!("bytes memory inspectoor = abi.encode({input});");
fails, do not return early but instead check whether the latest line is the name of an event and if that's the case, print information about the event.Example