v3.0: transaction-status-client-types: Fix deserializer for SDKv2 (backport of #8625)#8759
Merged
v3.0: transaction-status-client-types: Fix deserializer for SDKv2 (backport of #8625)#8759
Conversation
#### 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)
t-nelson
approved these changes
Oct 29, 2025
Codecov Report✅ All modified and coverable lines are covered by tests. 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:
|
steveluscher
approved these changes
Oct 29, 2025
steveluscher
left a comment
There was a problem hiding this comment.
Self-note: if instruction_error.get("BorshIoError") returns None when the instruction_error is a non-object, so this works.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The InstructionError deserializer within UiTransactionError fails to deserialize errors from SDKv2 because
BorshIoErrorchanged 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
BorshIoErrorand 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.