Skip to content

v3.0: transaction-status-client-types: Fix deserializer for SDKv2 (backport of #8625)#8759

Merged
joncinque merged 1 commit intov3.0from
mergify/bp/v3.0/pr-8625
Oct 29, 2025
Merged

v3.0: transaction-status-client-types: Fix deserializer for SDKv2 (backport of #8625)#8759
joncinque merged 1 commit intov3.0from
mergify/bp/v3.0/pr-8625

Conversation

@mergify
Copy link
Copy Markdown

@mergify mergify Bot commented Oct 29, 2025

Problem

The InstructionError deserializer within UiTransactionError fails to deserialize errors from SDKv2 because BorshIoError changed from being a newtype with string to a unit enum variant.

Summary of changes

If deserialization fails, check to see if it's an old BorshIoError, and change to the new variation if so.

Also includes a test using the old and new SDKs.

Closes #8582 Fixes #8548

Note: the backport will be the exact same thing for v3.0, but v2.3 will change the logic to check for a string BorshIoError and replace it with {"BorshIoError": ""}, and will involve bringing in sdk v3 for the test.

cc @BriungRi


This is an automatic backport of pull request #8625 done by Mergify.

#### Problem

The InstructionError deserializer within UiTransactionError fails to
deserialize errors from SDKv2 because `BorshIoError` changed from being
a newtype with string to a unit enum variant.

#### Summary of changes

If deserialization fails, check to see if it's an old `BorshIoError`,
and change to the new variation if so.

Also include a test using the old and new error formats.

Co-authored-by: Brian Li <brnli7@gmail.com>
(cherry picked from commit ed4cbad)
@mergify mergify Bot requested a review from a team as a code owner October 29, 2025 17:46
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.4%. Comparing base (1d31602) to head (9ce2534).

Additional details and impacted files
@@            Coverage Diff            @@
##             v3.0    #8759     +/-   ##
=========================================
- Coverage    83.4%    83.4%   -0.1%     
=========================================
  Files         810      810             
  Lines      366196   366213     +17     
=========================================
+ Hits       305697   305705      +8     
- Misses      60499    60508      +9     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

@steveluscher steveluscher left a comment

Choose a reason for hiding this comment

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

Self-note: if instruction_error.get("BorshIoError") returns None when the instruction_error is a non-object, so this works.

@joncinque joncinque merged commit 57843a0 into v3.0 Oct 29, 2025
42 checks passed
@joncinque joncinque deleted the mergify/bp/v3.0/pr-8625 branch October 29, 2025 19:43
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.

4 participants