hardhat 3.0.13 → 3.0.14

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.
Files changed (38) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.d.ts.map +1 -1
  3. package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.js +80 -78
  4. package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.js.map +1 -1
  5. package/dist/src/internal/builtin-plugins/solidity/tasks/build.d.ts.map +1 -1
  6. package/dist/src/internal/builtin-plugins/solidity/tasks/build.js +27 -6
  7. package/dist/src/internal/builtin-plugins/solidity/tasks/build.js.map +1 -1
  8. package/dist/src/internal/builtin-plugins/solidity-test/helpers.d.ts.map +1 -1
  9. package/dist/src/internal/builtin-plugins/solidity-test/helpers.js +6 -2
  10. package/dist/src/internal/builtin-plugins/solidity-test/helpers.js.map +1 -1
  11. package/dist/src/internal/builtin-plugins/solidity-test/index.d.ts.map +1 -1
  12. package/dist/src/internal/builtin-plugins/solidity-test/index.js +2 -1
  13. package/dist/src/internal/builtin-plugins/solidity-test/index.js.map +1 -1
  14. package/dist/src/internal/builtin-plugins/solidity-test/reporter.d.ts.map +1 -1
  15. package/dist/src/internal/builtin-plugins/solidity-test/reporter.js +2 -0
  16. package/dist/src/internal/builtin-plugins/solidity-test/reporter.js.map +1 -1
  17. package/dist/src/internal/builtin-plugins/solidity-test/task-action.d.ts.map +1 -1
  18. package/dist/src/internal/builtin-plugins/solidity-test/task-action.js +7 -1
  19. package/dist/src/internal/builtin-plugins/solidity-test/task-action.js.map +1 -1
  20. package/dist/src/internal/builtin-plugins/test/index.d.ts.map +1 -1
  21. package/dist/src/internal/builtin-plugins/test/index.js +2 -1
  22. package/dist/src/internal/builtin-plugins/test/index.js.map +1 -1
  23. package/dist/src/internal/constants.d.ts +1 -0
  24. package/dist/src/internal/constants.d.ts.map +1 -1
  25. package/dist/src/internal/constants.js +1 -0
  26. package/dist/src/internal/constants.js.map +1 -1
  27. package/package.json +2 -2
  28. package/src/internal/builtin-plugins/solidity/build-system/build-system.ts +132 -127
  29. package/src/internal/builtin-plugins/solidity/tasks/build.ts +40 -6
  30. package/src/internal/builtin-plugins/solidity-test/helpers.ts +7 -1
  31. package/src/internal/builtin-plugins/solidity-test/index.ts +2 -1
  32. package/src/internal/builtin-plugins/solidity-test/reporter.ts +2 -0
  33. package/src/internal/builtin-plugins/solidity-test/task-action.ts +8 -1
  34. package/src/internal/builtin-plugins/test/index.ts +2 -1
  35. package/src/internal/constants.ts +2 -0
  36. package/templates/hardhat-3/01-node-test-runner-viem/package.json +2 -2
  37. package/templates/hardhat-3/02-mocha-ethers/package.json +2 -2
  38. package/templates/hardhat-3/03-minimal/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"task-action.js","sourceRoot":"","sources":["../../../../../src/internal/builtin-plugins/solidity-test/task-action.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EACL,sBAAsB,EACtB,YAAY,GACb,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAE/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,uCAAuC,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EACL,gBAAgB,IAAI,YAAY,EAChC,kBAAkB,IAAI,gBAAgB,EACtC,eAAe,IAAI,cAAc,GAClC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,gBAAgB,IAAI,YAAY,EAChC,kBAAkB,IAAI,gBAAgB,EACtC,eAAe,IAAI,cA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B,YAAY,CAAC,MAAM,EAAE,0BAA0B,EAAE,SAAS,CAAC,CAC5D,CAAC;IAEJ,MAAM,YAAY,GAAG,kBAAkB,CAAC,IAAI,CAC1C,sBAAsB,CAAC,OAAO,CAAC,MAAM,CAAC,CACvC,CAAC;IAEF,IAAI,CAAC;QACH,sEAAsE;QACtE,iCAAiC;QACjC,MAAM,QAAQ,CAAC,SAAS,CAAC,CAAC;QAE1B,uEAAuE;QACvE,4DAA4D;QAC5D,MAAM,QAAQ,CAAC,YAAY,CAAC,CAAC;IAC/B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACrB,cAAc,GAAG,IAAI,CAAC;IACxB,CAAC;IAED,MAAM,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACnC,MAAM,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAEnC,qDAAqD;IACrD,MAAM,cAAc,CAAC,UAAU,CAAC,CAAC;IACjC,MAAM,cAAc,CAAC,UAAU,CAAC,CAAC;IAEjC,IAAI,gBAAgB,IAAI,cAAc,EAAE,CAAC;QACvC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,CAAC,GAAG,EAAE,CAAC;AAChB,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"task-action.js","sourceRoot":"","sources":["../../../../../src/internal/builtin-plugins/solidity-test/task-action.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EACL,sBAAsB,EACtB,YAAY,GACb,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAE/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,uCAAuC,EAAE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AC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,CAAC,GAAG,EAAE,CAAC;AAChB,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/builtin-plugins/test/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAK/D,OAAO,sBAAsB,CAAC;AAE9B,QAAA,MAAM,aAAa,EAAE,aAsCpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/builtin-plugins/test/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAM/D,OAAO,sBAAsB,CAAC;AAE9B,QAAA,MAAM,aAAa,EAAE,aAsCpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { ArgumentType } from "../../../types/arguments.js";
2
+ import { DEFAULT_VERBOSITY } from "../../constants.js";
2
3
  import { task } from "../../core/config.js";
3
4
  import "./type-extensions.js";
4
5
  const hardhatPlugin = {
@@ -32,7 +33,7 @@ const hardhatPlugin = {
32
33
  name: "verbosity",
33
34
  shortName: "v",
34
35
  description: "Verbosity level of the test output",
35
- defaultValue: 2,
36
+ defaultValue: DEFAULT_VERBOSITY,
36
37
  })
37
38
  .setAction(async () => import("./task-action.js"))
38
39
  .build(),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/builtin-plugins/test/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,OAAO,sBAAsB,CAAC;AAE9B,MAAM,aAAa,GAAkB;IACnC,EAAE,EAAE,cAAc;IAClB,YAAY,EAAE;QACZ,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,2BAA2B,CAAC;KAClD;IACD,KAAK,EAAE;QACL,IAAI,CAAC,MAAM,EAAE,eAAe,CAAC;aAC1B,mBAAmB,CAAC;YACnB,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE,wCAAwC;YACrD,YAAY,EAAE,EAAE;SACjB,CAAC;aACD,SAAS,CAAC;YACT,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE,mDAAmD;YAChE,YAAY,EAAE,IAAI;SACnB,CAAC;aACD,SAAS,CAAC;YACT,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,oDAAoD;YACjE,IAAI,EAAE,YAAY,CAAC,sBAAsB;YACzC,YAAY,EAAE,SAAS;SACxB,CAAC;aACD,OAAO,CAAC;YACP,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE,qDAAqD;SACnE,CAAC;aACD,QAAQ,CAAC;YACR,IAAI,EAAE,WAAW;YACjB,SAAS,EAAE,GAAG;YACd,WAAW,EAAE,oCAAoC;YACjD,YAAY,EAAE,CAAC;SAChB,CAAC;aACD,SAAS,CAAC,KAAK,IAAI,EAAE,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;aACjD,KAAK,EAAE;KACX;IACD,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC;IACpD,UAAU,EAAE,SAAS;CACtB,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/builtin-plugins/test/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,OAAO,sBAAsB,CAAC;AAE9B,MAAM,aAAa,GAAkB;IACnC,EAAE,EAAE,cAAc;IAClB,YAAY,EAAE;QACZ,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,2BAA2B,CAAC;KAClD;IACD,KAAK,EAAE;QACL,IAAI,CAAC,MAAM,EAAE,eAAe,CAAC;aAC1B,mBAAmB,CAAC;YACnB,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE,wCAAwC;YACrD,YAAY,EAAE,EAAE;SACjB,CAAC;aACD,SAAS,CAAC;YACT,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE,mDAAmD;YAChE,YAAY,EAAE,IAAI;SACnB,CAAC;aACD,SAAS,CAAC;YACT,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,oDAAoD;YACjE,IAAI,EAAE,YAAY,CAAC,sBAAsB;YACzC,YAAY,EAAE,SAAS;SACxB,CAAC;aACD,OAAO,CAAC;YACP,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE,qDAAqD;SACnE,CAAC;aACD,QAAQ,CAAC;YACR,IAAI,EAAE,WAAW;YACjB,SAAS,EAAE,GAAG;YACd,WAAW,EAAE,oCAAoC;YACjD,YAAY,EAAE,iBAAiB;SAChC,CAAC;aACD,SAAS,CAAC,KAAK,IAAI,EAAE,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;aACjD,KAAK,EAAE;KACX;IACD,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC;IACpD,UAAU,EAAE,SAAS;CACtB,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -6,4 +6,5 @@ export declare const GENERIC_CHAIN_TYPE = "generic";
6
6
  export declare const L1_CHAIN_TYPE = "l1";
7
7
  export declare const OPTIMISM_CHAIN_TYPE = "op";
8
8
  export declare const DEFAULT_NETWORK_NAME = "default";
9
+ export declare const DEFAULT_VERBOSITY = 2;
9
10
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/internal/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAC9C,eAAO,MAAM,YAAY,YAAY,CAAC;AACtC,eAAO,MAAM,mBAAmB,yBAAyB,CAAC;AAE1D,eAAO,MAAM,iCAAiC,iCAAiC,CAAC;AAEhF,eAAO,MAAM,kBAAkB,YAAY,CAAC;AAC5C,eAAO,MAAM,aAAa,OAAO,CAAC;AAClC,eAAO,MAAM,mBAAmB,OAAO,CAAC;AAExC,eAAO,MAAM,oBAAoB,YAAY,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/internal/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAC9C,eAAO,MAAM,YAAY,YAAY,CAAC;AACtC,eAAO,MAAM,mBAAmB,yBAAyB,CAAC;AAE1D,eAAO,MAAM,iCAAiC,iCAAiC,CAAC;AAEhF,eAAO,MAAM,kBAAkB,YAAY,CAAC;AAC5C,eAAO,MAAM,aAAa,OAAO,CAAC;AAClC,eAAO,MAAM,mBAAmB,OAAO,CAAC;AAExC,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAE9C,eAAO,MAAM,iBAAiB,IAAI,CAAC"}
@@ -6,4 +6,5 @@ export const GENERIC_CHAIN_TYPE = "generic";
6
6
  export const L1_CHAIN_TYPE = "l1";
7
7
  export const OPTIMISM_CHAIN_TYPE = "op";
8
8
  export const DEFAULT_NETWORK_NAME = "default";
9
+ export const DEFAULT_VERBOSITY = 2;
9
10
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/internal/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG,SAAS,CAAC;AAC9C,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC;AACtC,MAAM,CAAC,MAAM,mBAAmB,GAAG,sBAAsB,CAAC;AAE1D,MAAM,CAAC,MAAM,iCAAiC,GAAG,8BAA8B,CAAC;AAEhF,MAAM,CAAC,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAC5C,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC;AAClC,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AAExC,MAAM,CAAC,MAAM,oBAAoB,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/internal/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG,SAAS,CAAC;AAC9C,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC;AACtC,MAAM,CAAC,MAAM,mBAAmB,GAAG,sBAAsB,CAAC;AAE1D,MAAM,CAAC,MAAM,iCAAiC,GAAG,8BAA8B,CAAC;AAEhF,MAAM,CAAC,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAC5C,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC;AAClC,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AAExC,MAAM,CAAC,MAAM,oBAAoB,GAAG,SAAS,CAAC;AAE9C,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hardhat",
3
- "version": "3.0.13",
3
+ "version": "3.0.14",
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://github.com/nomicfoundation/hardhat/tree/v-next/v-next/hardhat",
6
6
  "repository": {
@@ -72,7 +72,7 @@
72
72
  },
73
73
  "dependencies": {
74
74
  "@nomicfoundation/edr": "0.12.0-next.14",
75
- "@nomicfoundation/hardhat-errors": "^3.0.3",
75
+ "@nomicfoundation/hardhat-errors": "^3.0.4",
76
76
  "@nomicfoundation/hardhat-utils": "^3.0.5",
77
77
  "@nomicfoundation/hardhat-zod-utils": "^3.0.1",
78
78
  "@nomicfoundation/solidity-analyzer": "^0.1.1",
@@ -176,15 +176,8 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
176
176
  ..._options,
177
177
  };
178
178
 
179
- const spinner = createSpinner({
180
- text: `Compiling your Solidity ${options.scope}...`,
181
- enabled: true,
182
- });
183
-
184
179
  await this.#downloadConfiguredCompilers(options.quiet);
185
180
 
186
- spinner.start();
187
-
188
181
  const { buildProfile } = this.#getBuildProfile(options.buildProfile);
189
182
 
190
183
  const compilationJobsResult = await this.getCompilationJobs(
@@ -193,161 +186,173 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
193
186
  );
194
187
 
195
188
  if ("reason" in compilationJobsResult) {
196
- spinner.stop();
197
189
  return compilationJobsResult;
198
190
  }
199
191
 
200
- const { compilationJobsPerFile, indexedIndividualJobs } =
201
- compilationJobsResult;
192
+ const spinner = createSpinner({
193
+ text: `Compiling your Solidity ${options.scope}...`,
194
+ enabled: true,
195
+ });
196
+ spinner.start();
202
197
 
203
- const runnableCompilationJobs = [
204
- ...new Set(compilationJobsPerFile.values()),
205
- ];
198
+ try {
199
+ const { compilationJobsPerFile, indexedIndividualJobs } =
200
+ compilationJobsResult;
206
201
 
207
- // NOTE: We precompute the build ids in parallel here, which are cached
208
- // internally in each compilation job
209
- await Promise.all(
210
- runnableCompilationJobs.map(async (runnableCompilationJob) =>
211
- runnableCompilationJob.getBuildId(),
212
- ),
213
- );
202
+ const runnableCompilationJobs = [
203
+ ...new Set(compilationJobsPerFile.values()),
204
+ ];
214
205
 
215
- const results: CompilationResult[] = await pMap(
216
- runnableCompilationJobs,
217
- async (runnableCompilationJob) => {
218
- const { output, compiler } = await this.runCompilationJob(
219
- runnableCompilationJob,
220
- options,
221
- );
206
+ // NOTE: We precompute the build ids in parallel here, which are cached
207
+ // internally in each compilation job
208
+ await Promise.all(
209
+ runnableCompilationJobs.map(async (runnableCompilationJob) =>
210
+ runnableCompilationJob.getBuildId(),
211
+ ),
212
+ );
222
213
 
223
- return {
224
- compilationJob: runnableCompilationJob,
225
- compilerOutput: output,
226
- cached: false,
227
- compiler,
228
- };
229
- },
230
- {
231
- concurrency: options.concurrency,
232
- // An error when running the compiler is not a compilation failure, but
233
- // a fatal failure trying to run it, so we just throw on the first error
234
- stopOnError: true,
235
- },
236
- );
214
+ const results: CompilationResult[] = await pMap(
215
+ runnableCompilationJobs,
216
+ async (runnableCompilationJob) => {
217
+ const { output, compiler } = await this.runCompilationJob(
218
+ runnableCompilationJob,
219
+ options,
220
+ );
237
221
 
238
- const uncachedResults = results.filter((result) => !result.cached);
239
- const uncachedSuccessfulResults = uncachedResults.filter(
240
- (result) => !this.#hasCompilationErrors(result.compilerOutput),
241
- );
222
+ return {
223
+ compilationJob: runnableCompilationJob,
224
+ compilerOutput: output,
225
+ cached: false,
226
+ compiler,
227
+ };
228
+ },
229
+ {
230
+ concurrency: options.concurrency,
231
+ // An error when running the compiler is not a compilation failure, but
232
+ // a fatal failure trying to run it, so we just throw on the first error
233
+ stopOnError: true,
234
+ },
235
+ );
242
236
 
243
- const isSuccessfulBuild =
244
- uncachedResults.length === uncachedSuccessfulResults.length;
237
+ const uncachedResults = results.filter((result) => !result.cached);
238
+ const uncachedSuccessfulResults = uncachedResults.filter(
239
+ (result) => !this.#hasCompilationErrors(result.compilerOutput),
240
+ );
245
241
 
246
- const contractArtifactsGeneratedByCompilationJob: Map<
247
- CompilationJob,
248
- ReadonlyMap<string, string[]>
249
- > = new Map();
242
+ const isSuccessfulBuild =
243
+ uncachedResults.length === uncachedSuccessfulResults.length;
250
244
 
251
- if (isSuccessfulBuild) {
252
- log("Emitting artifacts of successful build");
253
- await Promise.all(
254
- results.map(async (compilationResult) => {
255
- const emitArtifactsResult = await this.emitArtifacts(
256
- compilationResult.compilationJob,
257
- compilationResult.compilerOutput,
258
- options,
259
- );
245
+ const contractArtifactsGeneratedByCompilationJob: Map<
246
+ CompilationJob,
247
+ ReadonlyMap<string, string[]>
248
+ > = new Map();
260
249
 
261
- const { artifactsPerFile } = emitArtifactsResult;
250
+ if (isSuccessfulBuild) {
251
+ log("Emitting artifacts of successful build");
252
+ await Promise.all(
253
+ results.map(async (compilationResult) => {
254
+ const emitArtifactsResult = await this.emitArtifacts(
255
+ compilationResult.compilationJob,
256
+ compilationResult.compilerOutput,
257
+ options,
258
+ );
262
259
 
263
- contractArtifactsGeneratedByCompilationJob.set(
264
- compilationResult.compilationJob,
265
- artifactsPerFile,
266
- );
260
+ const { artifactsPerFile } = emitArtifactsResult;
267
261
 
268
- // Cache the results
269
- await this.#cacheCompilationResult(
270
- indexedIndividualJobs,
271
- compilationResult,
272
- emitArtifactsResult,
273
- buildProfile.isolated,
274
- options.scope,
275
- );
276
- }),
277
- );
262
+ contractArtifactsGeneratedByCompilationJob.set(
263
+ compilationResult.compilationJob,
264
+ artifactsPerFile,
265
+ );
278
266
 
279
- await saveCache(this.#options.cachePath, this.#compileCache);
280
- }
267
+ // Cache the results
268
+ await this.#cacheCompilationResult(
269
+ indexedIndividualJobs,
270
+ compilationResult,
271
+ emitArtifactsResult,
272
+ buildProfile.isolated,
273
+ options.scope,
274
+ );
275
+ }),
276
+ );
281
277
 
282
- const resultsMap: Map<string, FileBuildResult> = new Map();
278
+ await saveCache(this.#options.cachePath, this.#compileCache);
279
+ }
283
280
 
284
- spinner.stop();
281
+ spinner.stop();
285
282
 
286
- for (const result of results) {
287
- const contractArtifactsGenerated = isSuccessfulBuild
288
- ? contractArtifactsGeneratedByCompilationJob.get(result.compilationJob)
289
- : new Map();
283
+ const resultsMap: Map<string, FileBuildResult> = new Map();
290
284
 
291
- assertHardhatInvariant(
292
- contractArtifactsGenerated !== undefined,
293
- "We emitted contract artifacts for all the jobs if the build was successful",
294
- );
285
+ for (const result of results) {
286
+ const contractArtifactsGenerated = isSuccessfulBuild
287
+ ? contractArtifactsGeneratedByCompilationJob.get(
288
+ result.compilationJob,
289
+ )
290
+ : new Map();
295
291
 
296
- const errors = await Promise.all(
297
- (result.compilerOutput.errors ?? []).map((error) =>
298
- this.remapCompilerError(result.compilationJob, error, true),
299
- ),
300
- );
292
+ assertHardhatInvariant(
293
+ contractArtifactsGenerated !== undefined,
294
+ "We emitted contract artifacts for all the jobs if the build was successful",
295
+ );
301
296
 
302
- this.#printSolcErrorsAndWarnings(errors);
303
- const successfulResult = !this.#hasCompilationErrors(
304
- result.compilerOutput,
305
- );
297
+ const errors = await Promise.all(
298
+ (result.compilerOutput.errors ?? []).map((error) =>
299
+ this.remapCompilerError(result.compilationJob, error, true),
300
+ ),
301
+ );
306
302
 
307
- for (const [userSourceName, root] of result.compilationJob.dependencyGraph
308
- .getRoots()
309
- .entries()) {
310
- if (!successfulResult) {
311
- resultsMap.set(formatRootPath(userSourceName, root), {
312
- type: FileBuildResultType.BUILD_FAILURE,
313
- compilationJob: result.compilationJob,
314
- errors,
315
- });
303
+ this.#printSolcErrorsAndWarnings(errors);
304
+ const successfulResult = !this.#hasCompilationErrors(
305
+ result.compilerOutput,
306
+ );
316
307
 
317
- continue;
318
- }
308
+ for (const [
309
+ userSourceName,
310
+ root,
311
+ ] of result.compilationJob.dependencyGraph.getRoots().entries()) {
312
+ if (!successfulResult) {
313
+ resultsMap.set(formatRootPath(userSourceName, root), {
314
+ type: FileBuildResultType.BUILD_FAILURE,
315
+ compilationJob: result.compilationJob,
316
+ errors,
317
+ });
318
+
319
+ continue;
320
+ }
321
+
322
+ if (result.cached) {
323
+ resultsMap.set(formatRootPath(userSourceName, root), {
324
+ type: FileBuildResultType.CACHE_HIT,
325
+ compilationJob: result.compilationJob,
326
+ contractArtifactsGenerated:
327
+ contractArtifactsGenerated.get(userSourceName) ?? [],
328
+ warnings: errors,
329
+ });
330
+
331
+ continue;
332
+ }
319
333
 
320
- if (result.cached) {
321
334
  resultsMap.set(formatRootPath(userSourceName, root), {
322
- type: FileBuildResultType.CACHE_HIT,
335
+ type: FileBuildResultType.BUILD_SUCCESS,
323
336
  compilationJob: result.compilationJob,
324
337
  contractArtifactsGenerated:
325
338
  contractArtifactsGenerated.get(userSourceName) ?? [],
326
339
  warnings: errors,
327
340
  });
328
-
329
- continue;
330
341
  }
331
-
332
- resultsMap.set(formatRootPath(userSourceName, root), {
333
- type: FileBuildResultType.BUILD_SUCCESS,
334
- compilationJob: result.compilationJob,
335
- contractArtifactsGenerated:
336
- contractArtifactsGenerated.get(userSourceName) ?? [],
337
- warnings: errors,
338
- });
339
342
  }
340
- }
341
343
 
342
- if (!options.quiet) {
343
- if (isSuccessfulBuild) {
344
- await this.#printCompilationResult(runnableCompilationJobs, {
345
- scope: options.scope,
346
- });
344
+ if (!options.quiet) {
345
+ if (isSuccessfulBuild) {
346
+ await this.#printCompilationResult(runnableCompilationJobs, {
347
+ scope: options.scope,
348
+ });
349
+ }
347
350
  }
348
- }
349
351
 
350
- return resultsMap;
352
+ return resultsMap;
353
+ } finally {
354
+ spinner.stop();
355
+ }
351
356
  }
352
357
 
353
358
  public async getCompilationJobs(
@@ -2,6 +2,7 @@ import type { HardhatRuntimeEnvironment } from "../../../../types/hre.js";
2
2
  import type { BuildScope } from "../../../../types/solidity.js";
3
3
  import type { NewTaskActionFunction } from "../../../../types/tasks.js";
4
4
 
5
+ import { HardhatError } from "@nomicfoundation/hardhat-errors";
5
6
  import { resolveFromRoot } from "@nomicfoundation/hardhat-utils/path";
6
7
 
7
8
  import { throwIfSolidityBuildFailed } from "../build-results.js";
@@ -20,15 +21,45 @@ const buildAction: NewTaskActionFunction<BuildActionArguments> = async (
20
21
  args: BuildActionArguments,
21
22
  hre,
22
23
  ) => {
23
- const contractRootPaths = [];
24
- const testRootPaths = [];
24
+ let contractRootPaths: string[] = [];
25
+ let testRootPaths: string[] = [];
26
+ const allUsedFiles: string[] = [];
25
27
 
26
28
  if (args.noContracts === false) {
27
- contractRootPaths.push(...(await buildForScope("contracts", args, hre)));
29
+ const { rootPaths, usedFiles } = await buildForScope(
30
+ "contracts",
31
+ args,
32
+ hre,
33
+ );
34
+
35
+ contractRootPaths = rootPaths;
36
+ allUsedFiles.push(...usedFiles);
28
37
  }
29
38
 
30
39
  if (args.noTests === false) {
31
- testRootPaths.push(...(await buildForScope("tests", args, hre)));
40
+ const { rootPaths, usedFiles } = await buildForScope("tests", args, hre);
41
+
42
+ testRootPaths = rootPaths;
43
+ allUsedFiles.push(...usedFiles);
44
+ }
45
+
46
+ // If there's an unused file we fail
47
+ if (args.files.length !== 0) {
48
+ const files = new Set(args.files);
49
+ const usedFiles = new Set(allUsedFiles);
50
+ const unusedFiles = files.difference(usedFiles);
51
+
52
+ if (unusedFiles.size > 0) {
53
+ const list = [...unusedFiles]
54
+ .sort()
55
+ .map((f) => `- ${f}`)
56
+ .join("\n");
57
+
58
+ throw new HardhatError(
59
+ HardhatError.ERRORS.CORE.SOLIDITY.UNRECOGNIZED_FILES_NOT_COMPILED,
60
+ { files: list },
61
+ );
62
+ }
32
63
  }
33
64
 
34
65
  return { contractRootPaths, testRootPaths };
@@ -39,6 +70,8 @@ async function buildForScope(
39
70
  { force, files, quiet, defaultBuildProfile }: BuildActionArguments,
40
71
  { solidity, globalOptions }: HardhatRuntimeEnvironment,
41
72
  ) {
73
+ const usedFiles = [];
74
+
42
75
  // If no specific files are passed, it means a full compilation, i.e. all source files
43
76
  const isFullCompilation = files.length === 0;
44
77
 
@@ -58,12 +91,13 @@ async function buildForScope(
58
91
  continue;
59
92
  }
60
93
 
94
+ usedFiles.push(file);
61
95
  rootPaths.push(rootPath);
62
96
  }
63
97
 
64
98
  // If a file list has been passed but none match this scope, we don't run the build
65
99
  if (rootPaths.length === 0) {
66
- return [];
100
+ return { rootPaths, usedFiles };
67
101
  }
68
102
  }
69
103
 
@@ -83,7 +117,7 @@ async function buildForScope(
83
117
  await solidity.cleanupArtifacts(rootPaths, { scope });
84
118
  }
85
119
 
86
- return rootPaths;
120
+ return { rootPaths, usedFiles };
87
121
  }
88
122
 
89
123
  export default buildAction;
@@ -16,11 +16,12 @@ import {
16
16
  l1HardforkLatest,
17
17
  IncludeTraces,
18
18
  FsAccessPermission,
19
+ CollectStackTraces,
19
20
  } from "@nomicfoundation/edr";
20
21
  import { hexStringToBytes } from "@nomicfoundation/hardhat-utils/hex";
21
22
  import chalk from "chalk";
22
23
 
23
- import { OPTIMISM_CHAIN_TYPE } from "../../constants.js";
24
+ import { DEFAULT_VERBOSITY, OPTIMISM_CHAIN_TYPE } from "../../constants.js";
24
25
 
25
26
  import { type Colorizer, formatArtifactId } from "./formatters.js";
26
27
 
@@ -126,6 +127,8 @@ export async function solidityTestConfigToSolidityTestRunnerConfigArgs({
126
127
  }
127
128
  }
128
129
 
130
+ const shouldAlwaysCollectStackTraces = verbosity > DEFAULT_VERBOSITY;
131
+
129
132
  return {
130
133
  projectRoot,
131
134
  ...config,
@@ -144,6 +147,9 @@ export async function solidityTestConfigToSolidityTestRunnerConfigArgs({
144
147
  forkBlockNumber,
145
148
  rpcEndpoints,
146
149
  generateGasReport,
150
+ collectStackTraces: shouldAlwaysCollectStackTraces
151
+ ? CollectStackTraces.Always
152
+ : CollectStackTraces.OnFailure,
147
153
  };
148
154
  }
149
155
 
@@ -2,6 +2,7 @@ import type { HardhatPlugin } from "../../../types/plugins.js";
2
2
 
3
3
  import { ArgumentType } from "hardhat/types/arguments";
4
4
 
5
+ import { DEFAULT_VERBOSITY } from "../../constants.js";
5
6
  import { task } from "../../core/config.js";
6
7
 
7
8
  import "./type-extensions.js";
@@ -38,7 +39,7 @@ const hardhatPlugin: HardhatPlugin = {
38
39
  name: "verbosity",
39
40
  shortName: "v",
40
41
  description: "Verbosity level of the test output",
41
- defaultValue: 2,
42
+ defaultValue: DEFAULT_VERBOSITY,
42
43
  })
