hardhat 3.3.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 +69 -0
- package/dist/src/internal/builtin-plugins/artifacts/artifact-manager.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/artifacts/artifact-manager.js +6 -14
- 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/console/task-action.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/console/task-action.js +2 -1
- package/dist/src/internal/builtin-plugins/console/task-action.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/exports.d.ts +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/exports.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/exports.js +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/exports.js.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/function-gas-snapshots.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/function-gas-snapshots.js +1 -2
- package/dist/src/internal/builtin-plugins/gas-analytics/function-gas-snapshots.js.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/gas-analytics-manager.d.ts +7 -5
- package/dist/src/internal/builtin-plugins/gas-analytics/gas-analytics-manager.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/gas-analytics-manager.js +60 -44
- package/dist/src/internal/builtin-plugins/gas-analytics/gas-analytics-manager.js.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/helpers/accessors.d.ts +6 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/helpers/accessors.d.ts.map +1 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/helpers/accessors.js +14 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/helpers/accessors.js.map +1 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/helpers/compat.d.ts +4 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/helpers/compat.d.ts.map +1 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/helpers/compat.js +27 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/helpers/compat.js.map +1 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/helpers/utils.d.ts +36 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/helpers/utils.d.ts.map +1 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/helpers/utils.js +86 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/helpers/utils.js.map +1 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/hook-handlers/hre.js +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/hook-handlers/hre.js.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/hook-handlers/test.js +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/hook-handlers/test.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 +1 -2
- package/dist/src/internal/builtin-plugins/gas-analytics/snapshot-cheatcodes.js.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/types.d.ts +10 -2
- package/dist/src/internal/builtin-plugins/gas-analytics/types.d.ts.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/stack-traces/solidity-stack-trace.d.ts +4 -4
- package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/solidity-stack-trace.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/solidity-stack-trace.js +2 -2
- package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/solidity-stack-trace.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-solidity-errors.d.ts +6 -3
- package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-solidity-errors.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-solidity-errors.js +23 -5
- package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-solidity-errors.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/utils/convert-to-edr.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/utils/convert-to-edr.js +3 -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.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/hook-handlers/hre.js +24 -2
- 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.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/hook-handlers/network.js +19 -11
- 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 +11 -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 +91 -24
- package/dist/src/internal/builtin-plugins/network-manager/network-manager.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/accounts/hd-wallet-handler.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/accounts/hd-wallet-handler.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/accounts/local-accounts.d.ts +1 -0
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/accounts/local-accounts.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/accounts/local-accounts.js +22 -8
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/accounts/local-accounts.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/accounts/sender.d.ts +2 -0
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/accounts/sender.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/accounts/sender.js +19 -12
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/accounts/sender.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/chain-id/chain-id-handler.d.ts +1 -0
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/chain-id/chain-id-handler.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/chain-id/chain-id-handler.js +9 -3
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/chain-id/chain-id-handler.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/gas/automatic-gas-handler.d.ts +2 -0
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/gas/automatic-gas-handler.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/gas/automatic-gas-handler.js +5 -1
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/gas/automatic-gas-handler.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/gas/automatic-gas-price-handler.d.ts +1 -0
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/gas/automatic-gas-price-handler.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/gas/automatic-gas-price-handler.js +5 -1
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/gas/automatic-gas-price-handler.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/gas/fixed-gas-handler.d.ts +1 -0
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/gas/fixed-gas-handler.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/gas/fixed-gas-handler.js +5 -1
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/gas/fixed-gas-handler.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/gas/fixed-gas-price-handler.d.ts +1 -0
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/gas/fixed-gas-price-handler.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/gas/fixed-gas-price-handler.js +5 -1
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/gas/fixed-gas-price-handler.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/types.d.ts +9 -0
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/types.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/revert-error-code.d.ts +2 -0
- package/dist/src/internal/builtin-plugins/network-manager/revert-error-code.d.ts.map +1 -0
- package/dist/src/internal/builtin-plugins/network-manager/revert-error-code.js +3 -0
- package/dist/src/internal/builtin-plugins/network-manager/revert-error-code.js.map +1 -0
- package/dist/src/internal/builtin-plugins/network-manager/type-extensions/config.d.ts +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/type-extensions/config.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/type-validation.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/type-validation.js +2 -1
- package/dist/src/internal/builtin-plugins/network-manager/type-validation.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/node/json-rpc/handler.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/node/json-rpc/handler.js +8 -2
- package/dist/src/internal/builtin-plugins/node/json-rpc/handler.js.map +1 -1
- package/dist/src/internal/builtin-plugins/node/task-action.js +2 -2
- package/dist/src/internal/builtin-plugins/node/task-action.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/run/task-action.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/run/task-action.js +2 -1
- package/dist/src/internal/builtin-plugins/run/task-action.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/artifacts.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/artifacts.js +3 -0
- package/dist/src/internal/builtin-plugins/solidity/build-system/artifacts.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.d.ts +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 +125 -39
- package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/cache.d.ts +2 -0
- package/dist/src/internal/builtin-plugins/solidity/build-system/cache.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/cache.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/compilation-job.d.ts +3 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/compilation-job.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/compilation-job.js +12 -4
- 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/dependency-graph.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/dependency-graph.js +5 -5
- package/dist/src/internal/builtin-plugins/solidity/build-system/dependency-graph.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/build-system/solc-info.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/solc-info.js +1 -0
- package/dist/src/internal/builtin-plugins/solidity/build-system/solc-info.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/warning-suppression.js +2 -2
- package/dist/src/internal/builtin-plugins/solidity/build-system/warning-suppression.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/config.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/config.js +19 -16
- package/dist/src/internal/builtin-plugins/solidity/config.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/constants.d.ts +3 -0
- package/dist/src/internal/builtin-plugins/solidity/constants.d.ts.map +1 -0
- package/dist/src/internal/builtin-plugins/solidity/constants.js +19 -0
- package/dist/src/internal/builtin-plugins/solidity/constants.js.map +1 -0
- 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.d.ts +1 -1
- package/dist/src/internal/builtin-plugins/solidity/tasks/build.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/tasks/build.js +225 -55
- package/dist/src/internal/builtin-plugins/solidity/tasks/build.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/type-extensions.d.ts +30 -4
- package/dist/src/internal/builtin-plugins/solidity/type-extensions.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/type-extensions.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/config.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/config.js +5 -3
- package/dist/src/internal/builtin-plugins/solidity-test/config.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/helpers.d.ts +0 -2
- package/dist/src/internal/builtin-plugins/solidity-test/helpers.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/helpers.js +0 -3
- package/dist/src/internal/builtin-plugins/solidity-test/helpers.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/runner.d.ts +2 -8
- package/dist/src/internal/builtin-plugins/solidity-test/runner.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/runner.js +47 -50
- package/dist/src/internal/builtin-plugins/solidity-test/runner.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/stack-trace-solidity-errors.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/stack-trace-solidity-errors.js +11 -2
- package/dist/src/internal/builtin-plugins/solidity-test/stack-trace-solidity-errors.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/task-action.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/task-action.js +108 -32
- package/dist/src/internal/builtin-plugins/solidity-test/task-action.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/type-extensions.d.ts +1 -2
- package/dist/src/internal/builtin-plugins/solidity-test/type-extensions.d.ts.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.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/test/task-action.js +3 -4
- package/dist/src/internal/builtin-plugins/test/task-action.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 +12 -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/dist/src/types/artifacts.d.ts +5 -4
- package/dist/src/types/artifacts.d.ts.map +1 -1
- package/dist/src/types/network.d.ts +39 -0
- package/dist/src/types/network.d.ts.map +1 -1
- package/dist/src/types/solidity/build-system.d.ts +66 -3
- package/dist/src/types/solidity/build-system.d.ts.map +1 -1
- package/dist/src/types/solidity/build-system.js.map +1 -1
- package/dist/src/types/solidity/compilation-job.d.ts +6 -0
- package/dist/src/types/solidity/compilation-job.d.ts.map +1 -1
- package/dist/src/types/solidity/solidity-artifacts.d.ts +14 -0
- package/dist/src/types/solidity/solidity-artifacts.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/internal/builtin-plugins/artifacts/artifact-manager.ts +10 -16
- 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/console/task-action.ts +2 -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/exports.ts +1 -1
- package/src/internal/builtin-plugins/gas-analytics/function-gas-snapshots.ts +1 -2
- package/src/internal/builtin-plugins/gas-analytics/gas-analytics-manager.ts +100 -61
- package/src/internal/builtin-plugins/gas-analytics/helpers/accessors.ts +31 -0
- package/src/internal/builtin-plugins/gas-analytics/helpers/compat.ts +37 -0
- package/src/internal/builtin-plugins/gas-analytics/helpers/utils.ts +112 -0
- package/src/internal/builtin-plugins/gas-analytics/hook-handlers/hre.ts +1 -1
- package/src/internal/builtin-plugins/gas-analytics/hook-handlers/test.ts +1 -1
- package/src/internal/builtin-plugins/gas-analytics/index.ts +4 -2
- package/src/internal/builtin-plugins/gas-analytics/snapshot-cheatcodes.ts +1 -2
- package/src/internal/builtin-plugins/gas-analytics/types.ts +11 -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/stack-traces/solidity-stack-trace.ts +4 -0
- package/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-solidity-errors.ts +28 -4
- package/src/internal/builtin-plugins/network-manager/edr/utils/convert-to-edr.ts +3 -2
- package/src/internal/builtin-plugins/network-manager/hook-handlers/hre.ts +31 -2
- package/src/internal/builtin-plugins/network-manager/hook-handlers/network.ts +22 -16
- package/src/internal/builtin-plugins/network-manager/http-provider.ts +6 -2
- package/src/internal/builtin-plugins/network-manager/network-manager.ts +139 -32
- package/src/internal/builtin-plugins/network-manager/request-handlers/handlers/accounts/hd-wallet-handler.ts +1 -0
- package/src/internal/builtin-plugins/network-manager/request-handlers/handlers/accounts/local-accounts.ts +30 -13
- package/src/internal/builtin-plugins/network-manager/request-handlers/handlers/accounts/sender.ts +25 -17
- package/src/internal/builtin-plugins/network-manager/request-handlers/handlers/chain-id/chain-id-handler.ts +13 -5
- package/src/internal/builtin-plugins/network-manager/request-handlers/handlers/gas/automatic-gas-handler.ts +7 -1
- package/src/internal/builtin-plugins/network-manager/request-handlers/handlers/gas/automatic-gas-price-handler.ts +7 -1
- package/src/internal/builtin-plugins/network-manager/request-handlers/handlers/gas/fixed-gas-handler.ts +7 -1
- package/src/internal/builtin-plugins/network-manager/request-handlers/handlers/gas/fixed-gas-price-handler.ts +7 -1
- package/src/internal/builtin-plugins/network-manager/request-handlers/types.ts +10 -0
- package/src/internal/builtin-plugins/network-manager/revert-error-code.ts +2 -0
- package/src/internal/builtin-plugins/network-manager/type-extensions/config.ts +1 -1
- package/src/internal/builtin-plugins/network-manager/type-validation.ts +5 -1
- 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/node/json-rpc/handler.ts +10 -2
- package/src/internal/builtin-plugins/node/task-action.ts +2 -2
- package/src/internal/builtin-plugins/run/index.ts +1 -1
- package/src/internal/builtin-plugins/run/task-action.ts +2 -1
- package/src/internal/builtin-plugins/solidity/build-system/artifacts.ts +3 -0
- package/src/internal/builtin-plugins/solidity/build-system/build-system.ts +176 -45
- package/src/internal/builtin-plugins/solidity/build-system/cache.ts +2 -0
- package/src/internal/builtin-plugins/solidity/build-system/compilation-job.ts +16 -10
- 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/dependency-graph.ts +9 -7
- 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/build-system/solc-info.ts +1 -0
- package/src/internal/builtin-plugins/solidity/build-system/warning-suppression.ts +2 -2
- package/src/internal/builtin-plugins/solidity/config.ts +23 -13
- package/src/internal/builtin-plugins/solidity/constants.ts +21 -0
- 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 +359 -74
- package/src/internal/builtin-plugins/solidity/type-extensions.ts +38 -8
- package/src/internal/builtin-plugins/solidity-test/config.ts +11 -2
- package/src/internal/builtin-plugins/solidity-test/edr-artifacts.ts +2 -2
- package/src/internal/builtin-plugins/solidity-test/helpers.ts +0 -7
- 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/runner.ts +64 -83
- package/src/internal/builtin-plugins/solidity-test/stack-trace-solidity-errors.ts +15 -2
- package/src/internal/builtin-plugins/solidity-test/task-action.ts +161 -43
- package/src/internal/builtin-plugins/solidity-test/type-extensions.ts +1 -2
- 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 +3 -4
- package/src/internal/cli/init/init.ts +1 -1
- package/src/internal/cli/main.ts +19 -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/src/types/artifacts.ts +5 -4
- package/src/types/network.ts +48 -0
- package/src/types/solidity/build-system.ts +66 -3
- package/src/types/solidity/compilation-job.ts +7 -0
- package/src/types/solidity/solidity-artifacts.ts +16 -0
- package/templates/hardhat-2/04-mocha-viem-ts/package.json +1 -1
- package/templates/hardhat-3/01-node-test-runner-viem/gitignore +11 -0
- package/templates/hardhat-3/01-node-test-runner-viem/package.json +12 -12
- package/templates/hardhat-3/01-node-test-runner-viem/scripts/send-op-tx.ts +1 -1
- package/templates/hardhat-3/01-node-test-runner-viem/test/Counter.ts +1 -1
- package/templates/hardhat-3/02-mocha-ethers/gitignore +11 -0
- package/templates/hardhat-3/02-mocha-ethers/package.json +14 -14
- package/templates/hardhat-3/02-mocha-ethers/scripts/send-op-tx.ts +1 -1
- package/templates/hardhat-3/02-mocha-ethers/test/Counter.ts +1 -1
- package/templates/hardhat-3/03-minimal/gitignore +11 -0
- package/templates/hardhat-3/03-minimal/package.json +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/helpers.d.ts +0 -14
- package/dist/src/internal/builtin-plugins/gas-analytics/helpers.d.ts.map +0 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/helpers.js +0 -55
- package/dist/src/internal/builtin-plugins/gas-analytics/helpers.js.map +0 -1
- package/src/internal/builtin-plugins/gas-analytics/helpers.ts +0 -96
|
@@ -14,16 +14,22 @@ import { getRequestParams } from "../../../json-rpc.js";
|
|
|
14
14
|
* For `eth_sendTransaction` requests, it sets the gasPrice field with the value provided via the class constructor, if it hasn't been specified already.
|
|
15
15
|
*/
|
|
16
16
|
export class FixedGasPriceHandler implements RequestHandler {
|
|
17
|
+
readonly #methods: ReadonlySet<string> = new Set(["eth_sendTransaction"]);
|
|
18
|
+
|
|
17
19
|
readonly #gasPrice: PrefixedHexString;
|
|
18
20
|
|
|
19
21
|
constructor(gasPrice: PrefixedHexString) {
|
|
20
22
|
this.#gasPrice = gasPrice;
|
|
21
23
|
}
|
|
22
24
|
|
|
25
|
+
public isSupportedMethod(jsonRpcRequest: JsonRpcRequest): boolean {
|
|
26
|
+
return this.#methods.has(jsonRpcRequest.method);
|
|
27
|
+
}
|
|
28
|
+
|
|
23
29
|
public async handle(
|
|
24
30
|
jsonRpcRequest: JsonRpcRequest,
|
|
25
31
|
): Promise<JsonRpcRequest | JsonRpcResponse> {
|
|
26
|
-
if (jsonRpcRequest
|
|
32
|
+
if (!this.isSupportedMethod(jsonRpcRequest)) {
|
|
27
33
|
return jsonRpcRequest;
|
|
28
34
|
}
|
|
29
35
|
|
|
@@ -14,6 +14,16 @@ import type {
|
|
|
14
14
|
*
|
|
15
15
|
*/
|
|
16
16
|
export interface RequestHandler {
|
|
17
|
+
/**
|
|
18
|
+
* A guard to ensure the request is supported by the handler.
|
|
19
|
+
* If the handler does not support the request, then it can be safely
|
|
20
|
+
* skipped.
|
|
21
|
+
*
|
|
22
|
+
* @param jsonRpcRequest - The JSON-RPC request to check.
|
|
23
|
+
* @returns true if the method will be processed by the handler, false otherwise.
|
|
24
|
+
*/
|
|
25
|
+
isSupportedMethod(jsonRpcRequest: JsonRpcRequest): boolean;
|
|
26
|
+
|
|
17
27
|
handle(
|
|
18
28
|
jsonRpcRequest: JsonRpcRequest,
|
|
19
29
|
): Promise<JsonRpcRequest | JsonRpcResponse>;
|
|
@@ -147,7 +147,7 @@ declare module "../../../../types/config.js" {
|
|
|
147
147
|
export interface EdrNetworkForkingUserConfig {
|
|
148
148
|
enabled?: boolean;
|
|
149
149
|
url: SensitiveString;
|
|
150
|
-
blockNumber?: number;
|
|
150
|
+
blockNumber?: number | bigint;
|
|
151
151
|
httpHeaders?: Record<string, string>;
|
|
152
152
|
}
|
|
153
153
|
|
|
@@ -45,6 +45,10 @@ const nonnegativeIntSchema = z.number().int().nonnegative();
|
|
|
45
45
|
const nonnegativeBigIntSchema = z.bigint().nonnegative();
|
|
46
46
|
|
|
47
47
|
const blockNumberSchema = nonnegativeIntSchema;
|
|
48
|
+
const forkingBlockNumberSchema = unionType(
|
|
49
|
+
[z.number().int().nonnegative().safe(), z.bigint().nonnegative()],
|
|
50
|
+
"Expected a nonnegative safe int or a nonnegative bigint",
|
|
51
|
+
);
|
|
48
52
|
const chainIdSchema = nonnegativeIntSchema;
|
|
49
53
|
|
|
50
54
|
const chainTypeUserConfigSchema = unionType(
|
|
@@ -267,7 +271,7 @@ const edrNetworkAccountsUserConfigSchema = conditionalUnionType(
|
|
|
267
271
|
const edrNetworkForkingUserConfigSchema = z.object({
|
|
268
272
|
enabled: z.optional(z.boolean()),
|
|
269
273
|
url: sensitiveUrlSchema,
|
|
270
|
-
blockNumber: z.optional(
|
|
274
|
+
blockNumber: z.optional(forkingBlockNumberSchema),
|
|
271
275
|
httpHeaders: z.optional(z.record(z.string())),
|
|
272
276
|
});
|
|
273
277
|
|
|
@@ -16,7 +16,7 @@ import chalk from "chalk";
|
|
|
16
16
|
// micro-eth-signer is known to be slow to load, so we lazy load it
|
|
17
17
|
let microEthSigner: typeof MicroEthSignerT | undefined;
|
|
18
18
|
|
|
19
|
-
import { sendErrorTelemetry } from "../../cli/telemetry/
|
|
19
|
+
import { sendErrorTelemetry } from "../../cli/telemetry/error-reporter/reporter.js";
|
|
20
20
|
import { isDefaultEdrNetworkHDAccountsConfig } from "../network-manager/edr/edr-provider.js";
|
|
21
21
|
import { normalizeEdrNetworkAccountsConfig } from "../network-manager/edr/utils/convert-to-edr.js";
|
|
22
22
|
|
|
@@ -46,7 +46,7 @@ const hardhatPlugin: HardhatPlugin = {
|
|
|
46
46
|
type: ArgumentType.INT,
|
|
47
47
|
defaultValue: -1,
|
|
48
48
|
})
|
|
49
|
-
.setAction(async () => import("./task-action.js"))
|
|
49
|
+
.setAction(async () => await import("./task-action.js"))
|
|
50
50
|
.build(),
|
|
51
51
|
],
|
|
52
52
|
dependencies: () => [import("../network-manager/index.js")],
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
InvalidRequestError,
|
|
22
22
|
ProviderError,
|
|
23
23
|
} from "../../network-manager/provider-errors.js";
|
|
24
|
+
import { REVERT_ERROR_CODE } from "../../network-manager/revert-error-code.js";
|
|
24
25
|
|
|
25
26
|
export class JsonRpcHandler {
|
|
26
27
|
readonly #provider: EthereumProvider;
|
|
@@ -256,8 +257,15 @@ const _handleError = (error: Error): JsonRpcResponse => {
|
|
|
256
257
|
const txHash = extractTxHash(error);
|
|
257
258
|
const returnData = extractReturnData(error);
|
|
258
259
|
|
|
259
|
-
//
|
|
260
|
-
|
|
260
|
+
// Check if this is a revert error (code 3) matching the geth/anvil convention.
|
|
261
|
+
const isRevertError =
|
|
262
|
+
"code" in error &&
|
|
263
|
+
typeof error.code === "number" &&
|
|
264
|
+
error.code === REVERT_ERROR_CODE;
|
|
265
|
+
|
|
266
|
+
// In case of non-hardhat error that is not a revert, treat it as internal
|
|
267
|
+
// and associate the appropriate error code.
|
|
268
|
+
if (!ProviderError.isProviderError(error) && !isRevertError) {
|
|
261
269
|
error = new InternalError(undefined, error);
|
|
262
270
|
}
|
|
263
271
|
|
|
@@ -106,10 +106,10 @@ const nodeAction: NewTaskActionFunction<NodeActionArguments> = async (
|
|
|
106
106
|
);
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
// NOTE: This is where we initialize the network; the
|
|
109
|
+
// NOTE: This is where we initialize the network; the create method returns
|
|
110
110
|
// a fully resolved networkConfig object which might be useful for display
|
|
111
111
|
const { networkConfig, provider } =
|
|
112
|
-
await hre.network.
|
|
112
|
+
await hre.network.create(connectionParams);
|
|
113
113
|
|
|
114
114
|
assertHardhatInvariant(
|
|
115
115
|
provider instanceof EdrProvider,
|
|
@@ -14,7 +14,7 @@ const hardhatPlugin: HardhatPlugin = {
|
|
|
14
14
|
name: "noCompile",
|
|
15
15
|
description: "Do not compile the project before running the script",
|
|
16
16
|
})
|
|
17
|
-
.setAction(async () => import("./task-action.js"))
|
|
17
|
+
.setAction(async () => await import("./task-action.js"))
|
|
18
18
|
.build(),
|
|
19
19
|
],
|
|
20
20
|
dependencies: () => [import("../solidity/index.js")],
|
|
@@ -25,7 +25,8 @@ const runScriptWithHardhat: NewTaskActionFunction<RunActionArguments> = async (
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
if (!noCompile) {
|
|
28
|
-
|
|
28
|
+
const noTests = hre.config.solidity.splitTestsCompilation;
|
|
29
|
+
await hre.tasks.getTask("build").run({ quiet: true, noTests });
|
|
29
30
|
console.log();
|
|
30
31
|
}
|
|
31
32
|
|
|
@@ -117,6 +117,9 @@ export async function getBuildInfo(
|
|
|
117
117
|
solcVersion: compilationJob.solcConfig.version,
|
|
118
118
|
solcLongVersion: compilationJob.solcLongVersion,
|
|
119
119
|
compilerType,
|
|
120
|
+
...(compilationJob.toolVersions !== undefined
|
|
121
|
+
? { toolVersions: compilationJob.toolVersions }
|
|
122
|
+
: {}),
|
|
120
123
|
userSourceNameMap:
|
|
121
124
|
compilationJob.dependencyGraph.getRootsUserSourceNameMap(),
|
|
122
125
|
input: await compilationJob.getSolcInput(),
|
|
@@ -22,6 +22,7 @@ import type {
|
|
|
22
22
|
CacheHitInfo,
|
|
23
23
|
} from "../../../../types/solidity/build-system.js";
|
|
24
24
|
import type {
|
|
25
|
+
ToolVersions,
|
|
25
26
|
CompilationJob,
|
|
26
27
|
Compiler,
|
|
27
28
|
CompilerOutput,
|
|
@@ -57,6 +58,7 @@ import debug from "debug";
|
|
|
57
58
|
import pMap from "p-map";
|
|
58
59
|
|
|
59
60
|
import { FileBuildResultType } from "../../../../types/solidity/build-system.js";
|
|
61
|
+
import { getHardhatVersion } from "../../../utils/package.js";
|
|
60
62
|
import { DEFAULT_BUILD_PROFILE } from "../build-profiles.js";
|
|
61
63
|
import { getSolcCompilerForConfig } from "../solidity-hooks.js";
|
|
62
64
|
|
|
@@ -153,15 +155,17 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
153
155
|
|
|
154
156
|
public async getScope(fsPath: string): Promise<BuildScope> {
|
|
155
157
|
if (
|
|
156
|
-
fsPath.startsWith(this.#options.solidityTestsPath) &&
|
|
158
|
+
fsPath.startsWith(this.#options.solidityTestsPath + path.sep) &&
|
|
157
159
|
fsPath.endsWith(".sol")
|
|
158
160
|
) {
|
|
159
161
|
return "tests";
|
|
160
162
|
}
|
|
161
163
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
164
|
+
if (fsPath.endsWith(".t.sol")) {
|
|
165
|
+
for (const sourcesPath of this.#options.soliditySourcesPaths) {
|
|
166
|
+
if (fsPath.startsWith(sourcesPath + path.sep)) {
|
|
167
|
+
return "tests";
|
|
168
|
+
}
|
|
165
169
|
}
|
|
166
170
|
}
|
|
167
171
|
|
|
@@ -172,10 +176,13 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
172
176
|
options: { scope?: BuildScope } = {},
|
|
173
177
|
): Promise<string[]> {
|
|
174
178
|
const scope = options.scope ?? "contracts";
|
|
179
|
+
const unified = !this.#options.solidityConfig.splitTestsCompilation;
|
|
180
|
+
|
|
181
|
+
this.#ensureSplitCompilationModeIfTestsScope(scope);
|
|
175
182
|
|
|
176
183
|
switch (scope) {
|
|
177
|
-
case "contracts":
|
|
178
|
-
const
|
|
184
|
+
case "contracts": {
|
|
185
|
+
const localContractFiles = (
|
|
179
186
|
await Promise.all(
|
|
180
187
|
this.#options.soliditySourcesPaths.map((dir) =>
|
|
181
188
|
getAllFilesMatching(
|
|
@@ -191,15 +198,41 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
191
198
|
npmModuleToNpmRootPath,
|
|
192
199
|
);
|
|
193
200
|
|
|
194
|
-
|
|
195
|
-
|
|
201
|
+
if (!unified) {
|
|
202
|
+
return [...localContractFiles, ...npmFilesToBuild];
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// In unified mode, contracts scope returns all roots: contracts,
|
|
206
|
+
// tests, and npm files.
|
|
207
|
+
const testFiles = (
|
|
208
|
+
await Promise.all([
|
|
209
|
+
getAllFilesMatching(this.#options.solidityTestsPath, (f) =>
|
|
210
|
+
f.endsWith(".sol"),
|
|
211
|
+
),
|
|
212
|
+
...this.#options.soliditySourcesPaths.map(async (dir) => {
|
|
213
|
+
return await getAllFilesMatching(dir, (f) =>
|
|
214
|
+
f.endsWith(".t.sol"),
|
|
215
|
+
);
|
|
216
|
+
}),
|
|
217
|
+
])
|
|
218
|
+
).flat(1);
|
|
219
|
+
|
|
220
|
+
// Remove duplicates in case there is an intersection between
|
|
221
|
+
// the tests.solidity paths and the sources paths
|
|
222
|
+
return Array.from(
|
|
223
|
+
new Set([...localContractFiles, ...npmFilesToBuild, ...testFiles]),
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
case "tests": {
|
|
196
227
|
let rootFilePaths = (
|
|
197
228
|
await Promise.all([
|
|
198
229
|
getAllFilesMatching(this.#options.solidityTestsPath, (f) =>
|
|
199
230
|
f.endsWith(".sol"),
|
|
200
231
|
),
|
|
201
232
|
...this.#options.soliditySourcesPaths.map(async (dir) => {
|
|
202
|
-
return getAllFilesMatching(dir, (f) =>
|
|
233
|
+
return await getAllFilesMatching(dir, (f) =>
|
|
234
|
+
f.endsWith(".t.sol"),
|
|
235
|
+
);
|
|
203
236
|
}),
|
|
204
237
|
])
|
|
205
238
|
).flat(1);
|
|
@@ -208,6 +241,7 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
208
241
|
// the tests.solidity paths and the sources paths
|
|
209
242
|
rootFilePaths = Array.from(new Set(rootFilePaths));
|
|
210
243
|
return rootFilePaths;
|
|
244
|
+
}
|
|
211
245
|
}
|
|
212
246
|
}
|
|
213
247
|
|
|
@@ -219,38 +253,42 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
219
253
|
|
|
220
254
|
public async build(
|
|
221
255
|
rootFilePaths: string[],
|
|
222
|
-
|
|
256
|
+
options?: BuildOptions,
|
|
223
257
|
): Promise<CompilationJobCreationError | Map<string, FileBuildResult>> {
|
|
224
|
-
|
|
258
|
+
this.#ensureSplitCompilationModeIfTestsScope(options?.scope);
|
|
259
|
+
|
|
260
|
+
return await this.#hooks.runHandlerChain(
|
|
225
261
|
"solidity",
|
|
226
262
|
"build",
|
|
227
|
-
[rootFilePaths,
|
|
263
|
+
[rootFilePaths, options],
|
|
228
264
|
async (_context, nextRootFilePaths, nextOptions) =>
|
|
229
|
-
this.#build(nextRootFilePaths, nextOptions),
|
|
265
|
+
await this.#build(nextRootFilePaths, nextOptions),
|
|
230
266
|
);
|
|
231
267
|
}
|
|
232
268
|
|
|
233
269
|
async #build(
|
|
234
270
|
rootFilePaths: string[],
|
|
235
|
-
|
|
271
|
+
options?: BuildOptions,
|
|
236
272
|
): Promise<CompilationJobCreationError | Map<string, FileBuildResult>> {
|
|
237
|
-
const
|
|
273
|
+
const resolvedOptions: Required<BuildOptions> = {
|
|
238
274
|
buildProfile: DEFAULT_BUILD_PROFILE,
|
|
239
275
|
concurrency: Math.max(os.cpus().length - 1, 1),
|
|
240
276
|
force: false,
|
|
241
277
|
isolated: false,
|
|
242
278
|
quiet: false,
|
|
243
279
|
scope: "contracts",
|
|
244
|
-
...
|
|
280
|
+
...options,
|
|
245
281
|
};
|
|
246
282
|
|
|
247
|
-
await this.#downloadConfiguredCompilers(
|
|
283
|
+
await this.#downloadConfiguredCompilers(resolvedOptions.quiet);
|
|
248
284
|
|
|
249
|
-
const { buildProfile } = this.#getBuildProfile(
|
|
285
|
+
const { buildProfile } = this.#getBuildProfile(
|
|
286
|
+
resolvedOptions.buildProfile,
|
|
287
|
+
);
|
|
250
288
|
|
|
251
289
|
const compilationJobsResult = await this.getCompilationJobs(
|
|
252
290
|
rootFilePaths,
|
|
253
|
-
|
|
291
|
+
resolvedOptions,
|
|
254
292
|
);
|
|
255
293
|
|
|
256
294
|
if (!compilationJobsResult.success) {
|
|
@@ -258,7 +296,7 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
258
296
|
}
|
|
259
297
|
|
|
260
298
|
const spinner = createSpinner({
|
|
261
|
-
text: `Compiling your Solidity ${
|
|
299
|
+
text: `Compiling your Solidity ${resolvedOptions.scope}...`,
|
|
262
300
|
enabled: true,
|
|
263
301
|
});
|
|
264
302
|
spinner.start();
|
|
@@ -274,8 +312,9 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
274
312
|
// NOTE: We precompute the build ids in parallel here, which are cached
|
|
275
313
|
// internally in each compilation job
|
|
276
314
|
await Promise.all(
|
|
277
|
-
runnableCompilationJobs.map(
|
|
278
|
-
runnableCompilationJob
|
|
315
|
+
runnableCompilationJobs.map(
|
|
316
|
+
async (runnableCompilationJob) =>
|
|
317
|
+
await runnableCompilationJob.getBuildId(),
|
|
279
318
|
),
|
|
280
319
|
);
|
|
281
320
|
|
|
@@ -284,7 +323,7 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
284
323
|
async (runnableCompilationJob) => {
|
|
285
324
|
const { output, compiler } = await this.runCompilationJob(
|
|
286
325
|
runnableCompilationJob,
|
|
287
|
-
|
|
326
|
+
resolvedOptions,
|
|
288
327
|
);
|
|
289
328
|
|
|
290
329
|
return {
|
|
@@ -294,7 +333,7 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
294
333
|
};
|
|
295
334
|
},
|
|
296
335
|
{
|
|
297
|
-
concurrency:
|
|
336
|
+
concurrency: resolvedOptions.concurrency,
|
|
298
337
|
// An error when running the compiler is not a compilation failure, but
|
|
299
338
|
// a fatal failure trying to run it, so we just throw on the first error
|
|
300
339
|
stopOnError: true,
|
|
@@ -319,7 +358,7 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
319
358
|
const emitArtifactsResult = await this.emitArtifacts(
|
|
320
359
|
compilationResult.compilationJob,
|
|
321
360
|
compilationResult.compilerOutput,
|
|
322
|
-
|
|
361
|
+
resolvedOptions,
|
|
323
362
|
);
|
|
324
363
|
|
|
325
364
|
const { artifactsPerFile } = emitArtifactsResult;
|
|
@@ -335,7 +374,7 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
335
374
|
compilationResult,
|
|
336
375
|
emitArtifactsResult,
|
|
337
376
|
buildProfile.isolated,
|
|
338
|
-
|
|
377
|
+
resolvedOptions.scope,
|
|
339
378
|
);
|
|
340
379
|
}),
|
|
341
380
|
);
|
|
@@ -403,10 +442,10 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
403
442
|
});
|
|
404
443
|
}
|
|
405
444
|
|
|
406
|
-
if (!
|
|
445
|
+
if (!resolvedOptions.quiet) {
|
|
407
446
|
if (isSuccessfulBuild) {
|
|
408
447
|
await this.#printCompilationResult(runnableCompilationJobs, {
|
|
409
|
-
scope:
|
|
448
|
+
scope: resolvedOptions.scope,
|
|
410
449
|
});
|
|
411
450
|
}
|
|
412
451
|
}
|
|
@@ -421,6 +460,8 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
421
460
|
rootFilePaths: string[],
|
|
422
461
|
options?: GetCompilationJobsOptions,
|
|
423
462
|
): Promise<CompilationJobCreationError | GetCompilationJobsResult> {
|
|
463
|
+
this.#ensureSplitCompilationModeIfTestsScope(options?.scope);
|
|
464
|
+
|
|
424
465
|
await this.#downloadConfiguredCompilers(options?.quiet);
|
|
425
466
|
|
|
426
467
|
const dependencyGraph = await buildDependencyGraph(
|
|
@@ -436,6 +477,11 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
436
477
|
|
|
437
478
|
log(`Using build profile ${buildProfileName}`);
|
|
438
479
|
|
|
480
|
+
let toolVersions: ToolVersions | undefined;
|
|
481
|
+
if (buildProfile.toolVersionsInBuildInfo === true) {
|
|
482
|
+
toolVersions = { hardhat: await getHardhatVersion() };
|
|
483
|
+
}
|
|
484
|
+
|
|
439
485
|
const solcConfigSelector = new SolcConfigSelector(
|
|
440
486
|
buildProfileName,
|
|
441
487
|
buildProfile,
|
|
@@ -498,7 +544,7 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
498
544
|
"getCompiler",
|
|
499
545
|
[compilerConfig],
|
|
500
546
|
async (_context, cfg) =>
|
|
501
|
-
getSolcCompilerForConfig(cfg, buildProfile.preferWasm),
|
|
547
|
+
await getSolcCompilerForConfig(cfg, buildProfile.preferWasm),
|
|
502
548
|
);
|
|
503
549
|
longVersion = compiler.longVersion;
|
|
504
550
|
longVersionMap.set(compilerConfig.version, longVersion);
|
|
@@ -533,6 +579,7 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
533
579
|
longVersion,
|
|
534
580
|
this.#hooks,
|
|
535
581
|
sharedContentHashes,
|
|
582
|
+
toolVersions,
|
|
536
583
|
);
|
|
537
584
|
|
|
538
585
|
await individualJob.getBuildId(); // precompute
|
|
@@ -584,6 +631,26 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
584
631
|
continue;
|
|
585
632
|
}
|
|
586
633
|
|
|
634
|
+
// Validate output layout: if the cached layout doesn't match the
|
|
635
|
+
// expected layout for the current config, treat it as a miss.
|
|
636
|
+
// Pre-existing cache entries without these fields are also treated
|
|
637
|
+
// as misses.
|
|
638
|
+
const expectedLayout = await this.#getExpectedOutputLayout(
|
|
639
|
+
rootFile,
|
|
640
|
+
options?.scope ?? "contracts",
|
|
641
|
+
);
|
|
642
|
+
|
|
643
|
+
if (
|
|
644
|
+
cacheResult.artifactsDirectory === undefined ||
|
|
645
|
+
cacheResult.emitsTypeDeclarations === undefined ||
|
|
646
|
+
cacheResult.artifactsDirectory !== expectedLayout.artifactsDirectory ||
|
|
647
|
+
cacheResult.emitsTypeDeclarations !==
|
|
648
|
+
expectedLayout.emitsTypeDeclarations
|
|
649
|
+
) {
|
|
650
|
+
rootFilesToCompile.add(rootFile);
|
|
651
|
+
continue;
|
|
652
|
+
}
|
|
653
|
+
|
|
587
654
|
// If any of the emitted files are not present anymore, compile it
|
|
588
655
|
const {
|
|
589
656
|
artifactPaths,
|
|
@@ -687,6 +754,7 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
687
754
|
longVersion,
|
|
688
755
|
this.#hooks,
|
|
689
756
|
sharedContentHashes,
|
|
757
|
+
toolVersions,
|
|
690
758
|
);
|
|
691
759
|
|
|
692
760
|
for (const [userSourceName, root] of subgraph.getRoots().entries()) {
|
|
@@ -742,7 +810,7 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
742
810
|
"getCompiler",
|
|
743
811
|
[runnableCompilationJob.solcConfig],
|
|
744
812
|
async (_context, cfg) =>
|
|
745
|
-
getSolcCompilerForConfig(cfg, buildProfile.preferWasm),
|
|
813
|
+
await getSolcCompilerForConfig(cfg, buildProfile.preferWasm),
|
|
746
814
|
);
|
|
747
815
|
|
|
748
816
|
log(
|
|
@@ -761,7 +829,7 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
761
829
|
"invokeSolc",
|
|
762
830
|
[compiler, input, runnableCompilationJob.solcConfig],
|
|
763
831
|
async (_context, nextCompiler, nextSolcInput) => {
|
|
764
|
-
return nextCompiler.compile(nextSolcInput);
|
|
832
|
+
return await nextCompiler.compile(nextSolcInput);
|
|
765
833
|
},
|
|
766
834
|
);
|
|
767
835
|
|
|
@@ -808,6 +876,10 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
808
876
|
): Promise<EmitArtifactsResult> {
|
|
809
877
|
const scope = options.scope ?? "contracts";
|
|
810
878
|
|
|
879
|
+
this.#ensureSplitCompilationModeIfTestsScope(scope);
|
|
880
|
+
|
|
881
|
+
const unified = !this.#options.solidityConfig.splitTestsCompilation;
|
|
882
|
+
|
|
811
883
|
const artifactsPerFile = new Map<string, string[]>();
|
|
812
884
|
const typeFilePaths = new Map<string, string>();
|
|
813
885
|
const buildId = await runnableCompilationJob.getBuildId();
|
|
@@ -858,8 +930,15 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
858
930
|
|
|
859
931
|
artifactsPerFile.set(formatRootPath(userSourceName, root), paths);
|
|
860
932
|
|
|
861
|
-
//
|
|
862
|
-
|
|
933
|
+
// In split mode, test roots are never part of a "contracts"-scoped pass,
|
|
934
|
+
// so the scope guard below is sufficient. In unified mode, both contract
|
|
935
|
+
// and test roots share the same pass, so we check individually.
|
|
936
|
+
const isTestRoot = unified
|
|
937
|
+
? (await this.getScope(root.fsPath)) === "tests"
|
|
938
|
+
: false;
|
|
939
|
+
|
|
940
|
+
// Write the type declaration file for contract roots only.
|
|
941
|
+
if (scope === "contracts" && !isTestRoot) {
|
|
863
942
|
const artifactsDeclarationFilePath = path.join(
|
|
864
943
|
fileFolder,
|
|
865
944
|
"artifacts.d.ts",
|
|
@@ -954,6 +1033,12 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
954
1033
|
}
|
|
955
1034
|
|
|
956
1035
|
public async getArtifactsDirectory(scope: BuildScope): Promise<string> {
|
|
1036
|
+
// In unified mode, both scopes point to the main artifacts directory
|
|
1037
|
+
// because contract and test artifacts live together.
|
|
1038
|
+
if (!this.#options.solidityConfig.splitTestsCompilation) {
|
|
1039
|
+
return this.#options.artifactsPath;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
957
1042
|
return scope === "contracts"
|
|
958
1043
|
? this.#options.artifactsPath
|
|
959
1044
|
: path.join(this.#options.cachePath, "test-artifacts");
|
|
@@ -963,9 +1048,11 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
963
1048
|
rootFilePaths: string[],
|
|
964
1049
|
options: { scope?: BuildScope } = {},
|
|
965
1050
|
): Promise<void> {
|
|
966
|
-
log(`Cleaning up artifacts`);
|
|
967
|
-
|
|
968
1051
|
const scope = options.scope ?? "contracts";
|
|
1052
|
+
|
|
1053
|
+
this.#ensureSplitCompilationModeIfTestsScope(scope);
|
|
1054
|
+
|
|
1055
|
+
log(`Cleaning up artifacts`);
|
|
969
1056
|
const artifactsDirectory = await this.getArtifactsDirectory(scope);
|
|
970
1057
|
|
|
971
1058
|
const userSourceNames = rootFilePaths.map((rootFilePath) => {
|
|
@@ -1017,7 +1104,7 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
1017
1104
|
|
|
1018
1105
|
// Get all the reachable build info files
|
|
1019
1106
|
const buildInfoFiles = await getAllFilesMatching(buildInfosDir, (f) =>
|
|
1020
|
-
f.startsWith(buildInfosDir),
|
|
1107
|
+
f.startsWith(buildInfosDir + path.sep),
|
|
1021
1108
|
);
|
|
1022
1109
|
|
|
1023
1110
|
for (const buildInfoFile of buildInfoFiles) {
|
|
@@ -1083,7 +1170,7 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
1083
1170
|
preferWasm: false,
|
|
1084
1171
|
});
|
|
1085
1172
|
|
|
1086
|
-
return compiler.compile(buildInfo.input);
|
|
1173
|
+
return await compiler.compile(buildInfo.input);
|
|
1087
1174
|
}
|
|
1088
1175
|
|
|
1089
1176
|
async #downloadConfiguredCompilers(quiet = false): Promise<void> {
|
|
@@ -1118,8 +1205,12 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
1118
1205
|
);
|
|
1119
1206
|
}
|
|
1120
1207
|
|
|
1208
|
+
#isFatalError(error: CompilerOutputError): boolean {
|
|
1209
|
+
return error.type !== "Warning" && error.severity === "error";
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1121
1212
|
#hasCompilationErrors(output: CompilerOutput): boolean {
|
|
1122
|
-
return output.errors?.some((
|
|
1213
|
+
return output.errors?.some((e) => this.#isFatalError(e)) ?? false;
|
|
1123
1214
|
}
|
|
1124
1215
|
|
|
1125
1216
|
/**
|
|
@@ -1141,6 +1232,34 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
1141
1232
|
return `${error.type}: ${error.message}`.replace(/[:\s]*$/g, "").trim();
|
|
1142
1233
|
}
|
|
1143
1234
|
|
|
1235
|
+
async #getExpectedOutputLayout(
|
|
1236
|
+
rootFilePath: string,
|
|
1237
|
+
scope: BuildScope,
|
|
1238
|
+
): Promise<{ artifactsDirectory: string; emitsTypeDeclarations: boolean }> {
|
|
1239
|
+
const artifactsDirectory = await this.getArtifactsDirectory(scope);
|
|
1240
|
+
|
|
1241
|
+
const unified = !this.#options.solidityConfig.splitTestsCompilation;
|
|
1242
|
+
|
|
1243
|
+
// In unified mode, test roots under contracts scope don't emit type
|
|
1244
|
+
// declarations. In split mode, the scope alone determines this.
|
|
1245
|
+
let emitsTypeDeclarations: boolean;
|
|
1246
|
+
if (scope === "contracts") {
|
|
1247
|
+
if (unified) {
|
|
1248
|
+
const parsed = parseRootPath(rootFilePath);
|
|
1249
|
+
const isTestRoot = isNpmParsedRootPath(parsed)
|
|
1250
|
+
? false
|
|
1251
|
+
: (await this.getScope(parsed.fsPath)) === "tests";
|
|
1252
|
+
emitsTypeDeclarations = !isTestRoot;
|
|
1253
|
+
} else {
|
|
1254
|
+
emitsTypeDeclarations = true;
|
|
1255
|
+
}
|
|
1256
|
+
} else {
|
|
1257
|
+
emitsTypeDeclarations = false;
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
return { artifactsDirectory, emitsTypeDeclarations };
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1144
1263
|
async #cacheCompilationResult(
|
|
1145
1264
|
indexedIndividualJobs: Map<string, CompilationJob>,
|
|
1146
1265
|
result: CompilationResult,
|
|
@@ -1169,14 +1288,13 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
1169
1288
|
|
|
1170
1289
|
const typeFilePath = emitArtifactsResult.typeFilePaths.get(rootFilePath);
|
|
1171
1290
|
|
|
1172
|
-
// Type declaration file is not generated for solidity tests
|
|
1173
|
-
assertHardhatInvariant(
|
|
1174
|
-
scope === "tests" || typeFilePath !== undefined,
|
|
1175
|
-
`No type file found on map for contract ${rootFilePath}`,
|
|
1176
|
-
);
|
|
1177
|
-
|
|
1178
1291
|
const jobHash = await individualJob.getBuildId();
|
|
1179
1292
|
|
|
1293
|
+
const expectedLayout = await this.#getExpectedOutputLayout(
|
|
1294
|
+
rootFilePath,
|
|
1295
|
+
scope,
|
|
1296
|
+
);
|
|
1297
|
+
|
|
1180
1298
|
this.#compileCache[rootFilePath] = {
|
|
1181
1299
|
jobHash,
|
|
1182
1300
|
isolated,
|
|
@@ -1186,6 +1304,8 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
1186
1304
|
buildInfoOutputPath: emitArtifactsResult.buildInfoOutputPath,
|
|
1187
1305
|
typeFilePath,
|
|
1188
1306
|
wasm: result.compiler.isSolcJs,
|
|
1307
|
+
artifactsDirectory: expectedLayout.artifactsDirectory,
|
|
1308
|
+
emitsTypeDeclarations: expectedLayout.emitsTypeDeclarations,
|
|
1189
1309
|
};
|
|
1190
1310
|
}
|
|
1191
1311
|
}
|
|
@@ -1203,7 +1323,7 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
1203
1323
|
console.log();
|
|
1204
1324
|
|
|
1205
1325
|
for (const error of filteredErrors) {
|
|
1206
|
-
if (error
|
|
1326
|
+
if (this.#isFatalError(error)) {
|
|
1207
1327
|
const errorMessage: string =
|
|
1208
1328
|
this.#getFormattedInternalCompilerErrorMessage(error) ??
|
|
1209
1329
|
error.formattedMessage ??
|
|
@@ -1332,6 +1452,17 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
1332
1452
|
}
|
|
1333
1453
|
}
|
|
1334
1454
|
}
|
|
1455
|
+
|
|
1456
|
+
#ensureSplitCompilationModeIfTestsScope(scope: BuildScope = "contracts") {
|
|
1457
|
+
if (
|
|
1458
|
+
scope === "tests" &&
|
|
1459
|
+
!this.#options.solidityConfig.splitTestsCompilation
|
|
1460
|
+
) {
|
|
1461
|
+
throw new HardhatError(
|
|
1462
|
+
HardhatError.ERRORS.CORE.SOLIDITY.SPLIT_TESTS_COMPILATION_DISABLED,
|
|
1463
|
+
);
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1335
1466
|
}
|
|
1336
1467
|
|
|
1337
1468
|
function toForwardSlash(str: string): string {
|