Skip to content

Commit a549e56

Browse files
authored
Merge pull request #6974 from NomicFoundation/remove-defaultNetwork
Remove the defaultNetwork option and introduce a network called "default"
2 parents 546af5d + 232802b commit a549e56

File tree

30 files changed

+63
-69
lines changed

30 files changed

+63
-69
lines changed

.changeset/tiny-apes-tell.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"hardhat": patch
3+
---
4+
5+
Remove the `defaultNetwork` config option and introduce a network called `default` ([#6875](https://github.com/NomicFoundation/hardhat/issues/6875))

v-next/hardhat-ethers/test/gas-config.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { before, describe, it } from "node:test";
1010
import { initializeTestEthers } from "./helpers/helpers.js";
1111

1212
type GasLimitValue = "default" | "auto" | bigint;
13-
type ConnectedNetwork = "hardhat" | "localhost";
13+
type ConnectedNetwork = "default" | "localhost";
1414

1515
interface Combination {
1616
hardhatGasLimit: GasLimitValue;
@@ -34,7 +34,7 @@ function generateCombinations(): Combination[] {
3434
1_000_000n,
3535
];
3636

37-
// TODO: enable when V3 is ready: V3 node required - add hardhat network -> ["hardhat", "localhost"];
37+
// TODO: enable when V3 is ready: V3 node required - add hardhat network -> ["default", "localhost"];
3838
const connectedNetworkValues: ConnectedNetwork[] = ["localhost"];
3939

4040
for (const hardhatGasLimit of hardhatGasLimitValues) {
@@ -67,7 +67,7 @@ describe("gas config behavior", () => {
6767
{ artifactName: "Example", fileName: "gas-config" },
6868
]));
6969

70-
if (hardhatGasLimit !== "default" && connectedNetwork === "hardhat") {
70+
if (hardhatGasLimit !== "default" && connectedNetwork === "default") {
7171
networkConfig.gas = hardhatGasLimit;
7272
}
7373

@@ -85,12 +85,12 @@ describe("gas config behavior", () => {
8585
// the result of an estimateGas call should be used
8686
let defaultGasLimit: bigint | undefined;
8787
if (
88-
(connectedNetwork === "hardhat" && hardhatGasLimit === 1_000_000n) ||
88+
(connectedNetwork === "default" && hardhatGasLimit === 1_000_000n) ||
8989
(connectedNetwork === "localhost" && localhostGasLimit === 1_000_000n)
9090
) {
9191
defaultGasLimit = 1_000_000n;
9292
} else if (
93-
(connectedNetwork === "hardhat" && hardhatGasLimit === "default") ||
93+
(connectedNetwork === "default" && hardhatGasLimit === "default") ||
9494
(connectedNetwork === "localhost" && localhostGasLimit === "default")
9595
) {
9696
// expect the block gas limit to be used as the default gas limit

v-next/hardhat-ethers/test/hardhat-ethers-provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ describe("hardhat ethers provider", () => {
136136
// it("should return the network", async ()=>{
137137
// const network = await ethers.provider.getNetwork();
138138

139-
// assert.equal(network.name, "hardhat");
139+
// assert.equal(network.name, "default");
140140
// assert.equal(network.chainId, 31337n);
141141
// });
142142

v-next/hardhat-ethers/test/hardhat-ethers-signer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ describe("hardhat ethers signer", () => {
157157
const { ethers: hhEthers, provider: hhProvider } =
158158
await initializeTestEthers([], {
159159
networks: {
160-
hardhat: {
160+
default: {
161161
type: "edr",
162162
accounts: [
163163
{ balance: "1000000000000000000", privateKey: TEST_P_KEY_1 },
@@ -174,7 +174,7 @@ describe("hardhat ethers signer", () => {
174174
const { ethers: hhEthers, provider: hhProvider } =
175175
await initializeTestEthers([], {
176176
networks: {
177-
hardhat: {
177+
default: {
178178
type: "edr",
179179
accounts: HD_ACCOUNTS,
180180
},

v-next/hardhat-ethers/test/helpers/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export async function initializeTestEthers(
2525
const hre = await createHardhatRuntimeEnvironment(config);
2626

2727
const network =
28-
config.networks?.localhost !== undefined ? "localhost" : "hardhat";
28+
config.networks?.localhost !== undefined ? "localhost" : "default";
2929

3030
const connection = await hre.network.connect(network);
3131

v-next/hardhat-ethers/test/plugin-functionalities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ describe("Ethers plugin", () => {
939939
});
940940
});
941941

942-
describe("hardhat", () => {
942+
describe("default", () => {
943943
describe("contract events", () => {
944944
// TODO re-enable when we make .on("event") work
945945
// it("should be detected", async ()=> {

v-next/hardhat-ignition-ethers/src/internal/ethers-ignition-helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export class EthersIgnitionHelperImpl<ChainTypeT extends ChainType | string>
143143
const deploymentId = resolveDeploymentId(givenDeploymentId, chainId);
144144

145145
const deploymentDir =
146-
this.#connection.networkName === "hardhat"
146+
this.#connection.networkName === "default"
147147
? undefined
148148
: path.join(
149149
this.#hardhatConfig.paths.ignition,

v-next/hardhat-ignition-ethers/test/fixture-projects/minimal/hardhat.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export default {
22
solidity: "0.8.19",
33
networks: {
4-
hardhat: {
4+
default: {
55
mining: {
66
auto: false,
77
},

v-next/hardhat-ignition-viem/src/internal/viem-ignition-helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export class ViemIgnitionHelperImpl<ChainTypeT extends ChainType | string>
146146
const deploymentId = resolveDeploymentId(givenDeploymentId, chainId);
147147

148148
const deploymentDir =
149-
this.#connection.networkName === "hardhat"
149+
this.#connection.networkName === "default"
150150
? undefined
151151
: path.join(
152152
this.#hardhatConfig.paths.ignition,

v-next/hardhat-ignition-viem/test/fixture-projects/minimal/hardhat.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export default {
22
solidity: "0.8.19",
33
networks: {
4-
hardhat: {
4+
default: {
55
mining: {
66
auto: false,
77
},

0 commit comments

Comments
 (0)