Skip to content

Commit a54fefe

Browse files
feat: enable erc20 token optimization for all tokens
Ticket: WIN-8584
1 parent 4379062 commit a54fefe

3 files changed

Lines changed: 4 additions & 26 deletions

File tree

modules/statics/src/coins.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,11 @@ export const coins = CoinMap.fromCoins([
5252
// Maps family -> coin name (e.g., 'ip' -> 'ip')
5353
const erc20ChainToNameMap: Record<string, string> = {};
5454

55-
// TODO: remove ip and hypeeevm coins here and remove other evm coins from switch block, once changes are tested (Ticket: https://bitgoinc.atlassian.net/browse/WIN-7835)
56-
const enabledEvmCoins = ['ip', 'hypeevm', 'plume'];
5755
allCoinsAndTokens.forEach((coin) => {
5856
if (
5957
coin.features.includes(CoinFeature.SUPPORTS_ERC20) &&
6058
coin.network.type === NetworkType.MAINNET &&
61-
!coin.isToken &&
62-
enabledEvmCoins.includes(coin.family)
59+
!coin.isToken
6360
) {
6461
erc20ChainToNameMap[coin.family] = coin.name;
6562
}

modules/statics/src/tokenConfig.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,12 +1162,9 @@ export const getEthLikeTokens = (network: 'Mainnet' | 'Testnet', tokenType: Toke
11621162
}
11631163

11641164
const ethLikeTokenMap = {} as EthLikeTokenMap;
1165-
// TODO: add IP token here and test changes (Ticket: https://bitgoinc.atlassian.net/browse/WIN-7835)
1166-
const enabledChains = ['ip', 'hypeevm', 'plume'] as string[];
11671165

11681166
coins.forEach((coin) => {
1169-
// TODO: remove enabled chains once changes are done (Ticket: https://bitgoinc.atlassian.net/browse/WIN-7835)
1170-
if (coin instanceof AccountCoin && coin.features.includes(feature) && enabledChains.includes(coin.family)) {
1167+
if (coin instanceof AccountCoin && coin.features.includes(feature)) {
11711168
const coinName = coin.family;
11721169
const coinNameForNetwork = network === 'Testnet' ? `t${coinName}` : coinName;
11731170

modules/statics/test/unit/tokenConfigTests.ts

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -312,11 +312,11 @@ describe('EthLike Token Config Functions', function () {
312312
});
313313

314314
describe('getEthLikeTokens', function () {
315-
it('should return a map with tokens for enabled chains', function () {
315+
it('should return a map with tokens for EVM chains supporting ERC20', function () {
316316
const result = getEthLikeTokens('Mainnet', TokenTypeEnum.ERC20);
317317

318318
result.should.be.an.Object();
319-
// The function filters by enabledChains which currently includes 'ip' and 'hypeevm'
319+
// The function includes all EVM chains with SUPPORTS_ERC20 feature
320320
if (result.ip) {
321321
result.ip.should.have.property('tokens');
322322
result.ip.tokens.should.be.an.Array();
@@ -390,22 +390,6 @@ describe('EthLike Token Config Functions', function () {
390390
});
391391
});
392392

393-
it('should only include tokens from enabled chains', function () {
394-
const mainnetResult = getEthLikeTokens('Mainnet', TokenTypeEnum.ERC20);
395-
const testnetResult = getEthLikeTokens('Testnet', TokenTypeEnum.ERC20);
396-
397-
// Current implementation enables 'ip' and 'hypeevm' chains
398-
const enabledChains = ['ip', 'hypeevm', 'plume'];
399-
400-
Object.keys(mainnetResult).forEach((family) => {
401-
enabledChains.should.containEql(family);
402-
});
403-
404-
Object.keys(testnetResult).forEach((family) => {
405-
enabledChains.should.containEql(family);
406-
});
407-
});
408-
409393
it('should return empty tokens array for chains without tokens', function () {
410394
const result = getEthLikeTokens('Mainnet', TokenTypeEnum.ERC20);
411395

0 commit comments

Comments
 (0)