Skip to content

Commit eca367b

Browse files
sachinBitgoclaude
andcommitted
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. 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 <noreply@anthropic.com> Session-Id: 6ec5a14f-c3aa-46ed-8177-39e4fc4263cd Task-Id: 1d9f9835-f70a-4605-9a03-d95971816e49
1 parent 6d77a3e commit eca367b

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

modules/statics/src/map.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ export class CoinMap {
113113
11142220: 'tcelo',
114114
2222: 'kava',
115115
2221: 'tkava',
116-
43114: 'avax',
117-
43113: 'tavax',
116+
43114: 'avaxc',
117+
43113: 'tavaxc',
118118
100: 'gno',
119119
130: 'unieth',
120120
1301: 'tunieth',

modules/statics/test/unit/coins.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,19 @@ describe('CoinMap', function () {
857857
should(ethCoinName).not.be.undefined();
858858
ethCoinName!.should.equal('eth');
859859
});
860+
861+
it('should map Avalanche C-Chain chain IDs to registered coin names', () => {
862+
const avaxcName = coins.coinNameFromChainId(43114);
863+
should(avaxcName).not.be.undefined();
864+
avaxcName!.should.equal('avaxc');
865+
should(() => coins.get(avaxcName!)).not.throw();
866+
867+
const tavaxcName = coins.coinNameFromChainId(43113);
868+
should(tavaxcName).not.be.undefined();
869+
tavaxcName!.should.equal('tavaxc');
870+
should(() => coins.get(tavaxcName!)).not.throw();
871+
});
872+
860873
});
861874
});
862875

0 commit comments

Comments
 (0)