Skip to content

Commit 951e026

Browse files
fix: adjust network names (#4865)
## Explanation The current state of the network nickname mappings does not fully align with the naming conventions used by third-party providers, leading to potential inconsistencies and confusion. Specifically, the names "Mainnet" and "Linea Mainnet" do not match the standard conventions of "Ethereum Mainnet" and "Linea." Updating these nicknames helps ensure clarity and consistency across platforms. The proposed changes standardize the network names by updating `Mainnet` to `Ethereum Mainnet` and `Linea Mainnet` to `Linea`. This provides better alignment with widely accepted naming conventions, making it easier for consumers to understand and trust the network names displayed. ## References This change aligns the network names with conventions used by third-party providers for Ethereum mainnet and Linea mainnet. - Related to #67890 ## Changelog ### `@metamask/controller-utils` - **CHANGED**: Updated network nickname for `Mainnet` to `Ethereum Mainnet` to standardize with third-party naming. - **CHANGED**: Updated network nickname for `Linea Mainnet` to `Linea` for consistency. ### `@metamask/network-controller` - **CHANGED**: Updated network nickname for `Mainnet` to `Ethereum Mainnet` to pass the unit tests. ## Checklist - [x] I've updated the test suite for new or updated code as appropriate. - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate. - [ ] I've highlighted breaking changes using the "BREAKING" category above as appropriate. - [ ] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes. Co-authored-by: cryptodev-2s <109512101+cryptodev-2s@users.noreply.github.com>
1 parent 506071e commit 951e026

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/controller-utils/src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ export type BlockExplorerUrl =
108108
(typeof BlockExplorerUrl)[keyof typeof BlockExplorerUrl];
109109

110110
export const NetworkNickname = {
111-
[BuiltInNetworkName.Mainnet]: 'Mainnet',
111+
[BuiltInNetworkName.Mainnet]: 'Ethereum Mainnet',
112112
[BuiltInNetworkName.Goerli]: 'Goerli',
113113
[BuiltInNetworkName.Sepolia]: 'Sepolia',
114114
[BuiltInNetworkName.LineaGoerli]: 'Linea Goerli',
115115
[BuiltInNetworkName.LineaSepolia]: 'Linea Sepolia',
116-
[BuiltInNetworkName.LineaMainnet]: 'Linea Mainnet',
116+
[BuiltInNetworkName.LineaMainnet]: 'Linea',
117117
} as const satisfies Record<InfuraNetworkType, string>;
118118
export type NetworkNickname =
119119
(typeof NetworkNickname)[keyof typeof NetworkNickname];

packages/network-controller/tests/NetworkController.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ describe('NetworkController', () => {
358358
"blockExplorerUrls": Array [],
359359
"chainId": "0x1",
360360
"defaultRpcEndpointIndex": 0,
361-
"name": "Mainnet",
361+
"name": "Ethereum Mainnet",
362362
"nativeCurrency": "ETH",
363363
"rpcEndpoints": Array [
364364
Object {
@@ -428,7 +428,7 @@ describe('NetworkController', () => {
428428
"blockExplorerUrls": Array [],
429429
"chainId": "0xe708",
430430
"defaultRpcEndpointIndex": 0,
431-
"name": "Linea Mainnet",
431+
"name": "Linea",
432432
"nativeCurrency": "ETH",
433433
"rpcEndpoints": Array [
434434
Object {
@@ -3647,7 +3647,7 @@ describe('NetworkController', () => {
36473647
}),
36483648
).toThrow(
36493649
new Error(
3650-
"Could not add network with chain ID 0x1337 and Infura RPC endpoint for 'Mainnet' which represents 0x1, as the two conflict",
3650+
"Could not add network with chain ID 0x1337 and Infura RPC endpoint for 'Ethereum Mainnet' which represents 0x1, as the two conflict",
36513651
),
36523652
);
36533653
},
@@ -6531,7 +6531,7 @@ describe('NetworkController', () => {
65316531
],
65326532
}),
65336533
).rejects.toThrow(
6534-
"Could not update network to point to same RPC endpoint as existing network for chain 0x1 ('Mainnet')",
6534+
"Could not update network to point to same RPC endpoint as existing network for chain 0x1 ('Ethereum Mainnet')",
65356535
);
65366536
},
65376537
);

0 commit comments

Comments
 (0)