-
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(cast
): decode-error
with sig, local cache and openchain api
#9428
Conversation
decode-error
with sig and local cache
decode-error
with sig and local cachecast
): decode-error
with sig and local cache
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! 💯
cast
): decode-error
with sig and local cachecast
): decode-error
with sig, local cache and openchain api
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 nits
crates/cast/bin/main.rs
Outdated
.await | ||
.identify_error(&hex::decode(selector)?) | ||
.await; | ||
if err.is_none() { |
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.
let Some ... else
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.
changed in 1834215
DecodeError { | ||
/// The error signature. If none provided then tries to decode from local cache or `https://api.openchain.xyz`. | ||
#[arg(long, visible_alias = "error-sig")] | ||
sig: Option<String>, |
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.
can we make this optional for decode event too? followup
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, will follow up with a PR, have to figure out how to parse with topics
…oundry-rs#9428) * feat(cast): Add custom error decoding support * Review changes * Changes after review: decode with Openchain too, add test * Review changes: nit, handle incomplete selectors
Motivation
cast decode-error [OPTIONS] <DATA>
command: if--sig
arg specified then it tries to decode data with given signature; if no--sig
then tries to identify error in local cache or openchain API and decode with. For identified errors, the signature is printed in responseforge selectors cache
within projectSolution