From a0f3d95ff3479fd51cf571f8aed61b8390dcef92 Mon Sep 17 00:00:00 2001 From: Miguel Mota Date: Wed, 24 Mar 2021 13:10:43 -0700 Subject: [PATCH] Allow default network switching with addEthereumChain. #10623 #10597 --- .../rpc-method-middleware/handlers/add-ethereum-chain.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/app/scripts/lib/rpc-method-middleware/handlers/add-ethereum-chain.js b/app/scripts/lib/rpc-method-middleware/handlers/add-ethereum-chain.js index ac170b399320..c5d2ad686902 100644 --- a/app/scripts/lib/rpc-method-middleware/handlers/add-ethereum-chain.js +++ b/app/scripts/lib/rpc-method-middleware/handlers/add-ethereum-chain.js @@ -7,7 +7,6 @@ import { isSafeChainId, } from '../../../../../shared/modules/network.utils'; import { jsonRpcRequest } from '../../../../../shared/modules/rpc.utils'; -import { CHAIN_ID_TO_NETWORK_ID_MAP } from '../../../../../shared/constants/network'; const addEthereumChain = { methodNames: [MESSAGE_TYPE.ADD_ETHEREUM_CHAIN], @@ -113,14 +112,6 @@ async function addEthereumChainHandler( ); } - if (CHAIN_ID_TO_NETWORK_ID_MAP[_chainId]) { - return end( - ethErrors.rpc.invalidParams({ - message: `May not specify default MetaMask chain.`, - }), - ); - } - const existingNetwork = findCustomRpcBy({ chainId: _chainId }); if (existingNetwork !== null) {