hardhat 3.4.0 → 3.4.2
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 +36 -0
- package/dist/src/cli.js +5 -5
- package/dist/src/cli.js.map +1 -1
- package/dist/src/internal/builtin-plugins/artifacts/artifact-manager.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/artifacts/artifact-manager.js +11 -4
- 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/exports.d.ts +1 -1
- package/dist/src/internal/builtin-plugins/coverage/exports.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/exports.js +1 -1
- package/dist/src/internal/builtin-plugins/coverage/exports.js.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/helpers/accessors.d.ts +7 -0
- package/dist/src/internal/builtin-plugins/coverage/helpers/accessors.d.ts.map +1 -0
- package/dist/src/internal/builtin-plugins/coverage/helpers/accessors.js +24 -0
- package/dist/src/internal/builtin-plugins/coverage/helpers/accessors.js.map +1 -0
- package/dist/src/internal/builtin-plugins/coverage/helpers/compat.d.ts +4 -0
- package/dist/src/internal/builtin-plugins/coverage/helpers/compat.d.ts.map +1 -0
- package/dist/src/internal/builtin-plugins/coverage/helpers/compat.js +27 -0
- package/dist/src/internal/builtin-plugins/coverage/helpers/compat.js.map +1 -0
- package/dist/src/internal/builtin-plugins/coverage/hook-handlers/clean.js +1 -1
- package/dist/src/internal/builtin-plugins/coverage/hook-handlers/clean.js.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/hook-handlers/hre.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/hook-handlers/hre.js +18 -15
- package/dist/src/internal/builtin-plugins/coverage/hook-handlers/hre.js.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/hook-handlers/solidity.js +3 -3
- package/dist/src/internal/builtin-plugins/coverage/hook-handlers/solidity.js.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/hook-handlers/test.js +1 -1
- package/dist/src/internal/builtin-plugins/coverage/hook-handlers/test.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/helpers/accessors.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/helpers/accessors.js +10 -4
- package/dist/src/internal/builtin-plugins/gas-analytics/helpers/accessors.js.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/hook-handlers/hre.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/hook-handlers/hre.js +18 -14
- package/dist/src/internal/builtin-plugins/gas-analytics/hook-handlers/hre.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/gas-analytics/snapshot-cheatcodes.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/snapshot-cheatcodes.js +2 -7
- package/dist/src/internal/builtin-plugins/gas-analytics/snapshot-cheatcodes.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/config-resolution.js +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/config-resolution.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/edr-constants.d.ts +14 -0
- package/dist/src/internal/builtin-plugins/network-manager/edr/edr-constants.d.ts.map +1 -0
- package/dist/src/internal/builtin-plugins/network-manager/edr/edr-constants.js +40 -0
- package/dist/src/internal/builtin-plugins/network-manager/edr/edr-constants.js.map +1 -0
- package/dist/src/internal/builtin-plugins/network-manager/edr/edr-provider.d.ts +1 -12
- package/dist/src/internal/builtin-plugins/network-manager/edr/edr-provider.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/edr-provider.js +3 -42
- 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/types/hardfork.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/types/hardfork.js +2 -5
- package/dist/src/internal/builtin-plugins/network-manager/edr/types/hardfork.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/utils/convert-to-edr.js +2 -2
- 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 +2 -2
- 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 +61 -28
- 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 +16 -11
- 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/solidity-test/task-action.js +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/task-action.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/builtin-plugins/test/task-action.js +1 -1
- package/dist/src/internal/builtin-plugins/test/task-action.js.map +1 -1
- package/dist/src/internal/cli/init/init.d.ts.map +1 -1
- package/dist/src/internal/cli/init/init.js +18 -9
- package/dist/src/internal/cli/init/init.js.map +1 -1
- package/dist/src/internal/cli/init/template.d.ts.map +1 -1
- package/dist/src/internal/cli/init/template.js +5 -14
- package/dist/src/internal/cli/init/template.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 +1 -1
- package/dist/src/internal/cli/node-version.d.ts.map +1 -1
- package/dist/src/internal/cli/node-version.js +18 -8
- 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.d.ts.map +1 -1
- package/dist/src/internal/core/hook-manager.js +196 -59
- 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 +5 -5
- package/dist/src/internal/core/hre.js.map +1 -1
- package/dist/src/internal/core/lazy-user-interruptions.d.ts +11 -0
- package/dist/src/internal/core/lazy-user-interruptions.d.ts.map +1 -0
- package/dist/src/internal/core/lazy-user-interruptions.js +39 -0
- package/dist/src/internal/core/lazy-user-interruptions.js.map +1 -0
- 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/cli.ts +5 -5
- package/src/internal/builtin-plugins/artifacts/artifact-manager.ts +13 -6
- 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/exports.ts +1 -1
- package/src/internal/builtin-plugins/coverage/helpers/accessors.ts +44 -0
- package/src/internal/builtin-plugins/coverage/helpers/compat.ts +37 -0
- package/src/internal/builtin-plugins/coverage/hook-handlers/clean.ts +1 -1
- package/src/internal/builtin-plugins/coverage/hook-handlers/hre.ts +26 -16
- package/src/internal/builtin-plugins/coverage/hook-handlers/solidity.ts +3 -3
- package/src/internal/builtin-plugins/coverage/hook-handlers/test.ts +1 -1
- package/src/internal/builtin-plugins/flatten/index.ts +1 -1
- package/src/internal/builtin-plugins/gas-analytics/helpers/accessors.ts +12 -5
- package/src/internal/builtin-plugins/gas-analytics/hook-handlers/hre.ts +29 -17
- package/src/internal/builtin-plugins/gas-analytics/index.ts +4 -2
- package/src/internal/builtin-plugins/gas-analytics/snapshot-cheatcodes.ts +2 -6
- package/src/internal/builtin-plugins/network-manager/config-resolution.ts +1 -1
- package/src/internal/builtin-plugins/network-manager/edr/edr-constants.ts +61 -0
- package/src/internal/builtin-plugins/network-manager/edr/edr-provider.ts +3 -62
- package/src/internal/builtin-plugins/network-manager/edr/genesis-state.ts +1 -1
- package/src/internal/builtin-plugins/network-manager/edr/types/hardfork.ts +3 -9
- package/src/internal/builtin-plugins/network-manager/edr/utils/convert-to-edr.ts +2 -2
- 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 +2 -2
- 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 +84 -49
- 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 +27 -14
- 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/solidity-test/task-action.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/builtin-plugins/test/task-action.ts +1 -1
- package/src/internal/cli/init/init.ts +32 -14
- package/src/internal/cli/init/template.ts +22 -27
- package/src/internal/cli/main.ts +5 -3
- package/src/internal/cli/node-version.ts +21 -10
- 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 +267 -103
- package/src/internal/core/hre.ts +7 -5
- package/src/internal/core/lazy-user-interruptions.ts +75 -0
- 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
- package/dist/src/internal/builtin-plugins/coverage/helpers.d.ts +0 -15
- package/dist/src/internal/builtin-plugins/coverage/helpers.d.ts.map +0 -1
- package/dist/src/internal/builtin-plugins/coverage/helpers.js +0 -35
- package/dist/src/internal/builtin-plugins/coverage/helpers.js.map +0 -1
- package/src/internal/builtin-plugins/coverage/helpers.ts +0 -63
|
@@ -9,22 +9,22 @@ export class UserInterruptionManagerImplementation {
|
|
|
9
9
|
this.#hooks = hooks;
|
|
10
10
|
}
|
|
11
11
|
async displayMessage(interruptor, message) {
|
|
12
|
-
return this.#mutex.exclusiveRun(async () => {
|
|
13
|
-
return this.#hooks.runHandlerChain("userInterruptions", "displayMessage", [interruptor, message], defaultDisplayMessage);
|
|
12
|
+
return await this.#mutex.exclusiveRun(async () => {
|
|
13
|
+
return await this.#hooks.runHandlerChain("userInterruptions", "displayMessage", [interruptor, message], defaultDisplayMessage);
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
async requestInput(interruptor, inputDescription) {
|
|
17
|
-
return this.#mutex.exclusiveRun(async () => {
|
|
18
|
-
return this.#hooks.runHandlerChain("userInterruptions", "requestInput", [interruptor, inputDescription], defaultRequestInput);
|
|
17
|
+
return await this.#mutex.exclusiveRun(async () => {
|
|
18
|
+
return await this.#hooks.runHandlerChain("userInterruptions", "requestInput", [interruptor, inputDescription], defaultRequestInput);
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
async requestSecretInput(interruptor, inputDescription) {
|
|
22
|
-
return this.#mutex.exclusiveRun(async () => {
|
|
23
|
-
return this.#hooks.runHandlerChain("userInterruptions", "requestSecretInput", [interruptor, inputDescription], defaultRequestSecretInput);
|
|
22
|
+
return await this.#mutex.exclusiveRun(async () => {
|
|
23
|
+
return await this.#hooks.runHandlerChain("userInterruptions", "requestSecretInput", [interruptor, inputDescription], defaultRequestSecretInput);
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
async uninterrupted(f) {
|
|
27
|
-
return this.#mutex.exclusiveRun(f);
|
|
27
|
+
return await this.#mutex.exclusiveRun(f);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
async function defaultDisplayMessage(_context, interruptor, message) {
|
|
@@ -35,7 +35,7 @@ async function defaultRequestInput(_context, interruptor, inputDescription) {
|
|
|
35
35
|
input: process.stdin,
|
|
36
36
|
output: process.stdout,
|
|
37
37
|
});
|
|
38
|
-
return new Promise((resolve) => {
|
|
38
|
+
return await new Promise((resolve) => {
|
|
39
39
|
rl.question(chalk.blue(`[${interruptor}]`) + ` ${inputDescription}: `, (answer) => {
|
|
40
40
|
resolve(answer);
|
|
41
41
|
rl.close();
|
|
@@ -72,7 +72,7 @@ async function defaultRequestSecretInput(_context, interruptor, inputDescription
|
|
|
72
72
|
rlAsAny.output.write("*");
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
|
-
return new Promise((resolve) => {
|
|
75
|
+
return await new Promise((resolve) => {
|
|
76
76
|
rl.question(chalk.blue(`[${interruptor}]`) + ` ${inputDescription}: `, (answer) => {
|
|
77
77
|
resolve(answer);
|
|
78
78
|
rl.close();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-interruptions.js","sourceRoot":"","sources":["../../../../src/internal/core/user-interruptions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,gDAAgD,CAAC;AAC5E,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,OAAO,qCAAqC;IAGvC,MAAM,CAAC;IACP,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;IAEnC,YAAY,KAAkB;QAC5B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAEM,KAAK,CAAC,cAAc,CACzB,WAAmB,EACnB,OAAe;QAEf,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,IAAI,EAAE;
|
|
1
|
+
{"version":3,"file":"user-interruptions.js","sourceRoot":"","sources":["../../../../src/internal/core/user-interruptions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,gDAAgD,CAAC;AAC5E,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,OAAO,qCAAqC;IAGvC,MAAM,CAAC;IACP,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;IAEnC,YAAY,KAAkB;QAC5B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAEM,KAAK,CAAC,cAAc,CACzB,WAAmB,EACnB,OAAe;QAEf,OAAO,MAAM,IAAI,CAAC,MAAM,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C,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;gBAC7B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBAC1B,GAAG,GAAG,EAAE,CAAC;YACX,CAAC;QACH,CAAC;QAED,uCAAuC;QACvC,KAAK,MAAM,CAAC,IAAI,GAAG,EAAE,CAAC;YACpB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,MAAM,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,EAAE;QAC3C,EAAE,CAAC,QAAQ,CACT,KAAK,CAAC,IAAI,CAAC,IAAI,WAAW,GAAG,CAAC,GAAG,IAAI,gBAAgB,IAAI,EACzD,CAAC,MAAM,EAAE,EAAE;YACT,OAAO,CAAC,MAAM,CAAC,CAAC;YAChB,EAAE,CAAC,KAAK,EAAE,CAAC;QACb,CAAC,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -33,7 +33,7 @@ export async function createHardhatRuntimeEnvironment(config, userProvidedGlobal
|
|
|
33
33
|
]);
|
|
34
34
|
unsafeOptions.globalOptionDefinitions = globalOptionDefinitions;
|
|
35
35
|
}
|
|
36
|
-
return HardhatRuntimeEnvironmentImplementation.create(config, userProvidedGlobalOptions, resolvedProjectRoot, unsafeOptions);
|
|
36
|
+
return await HardhatRuntimeEnvironmentImplementation.create(config, userProvidedGlobalOptions, resolvedProjectRoot, unsafeOptions);
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
39
|
* Gets the global Hardhat Runtime Environment, or creates it if it doesn't exist.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hre-initialization.js","sourceRoot":"","sources":["../../../src/internal/hre-initialization.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kCAAkC,EAAE,MAAM,6BAA6B,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EACL,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,EACL,kBAAkB,EAClB,uCAAuC,GACxC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EACL,kCAAkC,EAClC,kCAAkC,GACnC,MAAM,0BAA0B,CAAC;AAElC;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,+BAA+B,CACnD,MAAyB,EACzB,4BAAoD,EAAE,EACtD,WAAoB,EACpB,gBAAwD,EAAE;IAE1D,MAAM,mBAAmB,GAAG,MAAM,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAElE,IAAI,aAAa,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;QAChD,MAAM,OAAO,GAAG,CAAC,GAAG,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC;QAE/D,MAAM,eAAe,GAAG,MAAM,iBAAiB,CAC7C,mBAAmB,EACnB,OAAO,CACR,CAAC;QAEF,aAAa,CAAC,eAAe,GAAG,eAAe,CAAC;IAClD,CAAC;IAED,IAAI,aAAa,CAAC,uBAAuB,KAAK,SAAS,EAAE,CAAC;QACxD,MAAM,6BAA6B,GAAG,4BAA4B,CAChE,aAAa,CAAC,eAAe,CAC9B,CAAC;QAEF,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAC;YACtC,GAAG,kCAAkC;YACrC,GAAG,6BAA6B;SACjC,CAAC,CAAC;QAEH,aAAa,CAAC,uBAAuB,GAAG,uBAAuB,CAAC;IAClE,CAAC;IAED,OAAO,uCAAuC,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"hre-initialization.js","sourceRoot":"","sources":["../../../src/internal/hre-initialization.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kCAAk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B,mBAAmB,EACnB,aAAa,CACd,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,0CAA0C;IAC9D,IAAI,SAAS,GAAG,kCAAkC,EAAE,CAAC;IAErD,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,wBAAwB,EAAE,CAAC;IACpD,MAAM,WAAW,GAAG,MAAM,kBAAkB,CAAC,UAAU,CAAC,CAAC;IACzD,MAAM,UAAU,GAAG,MAAM,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAEtD,SAAS,GAAG,MAAM,+BAA+B,CAC/C,UAAU,EACV,EAAE,MAAM,EAAE,UAAU,EAAE,EACtB,WAAW,CACZ,CAAC;IAEF,kCAAkC,CAAC,SAAS,CAAC,CAAC;IAE9C,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hardhat",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.2",
|
|
4
4
|
"description": "Hardhat is an extensible developer tool that helps smart contract developers increase productivity by reliably bringing together the tools they want.",
|
|
5
5
|
"homepage": "https://hardhat.org",
|
|
6
6
|
"repository": {
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"README.md"
|
|
63
63
|
],
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@nomicfoundation/hardhat-node-test-reporter": "^3.0.
|
|
65
|
+
"@nomicfoundation/hardhat-node-test-reporter": "^3.0.5",
|
|
66
66
|
"@types/adm-zip": "^0.5.5",
|
|
67
67
|
"@types/debug": "^4.1.7",
|
|
68
68
|
"@types/node": "^22.0.0",
|
|
@@ -74,12 +74,12 @@
|
|
|
74
74
|
"prettier": "3.2.5",
|
|
75
75
|
"rimraf": "^5.0.5",
|
|
76
76
|
"typescript": "~5.8.0",
|
|
77
|
-
"@nomicfoundation/hardhat-test-utils": "^2.0.
|
|
77
|
+
"@nomicfoundation/hardhat-test-utils": "^2.0.3"
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
80
|
"@nomicfoundation/edr": "0.12.0-next.29",
|
|
81
81
|
"@nomicfoundation/hardhat-errors": "^3.0.11",
|
|
82
|
-
"@nomicfoundation/hardhat-utils": "^4.0.
|
|
82
|
+
"@nomicfoundation/hardhat-utils": "^4.0.5",
|
|
83
83
|
"@nomicfoundation/hardhat-vendored": "^3.0.2",
|
|
84
84
|
"@nomicfoundation/hardhat-zod-utils": "^3.0.4",
|
|
85
85
|
"@nomicfoundation/solidity-analyzer": "^0.1.1",
|
package/src/cli.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { exitIfNodeVersionNotSupported } from "./internal/cli/node-version.js";
|
|
4
4
|
|
|
5
5
|
// We enable the sourcemaps before loading main, so that everything except this
|
|
6
6
|
// small file is loaded with sourcemaps enabled.
|
|
7
7
|
process.setSourceMapsEnabled(true);
|
|
8
8
|
|
|
9
|
-
// We
|
|
10
|
-
// unsupported js syntax or Node API elsewhere, we get to
|
|
11
|
-
// crashing.
|
|
12
|
-
|
|
9
|
+
// We check the Node.js version before loading main, so that if there is some
|
|
10
|
+
// unsupported js syntax or Node API elsewhere, we get to exit with a clear
|
|
11
|
+
// error before crashing.
|
|
12
|
+
exitIfNodeVersionNotSupported();
|
|
13
13
|
|
|
14
14
|
// eslint-disable-next-line no-restricted-syntax -- Allow top-level await here
|
|
15
15
|
const { main } = await import("./internal/cli/main.js");
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
exists,
|
|
16
16
|
getAllFilesMatching,
|
|
17
|
+
readdirOrEmpty,
|
|
17
18
|
readJsonFile,
|
|
18
19
|
} from "@nomicfoundation/hardhat-utils/fs";
|
|
19
20
|
|
|
@@ -57,7 +58,7 @@ export class ArtifactManagerImplementation implements ArtifactManager {
|
|
|
57
58
|
contractNameOrFullyQualifiedName,
|
|
58
59
|
);
|
|
59
60
|
|
|
60
|
-
return readJsonFile(artifactPath);
|
|
61
|
+
return await readJsonFile(artifactPath);
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
public async getArtifactPath(
|
|
@@ -112,12 +113,18 @@ export class ArtifactManagerImplementation implements ArtifactManager {
|
|
|
112
113
|
}
|
|
113
114
|
|
|
114
115
|
public async getAllBuildInfoIds(): Promise<ReadonlySet<string>> {
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
const buildInfosDir = path.join(this.#artifactsPath, BUILD_INFO_DIR_NAME);
|
|
117
|
+
|
|
118
|
+
// The build-info directory is expected to be flat: every build-info file
|
|
119
|
+
// lives directly under it, so a non-recursive `readdir` is enough.
|
|
120
|
+
const buildInfoFiles = await readdirOrEmpty(buildInfosDir);
|
|
121
|
+
|
|
122
|
+
const jsonExtensionLength = ".json".length;
|
|
123
|
+
const buildInfoIds = buildInfoFiles
|
|
124
|
+
.filter((f) => f.endsWith(".json") && !f.endsWith(".output.json"))
|
|
125
|
+
.map((entry) => entry.slice(0, entry.length - jsonExtensionLength));
|
|
119
126
|
|
|
120
|
-
return new Set(
|
|
127
|
+
return new Set(buildInfoIds);
|
|
121
128
|
}
|
|
122
129
|
|
|
123
130
|
public async getBuildInfoPath(
|
|
@@ -20,62 +20,68 @@ class LazyArtifactManager implements ArtifactManager {
|
|
|
20
20
|
contractNameOrFullyQualifiedName: ContractNameT,
|
|
21
21
|
): Promise<GetArtifactByName<ContractNameT>> {
|
|
22
22
|
const artifactManager = await this.#getArtifactManager();
|
|
23
|
-
return artifactManager.readArtifact(contractNameOrFullyQualifiedName);
|
|
23
|
+
return await artifactManager.readArtifact(contractNameOrFullyQualifiedName);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
public async getArtifactPath(
|
|
27
27
|
contractNameOrFullyQualifiedName: string,
|
|
28
28
|
): Promise<string> {
|
|
29
29
|
const artifactManager = await this.#getArtifactManager();
|
|
30
|
-
return artifactManager.getArtifactPath(
|
|
30
|
+
return await artifactManager.getArtifactPath(
|
|
31
|
+
contractNameOrFullyQualifiedName,
|
|
32
|
+
);
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
public async artifactExists(
|
|
34
36
|
contractNameOrFullyQualifiedName: string,
|
|
35
37
|
): Promise<boolean> {
|
|
36
38
|
const artifactManager = await this.#getArtifactManager();
|
|
37
|
-
return artifactManager.artifactExists(
|
|
39
|
+
return await artifactManager.artifactExists(
|
|
40
|
+
contractNameOrFullyQualifiedName,
|
|
41
|
+
);
|
|
38
42
|
}
|
|
39
43
|
|
|
40
44
|
public async getAllFullyQualifiedNames(): Promise<ReadonlySet<string>> {
|
|
41
45
|
const artifactManager = await this.#getArtifactManager();
|
|
42
|
-
return artifactManager.getAllFullyQualifiedNames();
|
|
46
|
+
return await artifactManager.getAllFullyQualifiedNames();
|
|
43
47
|
}
|
|
44
48
|
|
|
45
49
|
public async getAllArtifactPaths(): Promise<ReadonlySet<string>> {
|
|
46
50
|
const artifactManager = await this.#getArtifactManager();
|
|
47
|
-
return artifactManager.getAllArtifactPaths();
|
|
51
|
+
return await artifactManager.getAllArtifactPaths();
|
|
48
52
|
}
|
|
49
53
|
|
|
50
54
|
public async getBuildInfoId(
|
|
51
55
|
contractNameOrFullyQualifiedName: string,
|
|
52
56
|
): Promise<string | undefined> {
|
|
53
57
|
const artifactManager = await this.#getArtifactManager();
|
|
54
|
-
return artifactManager.getBuildInfoId(
|
|
58
|
+
return await artifactManager.getBuildInfoId(
|
|
59
|
+
contractNameOrFullyQualifiedName,
|
|
60
|
+
);
|
|
55
61
|
}
|
|
56
62
|
|
|
57
63
|
public async getAllBuildInfoIds(): Promise<ReadonlySet<string>> {
|
|
58
64
|
const artifactManager = await this.#getArtifactManager();
|
|
59
|
-
return artifactManager.getAllBuildInfoIds();
|
|
65
|
+
return await artifactManager.getAllBuildInfoIds();
|
|
60
66
|
}
|
|
61
67
|
|
|
62
68
|
public async getBuildInfoPath(
|
|
63
69
|
buildInfoId: string,
|
|
64
70
|
): Promise<string | undefined> {
|
|
65
71
|
const artifactManager = await this.#getArtifactManager();
|
|
66
|
-
return artifactManager.getBuildInfoPath(buildInfoId);
|
|
72
|
+
return await artifactManager.getBuildInfoPath(buildInfoId);
|
|
67
73
|
}
|
|
68
74
|
|
|
69
75
|
public async getBuildInfoOutputPath(
|
|
70
76
|
buildInfoId: string,
|
|
71
77
|
): Promise<string | undefined> {
|
|
72
78
|
const artifactManager = await this.#getArtifactManager();
|
|
73
|
-
return artifactManager.getBuildInfoOutputPath(buildInfoId);
|
|
79
|
+
return await artifactManager.getBuildInfoOutputPath(buildInfoId);
|
|
74
80
|
}
|
|
75
81
|
|
|
76
82
|
public async clearCache(): Promise<void> {
|
|
77
83
|
const artifactManager = await this.#getArtifactManager();
|
|
78
|
-
return artifactManager.clearCache();
|
|
84
|
+
return await artifactManager.clearCache();
|
|
79
85
|
}
|
|
80
86
|
|
|
81
87
|
async #getArtifactManager(): Promise<ArtifactManager> {
|
|
@@ -12,7 +12,7 @@ const hardhatPlugin: HardhatPlugin = {
|
|
|
12
12
|
name: "global",
|
|
13
13
|
description: "Clear the global cache",
|
|
14
14
|
})
|
|
15
|
-
.setAction(async () => import("./task-action.js"))
|
|
15
|
+
.setAction(async () => await import("./task-action.js"))
|
|
16
16
|
.build(),
|
|
17
17
|
],
|
|
18
18
|
npmPackage: "hardhat",
|
|
@@ -20,7 +20,7 @@ const hardhatPlugin: HardhatPlugin = {
|
|
|
20
20
|
description: "Commands to run when the console starts",
|
|
21
21
|
defaultValue: [],
|
|
22
22
|
})
|
|
23
|
-
.setAction(async () => import("./task-action.js"))
|
|
23
|
+
.setAction(async () => await import("./task-action.js"))
|
|
24
24
|
.build(),
|
|
25
25
|
],
|
|
26
26
|
dependencies: () => [import("../solidity/index.js")],
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// NOTE: This file is imported from hot paths — the plugin's `created` hook
|
|
2
|
+
// handler and task-actions that may run on every `hardhat test` invocation
|
|
3
|
+
// regardless of whether the feature is enabled. It must stay lightweight:
|
|
4
|
+
// do not add top-level imports that pull in the coverage-manager module
|
|
5
|
+
// graph (chalk, debug, node:crypto, file-system traversal, etc.), or the
|
|
6
|
+
// `--coverage` lazy-load is silently defeated for every caller.
|
|
7
|
+
// If a new helper needs a heavy dependency, put it in a sibling file
|
|
8
|
+
// (e.g. `helpers/utils.ts`) so the accessors file's import cost stays flat.
|
|
9
|
+
|
|
10
|
+
import type { HookContext } from "../../../../types/hooks.js";
|
|
11
|
+
import type { HardhatRuntimeEnvironment } from "../../../../types/hre.js";
|
|
12
|
+
import type { CoverageManager } from "../types.js";
|
|
13
|
+
|
|
14
|
+
import path from "node:path";
|
|
15
|
+
|
|
16
|
+
import { assertHardhatInvariant } from "@nomicfoundation/hardhat-errors";
|
|
17
|
+
|
|
18
|
+
import { HardhatRuntimeEnvironmentImplementation } from "../../../core/hre.js";
|
|
19
|
+
|
|
20
|
+
export function getCoveragePath(rootPath: string): string {
|
|
21
|
+
return path.join(rootPath, "coverage");
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function getCoverageManager(
|
|
25
|
+
hookContextOrHre: HookContext | HardhatRuntimeEnvironment,
|
|
26
|
+
): CoverageManager {
|
|
27
|
+
assertHardhatInvariant(
|
|
28
|
+
hookContextOrHre instanceof HardhatRuntimeEnvironmentImplementation &&
|
|
29
|
+
hookContextOrHre._coverage !== undefined,
|
|
30
|
+
"Expected _coverage to be installed on the HRE",
|
|
31
|
+
);
|
|
32
|
+
return hookContextOrHre._coverage;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function setCoverageManager(
|
|
36
|
+
hre: HardhatRuntimeEnvironment,
|
|
37
|
+
coverageManager: CoverageManager,
|
|
38
|
+
): void {
|
|
39
|
+
assertHardhatInvariant(
|
|
40
|
+
hre instanceof HardhatRuntimeEnvironmentImplementation,
|
|
41
|
+
"Expected HRE to be an instance of HardhatRuntimeEnvironmentImplementation",
|
|
42
|
+
);
|
|
43
|
+
hre._coverage = coverageManager;
|
|
44
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { HardhatRuntimeEnvironment } from "../../../../types/hre.js";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
testRunDone,
|
|
5
|
+
testRunStart,
|
|
6
|
+
testWorkerDone,
|
|
7
|
+
} from "../hook-handlers/test.js";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The following helpers are kept for backward compatibility with older versions
|
|
11
|
+
* of test runner plugins (hardhat-mocha, hardhat-node-test-runner) that import
|
|
12
|
+
* from "hardhat/internal/coverage".
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
let cachedHre: HardhatRuntimeEnvironment | undefined;
|
|
16
|
+
async function getHre(): Promise<HardhatRuntimeEnvironment> {
|
|
17
|
+
if (cachedHre === undefined) {
|
|
18
|
+
const { default: hre } = await import("../../../../index.js");
|
|
19
|
+
cachedHre = hre;
|
|
20
|
+
}
|
|
21
|
+
return cachedHre;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export async function markTestRunStart(id: string): Promise<void> {
|
|
25
|
+
const hre = await getHre();
|
|
26
|
+
await testRunStart(hre, id);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export async function markTestWorkerDone(id: string): Promise<void> {
|
|
30
|
+
const hre = await getHre();
|
|
31
|
+
await testWorkerDone(hre, id);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export async function markTestRunDone(id: string): Promise<void> {
|
|
35
|
+
const hre = await getHre();
|
|
36
|
+
await testRunDone(hre, id);
|
|
37
|
+
}
|
|
@@ -2,7 +2,7 @@ import type { CleanHooks } from "../../../../types/hooks.js";
|
|
|
2
2
|
|
|
3
3
|
import { remove } from "@nomicfoundation/hardhat-utils/fs";
|
|
4
4
|
|
|
5
|
-
import { getCoveragePath } from "../helpers.js";
|
|
5
|
+
import { getCoveragePath } from "../helpers/accessors.js";
|
|
6
6
|
|
|
7
7
|
export default async (): Promise<Partial<CleanHooks>> => ({
|
|
8
8
|
onClean: async (context) => {
|
|
@@ -1,26 +1,36 @@
|
|
|
1
1
|
import type { HardhatRuntimeEnvironmentHooks } from "../../../../types/hooks.js";
|
|
2
|
+
import type { CoverageManagerImplementation as CoverageManagerImplementationT } from "../coverage-manager.js";
|
|
2
3
|
|
|
3
|
-
import {
|
|
4
|
-
|
|
4
|
+
import { getCoveragePath, setCoverageManager } from "../helpers/accessors.js";
|
|
5
|
+
|
|
6
|
+
let CoverageManagerImplementation:
|
|
7
|
+
| typeof CoverageManagerImplementationT
|
|
8
|
+
| undefined;
|
|
5
9
|
|
|
6
10
|
export default async (): Promise<Partial<HardhatRuntimeEnvironmentHooks>> => ({
|
|
7
11
|
created: async (context, hre) => {
|
|
8
|
-
if (context.globalOptions.coverage) {
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
if (!context.globalOptions.coverage) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
11
15
|
|
|
12
|
-
|
|
16
|
+
if (CoverageManagerImplementation === undefined) {
|
|
17
|
+
({ CoverageManagerImplementation } = await import(
|
|
18
|
+
"../coverage-manager.js"
|
|
19
|
+
));
|
|
20
|
+
}
|
|
13
21
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// is enabled or not.
|
|
17
|
-
hre.hooks.registerHandlers("network", {
|
|
18
|
-
onCoverageData: async (_context, coverageData) => {
|
|
19
|
-
await coverageManager.addData(coverageData);
|
|
22
|
+
const coveragePath = getCoveragePath(hre.config.paths.root);
|
|
23
|
+
const coverageManager = new CoverageManagerImplementation(coveragePath);
|
|
20
24
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
setCoverageManager(hre, coverageManager);
|
|
26
|
+
|
|
27
|
+
// NOTE: We register this hook dynamically because we use the information about
|
|
28
|
+
// the existence of onCoverageData hook handlers to determine whether coverage
|
|
29
|
+
// is enabled or not.
|
|
30
|
+
hre.hooks.registerHandlers("network", {
|
|
31
|
+
onCoverageData: async (_context, coverageData) => {
|
|
32
|
+
await coverageManager.addData(coverageData);
|
|
33
|
+
},
|
|
34
|
+
});
|
|
25
35
|
},
|
|
26
36
|
});
|
|
@@ -9,7 +9,7 @@ import { readUtf8File } from "@nomicfoundation/hardhat-utils/fs";
|
|
|
9
9
|
import { findClosestPackageRoot } from "@nomicfoundation/hardhat-utils/package";
|
|
10
10
|
import debug from "debug";
|
|
11
11
|
|
|
12
|
-
import { getCoverageManager } from "../helpers.js";
|
|
12
|
+
import { getCoverageManager } from "../helpers/accessors.js";
|
|
13
13
|
import { instrumentSolidityFileForCompilationJob } from "../instrumentation.js";
|
|
14
14
|
|
|
15
15
|
const log = debug("hardhat:core:coverage:hook-handlers:solidity");
|
|
@@ -94,7 +94,7 @@ export default async (): Promise<Partial<SolidityHooks>> => ({
|
|
|
94
94
|
);
|
|
95
95
|
}
|
|
96
96
|
} else {
|
|
97
|
-
return next(context, sourceName, fsPath, fileContent, solcVersion);
|
|
97
|
+
return await next(context, sourceName, fsPath, fileContent, solcVersion);
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
100
|
preprocessSolcInputBeforeBuilding: async (context, solcInput, next) => {
|
|
@@ -121,6 +121,6 @@ export default async (): Promise<Partial<SolidityHooks>> => ({
|
|
|
121
121
|
solcInput.sources[COVERAGE_LIBRARY_PATH] = { content };
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
return next(context, solcInput);
|
|
124
|
+
return await next(context, solcInput);
|
|
125
125
|
},
|
|
126
126
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { HookContext, TestHooks } from "../../../../types/hooks.js";
|
|
2
2
|
|
|
3
|
-
import { getCoverageManager } from "../helpers.js";
|
|
3
|
+
import { getCoverageManager } from "../helpers/accessors.js";
|
|
4
4
|
|
|
5
5
|
export default async (): Promise<Partial<TestHooks>> => ({
|
|
6
6
|
onTestRunStart: async (context, id, next) => {
|
|
@@ -14,7 +14,7 @@ const hardhatPlugin: HardhatPlugin = {
|
|
|
14
14
|
description: "An optional list of files to flatten",
|
|
15
15
|
type: ArgumentType.FILE,
|
|
16
16
|
})
|
|
17
|
-
.setAction(async () => import("./task-action.js"))
|
|
17
|
+
.setAction(async () => await import("./task-action.js"))
|
|
18
18
|
.build(),
|
|
19
19
|
],
|
|
20
20
|
};
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
// NOTE: This file is imported from hot paths — the plugin's `created` hook
|
|
2
|
+
// handler and task-actions that may run on every `hardhat test` invocation
|
|
3
|
+
// regardless of whether the feature is enabled. It must stay lightweight:
|
|
4
|
+
// do not add top-level imports that pull in the gas-analytics-manager module
|
|
5
|
+
// graph (chalk, debug, node:crypto, file-system traversal, etc.), or the
|
|
6
|
+
// `--gas-stats` lazy-load is silently defeated for every caller.
|
|
7
|
+
// If a new helper needs a heavy dependency, put it in a sibling file
|
|
8
|
+
// (e.g. `helpers/utils.ts`) so the accessors file's import cost stays flat.
|
|
9
|
+
|
|
1
10
|
import type { HookContext } from "../../../../types/hooks.js";
|
|
2
11
|
import type { HardhatRuntimeEnvironment } from "../../../../types/hre.js";
|
|
3
12
|
import type { GasAnalyticsManager } from "../types.js";
|
|
@@ -5,16 +14,14 @@ import type { GasAnalyticsManager } from "../types.js";
|
|
|
5
14
|
import { assertHardhatInvariant } from "@nomicfoundation/hardhat-errors";
|
|
6
15
|
|
|
7
16
|
import { HardhatRuntimeEnvironmentImplementation } from "../../../core/hre.js";
|
|
8
|
-
import { GasAnalyticsManagerImplementation } from "../gas-analytics-manager.js";
|
|
9
17
|
|
|
10
18
|
export function getGasAnalyticsManager(
|
|
11
19
|
hookContextOrHre: HookContext | HardhatRuntimeEnvironment,
|
|
12
20
|
): GasAnalyticsManager {
|
|
13
21
|
assertHardhatInvariant(
|
|
14
|
-
|
|
15
|
-
hookContextOrHre._gasAnalytics
|
|
16
|
-
|
|
17
|
-
"Expected _gasAnalytics to be an instance of GasAnalyticsManagerImplementation",
|
|
22
|
+
hookContextOrHre instanceof HardhatRuntimeEnvironmentImplementation &&
|
|
23
|
+
hookContextOrHre._gasAnalytics !== undefined,
|
|
24
|
+
"Expected _gasAnalytics to be installed on the HRE",
|
|
18
25
|
);
|
|
19
26
|
return hookContextOrHre._gasAnalytics;
|
|
20
27
|
}
|
|
@@ -1,29 +1,41 @@
|
|
|
1
1
|
import type { HardhatRuntimeEnvironmentHooks } from "../../../../types/hooks.js";
|
|
2
|
+
import type { GasAnalyticsManagerImplementation as GasAnalyticsManagerImplementationT } from "../gas-analytics-manager.js";
|
|
2
3
|
|
|
3
|
-
import { GasAnalyticsManagerImplementation } from "../gas-analytics-manager.js";
|
|
4
4
|
import { setGasAnalyticsManager } from "../helpers/accessors.js";
|
|
5
5
|
|
|
6
|
+
let GasAnalyticsManagerImplementation:
|
|
7
|
+
| typeof GasAnalyticsManagerImplementationT
|
|
8
|
+
| undefined;
|
|
9
|
+
|
|
6
10
|
export default async (): Promise<Partial<HardhatRuntimeEnvironmentHooks>> => ({
|
|
7
11
|
created: async (context, hre) => {
|
|
8
12
|
if (
|
|
9
|
-
context.globalOptions.gasStats
|
|
10
|
-
context.globalOptions.gasStatsJson
|
|
13
|
+
!context.globalOptions.gasStats &&
|
|
14
|
+
context.globalOptions.gasStatsJson === undefined
|
|
11
15
|
) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
setGasAnalyticsManager(hre, gasAnalyticsManager);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
hre.hooks.registerHandlers("network", {
|
|
23
|
-
onGasMeasurement: (_context, gasMeasurement) => {
|
|
24
|
-
gasAnalyticsManager.addGasMeasurement(gasMeasurement);
|
|
25
|
-
},
|
|
26
|
-
});
|
|
19
|
+
if (GasAnalyticsManagerImplementation === undefined) {
|
|
20
|
+
({ GasAnalyticsManagerImplementation } = await import(
|
|
21
|
+
"../gas-analytics-manager.js"
|
|
22
|
+
));
|
|
27
23
|
}
|
|
24
|
+
|
|
25
|
+
const gasAnalyticsManager = new GasAnalyticsManagerImplementation(
|
|
26
|
+
hre.config.paths.cache,
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
setGasAnalyticsManager(hre, gasAnalyticsManager);
|
|
30
|
+
|
|
31
|
+
// NOTE: We register this hook dynamically to avoid a circular dependency
|
|
32
|
+
// between gas-analytics and network-manager plugins. The network-manager
|
|
33
|
+
// checks for the existence of onGasReported handlers to determine if gas
|
|
34
|
+
// analytics is enabled, rather than directly checking the global option.
|
|
35
|
+
hre.hooks.registerHandlers("network", {
|
|
36
|
+
onGasMeasurement: (_context, gasMeasurement) => {
|
|
37
|
+
gasAnalyticsManager.addGasMeasurement(gasMeasurement);
|
|
38
|
+
},
|
|
39
|
+
});
|
|
28
40
|
},
|
|
29
41
|
});
|
|
@@ -22,7 +22,7 @@ const hardhatPlugin: HardhatPlugin = {
|
|
|
22
22
|
default: async (args, _hre, runSuper) => {
|
|
23
23
|
// We don't need to do anything here, as the test task will forward
|
|
24
24
|
// the arguments to its subtasks.
|
|
25
|
-
return runSuper(args);
|
|
25
|
+
return await runSuper(args);
|
|
26
26
|
},
|
|
27
27
|
}))
|
|
28
28
|
.build(),
|
|
@@ -35,7 +35,9 @@ const hardhatPlugin: HardhatPlugin = {
|
|
|
35
35
|
name: "snapshotCheck",
|
|
36
36
|
description: "Check the snapshots match the stored values",
|
|
37
37
|
})
|
|
38
|
-
.setAction(
|
|
38
|
+
.setAction(
|
|
39
|
+
async () => await import("./tasks/solidity-test/task-action.js"),
|
|
40
|
+
)
|
|
39
41
|
.build(),
|
|
40
42
|
],
|
|
41
43
|
globalOptions: [
|
|
@@ -7,6 +7,7 @@ import { ensureError } from "@nomicfoundation/hardhat-utils/error";
|
|
|
7
7
|
import {
|
|
8
8
|
FileNotFoundError,
|
|
9
9
|
readdir,
|
|
10
|
+
readdirOrEmpty,
|
|
10
11
|
readJsonFile,
|
|
11
12
|
remove,
|
|
12
13
|
writeJsonFile,
|
|
@@ -116,9 +117,8 @@ async function deleteOrphanedSnapshotFiles(
|
|
|
116
117
|
snapshotsDir: string,
|
|
117
118
|
currentGroups: Set<string>,
|
|
118
119
|
): Promise<void> {
|
|
119
|
-
let dirEntries: string[];
|
|
120
120
|
try {
|
|
121
|
-
dirEntries = await
|
|
121
|
+
const dirEntries = await readdirOrEmpty(snapshotsDir);
|
|
122
122
|
|
|
123
123
|
for (const entry of dirEntries) {
|
|
124
124
|
if (entry.endsWith(".json")) {
|
|
@@ -131,10 +131,6 @@ async function deleteOrphanedSnapshotFiles(
|
|
|
131
131
|
}
|
|
132
132
|
} catch (error) {
|
|
133
133
|
ensureError(error);
|
|
134
|
-
// Directory doesn't exist yet, nothing to clean up
|
|
135
|
-
if (error instanceof FileNotFoundError) {
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
134
|
throw new HardhatError(
|
|
139
135
|
HardhatError.ERRORS.CORE.SOLIDITY_TESTS.SNAPSHOT_WRITE_ERROR,
|
|
140
136
|
{ snapshotsPath: snapshotsDir, error: error.message },
|
|
@@ -36,7 +36,7 @@ import { DEFAULT_CHAIN_DESCRIPTORS } from "./chain-descriptors.js";
|
|
|
36
36
|
import {
|
|
37
37
|
DEFAULT_EDR_NETWORK_HD_ACCOUNTS_CONFIG_PARAMS,
|
|
38
38
|
EDR_NETWORK_DEFAULT_COINBASE,
|
|
39
|
-
} from "./edr/edr-
|
|
39
|
+
} from "./edr/edr-constants.js";
|
|
40
40
|
import { getCurrentHardfork } from "./edr/types/hardfork.js";
|
|
41
41
|
import { isHttpNetworkHdAccountsUserConfig } from "./type-validation.js";
|
|
42
42
|
|