43
44
  .setAction(async () => import("./task-action.js"))
44
45
  .build(),
@@ -302,9 +302,11 @@ export async function* testReporter(
302
302
  case "UnsafeToReplay":
303
303
  if (stackTrace.globalForkLatest === true) {
304
304
  yield indenter.t`Stack Trace Warning: ${colorizer.grey("The test is not safe to replay because a fork url without a fork block number was provided.")}\n`;
305
+ yield indenter.t`Try rerunning your tests with -vvv or above.\n`;
305
306
  }
306
307
  if (stackTrace.impureCheatcodes.length > 0) {
307
308
  yield indenter.t`Stack Trace Warning: ${colorizer.grey(`The test is not safe to replay because it uses impure cheatcodes: ${stackTrace.impureCheatcodes.join(", ")}`)}\n`;
309
+ yield indenter.t`Try rerunning your tests with -vvv or above.\n`;
308
310
  }
309
311
  break;
310
312
  case "HeuristicFailed":
@@ -79,12 +79,19 @@ const runSolidityTests: NewTaskActionFunction<TestActionArguments> = async (
79
79
  );
80
80
  }
81
81
 
82
+ // Run the build task for contract files if needed
83
+ if (noCompile !== true) {
84
+ await hre.tasks.getTask("build").run({
85
+ noTests: true,
86
+ });
87
+ }
88
+
82
89
  // Run the build task for test files
