-
Notifications
You must be signed in to change notification settings - Fork 19
[2.0] print inline evm tx error in hex #841
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
Conversation
src/actions.cpp
Outdated
| errmsg += std::to_string(size); | ||
| errmsg += "]"; | ||
| size_t i = 0; | ||
| for (; i < max_print_size && i < size; ++i ) { |
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.
maybe consider using std::stringstream?
src/actions.cpp
Outdated
| size_t i = 0; | ||
| for (; i < max_print_size && i < size; ++i ) { | ||
| static const char hex_chars[] = "0123456789ABCDEF"; | ||
| errmsg += " "; |
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.
IMO we should not insert the space here. Firstly, we can save some space here. secondly, in most cases, this hex string would be largely a utf string except for the first several bytes, add space between bytes will only cause trouble when one trying to use some online tool to convert the hex string to utf string
src/actions.cpp
Outdated
| if (rc.abort_on_failure) { | ||
| if (receipt.success == false) { | ||
| size_t size = (int)call_result.data.length(); | ||
| constexpr size_t max_print_size = 292;/*max printable solidity error msg size=224*/ |
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.
where does the 292 come from?
Resolve #838
silkworm PR: VaultaFoundation/silkworm#260