Skip to content

Fix BytesN parsing when using valid hex values.#2385

Merged
fnando merged 4 commits intomainfrom
fix-2245
Feb 12, 2026
Merged

Fix BytesN parsing when using valid hex values.#2385
fnando merged 4 commits intomainfrom
fix-2245

Conversation

@fnando
Copy link
Member

@fnando fnando commented Feb 11, 2026

What

Properly parse BytesN when using valid hex values.

Why

Fix #2245.

Known limitations

N/A

Copilot AI review requested due to automatic review settings February 11, 2026 20:57
@github-project-automation github-project-automation bot moved this to Backlog (Not Ready) in DevX Feb 11, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where BytesN parsing fails when using valid all-digit hexadecimal values. The issue occurred because when serde_json::from_str successfully parsed an all-digit hex string as a JSON number, it wasn't being converted back to a string for Bytes and BytesN types, leading to incorrect parsing downstream.

Changes:

  • Added ScType::Bytes and ScType::BytesN(_) to the list of types that should always be treated as strings in the success branch of from_string() method
  • Added a new test case test_bytesn_32_conversion_all_digit_hex to verify the fix works for the specific failing case from issue #2245

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Copy link
Member

@leighmcculloch leighmcculloch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, one comment inline because this shadows a code path that becomes dead and wondering if there's an error relating to that.

@fnando fnando merged commit a1c9455 into main Feb 12, 2026
31 of 32 checks passed
@fnando fnando deleted the fix-2245 branch February 12, 2026 21:41
@github-project-automation github-project-automation bot moved this from Backlog (Not Ready) to Done in DevX Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

contract invoke BytesN parsing fails to parse valid hex values

2 participants