Skip to content

test(sdk-coin-eos): add coverage for memoId=0 address handling#9314

Draft
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
masterfrom
fix/COINS-1232-eos-memoId-zero-approval
Draft

test(sdk-coin-eos): add coverage for memoId=0 address handling#9314
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
masterfrom
fix/COINS-1232-eos-memoId-zero-approval

Conversation

@bitgo-ai-agent-dev

Copy link
Copy Markdown

What

  • Added test cases confirming EOS address handling works correctly when memoId='0' (the first receive address index)
  • Tests cover getAddressDetails, isValidAddress, isValidMemoId, verifyAddress, and verifyTransaction with memoId=0

Why

  • Customers were unable to approve EOS transfers to addresses with memoId=0 (e.g. rqzdy4z2pigj?memoId=0), which is the first and most commonly used receive address for EOS wallets
  • The string '0' is truthy in JavaScript, but differs from other memo IDs by being numerically zero — this creates a subtle risk of falsy-check bugs in code that checks if (!memoId) or if (memoId && ...) without using strict comparisons
  • These tests provide regression coverage to detect any future changes that might inadvertently break zero-memoId handling and to document that memoId=0 must be treated the same as any other valid memoId value

Test plan

  • All existing EOS SDK unit tests pass (37 tests)
  • New memoId=0 tests added and passing

Ticket: COINS-1232

Add test cases for EOS address handling when memoId equals '0' (the
first receive address index). The string '0' is truthy in JavaScript
but differs from other memo IDs in being numerically zero, which can
trigger subtle falsy-check bugs.

Added tests for:
- getAddressDetails with ?memoId=0
- isValidAddress with ?memoId=0
- isValidMemoId with value '0'
- verifyAddress with ?memoId=0
- verifyTransaction with a tx containing memo='0' and recipient
  address ?memoId=0

All tests confirm the SDK handles memoId=0 correctly. These tests
provide regression coverage against future changes that might
inadvertently break the falsy-safe '0' handling.

Ticket: COINS-1232

Co-Authored-By: Claude <noreply@anthropic.com>
Session-Id: b9aaf785-eb22-46b4-853a-ee44f3d06a1a
Task-Id: 0bb9551a-800d-4e1e-b09f-fe82f03b7754
@linear-code

linear-code Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

COINS-1232

@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the fix/COINS-1232-eos-memoId-zero-approval branch from 0dd53bb to fef3e6d Compare July 21, 2026 15:41
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.

0 participants