Skip to content

Commit

Permalink
Allow default network switching with addEthereumChain. MetaMask#10623 M…
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmota committed Mar 24, 2021
1 parent 1cfa582 commit a0f3d95
Showing 1 changed file with 0 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit a0f3d95

Please sign in to comment.