Skip to content

fix(statics): correct Avalanche C-Chain entries in LEGACY_CHAIN_ID_MAP#8796

Open
sachinBitgo wants to merge 1 commit into
masterfrom
fix/cgd-726-avax-legacy-chain-id-map
Open

fix(statics): correct Avalanche C-Chain entries in LEGACY_CHAIN_ID_MAP#8796
sachinBitgo wants to merge 1 commit into
masterfrom
fix/cgd-726-avax-legacy-chain-id-map

Conversation

@sachinBitgo
Copy link
Copy Markdown
Contributor

Summary

  • Fixes LEGACY_CHAIN_ID_MAP in @bitgo/statics where Avalanche C-Chain chain IDs 43114 and 43113 were mapped to 'avax' and 'tavax' — names that do not exist in the coin registry. Corrected to 'avaxc' and 'tavaxc'.
  • Any call to CoinMap.coinNameFromChainId(43114) or coinNameFromChainId(43113) previously returned a dangling name that caused CoinNotDefinedError when passed to coins.get().
  • Adds a targeted regression test for the Avalanche C-Chain chain ID lookups.
  • Adds a broader regression test that iterates over every chain ID in LEGACY_CHAIN_ID_MAP and asserts the resolved coin name exists in CoinMap, preventing silent re-introduction of dangling references in future edits.

Test plan

  • yarn unit-test --scope @bitgo/statics passes, including the two new coinNameFromChainId test cases
  • coins.coinNameFromChainId(43114) returns 'avaxc' and coins.get('avaxc') succeeds
  • coins.coinNameFromChainId(43113) returns 'tavaxc' and coins.get('tavaxc') succeeds

Ticket: CGD-726

🤖 Generated with Ralph

@sachinBitgo sachinBitgo requested a review from a team as a code owner May 18, 2026 17:43
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 18, 2026

CGD-726

@bitgo-ai-agent-dev bitgo-ai-agent-dev Bot force-pushed the fix/cgd-726-avax-legacy-chain-id-map branch 2 times, most recently from eca367b to e8db837 Compare May 18, 2026 17:46
Chain IDs 43114 and 43113 were mapped to 'avax' and 'tavax'
respectively, but the registered coin names are 'avaxc' and
'tavaxc'. Any call to CoinMap.fromChainId() for these chain IDs
would throw CoinNotDefinedError.

Adds a unit test asserting that coinNameFromChainId(43114) returns
'avaxc' and coinNameFromChainId(43113) returns 'tavaxc', and that
coins.get() succeeds for both.

Ticket: CGD-726
Co-Authored-By: Claude Opus 4.7 <[email protected]>
Session-Id: 6ec5a14f-c3aa-46ed-8177-39e4fc4263cd
Task-Id: 1d9f9835-f70a-4605-9a03-d95971816e49
@bitgo-ai-agent-dev bitgo-ai-agent-dev Bot force-pushed the fix/cgd-726-avax-legacy-chain-id-map branch 2 times, most recently from 4704dc0 to fdd06f5 Compare May 18, 2026 18:12
@sachinBitgo sachinBitgo self-assigned this May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants