Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix linea ticker #25436

Merged
merged 1 commit into from
Jun 20, 2024
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
2 changes: 1 addition & 1 deletion ui/selectors/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ export const getNonTestNetworks = createDeepEqualSelector(
imageUrl: LINEA_MAINNET_TOKEN_IMAGE_URL,
},
providerType: NETWORK_TYPES.LINEA_MAINNET,
ticker: TEST_NETWORK_TICKER_MAP[NETWORK_TYPES.LINEA_MAINNET],
ticker: CURRENCY_SYMBOLS.ETH,
Copy link
Contributor Author

@salimtb salimtb Jun 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the value of TEST_NETWORK_TICKER_MAP[NETWORK_TYPES.LINEA_MAINNET] is undefined instead of ETH

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Emmmm i see the selector name is getNonTestNetworks, so it makes sense that the ticker is not from TEST_NETWORK_TICKER_MAP. also linea mainnet is explicitly excluded from TEST_NETWORK_TICKER_MAP;
Doing this LGTM!

id: NETWORK_TYPES.LINEA_MAINNET,
removable: false,
},
Expand Down
32 changes: 32 additions & 0 deletions ui/selectors/selectors.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,38 @@ describe('Selectors', () => {
});
});

describe('#getNonTestNetworks', () => {
it('returns nonTestNetworks', () => {
const nonTestNetworks = selectors.getNonTestNetworks({
metamask: {
networkConfigurations: {},
},
});

// Assert that the `nonTestNetworks` array returned by the selector matches a specific structure.
expect(nonTestNetworks).toStrictEqual(
expect.arrayContaining([
expect.objectContaining({
chainId: expect.any(String),
nickname: expect.any(String),
rpcUrl: expect.any(String),
rpcPrefs: expect.objectContaining({
imageUrl: expect.any(String),
}),
providerType: expect.any(String),
ticker: expect.any(String),
id: expect.any(String),
removable: expect.any(Boolean),
}),
]),
);

// Verify that each network object has a 'ticker' property that is not undefined
nonTestNetworks.forEach((network) => {
expect(network.ticker).toBeDefined();
});
});
});
describe('#getAllNetworks', () => {
it('sorts Localhost to the bottom of the test lists', () => {
const networks = selectors.getAllNetworks({
Expand Down
Loading