-
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 run): try custom error decode from openchain signature database #8632
base: master
Are you sure you want to change the base?
Conversation
7ad2db1
to
e6ad9ab
Compare
crates/evm/core/src/decode.rs
Outdated
// try from https://openchain.xyz | ||
let (tx, rx) = mpsc::channel(); | ||
let encoded_selector = hex::encode(selector); | ||
|
||
thread::spawn(move || { | ||
let rt = tokio::runtime::Runtime::new().unwrap(); | ||
let result = rt.block_on(decode_function_selector(&encoded_selector)); | ||
tx.send(result).unwrap(); | ||
}); |
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 is a bit expensive to do per invocation.
I can see how this could be useful, but I'd like to make this configurable this behaviour on the RevertDecoder
level by giving it an optional OpenChainClient and only use it if we can retrieve the a tokio handle
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.
Is this change ok or not, I need your feedback!
0301d51
to
b324b6d
Compare
cae43c4
to
5d290e6
Compare
5d290e6
to
515a4cc
Compare
da328f6
to
86f344a
Compare
a5e61d9
to
8a81dd2
Compare
Motivation
in this contract, when tx revert by using custom error.
cast run result:
Solution
I think we can make it more readable by using openchain's signature database online.
In this pr, custom err would look like: