hardhat 3.4.0 → 3.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/src/internal/builtin-plugins/artifacts/artifact-manager.js +1 -1
- package/dist/src/internal/builtin-plugins/artifacts/artifact-manager.js.map +1 -1
- package/dist/src/internal/builtin-plugins/artifacts/hook-handlers/hre.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/artifacts/hook-handlers/hre.js +10 -10
- package/dist/src/internal/builtin-plugins/artifacts/hook-handlers/hre.js.map +1 -1
- package/dist/src/internal/builtin-plugins/clean/index.js +1 -1
- package/dist/src/internal/builtin-plugins/clean/index.js.map +1 -1
- package/dist/src/internal/builtin-plugins/console/index.js +1 -1
- package/dist/src/internal/builtin-plugins/console/index.js.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/hook-handlers/solidity.js +2 -2
- package/dist/src/internal/builtin-plugins/coverage/hook-handlers/solidity.js.map +1 -1
- package/dist/src/internal/builtin-plugins/flatten/index.js +1 -1
- package/dist/src/internal/builtin-plugins/flatten/index.js.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/index.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/index.js +2 -2
- package/dist/src/internal/builtin-plugins/gas-analytics/index.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/edr-provider.js +4 -4
- package/dist/src/internal/builtin-plugins/network-manager/edr/edr-provider.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/genesis-state.js +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/genesis-state.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/utils/convert-to-edr.js +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/utils/convert-to-edr.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/hook-handlers/hre.js +4 -4
- package/dist/src/internal/builtin-plugins/network-manager/hook-handlers/hre.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/hook-handlers/network.js +2 -2
- package/dist/src/internal/builtin-plugins/network-manager/hook-handlers/network.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/http-provider.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/http-provider.js +2 -2
- package/dist/src/internal/builtin-plugins/network-manager/http-provider.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/network-manager.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/network-manager.js +7 -7
- package/dist/src/internal/builtin-plugins/network-manager/network-manager.js.map +1 -1
- package/dist/src/internal/builtin-plugins/node/helpers.js +1 -1
- package/dist/src/internal/builtin-plugins/node/helpers.js.map +1 -1
- package/dist/src/internal/builtin-plugins/node/index.js +1 -1
- package/dist/src/internal/builtin-plugins/node/index.js.map +1 -1
- package/dist/src/internal/builtin-plugins/run/index.js +1 -1
- package/dist/src/internal/builtin-plugins/run/index.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.js +13 -10
- package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/compilation-job.js +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/compilation-job.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/compiler/downloader.js +4 -4
- package/dist/src/internal/builtin-plugins/solidity/build-system/compiler/downloader.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/compiler/index.js +2 -2
- package/dist/src/internal/builtin-plugins/solidity/build-system/compiler/index.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/compiler/solcjs-runner.js +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/compiler/solcjs-runner.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/dependency-graph-building.js +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/dependency-graph-building.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/read-source-file.js +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/read-source-file.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/dependency-resolver.js +10 -10
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/dependency-resolver.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.js +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/hook-handlers/config.js +1 -1
- package/dist/src/internal/builtin-plugins/solidity/hook-handlers/config.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/hook-handlers/hre.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/hook-handlers/hre.js +10 -10
- package/dist/src/internal/builtin-plugins/solidity/hook-handlers/hre.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/index.js +1 -1
- package/dist/src/internal/builtin-plugins/solidity/index.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/solidity-hooks.js +1 -1
- package/dist/src/internal/builtin-plugins/solidity/solidity-hooks.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/tasks/build.js +4 -4
- package/dist/src/internal/builtin-plugins/solidity/tasks/build.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/edr-artifacts.js +2 -2
- package/dist/src/internal/builtin-plugins/solidity-test/edr-artifacts.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/hook-handlers/config.js +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/hook-handlers/config.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/hook-handlers/test.js +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/hook-handlers/test.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/index.js +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/index.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/reporter.js +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/reporter.js.map +1 -1
- package/dist/src/internal/builtin-plugins/telemetry/index.js +1 -1
- package/dist/src/internal/builtin-plugins/telemetry/index.js.map +1 -1
- package/dist/src/internal/builtin-plugins/test/hook-handlers/config.js +1 -1
- package/dist/src/internal/builtin-plugins/test/hook-handlers/config.js.map +1 -1
- package/dist/src/internal/builtin-plugins/test/index.js +1 -1
- package/dist/src/internal/builtin-plugins/test/index.js.map +1 -1
- package/dist/src/internal/cli/init/init.js +1 -1
- package/dist/src/internal/cli/init/init.js.map +1 -1
- package/dist/src/internal/cli/main.d.ts.map +1 -1
- package/dist/src/internal/cli/main.js +4 -2
- package/dist/src/internal/cli/main.js.map +1 -1
- package/dist/src/internal/cli/node-version.d.ts.map +1 -1
- package/dist/src/internal/cli/node-version.js +3 -0
- package/dist/src/internal/cli/node-version.js.map +1 -1
- package/dist/src/internal/cli/telemetry/analytics/analytics.js +2 -2
- package/dist/src/internal/cli/telemetry/analytics/analytics.js.map +1 -1
- package/dist/src/internal/cli/telemetry/error-reporter/global-error-handlers.d.ts +6 -0
- package/dist/src/internal/cli/telemetry/error-reporter/global-error-handlers.d.ts.map +1 -0
- package/dist/src/internal/cli/telemetry/error-reporter/global-error-handlers.js +47 -0
- package/dist/src/internal/cli/telemetry/error-reporter/global-error-handlers.js.map +1 -0
- package/dist/src/internal/cli/telemetry/error-reporter/reporter.d.ts +27 -0
- package/dist/src/internal/cli/telemetry/error-reporter/reporter.d.ts.map +1 -0
- package/dist/src/internal/cli/telemetry/error-reporter/reporter.js +40 -0
- package/dist/src/internal/cli/telemetry/error-reporter/reporter.js.map +1 -0
- package/dist/src/internal/cli/telemetry/sentry/anonymizer.js +1 -1
- package/dist/src/internal/cli/telemetry/sentry/anonymizer.js.map +1 -1
- package/dist/src/internal/cli/telemetry/sentry/init.d.ts +0 -8
- package/dist/src/internal/cli/telemetry/sentry/init.d.ts.map +1 -1
- package/dist/src/internal/cli/telemetry/sentry/init.js +1 -37
- package/dist/src/internal/cli/telemetry/sentry/init.js.map +1 -1
- package/dist/src/internal/cli/telemetry/sentry/reporter.d.ts +8 -2
- package/dist/src/internal/cli/telemetry/sentry/reporter.d.ts.map +1 -1
- package/dist/src/internal/cli/telemetry/sentry/reporter.js +18 -12
- package/dist/src/internal/cli/telemetry/sentry/reporter.js.map +1 -1
- package/dist/src/internal/cli/telemetry/sentry/transport.js +1 -1
- package/dist/src/internal/cli/telemetry/sentry/transport.js.map +1 -1
- package/dist/src/internal/cli/telemetry/telemetry-permissions.js +1 -1
- package/dist/src/internal/cli/telemetry/telemetry-permissions.js.map +1 -1
- package/dist/src/internal/config-loading.js +3 -3
- package/dist/src/internal/config-loading.js.map +1 -1
- package/dist/src/internal/core/configuration-variables.d.ts.map +1 -1
- package/dist/src/internal/core/configuration-variables.js +1 -1
- package/dist/src/internal/core/configuration-variables.js.map +1 -1
- package/dist/src/internal/core/hook-manager.js +3 -3
- package/dist/src/internal/core/hook-manager.js.map +1 -1
- package/dist/src/internal/core/hre.d.ts.map +1 -1
- package/dist/src/internal/core/hre.js +3 -3
- package/dist/src/internal/core/hre.js.map +1 -1
- package/dist/src/internal/core/plugins/resolve-plugin-list.js +1 -1
- package/dist/src/internal/core/plugins/resolve-plugin-list.js.map +1 -1
- package/dist/src/internal/core/tasks/resolved-task.js +4 -4
- package/dist/src/internal/core/tasks/resolved-task.js.map +1 -1
- package/dist/src/internal/core/user-interruptions.js +9 -9
- package/dist/src/internal/core/user-interruptions.js.map +1 -1
- package/dist/src/internal/hre-initialization.js +1 -1
- package/dist/src/internal/hre-initialization.js.map +1 -1
- package/package.json +4 -4
- package/src/internal/builtin-plugins/artifacts/artifact-manager.ts +1 -1
- package/src/internal/builtin-plugins/artifacts/hook-handlers/hre.ts +16 -10
- package/src/internal/builtin-plugins/clean/index.ts +1 -1
- package/src/internal/builtin-plugins/console/index.ts +1 -1
- package/src/internal/builtin-plugins/coverage/hook-handlers/solidity.ts +2 -2
- package/src/internal/builtin-plugins/flatten/index.ts +1 -1
- package/src/internal/builtin-plugins/gas-analytics/index.ts +4 -2
- package/src/internal/builtin-plugins/network-manager/edr/edr-provider.ts +4 -4
- package/src/internal/builtin-plugins/network-manager/edr/genesis-state.ts +1 -1
- package/src/internal/builtin-plugins/network-manager/edr/utils/convert-to-edr.ts +1 -1
- package/src/internal/builtin-plugins/network-manager/hook-handlers/hre.ts +4 -4
- package/src/internal/builtin-plugins/network-manager/hook-handlers/network.ts +2 -2
- package/src/internal/builtin-plugins/network-manager/http-provider.ts +6 -2
- package/src/internal/builtin-plugins/network-manager/network-manager.ts +11 -7
- package/src/internal/builtin-plugins/node/helpers.ts +1 -1
- package/src/internal/builtin-plugins/node/index.ts +1 -1
- package/src/internal/builtin-plugins/run/index.ts +1 -1
- package/src/internal/builtin-plugins/solidity/build-system/build-system.ts +21 -12
- package/src/internal/builtin-plugins/solidity/build-system/compilation-job.ts +1 -1
- package/src/internal/builtin-plugins/solidity/build-system/compiler/downloader.ts +4 -4
- package/src/internal/builtin-plugins/solidity/build-system/compiler/index.ts +2 -2
- package/src/internal/builtin-plugins/solidity/build-system/compiler/solcjs-runner.ts +1 -1
- package/src/internal/builtin-plugins/solidity/build-system/dependency-graph-building.ts +1 -1
- package/src/internal/builtin-plugins/solidity/build-system/read-source-file.ts +2 -2
- package/src/internal/builtin-plugins/solidity/build-system/resolver/dependency-resolver.ts +11 -11
- package/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.ts +1 -1
- package/src/internal/builtin-plugins/solidity/hook-handlers/config.ts +1 -1
- package/src/internal/builtin-plugins/solidity/hook-handlers/hre.ts +14 -10
- package/src/internal/builtin-plugins/solidity/index.ts +1 -1
- package/src/internal/builtin-plugins/solidity/solidity-hooks.ts +1 -1
- package/src/internal/builtin-plugins/solidity/tasks/build.ts +4 -4
- package/src/internal/builtin-plugins/solidity-test/edr-artifacts.ts +2 -2
- package/src/internal/builtin-plugins/solidity-test/hook-handlers/config.ts +1 -1
- package/src/internal/builtin-plugins/solidity-test/hook-handlers/test.ts +1 -1
- package/src/internal/builtin-plugins/solidity-test/index.ts +1 -1
- package/src/internal/builtin-plugins/solidity-test/reporter.ts +1 -1
- package/src/internal/builtin-plugins/telemetry/index.ts +1 -1
- package/src/internal/builtin-plugins/test/hook-handlers/config.ts +1 -1
- package/src/internal/builtin-plugins/test/index.ts +1 -1
- package/src/internal/cli/init/init.ts +1 -1
- package/src/internal/cli/main.ts +5 -3
- package/src/internal/cli/node-version.ts +3 -0
- package/src/internal/cli/telemetry/analytics/analytics.ts +2 -2
- package/src/internal/cli/telemetry/error-reporter/global-error-handlers.ts +64 -0
- package/src/internal/cli/telemetry/error-reporter/reporter.ts +49 -0
- package/src/internal/cli/telemetry/sentry/anonymizer.ts +1 -1
- package/src/internal/cli/telemetry/sentry/init.ts +2 -62
- package/src/internal/cli/telemetry/sentry/reporter.ts +27 -15
- package/src/internal/cli/telemetry/sentry/transport.ts +1 -1
- package/src/internal/cli/telemetry/telemetry-permissions.ts +1 -1
- package/src/internal/config-loading.ts +3 -3
- package/src/internal/core/configuration-variables.ts +19 -18
- package/src/internal/core/hook-manager.ts +3 -3
- package/src/internal/core/hre.ts +5 -3
- package/src/internal/core/plugins/resolve-plugin-list.ts +1 -1
- package/src/internal/core/tasks/resolved-task.ts +4 -4
- package/src/internal/core/user-interruptions.ts +9 -9
- package/src/internal/hre-initialization.ts +1 -1
- package/templates/hardhat-3/01-node-test-runner-viem/package.json +10 -10
- package/templates/hardhat-3/02-mocha-ethers/package.json +13 -13
- package/templates/hardhat-3/03-minimal/package.json +1 -1
|
@@ -19,15 +19,16 @@ const log = debug("hardhat:cli:telemetry:sentry:reporter");
|
|
|
19
19
|
export const SENTRY_DSN =
|
|
20
20
|
"https://572b03708e298427cc72fc26dac1e8b2@o385026.ingest.us.sentry.io/4508780138856448"; // PROD
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Use packages/hardhat/src/internal/cli/telemetry/error-reporter/reporter.ts
|
|
24
|
+
* instead.
|
|
25
|
+
*/
|
|
26
|
+
export async function sendErrorTelemetry(
|
|
27
|
+
error: Error,
|
|
28
|
+
hint?: { unhandled?: boolean; mechanismType?: string },
|
|
29
|
+
): Promise<boolean> {
|
|
29
30
|
const instance = await Reporter.getInstance();
|
|
30
|
-
return instance.reportErrorViaSubprocess(error);
|
|
31
|
+
return await instance.reportErrorViaSubprocess(error, hint);
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
export function setCliHardhatConfigPath(configPath: string): void {
|
|
@@ -57,9 +58,7 @@ class Reporter {
|
|
|
57
58
|
this.#hardhatConfigPath = configPath;
|
|
58
59
|
}
|
|
59
60
|
|
|
60
|
-
public static async getInstance(
|
|
61
|
-
shouldSetupErrorHandlers = false,
|
|
62
|
-
): Promise<Reporter> {
|
|
61
|
+
public static async getInstance(): Promise<Reporter> {
|
|
63
62
|
if (this.#instance !== undefined) {
|
|
64
63
|
return this.#instance;
|
|
65
64
|
}
|
|
@@ -94,7 +93,6 @@ class Reporter {
|
|
|
94
93
|
),
|
|
95
94
|
release,
|
|
96
95
|
environment,
|
|
97
|
-
installGlobalHandlers: shouldSetupErrorHandlers,
|
|
98
96
|
});
|
|
99
97
|
|
|
100
98
|
setExtra("nodeVersion", process.version);
|
|
@@ -108,17 +106,31 @@ class Reporter {
|
|
|
108
106
|
this.#instance = undefined;
|
|
109
107
|
}
|
|
110
108
|
|
|
111
|
-
public async reportErrorViaSubprocess(
|
|
109
|
+
public async reportErrorViaSubprocess(
|
|
110
|
+
error: Error,
|
|
111
|
+
hint?: { unhandled?: boolean; mechanismType?: string },
|
|
112
|
+
): Promise<boolean> {
|
|
112
113
|
if (!(await this.#shouldBeReported(error))) {
|
|
113
114
|
log("Error not send: this type of error should not be reported");
|
|
114
115
|
return false;
|
|
115
116
|
}
|
|
116
117
|
|
|
117
|
-
const { captureException } = await import("@sentry/core");
|
|
118
|
+
const { captureException, flush } = await import("@sentry/core");
|
|
118
119
|
|
|
119
120
|
log("Capturing exception");
|
|
120
121
|
|
|
121
|
-
captureException(
|
|
122
|
+
captureException(
|
|
123
|
+
error,
|
|
124
|
+
hint !== undefined
|
|
125
|
+
? {
|
|
126
|
+
mechanism: {
|
|
127
|
+
type: hint.mechanismType ?? "generic",
|
|
128
|
+
handled: hint.unhandled !== true,
|
|
129
|
+
},
|
|
130
|
+
}
|
|
131
|
+
: undefined,
|
|
132
|
+
);
|
|
133
|
+
await flush();
|
|
122
134
|
|
|
123
135
|
return true;
|
|
124
136
|
}
|
|
@@ -139,7 +139,7 @@ export async function sendEnvelopeToSentryBackend(
|
|
|
139
139
|
dsn: string,
|
|
140
140
|
envelope: Envelope,
|
|
141
141
|
): Promise<TransportMakeRequestResponse> {
|
|
142
|
-
return sendSerializedEnvelopeToSentryBackend(
|
|
142
|
+
return await sendSerializedEnvelopeToSentryBackend(
|
|
143
143
|
dsn,
|
|
144
144
|
serializeEnvelope(envelope),
|
|
145
145
|
);
|
|
@@ -35,7 +35,7 @@ export async function isTelemetryAllowed(
|
|
|
35
35
|
return process.env.HARDHAT_TEST_TELEMETRY_ENABLED === "true" ? true : false;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
return isTelemetryEnabled(telemetryConfigFilePath);
|
|
38
|
+
return await isTelemetryEnabled(telemetryConfigFilePath);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/**
|
|
@@ -34,15 +34,15 @@ export async function resolveHardhatConfigPath(
|
|
|
34
34
|
userProvidedPath?: string,
|
|
35
35
|
): Promise<string> {
|
|
36
36
|
if (userProvidedPath !== undefined) {
|
|
37
|
-
return normalizeConfigPath(userProvidedPath);
|
|
37
|
+
return await normalizeConfigPath(userProvidedPath);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
if (process.env.HARDHAT_CONFIG !== undefined) {
|
|
41
41
|
log("Using config file path from the HARDHAT_CONFIG env var");
|
|
42
|
-
return normalizeConfigPath(process.env.HARDHAT_CONFIG);
|
|
42
|
+
return await normalizeConfigPath(process.env.HARDHAT_CONFIG);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
return findClosestHardhatConfig();
|
|
45
|
+
return await findClosestHardhatConfig();
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
/**
|
|
@@ -118,24 +118,25 @@ export class LazyResolvedConfigurationVariable extends BaseResolvedConfiguration
|
|
|
118
118
|
const mutex = LazyResolvedConfigurationVariable.#mutexes.get(this.#hooks);
|
|
119
119
|
assertHardhatInvariant(mutex !== undefined, "Mutex must be defined");
|
|
120
120
|
|
|
121
|
-
return mutex.exclusiveRun(
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
HardhatError
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
121
|
+
return await mutex.exclusiveRun(
|
|
122
|
+
async () =>
|
|
123
|
+
await this.#hooks.runHandlerChain(
|
|
124
|
+
"configurationVariables",
|
|
125
|
+
"fetchValue",
|
|
126
|
+
[this.#variable],
|
|
127
|
+
async (_context, v) => {
|
|
128
|
+
const value = process.env[v.name];
|
|
129
|
+
|
|
130
|
+
if (typeof value !== "string") {
|
|
131
|
+
throw new HardhatError(
|
|
132
|
+
HardhatError.ERRORS.CORE.GENERAL.ENV_VAR_NOT_FOUND,
|
|
133
|
+
{ name: v.name },
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return value;
|
|
138
|
+
},
|
|
139
|
+
),
|
|
139
140
|
);
|
|
140
141
|
}
|
|
141
142
|
}
|
|
@@ -124,7 +124,7 @@ export class HookManagerImplementation implements HookManager {
|
|
|
124
124
|
return result;
|
|
125
125
|
};
|
|
126
126
|
|
|
127
|
-
return next(...handlerParams);
|
|
127
|
+
return await next(...handlerParams);
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
public async runSequentialHandlers<
|
|
@@ -192,7 +192,7 @@ export class HookManagerImplementation implements HookManager {
|
|
|
192
192
|
handlerParams = params;
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
return Promise.all(
|
|
195
|
+
return await Promise.all(
|
|
196
196
|
handlers.map((handler) => (handler as any)(...handlerParams)),
|
|
197
197
|
);
|
|
198
198
|
}
|
|
@@ -277,7 +277,7 @@ export class HookManagerImplementation implements HookManager {
|
|
|
277
277
|
const categories: Array<
|
|
278
278
|
Partial<HardhatHooks[HookCategoryNameT]> | undefined
|
|
279
279
|
> = await this.#mutex.exclusiveRun(async () => {
|
|
280
|
-
return Promise.all(
|
|
280
|
+
return await Promise.all(
|
|
281
281
|
this.#pluginsInReverseOrder.map(async (plugin) => {
|
|
282
282
|
const existingCategory = this.#staticHookHandlerCategories
|
|
283
283
|
.get(plugin.id)
|
package/src/internal/core/hre.ts
CHANGED
|
@@ -193,7 +193,9 @@ export class HardhatRuntimeEnvironmentImplementation
|
|
|
193
193
|
export async function resolveProjectRoot(
|
|
194
194
|
absolutePathWithinProject: string | undefined,
|
|
195
195
|
): Promise<string> {
|
|
196
|
-
return findClosestPackageRoot(
|
|
196
|
+
return await findClosestPackageRoot(
|
|
197
|
+
absolutePathWithinProject ?? process.cwd(),
|
|
198
|
+
);
|
|
197
199
|
}
|
|
198
200
|
|
|
199
201
|
/**
|
|
@@ -292,7 +294,7 @@ async function runUserConfigExtensions(
|
|
|
292
294
|
hooks: HookManager,
|
|
293
295
|
config: HardhatUserConfig,
|
|
294
296
|
): Promise<HardhatUserConfig> {
|
|
295
|
-
return hooks.runHandlerChain(
|
|
297
|
+
return await hooks.runHandlerChain(
|
|
296
298
|
"config",
|
|
297
299
|
"extendUserConfig",
|
|
298
300
|
[config],
|
|
@@ -320,7 +322,7 @@ async function resolveUserConfig(
|
|
|
320
322
|
paths: resolvePaths(projectRoot, configPath, config.paths),
|
|
321
323
|
} as HardhatConfig;
|
|
322
324
|
|
|
323
|
-
return hooks.runHandlerChain(
|
|
325
|
+
return await hooks.runHandlerChain(
|
|
324
326
|
"config",
|
|
325
327
|
"resolveUserConfig",
|
|
326
328
|
[config, (variable) => resolveConfigurationVariable(hooks, variable)],
|
|
@@ -12,7 +12,7 @@ export async function resolvePluginList(
|
|
|
12
12
|
projectRoot: string,
|
|
13
13
|
userConfigPluginList: HardhatPlugin[] = [],
|
|
14
14
|
): Promise<HardhatPlugin[]> {
|
|
15
|
-
return reverseTopologicalSort(projectRoot, userConfigPluginList);
|
|
15
|
+
return await reverseTopologicalSort(projectRoot, userConfigPluginList);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -175,22 +175,22 @@ export class ResolvedTask implements Task {
|
|
|
175
175
|
if (currentIndex === 0) {
|
|
176
176
|
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions --
|
|
177
177
|
We know that the first action in the array is a NewTaskActionFunction */
|
|
178
|
-
return (actionFn as NewTaskActionFunction)(
|
|
178
|
+
return await (actionFn as NewTaskActionFunction)(
|
|
179
179
|
nextTaskArguments,
|
|
180
180
|
this.#hre,
|
|
181
181
|
);
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
-
return actionFn(
|
|
184
|
+
return await actionFn(
|
|
185
185
|
nextTaskArguments,
|
|
186
186
|
this.#hre,
|
|
187
187
|
async (newTaskArguments: TaskArguments) => {
|
|
188
|
-
return next(newTaskArguments, currentIndex - 1);
|
|
188
|
+
return await next(newTaskArguments, currentIndex - 1);
|
|
189
189
|
},
|
|
190
190
|
);
|
|
191
191
|
};
|
|
192
192
|
|
|
193
|
-
return next(validatedTaskArguments);
|
|
193
|
+
return await next(validatedTaskArguments);
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
/**
|
|
@@ -21,8 +21,8 @@ export class UserInterruptionManagerImplementation
|
|
|
21
21
|
interruptor: string,
|
|
22
22
|
message: string,
|
|
23
23
|
): Promise<void> {
|
|
24
|
-
return this.#mutex.exclusiveRun(async () => {
|
|
25
|
-
return this.#hooks.runHandlerChain(
|
|
24
|
+
return await this.#mutex.exclusiveRun(async () => {
|
|
25
|
+
return await this.#hooks.runHandlerChain(
|
|
26
26
|
"userInterruptions",
|
|
27
27
|
"displayMessage",
|
|
28
28
|
[interruptor, message],
|
|
@@ -35,8 +35,8 @@ export class UserInterruptionManagerImplementation
|
|
|
35
35
|
interruptor: string,
|
|
36
36
|
inputDescription: string,
|
|
37
37
|
): Promise<string> {
|
|
38
|
-
return this.#mutex.exclusiveRun(async () => {
|
|
39
|
-
return this.#hooks.runHandlerChain(
|
|
38
|
+
return await this.#mutex.exclusiveRun(async () => {
|
|
39
|
+
return await this.#hooks.runHandlerChain(
|
|
40
40
|
"userInterruptions",
|
|
41
41
|
"requestInput",
|
|
42
42
|
[interruptor, inputDescription],
|
|
@@ -49,8 +49,8 @@ export class UserInterruptionManagerImplementation
|
|
|
49
49
|
interruptor: string,
|
|
50
50
|
inputDescription: string,
|
|
51
51
|
): Promise<string> {
|
|
52
|
-
return this.#mutex.exclusiveRun(async () => {
|
|
53
|
-
return this.#hooks.runHandlerChain(
|
|
52
|
+
return await this.#mutex.exclusiveRun(async () => {
|
|
53
|
+
return await this.#hooks.runHandlerChain(
|
|
54
54
|
"userInterruptions",
|
|
55
55
|
"requestSecretInput",
|
|
56
56
|
[interruptor, inputDescription],
|
|
@@ -62,7 +62,7 @@ export class UserInterruptionManagerImplementation
|
|
|
62
62
|
public async uninterrupted<ReturnT>(
|
|
63
63
|
f: () => ReturnT,
|
|
64
64
|
): Promise<Awaited<ReturnT>> {
|
|
65
|
-
return this.#mutex.exclusiveRun(f);
|
|
65
|
+
return await this.#mutex.exclusiveRun(f);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
|
|
@@ -84,7 +84,7 @@ async function defaultRequestInput(
|
|
|
84
84
|
output: process.stdout,
|
|
85
85
|
});
|
|
86
86
|
|
|
87
|
-
return new Promise<string>((resolve) => {
|
|
87
|
+
return await new Promise<string>((resolve) => {
|
|
88
88
|
rl.question(
|
|
89
89
|
chalk.blue(`[${interruptor}]`) + ` ${inputDescription}: `,
|
|
90
90
|
(answer) => {
|
|
@@ -138,7 +138,7 @@ async function defaultRequestSecretInput(
|
|
|
138
138
|
}
|
|
139
139
|
};
|
|
140
140
|
|
|
141
|
-
return new Promise<string>((resolve) => {
|
|
141
|
+
return await new Promise<string>((resolve) => {
|
|
142
142
|
rl.question(
|
|
143
143
|
chalk.blue(`[${interruptor}]`) + ` ${inputDescription}: `,
|
|
144
144
|
(answer) => {
|
|
@@ -65,7 +65,7 @@ export async function createHardhatRuntimeEnvironment(
|
|
|
65
65
|
unsafeOptions.globalOptionDefinitions = globalOptionDefinitions;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
return HardhatRuntimeEnvironmentImplementation.create(
|
|
68
|
+
return await HardhatRuntimeEnvironmentImplementation.create(
|
|
69
69
|
config,
|
|
70
70
|
userProvidedGlobalOptions,
|
|
71
71
|
resolvedProjectRoot,
|
|
@@ -5,22 +5,22 @@
|
|
|
5
5
|
"description": "A TypeScript Hardhat project using Node Test Runner and Viem",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"devDependencies": {
|
|
8
|
-
"hardhat": "workspace:^3.4.
|
|
8
|
+
"hardhat": "workspace:^3.4.1",
|
|
9
9
|
"@nomicfoundation/hardhat-toolbox-viem": "workspace:^5.0.4",
|
|
10
|
-
"@nomicfoundation/hardhat-ignition": "workspace:^3.1.
|
|
10
|
+
"@nomicfoundation/hardhat-ignition": "workspace:^3.1.3",
|
|
11
11
|
"@types/node": "^22.8.5",
|
|
12
12
|
"forge-std": "foundry-rs/forge-std#v1.9.4",
|
|
13
13
|
"typescript": "~5.8.0",
|
|
14
14
|
"viem": "^2.47.6"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"@nomicfoundation/hardhat-ignition-viem": "workspace:^3.1.
|
|
18
|
-
"@nomicfoundation/hardhat-keystore": "workspace:^3.0.
|
|
19
|
-
"@nomicfoundation/hardhat-network-helpers": "workspace:^3.0.
|
|
20
|
-
"@nomicfoundation/hardhat-node-test-runner": "workspace:^3.0.
|
|
21
|
-
"@nomicfoundation/hardhat-viem": "workspace:^3.0.
|
|
22
|
-
"@nomicfoundation/hardhat-viem-assertions": "workspace:^3.0.
|
|
23
|
-
"@nomicfoundation/hardhat-verify": "workspace:^3.0.
|
|
24
|
-
"@nomicfoundation/ignition-core": "workspace:^3.1.
|
|
17
|
+
"@nomicfoundation/hardhat-ignition-viem": "workspace:^3.1.3",
|
|
18
|
+
"@nomicfoundation/hardhat-keystore": "workspace:^3.0.7",
|
|
19
|
+
"@nomicfoundation/hardhat-network-helpers": "workspace:^3.0.6",
|
|
20
|
+
"@nomicfoundation/hardhat-node-test-runner": "workspace:^3.0.14",
|
|
21
|
+
"@nomicfoundation/hardhat-viem": "workspace:^3.0.6",
|
|
22
|
+
"@nomicfoundation/hardhat-viem-assertions": "workspace:^3.0.9",
|
|
23
|
+
"@nomicfoundation/hardhat-verify": "workspace:^3.0.15",
|
|
24
|
+
"@nomicfoundation/ignition-core": "workspace:^3.1.3"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
"description": "A TypeScript Hardhat project using Mocha and Ethers.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"devDependencies": {
|
|
8
|
-
"hardhat": "workspace:^3.4.
|
|
8
|
+
"hardhat": "workspace:^3.4.1",
|
|
9
9
|
"@nomicfoundation/hardhat-toolbox-mocha-ethers": "workspace:^3.0.4",
|
|
10
|
-
"@nomicfoundation/hardhat-ethers": "workspace:^4.0.
|
|
11
|
-
"@nomicfoundation/hardhat-ignition": "workspace:^3.1.
|
|
10
|
+
"@nomicfoundation/hardhat-ethers": "workspace:^4.0.9",
|
|
11
|
+
"@nomicfoundation/hardhat-ignition": "workspace:^3.1.3",
|
|
12
12
|
"@types/chai": "^5.2.3",
|
|
13
13
|
"@types/chai-as-promised": "^8.0.1",
|
|
14
14
|
"@types/mocha": ">=10.0.10",
|
|
@@ -20,15 +20,15 @@
|
|
|
20
20
|
"typescript": "~5.8.0"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@nomicfoundation/hardhat-ethers": "workspace:^4.0.
|
|
24
|
-
"@nomicfoundation/hardhat-ethers-chai-matchers": "workspace:^3.0.
|
|
25
|
-
"@nomicfoundation/hardhat-ignition": "workspace:^3.1.
|
|
26
|
-
"@nomicfoundation/hardhat-ignition-ethers": "workspace:^3.1.
|
|
27
|
-
"@nomicfoundation/hardhat-keystore": "workspace:^3.0.
|
|
28
|
-
"@nomicfoundation/hardhat-mocha": "workspace:^3.0.
|
|
29
|
-
"@nomicfoundation/hardhat-network-helpers": "workspace:^3.0.
|
|
30
|
-
"@nomicfoundation/hardhat-typechain": "workspace:^3.0.
|
|
31
|
-
"@nomicfoundation/hardhat-verify": "workspace:^3.0.
|
|
32
|
-
"@nomicfoundation/ignition-core": "workspace:^3.1.
|
|
23
|
+
"@nomicfoundation/hardhat-ethers": "workspace:^4.0.9",
|
|
24
|
+
"@nomicfoundation/hardhat-ethers-chai-matchers": "workspace:^3.0.6",
|
|
25
|
+
"@nomicfoundation/hardhat-ignition": "workspace:^3.1.3",
|
|
26
|
+
"@nomicfoundation/hardhat-ignition-ethers": "workspace:^3.1.3",
|
|
27
|
+
"@nomicfoundation/hardhat-keystore": "workspace:^3.0.7",
|
|
28
|
+
"@nomicfoundation/hardhat-mocha": "workspace:^3.0.17",
|
|
29
|
+
"@nomicfoundation/hardhat-network-helpers": "workspace:^3.0.6",
|
|
30
|
+
"@nomicfoundation/hardhat-typechain": "workspace:^3.0.7",
|
|
31
|
+
"@nomicfoundation/hardhat-verify": "workspace:^3.0.15",
|
|
32
|
+
"@nomicfoundation/ignition-core": "workspace:^3.1.3"
|
|
33
33
|
}
|
|
34
34
|
}
|