-
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(forge): Add errors
field to forge inspect
#5228
Conversation
for er in abi.errors.iter().flat_map(|(_, errors)| errors) { | ||
let types = | ||
er.inputs.iter().map(|p| p.kind.to_string()).collect::<Vec<_>>(); | ||
let sig = format!("{:x}", er.signature()); | ||
let sig_trimmed = &sig[0..8]; | ||
out.insert( | ||
format!("{}({})", er.name, types.join(",")), | ||
sig_trimmed.to_string().into(), | ||
); |
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.
this seems fine,
no strong opinion on the format here tbh,
defer to @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.
I like this! Tested and format is the same as when printing events—looks good IMHO.
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, thank you!
for er in abi.errors.iter().flat_map(|(_, errors)| errors) { | ||
let types = | ||
er.inputs.iter().map(|p| p.kind.to_string()).collect::<Vec<_>>(); | ||
let sig = format!("{:x}", er.signature()); | ||
let sig_trimmed = &sig[0..8]; | ||
out.insert( | ||
format!("{}({})", er.name, types.join(",")), | ||
sig_trimmed.to_string().into(), | ||
); |
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 like this! Tested and format is the same as when printing events—looks good IMHO.
Motivation
Currently it is possible to get the selectors for functions (
methodIdentifiers
) and events (events
) but not errors.Solution
This PR adds a
errors
field to theforge inspect
command.