fix(go): preserve uint64 ids during json unmarshal#138
Merged
codeZe-us merged 3 commits intoBoxkit-Labs:mainfrom Mar 29, 2026
Merged
fix(go): preserve uint64 ids during json unmarshal#138codeZe-us merged 3 commits intoBoxkit-Labs:mainfrom
codeZe-us merged 3 commits intoBoxkit-Labs:mainfrom
Conversation
|
@Obiajulu-gif Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
codeZe-us
approved these changes
Mar 26, 2026
Contributor
codeZe-us
left a comment
There was a problem hiding this comment.
@Obiajulu-gif PR reviewed, this is okay
Contributor
|
@Obiajulu-gif fix conflict in your branch |
Contributor
|
@Obiajulu-gif please resolve conflicts |
Contributor
Author
|
@codeZe-us i have fix the conflict |
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.
This pull request introduces several improvements and fixes to the address and routing logic in the core Go package, with a focus on better handling of muxed accounts, improved error handling, and enhanced support for large routing IDs. The most significant changes include refactoring muxed account encoding/decoding, updating the detection of address kinds, improving the robustness of routing ID parsing and JSON unmarshalling, and adding comprehensive tests for edge cases.
Muxed Account Handling:
muxed.DecodeMuxedandmuxed.EncodeMuxedto use the updatedstrkey.MuxedAccountAPI for safer and more accurate muxed account processing, including stricter validation of muxed account IDs. [1] [2]Address Detection and Parsing:
Detectfunction to use more precise checks for muxed accounts and contracts, aligning with the lateststrkeymethods.ParseResultandAddressErrortypes to standardize address parsing results and error reporting.Routing Logic and Error Handling:
ExtractRoutingto handle errors from muxed account decoding gracefully, return appropriate error codes, and consistently process optional memo values. Routing IDs are now always wrapped in theRoutingIDtype. [1] [2] [3] [4]stringValueto safely dereference optional string pointers.Routing ID Robustness:
UnmarshalJSONmethod forRoutingIDto correctly handle both quoted and unquoted uint64 values, reject invalid or out-of-range numbers, and preserve the full uint64 range.RoutingIDJSON unmarshalling, covering valid, edge, and invalid cases.Dependency and Tooling Updates:
github.com/stellar/godependency, and added indirect dependencies for improved build compatibility.uint64Maxinmemo.gofor correct big integer comparison.These changes collectively improve the reliability and maintainability of address and routing handling, especially for muxed accounts and large routing IDs.
Closes #82