Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@overcat
Copy link
Member

@overcat overcat commented Jul 6, 2025

… to Address class.

@overcat overcat requested a review from Copilot July 6, 2025 03:17
Copy link

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

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 Address constructor, toString, and SCAddress conversion methods to handle new address types.
  • Add static factory methods (fromMuxedAccount, fromClaimableBalance, fromLiquidityPool) and corresponding fromSCAddress branches.
  • 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 that accountId is 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 {
Copy link

Copilot AI Jul 6, 2025

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.

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Jul 6, 2025

Codecov Report

Attention: Patch coverage is 81.13208% with 10 lines in your changes missing coverage. Please review.

Please upload report for BASE (add-protocol23-support@17ffc77). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/main/java/org/stellar/sdk/Address.java 81.13% 8 Missing and 2 partials ⚠️
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           
Files with missing lines Coverage Δ
src/main/java/org/stellar/sdk/Address.java 77.65% <81.13%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@overcat overcat merged commit fc0ba63 into add-protocol23-support Jul 6, 2025
12 of 14 checks passed
@overcat overcat deleted the p23-address branch July 6, 2025 23:44
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.

2 participants