83
90
  const { testRootPaths }: { testRootPaths: string[] } = await hre.tasks
84
91
  .getTask("build")
85
92
  .run({
86
93
  files: testFiles,
87
- noContracts: noCompile,
94
+ noContracts: true,
88
95
  });
89
96
  console.log();
90
97
 
@@ -1,6 +1,7 @@
1
1
  import type { HardhatPlugin } from "../../../types/plugins.js";
2
2
 
3
3
  import { ArgumentType } from "../../../types/arguments.js";
4
+ import { DEFAULT_VERBOSITY } from "../../constants.js";
4
5
  import { task } from "../../core/config.js";
5
6
 
6
7
  import "./type-extensions.js";
@@ -36,7 +37,7 @@ const hardhatPlugin: HardhatPlugin = {
36
37
  name: "verbosity",
37
38
  shortName: "v",
38
39
  description: "Verbosity level of the test output",
39
- defaultValue: 2,
40
+ defaultValue: DEFAULT_VERBOSITY,
40
41
  })
41
42
  .setAction(async () => import("./task-action.js"))
42
43
  .build(),
@@ -9,3 +9,5 @@ export const L1_CHAIN_TYPE = "l1";
9
9
  export const OPTIMISM_CHAIN_TYPE = "op";
10
10
 
