Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions modules/statics/src/coins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,11 @@ export const coins = CoinMap.fromCoins([
// Maps family -> coin name (e.g., 'ip' -> 'ip')
const erc20ChainToNameMap: Record<string, string> = {};

// 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)
const enabledEvmCoins = ['ip', 'hypeevm', 'plume'];
allCoinsAndTokens.forEach((coin) => {
if (
coin.features.includes(CoinFeature.SUPPORTS_ERC20) &&
coin.network.type === NetworkType.MAINNET &&
!coin.isToken &&
enabledEvmCoins.includes(coin.family)
!coin.isToken
) {
erc20ChainToNameMap[coin.family] = coin.name;
}
Expand Down
5 changes: 1 addition & 4 deletions modules/statics/src/tokenConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1162,12 +1162,9 @@ export const getEthLikeTokens = (network: 'Mainnet' | 'Testnet', tokenType: Toke
}

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

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

Expand Down
20 changes: 2 additions & 18 deletions modules/statics/test/unit/tokenConfigTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,11 @@ describe('EthLike Token Config Functions', function () {
});

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

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

it('should only include tokens from enabled chains', function () {
const mainnetResult = getEthLikeTokens('Mainnet', TokenTypeEnum.ERC20);
const testnetResult = getEthLikeTokens('Testnet', TokenTypeEnum.ERC20);

// Current implementation enables 'ip' and 'hypeevm' chains
const enabledChains = ['ip', 'hypeevm', 'plume'];

Object.keys(mainnetResult).forEach((family) => {
enabledChains.should.containEql(family);
});

Object.keys(testnetResult).forEach((family) => {
enabledChains.should.containEql(family);
});
});

it('should return empty tokens array for chains without tokens', function () {
const result = getEthLikeTokens('Mainnet', TokenTypeEnum.ERC20);

Expand Down