From 91d0dc4a300e18a8058e5ce0ca4013344a457760 Mon Sep 17 00:00:00 2001 From: Patricio Palladino Date: Mon, 28 Oct 2024 20:51:35 +0000 Subject: [PATCH] Make chainId optional in the EDR network configs --- .../builtin-plugins/network-manager/hook-handlers/config.ts | 5 ++--- .../network-manager/type-extensions/config.ts | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/v-next/hardhat/src/internal/builtin-plugins/network-manager/hook-handlers/config.ts b/v-next/hardhat/src/internal/builtin-plugins/network-manager/hook-handlers/config.ts index 77f087f973..bf67393d82 100644 --- a/v-next/hardhat/src/internal/builtin-plugins/network-manager/hook-handlers/config.ts +++ b/v-next/hardhat/src/internal/builtin-plugins/network-manager/hook-handlers/config.ts @@ -220,15 +220,14 @@ export async function resolveUserConfig( if (networkConfig.type === "edr") { const resolvedNetworkConfig: EdrNetworkConfig = { type: "edr", - chainId: networkConfig.chainId, + chainId: networkConfig.chainId ?? 31337, chainType: networkConfig.chainType ?? "l1", from: networkConfig.from, gas: resolveGasConfig(networkConfig.gas), gasMultiplier: networkConfig.gasMultiplier ?? 1, gasPrice: resolveGasConfig(networkConfig.gasPrice), - hardfork: networkConfig.hardfork ?? "cancun", - networkId: networkConfig.networkId ?? networkConfig.chainId, + networkId: networkConfig.networkId ?? networkConfig.chainId ?? 31337, blockGasLimit: networkConfig.blockGasLimit ?? 12_500_000, minGasPrice: BigInt(networkConfig.minGasPrice ?? 0), automine: networkConfig.automine ?? true, diff --git a/v-next/hardhat/src/internal/builtin-plugins/network-manager/type-extensions/config.ts b/v-next/hardhat/src/internal/builtin-plugins/network-manager/type-extensions/config.ts index de94a6d0d3..68fbe05fe5 100644 --- a/v-next/hardhat/src/internal/builtin-plugins/network-manager/type-extensions/config.ts +++ b/v-next/hardhat/src/internal/builtin-plugins/network-manager/type-extensions/config.ts @@ -78,7 +78,7 @@ declare module "../../../../types/config.js" { export interface EdrNetworkUserConfig { type: "edr"; - chainId: number; + chainId?: number; chainType?: ChainType; from?: string; gas?: GasUserConfig;