11
11
  export const DEFAULT_NETWORK_NAME = "default";
12
+
13
+ export const DEFAULT_VERBOSITY = 2;
@@ -5,7 +5,7 @@
5
5
  "description": "A TypeScript Hardhat project using Node Test Runner and Viem",
6
6
  "type": "module",
7
7
  "devDependencies": {
8
- "hardhat": "workspace:^3.0.13",
8
+ "hardhat": "workspace:^3.0.14",
9
9
  "@nomicfoundation/hardhat-toolbox-viem": "workspace:^5.0.1",
10
10
  "@nomicfoundation/hardhat-ignition": "workspace:^3.0.5",
11
11
  "@types/node": "^22.8.5",
@@ -20,7 +20,7 @@
20
20
  "@nomicfoundation/hardhat-node-test-runner": "workspace:^3.0.7",
21
21
  "@nomicfoundation/hardhat-viem": "workspace:^3.0.0",
22
22
  "@nomicfoundation/hardhat-viem-assertions": "workspace:^3.0.0",
23
- "@nomicfoundation/hardhat-verify": "workspace:^3.0.6",
23
+ "@nomicfoundation/hardhat-verify": "workspace:^3.0.7",
24
24
  "@nomicfoundation/ignition-core": "workspace:^3.0.5"
25
25
  }
26
26
  }
@@ -5,7 +5,7 @@
5
5
  "description": "A TypeScript Hardhat project using Mocha and Ethers.js",
6
6
  "type": "module",
7
7
  "devDependencies": {
8
- "hardhat": "workspace:^3.0.13",
8
+ "hardhat": "workspace:^3.0.14",
9
9
  "@nomicfoundation/hardhat-toolbox-mocha-ethers": "workspace:^3.0.1",
10
10
  "@nomicfoundation/hardhat-ignition": "workspace:^3.0.5",
11
11
  "@types/chai": "^4.2.0",
@@ -27,7 +27,7 @@
27
27
  "@nomicfoundation/hardhat-mocha": "workspace:^3.0.7",
28
28
  "@nomicfoundation/hardhat-network-helpers": "workspace:^3.0.1",
29
29
  "@nomicfoundation/hardhat-typechain": "workspace:^3.0.0",
30
- "@nomicfoundation/hardhat-verify": "workspace:^3.0.6",
30
+ "@nomicfoundation/hardhat-verify": "workspace:^3.0.7",
31
31
  "@nomicfoundation/ignition-core": "workspace:^3.0.5"
32
32
  }
33
33
  }