Skip to content

Commit 2c64151

Browse files
committed
Remove _init usages
1 parent 4130bc7 commit 2c64151

File tree

3 files changed

+1
-23
lines changed

3 files changed

+1
-23
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
11
/* eslint-disable dot-notation,@typescript-eslint/dot-notation */
22
import { Common } from "@nomicfoundation/ethereumjs-common";
3-
import { isEdrProvider } from "./isEdrProvider";
43

54
export async function retrieveCommon(provider: any): Promise<Common> {
6-
if (isEdrProvider(provider)) {
7-
return provider["_common"];
8-
}
9-
10-
if (provider["_node"] === undefined) {
11-
await provider["_init"]();
12-
}
13-
const common = provider["_node"]?.["_common"];
14-
if (common === undefined) {
15-
throw new Error("Failed to retrieve common from HardhatNetworkProvider");
16-
}
17-
return common;
5+
return provider["_common"];
186
}

packages/hardhat-core/test/internal/hardhat-network/provider/modules/eth/hardforks.ts

-5
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,6 @@ describe("Eth module - hardfork dependant tests", function () {
5050
// TODO: Find out a better way to obtain the common here
5151
const provider: any = this.hardhatNetworkProvider;
5252

53-
if ("_init" in provider) {
54-
// eslint-disable-next-line dot-notation,@typescript-eslint/dot-notation
55-
await provider["_init"]();
56-
}
57-
5853
// eslint-disable-next-line dot-notation,@typescript-eslint/dot-notation
5954
this.common = provider["_common"];
6055
});

packages/hardhat-core/test/internal/hardhat-network/provider/modules/eth/methods/sendRawTransaction.ts

-5
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,6 @@ describe("Eth module", function () {
233233
// TODO: Find out a better way to obtain the common here
234234
const provider: any = this.hardhatNetworkProvider;
235235

236-
if ("_init" in provider) {
237-
// eslint-disable-next-line dot-notation,@typescript-eslint/dot-notation
238-
await provider["_init"]();
239-
}
240-
241236
// eslint-disable-next-line dot-notation,@typescript-eslint/dot-notation
242237
common = provider["_common"];
243238
});

0 commit comments

Comments
 (0)