-
Notifications
You must be signed in to change notification settings - Fork 159
feat: add muxed account, liquidity pool and claimable balance support… #703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… to `Address` class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds support for muxed accounts, claimable balances, and liquidity pools to the Address class, including encoding/decoding and SCAddress conversions, with accompanying tests and a changelog entry.
- Extend
Addressconstructor,toString, and SCAddress conversion methods to handle new address types. - Add static factory methods (
fromMuxedAccount,fromClaimableBalance,fromLiquidityPool) and correspondingfromSCAddressbranches. - Create comprehensive unit tests for all new address types and update the CHANGELOG.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/main/java/org/stellar/sdk/Address.java | Add decoding, encoding, SCAddress (de)serialization, and toString support for new types |
| src/test/java/org/stellar/sdk/AddressTest.java | Add tests covering constructor, byte-array factory, SCAddress conversions, and toString for new types |
| CHANGELOG.md | Document new feature under the feat: section |
Comments suppressed due to low confidence (1)
src/main/java/org/stellar/sdk/Address.java:57
- The Javadoc description mentions
(G...)for a byte array parameter, which may confuse readers. Please clarify thataccountIdis the raw public key bytes, not a string representation.
* @param accountId the byte array of the Stellar public key (G...).
| StrKey.encodeContract(scAddress.getContractId().getContractID().getHash())); | ||
| return fromContract(scAddress.getContractId().getContractID().getHash()); | ||
| case SC_ADDRESS_TYPE_MUXED_ACCOUNT: | ||
| try { |
Copilot
AI
Jul 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exception handling for XDR parsing is inconsistent: fromSCAddress wraps I/O errors in UnexpectedException, while toSCAddress throws IllegalArgumentException. Consider unifying on a single exception type (e.g., UnexpectedException) for parsing failures.
… to `Address` class.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## add-protocol23-support #703 +/- ##
=========================================================
Coverage ? 80.45%
Complexity ? 1262
=========================================================
Files ? 213
Lines ? 5008
Branches ? 421
=========================================================
Hits ? 4029
Misses ? 721
Partials ? 258
🚀 New features to boost your workflow:
|
… to
Addressclass.