Skip to content

Commit

Permalink
use connectedtohardhat
Browse files Browse the repository at this point in the history
  • Loading branch information
estebanmino committed Aug 29, 2024
1 parent 503d0da commit 26ac83a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/redux/gas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import { multiply } from '@/helpers/utilities';
import { ethereumUtils, gasUtils } from '@/utils';
import { getNetworkObject } from '@/networks';
import { ChainId } from '@/networks/types';
import { useConnectedToHardhatStore } from '@/state/connectedToHardhat';

const { CUSTOM, FAST, NORMAL, SLOW, URGENT, FLASHBOTS_MIN_TIP } = gasUtils;

Expand Down Expand Up @@ -554,12 +555,8 @@ export const gasPricesStartPolling =
// Set a really gas estimate to guarantee that we're gonna be over
// the basefee at the time we fork mainnet during our hardhat tests
let baseFee = baseFeePerGas;
if (chainId === ChainId.mainnet && IS_TESTING === 'true') {
const provider = getProvider({ chainId: ChainId.mainnet });
const providerUrl = provider?.connection?.url;
if (isHardHat(providerUrl)) {
baseFee = parseGasFeeParam(gweiToWei(1000));
}
if (chainId === ChainId.mainnet && IS_TESTING === 'true' && useConnectedToHardhatStore.getState().connectedToHardhat) {
baseFee = parseGasFeeParam(gweiToWei(1000));
}

if (customGasFeeModifiedByUser) {
Expand Down

0 comments on commit 26ac83a

Please sign in to comment.