Skip to content

Conversation

@taokayan
Copy link
Contributor

Resolve #838

silkworm PR: VaultaFoundation/silkworm#260

@taokayan taokayan requested a review from yarkinwho May 28, 2025 05:06
src/actions.cpp Outdated
errmsg += std::to_string(size);
errmsg += "]";
size_t i = 0;
for (; i < max_print_size && i < size; ++i ) {
Copy link
Contributor

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 += " ";
Copy link
Contributor

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*/
Copy link
Contributor

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?

@taokayan taokayan requested a review from yarkinwho May 30, 2025 03:29
@taokayan taokayan merged commit 8047d72 into release/2.0 May 30, 2025
3 checks passed
@taokayan taokayan deleted the kayan_2.0_errmsg_hex branch May 30, 2025 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants