From 2be88f4aaba359fb1564022023a188ae0211ed8b Mon Sep 17 00:00:00 2001 From: MicaiahReid Date: Wed, 30 Mar 2022 13:12:40 -0400 Subject: [PATCH] allow localhost blockExplorerUrls --- .../rpc-method-middleware/handlers/add-ethereum-chain.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 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 2fdc271223ee..8b5ff8bbe835 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 @@ -90,8 +90,10 @@ async function addEthereumChainHandler( const firstValidBlockExplorerUrl = blockExplorerUrls !== null && Array.isArray(blockExplorerUrls) - ? blockExplorerUrls.find((blockExplorerUrl) => - validUrl.isHttpsUri(blockExplorerUrl), + ? blockExplorerUrls.find( + (blockExplorerUrl) => + isLocalhost(blockExplorerUrl) || + validUrl.isHttpsUri(blockExplorerUrl), ) : null;