Skip to content

Commit

Permalink
fix(frontend): add Solana feature flag in tokens list (#4147)
Browse files Browse the repository at this point in the history
# Motivation

Just for insurance, we add the feature flag for Solana in the list of
tokens to pin too.
  • Loading branch information
AntonioVentilii authored Jan 9, 2025
1 parent d629bd9 commit 7735133
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/frontend/src/lib/derived/tokens.derived.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { enabledBitcoinTokens } from '$btc/derived/tokens.derived';
import { SOLANA_NETWORK_ENABLED } from '$env/networks/networks.sol.env';
import { BTC_MAINNET_TOKEN } from '$env/tokens/tokens.btc.env';
import { ETHEREUM_TOKEN } from '$env/tokens/tokens.eth.env';
import { ICP_TOKEN } from '$env/tokens/tokens.icp.env';
Expand Down Expand Up @@ -31,9 +32,9 @@ export const tokens: Readable<Token[]> = derived(
ICP_TOKEN,
...$enabledBitcoinTokens,
...$enabledEthereumTokens,
...$enabledSolanaTokens,
...$erc20Tokens,
...$icrcTokens,
...$enabledSolanaTokens
...$icrcTokens
]
);

Expand All @@ -43,7 +44,7 @@ export const tokensToPin: Readable<TokenToPin[]> = derived(
BTC_MAINNET_TOKEN,
ETHEREUM_TOKEN,
ICP_TOKEN,
SOLANA_TOKEN,
...(SOLANA_NETWORK_ENABLED ? [SOLANA_TOKEN] : []),
...$icrcChainFusionDefaultTokens
]
);
Expand Down
6 changes: 3 additions & 3 deletions src/frontend/src/tests/lib/derived/tokens.derived.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ describe('tokens.derived', () => {
ICP_TOKEN,
BTC_MAINNET_TOKEN,
ETHEREUM_TOKEN,
SOLANA_TOKEN,
{ ...mockErc20DefaultToken, enabled: false, version: undefined },
mockEr20UserToken,
{ ...mockIcrcDefaultToken, enabled: false, version: undefined, id: result[5].id },
{ ...mockIcrcCustomToken, id: result[6].id },
SOLANA_TOKEN
{ ...mockIcrcDefaultToken, enabled: false, version: undefined, id: result[6].id },
{ ...mockIcrcCustomToken, id: result[7].id }
]);
});

Expand Down

0 comments on commit 7735133

Please sign in to comment.