Skip to content

revert(sdk-coin-hbar): remove buildTransferData merge logic from PR #8774#8795

Merged
Doddanna17 merged 1 commit into
masterfrom
SI-605-revert-hbar-self-transfer-merge
May 19, 2026
Merged

revert(sdk-coin-hbar): remove buildTransferData merge logic from PR #8774#8795
Doddanna17 merged 1 commit into
masterfrom
SI-605-revert-hbar-self-transfer-merge

Conversation

@Doddanna17
Copy link
Copy Markdown
Contributor

Summary

Root Cause

buildHederaAccountID() strips memo from addresses, so 0.0.A and 0.0.A?memoId=1 produce the same proto AccountID key. The merge collapsed [{acct, -N}, {acct, +N}] into [{acct, 0}], causing verifyTransaction() to fail with "Tx outputs does not match with expected txParams recipients" because parsed amount "0" != expected amount "N".

Test plan

  • Verify normal HBAR transfer with memo-based address works (sender != recipient base address)
  • Verify normal HBAR self-transfer with memo (sender == recipient base address) no longer hits SDK validation error
  • Verify claim rewards self-transfer still works (fallback in getTransferData() handles 1-tinybar positive entry)
  • Existing unit tests pass

Ticket: SI-605

…8774

The merge logic in coinTransferBuilder.ts was collapsing transfer entries
with the same accountID, which broke normal HBAR transfers where sender
and recipient share the same base address (memo-based addresses like
0.0.X?memoId=Y). The merge was unnecessary for claim rewards since that
flow uses a different builder path. The self-transfer fallback in
transaction.ts getTransferData() (from PR #8742) already handles claim
rewards correctly with isPositive() for the 1-tinybar self-transfer.

This reverts merge commit c0b28ee.

Ticket: SI-605
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 18, 2026

SI-605

@Doddanna17 Doddanna17 marked this pull request as ready for review May 18, 2026 12:47
@Doddanna17 Doddanna17 requested a review from a team as a code owner May 18, 2026 12:47
Copy link
Copy Markdown
Contributor

@aditya-bitgo aditya-bitgo left a comment

Choose a reason for hiding this comment

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

lgtm

@Doddanna17 Doddanna17 merged commit 6ac0ccf into master May 19, 2026
22 checks passed
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