From 88372af128557a68deb565bb2f783a9711a4f1b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20Mi=C3=B1o?= Date: Thu, 29 Aug 2024 17:24:40 -0400 Subject: [PATCH] rm ishardhat --- src/handlers/web3.ts | 9 --------- src/redux/explorer.ts | 6 ++---- src/redux/gas.ts | 2 +- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/handlers/web3.ts b/src/handlers/web3.ts index b6a79b18b37..13416a8aceb 100644 --- a/src/handlers/web3.ts +++ b/src/handlers/web3.ts @@ -166,15 +166,6 @@ export const isL2Chain = ({ chainId }: { chainId: ChainId }): boolean => { return getNetworkObject({ chainId }).networkType === 'layer2'; }; -/** - * @desc Checks whether a provider is HardHat. - * @param providerUrl The provider URL. - * @return Whether or not the provider is HardHat. - */ -export const isHardHat = (providerUrl: string): boolean => { - return providerUrl?.startsWith('http://') && providerUrl?.endsWith('8545'); -}; - /** * @desc Checks if the given network is a testnet. * @param network The network to check. diff --git a/src/redux/explorer.ts b/src/redux/explorer.ts index 39465af9ae5..0892e4b5e8c 100644 --- a/src/redux/explorer.ts +++ b/src/redux/explorer.ts @@ -4,8 +4,8 @@ import { ThunkDispatch } from 'redux-thunk'; import { io, Socket } from 'socket.io-client'; import { getRemoteConfig } from '@/model/remoteConfig'; import { AppGetState, AppState } from './store'; -import { getProvider, isHardHat } from '@/handlers/web3'; import { ChainId } from '@/networks/types'; +import { useConnectedToHardhatStore } from '@/state/connectedToHardhat'; // -- Constants --------------------------------------- // const EXPLORER_UPDATE_SOCKETS = 'explorer/EXPLORER_UPDATE_SOCKETS'; @@ -118,9 +118,7 @@ export const explorerInit = () => (dispatch: ThunkDispatch