From 3039abc7f1b14dcdf6c69eef0b46273e770e2930 Mon Sep 17 00:00:00 2001 From: Sachin Roy Date: Mon, 18 May 2026 11:47:15 +0000 Subject: [PATCH 1/4] fix(statics): correct Avalanche C-Chain entries in LEGACY_CHAIN_ID_MAP 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. Also adds unit tests asserting that every LEGACY_CHAIN_ID_MAP entry resolves to a defined coin in CoinMap, and a specific regression test for the Avalanche C-Chain lookups. Ticket: CGD-726 Session-Id: f0e9d4de-b673-460c-bab7-293169947e32 Task-Id: 7cc8baff-7256-4246-aa9f-6694e37312b3 --- modules/statics/src/map.ts | 4 ++-- modules/statics/test/unit/coins.ts | 33 ++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/modules/statics/src/map.ts b/modules/statics/src/map.ts index 71e653f1b4..31314c9b22 100644 --- a/modules/statics/src/map.ts +++ b/modules/statics/src/map.ts @@ -113,8 +113,8 @@ export class CoinMap { 11142220: 'tcelo', 2222: 'kava', 2221: 'tkava', - 43114: 'avax', - 43113: 'tavax', + 43114: 'avaxc', + 43113: 'tavaxc', 100: 'gno', 130: 'unieth', 1301: 'tunieth', diff --git a/modules/statics/test/unit/coins.ts b/modules/statics/test/unit/coins.ts index c39bc3538e..b7780934e3 100644 --- a/modules/statics/test/unit/coins.ts +++ b/modules/statics/test/unit/coins.ts @@ -857,6 +857,39 @@ describe('CoinMap', function () { should(ethCoinName).not.be.undefined(); ethCoinName!.should.equal('eth'); }); + + it('should map Avalanche C-Chain chain IDs to registered coin names', () => { + const avaxcName = coins.coinNameFromChainId(43114); + should(avaxcName).not.be.undefined(); + avaxcName!.should.equal('avaxc'); + should(() => coins.get(avaxcName!)).not.throw(); + + const tavaxcName = coins.coinNameFromChainId(43113); + should(tavaxcName).not.be.undefined(); + tavaxcName!.should.equal('tavaxc'); + should(() => coins.get(tavaxcName!)).not.throw(); + }); + + it('every LEGACY_CHAIN_ID_MAP entry resolves to a defined coin', () => { + const legacyChainIds = [ + 1, 42, 5, 560048, 10001, 80002, 137, 56, 97, 42161, 421614, 10, + 11155420, 1116, 1114, 248, 9372, 14, 114, 19, 16, 1111, 1112, 50, 51, + 80094, 80069, 42220, 11142220, 2222, 2221, 43114, 43113, 100, 130, + 1301, 190415, 181228, 6985385, 7080969, 4663, 46630, 324, 8453, 84532, + 143, 10143, 480, 4801, 5031, 50312, 1868, 1946, 33111, 33139, 688689, + 102030, 102031, 998, 999, 16602, 16661, 9746, 9745, 14601, 146, 1328, + 1329, 1001, 8217, 1270, 59141, 59144, 1315, 1514, 545, 747, 98867, + 98866, 6343, 4326, 295, 296, 196, 1952, 5734951, 2019775, 5042002, + 4217, 42431, 5000, 5003, 25363, 20994, + ]; + for (const chainId of legacyChainIds) { + const coinName = coins.coinNameFromChainId(chainId); + should(coinName).not.be.undefined(`chainId ${chainId} should resolve to a coin name`); + should(() => coins.get(coinName!)).not.throw( + `chainId ${chainId} maps to '${coinName}' which is not defined in CoinMap` + ); + } + }); }); }); From cabd60a34594d78fa1b28dbed135b48a62f99374 Mon Sep 17 00:00:00 2001 From: Sachin Roy Date: Mon, 18 May 2026 12:01:13 +0000 Subject: [PATCH 2/4] test(statics): fix should.js assertion syntax in LEGACY_CHAIN_ID_MAP test should.js .undefined and .throw are zero-arg getter assertions; passing a message string triggers TypeError. Remove the arguments. Ticket: CGD-726 Session-Id: f0e9d4de-b673-460c-bab7-293169947e32 Task-Id: 7cc8baff-7256-4246-aa9f-6694e37312b3 --- modules/statics/test/unit/coins.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/statics/test/unit/coins.ts b/modules/statics/test/unit/coins.ts index b7780934e3..85f3fda7c2 100644 --- a/modules/statics/test/unit/coins.ts +++ b/modules/statics/test/unit/coins.ts @@ -884,10 +884,8 @@ describe('CoinMap', function () { ]; for (const chainId of legacyChainIds) { const coinName = coins.coinNameFromChainId(chainId); - should(coinName).not.be.undefined(`chainId ${chainId} should resolve to a coin name`); - should(() => coins.get(coinName!)).not.throw( - `chainId ${chainId} maps to '${coinName}' which is not defined in CoinMap` - ); + should(coinName).not.be.undefined(); + should(() => coins.get(coinName!)).not.throw(); } }); }); From e1781e43b2459b9bab4f2ef5fb31708164f1fefb Mon Sep 17 00:00:00 2001 From: Sachin Roy Date: Mon, 18 May 2026 12:17:25 +0000 Subject: [PATCH 3/4] fix(statics): correct kava EVM entries and remove invalid gno entry - 2222: 'kava' -> 'kavaevm', 2221: 'tkava' -> 'tkavaevm' - Remove 100: 'gno' (no Gnosis Chain coin registered; gno is ERC20 token only) Ticket: CGD-726 Session-Id: f0e9d4de-b673-460c-bab7-293169947e32 Task-Id: 7cc8baff-7256-4246-aa9f-6694e37312b3 --- modules/statics/src/map.ts | 5 ++--- modules/statics/test/unit/coins.ts | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/statics/src/map.ts b/modules/statics/src/map.ts index 31314c9b22..a3f3d5e3db 100644 --- a/modules/statics/src/map.ts +++ b/modules/statics/src/map.ts @@ -111,11 +111,10 @@ export class CoinMap { 80069: 'tbera', 42220: 'celo', 11142220: 'tcelo', - 2222: 'kava', - 2221: 'tkava', + 2222: 'kavaevm', + 2221: 'tkavaevm', 43114: 'avaxc', 43113: 'tavaxc', - 100: 'gno', 130: 'unieth', 1301: 'tunieth', 190415: 'hppeth', diff --git a/modules/statics/test/unit/coins.ts b/modules/statics/test/unit/coins.ts index 85f3fda7c2..48ca1f93ca 100644 --- a/modules/statics/test/unit/coins.ts +++ b/modules/statics/test/unit/coins.ts @@ -874,7 +874,7 @@ describe('CoinMap', function () { const legacyChainIds = [ 1, 42, 5, 560048, 10001, 80002, 137, 56, 97, 42161, 421614, 10, 11155420, 1116, 1114, 248, 9372, 14, 114, 19, 16, 1111, 1112, 50, 51, - 80094, 80069, 42220, 11142220, 2222, 2221, 43114, 43113, 100, 130, + 80094, 80069, 42220, 11142220, 2222, 2221, 43114, 43113, 130, 1301, 190415, 181228, 6985385, 7080969, 4663, 46630, 324, 8453, 84532, 143, 10143, 480, 4801, 5031, 50312, 1868, 1946, 33111, 33139, 688689, 102030, 102031, 998, 999, 16602, 16661, 9746, 9745, 14601, 146, 1328, From 4f9523f8d692287ad1e7898d798f0bede886a6ec Mon Sep 17 00:00:00 2001 From: Sachin Roy Date: Mon, 18 May 2026 17:40:48 +0000 Subject: [PATCH 4/4] revert(statics): undo out-of-scope kava and gno map changes Revert 2222:'kava'->'kavaevm', 2221:'tkava'->'tkavaevm', and removal of 100:'gno'. Those changes are outside the scope of this ticket. Also remove the broad LEGACY_CHAIN_ID_MAP coverage test that was driving the extra changes. Ticket: CGD-726 Session-Id: f0e9d4de-b673-460c-bab7-293169947e32 Task-Id: 7cc8baff-7256-4246-aa9f-6694e37312b3 --- modules/statics/src/map.ts | 5 +++-- modules/statics/test/unit/coins.ts | 18 ------------------ 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/modules/statics/src/map.ts b/modules/statics/src/map.ts index a3f3d5e3db..31314c9b22 100644 --- a/modules/statics/src/map.ts +++ b/modules/statics/src/map.ts @@ -111,10 +111,11 @@ export class CoinMap { 80069: 'tbera', 42220: 'celo', 11142220: 'tcelo', - 2222: 'kavaevm', - 2221: 'tkavaevm', + 2222: 'kava', + 2221: 'tkava', 43114: 'avaxc', 43113: 'tavaxc', + 100: 'gno', 130: 'unieth', 1301: 'tunieth', 190415: 'hppeth', diff --git a/modules/statics/test/unit/coins.ts b/modules/statics/test/unit/coins.ts index 48ca1f93ca..e012028fa0 100644 --- a/modules/statics/test/unit/coins.ts +++ b/modules/statics/test/unit/coins.ts @@ -870,24 +870,6 @@ describe('CoinMap', function () { should(() => coins.get(tavaxcName!)).not.throw(); }); - it('every LEGACY_CHAIN_ID_MAP entry resolves to a defined coin', () => { - const legacyChainIds = [ - 1, 42, 5, 560048, 10001, 80002, 137, 56, 97, 42161, 421614, 10, - 11155420, 1116, 1114, 248, 9372, 14, 114, 19, 16, 1111, 1112, 50, 51, - 80094, 80069, 42220, 11142220, 2222, 2221, 43114, 43113, 130, - 1301, 190415, 181228, 6985385, 7080969, 4663, 46630, 324, 8453, 84532, - 143, 10143, 480, 4801, 5031, 50312, 1868, 1946, 33111, 33139, 688689, - 102030, 102031, 998, 999, 16602, 16661, 9746, 9745, 14601, 146, 1328, - 1329, 1001, 8217, 1270, 59141, 59144, 1315, 1514, 545, 747, 98867, - 98866, 6343, 4326, 295, 296, 196, 1952, 5734951, 2019775, 5042002, - 4217, 42431, 5000, 5003, 25363, 20994, - ]; - for (const chainId of legacyChainIds) { - const coinName = coins.coinNameFromChainId(chainId); - should(coinName).not.be.undefined(); - should(() => coins.get(coinName!)).not.throw(); - } - }); }); });