hardhat 3.4.3 → 3.4.5

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 (204) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/src/config.d.ts +1 -1
  3. package/dist/src/config.d.ts.map +1 -1
  4. package/dist/src/config.js +0 -3
  5. package/dist/src/config.js.map +1 -1
  6. package/dist/src/hre.d.ts +1 -1
  7. package/dist/src/hre.d.ts.map +1 -1
  8. package/dist/src/hre.js +0 -3
  9. package/dist/src/hre.js.map +1 -1
  10. package/dist/src/index.d.ts +1 -1
  11. package/dist/src/index.d.ts.map +1 -1
  12. package/dist/src/index.js +0 -3
  13. package/dist/src/index.js.map +1 -1
  14. package/dist/src/internal/builtin-plugins/artifacts/index.d.ts +1 -1
  15. package/dist/src/internal/builtin-plugins/artifacts/index.d.ts.map +1 -1
  16. package/dist/src/internal/builtin-plugins/artifacts/index.js +0 -1
  17. package/dist/src/internal/builtin-plugins/artifacts/index.js.map +1 -1
  18. package/dist/src/internal/builtin-plugins/clean/index.d.ts +1 -1
  19. package/dist/src/internal/builtin-plugins/clean/index.d.ts.map +1 -1
  20. package/dist/src/internal/builtin-plugins/clean/index.js +0 -1
  21. package/dist/src/internal/builtin-plugins/clean/index.js.map +1 -1
  22. package/dist/src/internal/builtin-plugins/clean/type-extensions.d.ts +1 -1
  23. package/dist/src/internal/builtin-plugins/clean/type-extensions.d.ts.map +1 -1
  24. package/dist/src/internal/builtin-plugins/clean/type-extensions.js +1 -1
  25. package/dist/src/internal/builtin-plugins/clean/type-extensions.js.map +1 -1
  26. package/dist/src/internal/builtin-plugins/coverage/coverage-manager.d.ts +1 -1
  27. package/dist/src/internal/builtin-plugins/coverage/coverage-manager.d.ts.map +1 -1
  28. package/dist/src/internal/builtin-plugins/coverage/coverage-manager.js +9 -9
  29. package/dist/src/internal/builtin-plugins/coverage/coverage-manager.js.map +1 -1
  30. package/dist/src/internal/builtin-plugins/coverage/hook-handlers/solidity.d.ts.map +1 -1
  31. package/dist/src/internal/builtin-plugins/coverage/hook-handlers/solidity.js +7 -10
  32. package/dist/src/internal/builtin-plugins/coverage/hook-handlers/solidity.js.map +1 -1
  33. package/dist/src/internal/builtin-plugins/coverage/index.d.ts +1 -1
  34. package/dist/src/internal/builtin-plugins/coverage/index.d.ts.map +1 -1
  35. package/dist/src/internal/builtin-plugins/coverage/index.js +0 -1
  36. package/dist/src/internal/builtin-plugins/coverage/index.js.map +1 -1
  37. package/dist/src/internal/builtin-plugins/coverage/instrumentation.d.ts +1 -4
  38. package/dist/src/internal/builtin-plugins/coverage/instrumentation.d.ts.map +1 -1
  39. package/dist/src/internal/builtin-plugins/coverage/instrumentation.js +2 -4
  40. package/dist/src/internal/builtin-plugins/coverage/instrumentation.js.map +1 -1
  41. package/dist/src/internal/builtin-plugins/coverage/type-extensions.d.ts +1 -1
  42. package/dist/src/internal/builtin-plugins/coverage/type-extensions.d.ts.map +1 -1
  43. package/dist/src/internal/builtin-plugins/coverage/type-extensions.js +1 -1
  44. package/dist/src/internal/builtin-plugins/coverage/type-extensions.js.map +1 -1
  45. package/dist/src/internal/builtin-plugins/gas-analytics/index.d.ts +1 -1
  46. package/dist/src/internal/builtin-plugins/gas-analytics/index.d.ts.map +1 -1
  47. package/dist/src/internal/builtin-plugins/gas-analytics/index.js +0 -1
  48. package/dist/src/internal/builtin-plugins/gas-analytics/index.js.map +1 -1
  49. package/dist/src/internal/builtin-plugins/gas-analytics/type-extensions.d.ts +1 -1
  50. package/dist/src/internal/builtin-plugins/gas-analytics/type-extensions.d.ts.map +1 -1
  51. package/dist/src/internal/builtin-plugins/gas-analytics/type-extensions.js +1 -1
  52. package/dist/src/internal/builtin-plugins/gas-analytics/type-extensions.js.map +1 -1
  53. package/dist/src/internal/builtin-plugins/index.d.ts +8 -8
  54. package/dist/src/internal/builtin-plugins/index.d.ts.map +1 -1
  55. package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-solidity-errors.d.ts.map +1 -1
  56. package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-solidity-errors.js +7 -6
  57. package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-solidity-errors.js.map +1 -1
  58. package/dist/src/internal/builtin-plugins/network-manager/index.d.ts +4 -4
  59. package/dist/src/internal/builtin-plugins/network-manager/index.d.ts.map +1 -1
  60. package/dist/src/internal/builtin-plugins/network-manager/index.js +0 -4
  61. package/dist/src/internal/builtin-plugins/network-manager/index.js.map +1 -1
  62. package/dist/src/internal/builtin-plugins/network-manager/type-extensions/config.d.ts +0 -1
  63. package/dist/src/internal/builtin-plugins/network-manager/type-extensions/config.d.ts.map +1 -1
  64. package/dist/src/internal/builtin-plugins/network-manager/type-extensions/config.js +1 -1
  65. package/dist/src/internal/builtin-plugins/network-manager/type-extensions/config.js.map +1 -1
  66. package/dist/src/internal/builtin-plugins/network-manager/type-extensions/global-options.d.ts +1 -1
  67. package/dist/src/internal/builtin-plugins/network-manager/type-extensions/global-options.d.ts.map +1 -1
  68. package/dist/src/internal/builtin-plugins/network-manager/type-extensions/global-options.js +1 -1
  69. package/dist/src/internal/builtin-plugins/network-manager/type-extensions/global-options.js.map +1 -1
  70. package/dist/src/internal/builtin-plugins/network-manager/type-extensions/hooks.d.ts +0 -1
  71. package/dist/src/internal/builtin-plugins/network-manager/type-extensions/hooks.d.ts.map +1 -1
  72. package/dist/src/internal/builtin-plugins/network-manager/type-extensions/hooks.js +1 -1
  73. package/dist/src/internal/builtin-plugins/network-manager/type-extensions/hooks.js.map +1 -1
  74. package/dist/src/internal/builtin-plugins/network-manager/type-extensions/hre.d.ts +0 -1
  75. package/dist/src/internal/builtin-plugins/network-manager/type-extensions/hre.d.ts.map +1 -1
  76. package/dist/src/internal/builtin-plugins/network-manager/type-extensions/hre.js +1 -1
  77. package/dist/src/internal/builtin-plugins/network-manager/type-extensions/hre.js.map +1 -1
  78. package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.d.ts.map +1 -1
  79. package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.js +22 -9
  80. package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.js.map +1 -1
  81. package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.d.ts.map +1 -1
  82. package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.js +6 -0
  83. package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.js.map +1 -1
  84. package/dist/src/internal/builtin-plugins/solidity/index.d.ts +1 -1
  85. package/dist/src/internal/builtin-plugins/solidity/index.d.ts.map +1 -1
  86. package/dist/src/internal/builtin-plugins/solidity/index.js +0 -1
  87. package/dist/src/internal/builtin-plugins/solidity/index.js.map +1 -1
  88. package/dist/src/internal/builtin-plugins/solidity/type-extensions.d.ts +0 -4
  89. package/dist/src/internal/builtin-plugins/solidity/type-extensions.d.ts.map +1 -1
  90. package/dist/src/internal/builtin-plugins/solidity/type-extensions.js +1 -4
  91. package/dist/src/internal/builtin-plugins/solidity/type-extensions.js.map +1 -1
  92. package/dist/src/internal/builtin-plugins/solidity-test/index.d.ts +1 -1
  93. package/dist/src/internal/builtin-plugins/solidity-test/index.d.ts.map +1 -1
  94. package/dist/src/internal/builtin-plugins/solidity-test/index.js +0 -1
  95. package/dist/src/internal/builtin-plugins/solidity-test/index.js.map +1 -1
  96. package/dist/src/internal/builtin-plugins/solidity-test/inline-config/constants.d.ts +4 -2
  97. package/dist/src/internal/builtin-plugins/solidity-test/inline-config/constants.d.ts.map +1 -1
  98. package/dist/src/internal/builtin-plugins/solidity-test/inline-config/constants.js +5 -1
  99. package/dist/src/internal/builtin-plugins/solidity-test/inline-config/constants.js.map +1 -1
  100. package/dist/src/internal/builtin-plugins/solidity-test/inline-config/helpers.d.ts.map +1 -1
  101. package/dist/src/internal/builtin-plugins/solidity-test/inline-config/helpers.js +15 -3
  102. package/dist/src/internal/builtin-plugins/solidity-test/inline-config/helpers.js.map +1 -1
  103. package/dist/src/internal/builtin-plugins/solidity-test/inline-config/validation.d.ts +3 -2
  104. package/dist/src/internal/builtin-plugins/solidity-test/inline-config/validation.d.ts.map +1 -1
  105. package/dist/src/internal/builtin-plugins/solidity-test/inline-config/validation.js +18 -4
  106. package/dist/src/internal/builtin-plugins/solidity-test/inline-config/validation.js.map +1 -1
  107. package/dist/src/internal/builtin-plugins/solidity-test/type-extensions.d.ts +0 -1
  108. package/dist/src/internal/builtin-plugins/solidity-test/type-extensions.d.ts.map +1 -1
  109. package/dist/src/internal/builtin-plugins/solidity-test/type-extensions.js +1 -1
  110. package/dist/src/internal/builtin-plugins/solidity-test/type-extensions.js.map +1 -1
  111. package/dist/src/internal/builtin-plugins/test/index.d.ts +1 -1
  112. package/dist/src/internal/builtin-plugins/test/index.d.ts.map +1 -1
  113. package/dist/src/internal/builtin-plugins/test/index.js +0 -1
  114. package/dist/src/internal/builtin-plugins/test/index.js.map +1 -1
  115. package/dist/src/internal/builtin-plugins/test/type-extensions.d.ts +0 -1
  116. package/dist/src/internal/builtin-plugins/test/type-extensions.d.ts.map +1 -1
  117. package/dist/src/internal/builtin-plugins/test/type-extensions.js +1 -1
  118. package/dist/src/internal/builtin-plugins/test/type-extensions.js.map +1 -1
  119. package/dist/src/internal/cli/telemetry/error-classification/classifier.d.ts +58 -0
  120. package/dist/src/internal/cli/telemetry/error-classification/classifier.d.ts.map +1 -0
  121. package/dist/src/internal/cli/telemetry/error-classification/classifier.js +402 -0
  122. package/dist/src/internal/cli/telemetry/error-classification/classifier.js.map +1 -0
  123. package/dist/src/internal/cli/telemetry/error-classification/codebase-dependent-helpers.d.ts +67 -0
  124. package/dist/src/internal/cli/telemetry/error-classification/codebase-dependent-helpers.d.ts.map +1 -0
  125. package/dist/src/internal/cli/telemetry/error-classification/codebase-dependent-helpers.js +140 -0
  126. package/dist/src/internal/cli/telemetry/error-classification/codebase-dependent-helpers.js.map +1 -0
  127. package/dist/src/internal/cli/telemetry/error-classification/filter.d.ts +15 -0
  128. package/dist/src/internal/cli/telemetry/error-classification/filter.d.ts.map +1 -0
  129. package/dist/src/internal/cli/telemetry/error-classification/filter.js +114 -0
  130. package/dist/src/internal/cli/telemetry/error-classification/filter.js.map +1 -0
  131. package/dist/src/internal/cli/telemetry/error-classification/helpers.d.ts +52 -0
  132. package/dist/src/internal/cli/telemetry/error-classification/helpers.d.ts.map +1 -0
  133. package/dist/src/internal/cli/telemetry/error-classification/helpers.js +163 -0
  134. package/dist/src/internal/cli/telemetry/error-classification/helpers.js.map +1 -0
  135. package/dist/src/internal/cli/telemetry/error-reporter/reporter.d.ts.map +1 -1
  136. package/dist/src/internal/cli/telemetry/error-reporter/reporter.js +14 -0
  137. package/dist/src/internal/cli/telemetry/error-reporter/reporter.js.map +1 -1
  138. package/dist/src/internal/cli/telemetry/sentry/anonymizer.d.ts +0 -2
  139. package/dist/src/internal/cli/telemetry/sentry/anonymizer.d.ts.map +1 -1
  140. package/dist/src/internal/cli/telemetry/sentry/anonymizer.js +0 -117
  141. package/dist/src/internal/cli/telemetry/sentry/anonymizer.js.map +1 -1
  142. package/dist/src/internal/cli/telemetry/sentry/init.d.ts.map +1 -1
  143. package/dist/src/internal/cli/telemetry/sentry/init.js +14 -9
  144. package/dist/src/internal/cli/telemetry/sentry/init.js.map +1 -1
  145. package/dist/src/internal/cli/telemetry/sentry/reporter.d.ts.map +1 -1
  146. package/dist/src/internal/cli/telemetry/sentry/reporter.js +1 -27
  147. package/dist/src/internal/cli/telemetry/sentry/reporter.js.map +1 -1
  148. package/dist/src/internal/cli/telemetry/sentry/subprocess.js +11 -17
  149. package/dist/src/internal/cli/telemetry/sentry/subprocess.js.map +1 -1
  150. package/dist/src/types/config.d.ts +0 -1
  151. package/dist/src/types/config.d.ts.map +1 -1
  152. package/dist/src/types/config.js +1 -3
  153. package/dist/src/types/config.js.map +1 -1
  154. package/dist/src/types/plugins.d.ts +1 -1
  155. package/dist/src/types/plugins.d.ts.map +1 -1
  156. package/dist/src/types/plugins.js +1 -3
  157. package/dist/src/types/plugins.js.map +1 -1
  158. package/package.json +3 -4
  159. package/src/config.ts +2 -3
  160. package/src/hre.ts +2 -3
  161. package/src/index.ts +2 -3
  162. package/src/internal/builtin-plugins/artifacts/index.ts +1 -1
  163. package/src/internal/builtin-plugins/clean/index.ts +1 -1
  164. package/src/internal/builtin-plugins/clean/type-extensions.ts +0 -1
  165. package/src/internal/builtin-plugins/coverage/coverage-manager.ts +14 -10
  166. package/src/internal/builtin-plugins/coverage/hook-handlers/solidity.ts +8 -13
  167. package/src/internal/builtin-plugins/coverage/index.ts +1 -1
  168. package/src/internal/builtin-plugins/coverage/instrumentation.ts +0 -5
  169. package/src/internal/builtin-plugins/coverage/type-extensions.ts +0 -1
  170. package/src/internal/builtin-plugins/gas-analytics/index.ts +1 -1
  171. package/src/internal/builtin-plugins/gas-analytics/type-extensions.ts +0 -1
  172. package/src/internal/builtin-plugins/index.ts +10 -10
  173. package/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-solidity-errors.ts +10 -11
  174. package/src/internal/builtin-plugins/network-manager/index.ts +4 -4
  175. package/src/internal/builtin-plugins/network-manager/type-extensions/config.ts +0 -1
  176. package/src/internal/builtin-plugins/network-manager/type-extensions/global-options.ts +0 -1
  177. package/src/internal/builtin-plugins/network-manager/type-extensions/hooks.ts +0 -1
  178. package/src/internal/builtin-plugins/network-manager/type-extensions/hre.ts +0 -1
  179. package/src/internal/builtin-plugins/solidity/build-system/build-system.ts +32 -16
  180. package/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.ts +7 -0
  181. package/src/internal/builtin-plugins/solidity/index.ts +1 -1
  182. package/src/internal/builtin-plugins/solidity/type-extensions.ts +0 -4
  183. package/src/internal/builtin-plugins/solidity-test/index.ts +1 -1
  184. package/src/internal/builtin-plugins/solidity-test/inline-config/constants.ts +6 -2
  185. package/src/internal/builtin-plugins/solidity-test/inline-config/helpers.ts +15 -4
  186. package/src/internal/builtin-plugins/solidity-test/inline-config/validation.ts +25 -4
  187. package/src/internal/builtin-plugins/solidity-test/type-extensions.ts +0 -1
  188. package/src/internal/builtin-plugins/test/index.ts +1 -1
  189. package/src/internal/builtin-plugins/test/type-extensions.ts +0 -1
  190. package/src/internal/cli/telemetry/error-classification/classifier.ts +636 -0
  191. package/src/internal/cli/telemetry/error-classification/codebase-dependent-helpers.ts +200 -0
  192. package/src/internal/cli/telemetry/error-classification/filter.ts +140 -0
  193. package/src/internal/cli/telemetry/error-classification/helpers.ts +235 -0
  194. package/src/internal/cli/telemetry/error-reporter/reporter.ts +21 -0
  195. package/src/internal/cli/telemetry/sentry/anonymizer.ts +0 -168
  196. package/src/internal/cli/telemetry/sentry/init.ts +42 -33
  197. package/src/internal/cli/telemetry/sentry/reporter.ts +1 -44
  198. package/src/internal/cli/telemetry/sentry/subprocess.ts +11 -19
  199. package/src/types/config.ts +0 -4
  200. package/src/types/plugins.ts +2 -3
  201. package/templates/hardhat-3/01-node-test-runner-viem/package.json +11 -11
  202. package/templates/hardhat-3/02-mocha-ethers/package.json +14 -14
  203. package/templates/hardhat-3/03-minimal/package.json +1 -1
  204. package/coverage.sol +0 -38
@@ -1 +1 @@
1
- {"version":3,"file":"reporter.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/cli/telemetry/sentry/reporter.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,UAAU,0FACkE,CAAC;AAE1F;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,KAAK,EACZ,IAAI,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,GACrD,OAAO,CAAC,OAAO,CAAC,CAGlB;AAED,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAEhE;AAGD,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC"}
1
+ {"version":3,"file":"reporter.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/cli/telemetry/sentry/reporter.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,UAAU,0FACkE,CAAC;AAE1F;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,KAAK,EACZ,IAAI,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,GACrD,OAAO,CAAC,OAAO,CAAC,CAGlB;AAED,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAEhE;AAGD,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC"}
@@ -1,7 +1,4 @@
1
- import { HardhatError, HardhatPluginError, } from "@nomicfoundation/hardhat-errors";
2
1
  import { createDebug } from "@nomicfoundation/hardhat-utils/debug";
3
- import { ProviderError, UnknownError, } from "../../../builtin-plugins/network-manager/provider-errors.js";
4
- import { UsingHardhat2PluginError } from "../../../using-hardhat2-plugin-errors.js";
5
2
  import { getHardhatVersion } from "../../../utils/package.js";
6
3
  import { isTelemetryAllowed } from "../telemetry-permissions.js";
7
4
  const log = createDebug("hardhat:core:cli:telemetry:sentry:reporter");
@@ -70,8 +67,7 @@ class Reporter {
70
67
  this.#instance = undefined;
71
68
  }
72
69
  async reportErrorViaSubprocess(error, hint) {
73
- if (!(await this.#shouldBeReported(error))) {
74
- log("Error not send: this type of error should not be reported");
70
+ if (!this.#telemetryEnabled) {
75
71
  return false;
76
72
  }
77
73
  const { captureException, flush } = await import("@sentry/core");
@@ -87,27 +83,5 @@ class Reporter {
87
83
  await flush();
88
84
  return true;
89
85
  }
90
- async #shouldBeReported(error) {
91
- if (!this.#telemetryEnabled) {
92
- return false;
93
- }
94
- if (HardhatError.isHardhatError(error) &&
95
- !error.descriptor.shouldBeReported) {
96
- return false;
97
- }
98
- if (error instanceof UsingHardhat2PluginError) {
99
- return false;
100
- }
101
- if (HardhatPluginError.isHardhatPluginError(error)) {
102
- // Don't log errors from third-party plugins
103
- return false;
104
- }
105
- if (ProviderError.isProviderError(error) &&
106
- error.code !== UnknownError.CODE) {
107
- // We don't report known network related errors
108
- return false;
109
- }
110
- return true;
111
- }
112
86
  }
113
87
  //# sourceMappingURL=reporter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reporter.js","sourceRoot":"","sources":["../../../../../../src/internal/cli/telemetry/sentry/reporter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,kBAAkB,GACnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAEnE,OAAO,EACL,aAAa,EACb,YAAY,GACb,MAAM,6DAA6D,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE,MAAM,GAAG,GAAG,WAAW,CAAC,4CAA4C,CAAC,CAAC;AAEtE,4BAA4B;AAC5B,oGAAoG;AACpG,MAAM,CAAC,MAAM,UAAU,GACrB,uFAAuF,CAAC,CAAC,OAAO;AAElG;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,KAAY,EACZ,IAAsD;IAEtD,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,WAAW,EAAE,CAAC;IAC9C,OAAO,MAAM,QAAQ,CAAC,wBAAwB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AAC9D,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,UAAkB;IACxD,QAAQ,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;AAC5C,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,kBAAkB;IAChC,QAAQ,CAAC,cAAc,EAAE,CAAC;AAC5B,CAAC;AAED,MAAM,QAAQ;IACZ,uBAAuB;IACvB,mGAAmG;IACnG,gFAAgF;IAChF,sI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;YACD,OAAO;YACP,WAAW;SACZ,CAAC,CAAC;QAEH,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QACzC,QAAQ,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;QAE3C,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAEM,MAAM,CAAC,cAAc;QAC1B,8BAA8B;QAC9B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAEM,KAAK,CAAC,wBAAwB,CACnC,KAAY,EACZ,IAAsD;QAEtD,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC5B,OAAO,KAAK,CAAC;QACf,CAAC;QACD,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,CAAC;QAEjE,GAAG,CAAC,qBAAqB,CAAC,CAAC;QAE3B,gBAAgB,CACd,KAAK,EACL,IAAI,KAAK,SAAS;YAChB,CAAC,CAAC;gBACE,SAAS,EAAE;oBACT,IAAI,EAAE,IAAI,CAAC,aAAa,IAAI,SAAS;oBACrC,OAAO,EAAE,IAAI,CAAC,SAAS,KAAK,IAAI;iBACjC;aACF;YACH,CAAC,CAAC,SAAS,CACd,CAAC;QACF,MAAM,KAAK,EAAE,CAAC;QAEd,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -24,26 +24,20 @@ init({
24
24
  });
25
25
  const envelope = JSON.parse(serializedEnvelope);
26
26
  const anonymizer = new Anonymizer(configPath);
27
- const filteredEnvelope = anonymizer.filterOutEventsWithExceptionsNotRaisedByHardhat(envelope);
28
- if (filteredEnvelope[1].length === 0) {
29
- log("The events weren't raised by Hardhat, so we don't report them");
27
+ const anonymizeResult = await anonymizer.anonymizeEventsFromEnvelope(envelope);
28
+ if (!anonymizeResult.success) {
29
+ log("Failed to anonymize envelope", anonymizeResult.error);
30
+ captureMessage(anonymizeResult.error);
30
31
  }
31
32
  else {
32
- const anonymizeResult = await anonymizer.anonymizeEventsFromEnvelope(filteredEnvelope);
33
- if (!anonymizeResult.success) {
34
- log("Failed to anonymize envelope", anonymizeResult.error);
35
- captureMessage(anonymizeResult.error);
33
+ try {
34
+ log("Sending received envelope to Sentry");
35
+ await sendEnvelopeToSentryBackend(dsn, anonymizeResult.envelope);
36
+ log("Successfully sent received envelope to Sentry");
36
37
  }
37
- else {
38
- try {
39
- log("Sending received envelope to Sentry");
40
- await sendEnvelopeToSentryBackend(dsn, anonymizeResult.envelope);
41
- log("Successfully sent received envelope to Sentry");
42
- }
43
- catch (e) {
44
- log("Failed to send received envelope to Sentry", e);
45
- captureException(e);
46
- }
38
+ catch (e) {
39
+ log("Failed to send received envelope to Sentry", e);
40
+ captureException(e);
47
41
  }
48
42
  }
49
43
  await close();
@@ -1 +1 @@
1
- {"version":3,"file":"subprocess.js","sourceRoot":"","sources":["../../../../../../src/internal/cli/telemetry/sentry/subprocess.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEvE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,mBAAmB,EACnB,2BAA2B,GAC5B,MAAM,gBAAgB,CAAC;AAExB,MAAM,GAAG,GAAG,WAAW,CAAC,8CAA8C,CAAC,CAAC;AAExE,MAAM,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC3C,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACxE,MAAM,GAAG,GAAG,OAAO,CAAC,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AAO,CAAC,KAAK,CACX,+GAA+G,CAChH,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,GAAG,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;AAChC,GAAG,CAAC,0DAA0D,CAAC,CAAC;AAEhE,IAAI,CAAC;IACH,GAAG;IACH,OAAO;IACP,SAAS,EAAE,mBAAmB,CAAC,GAAG,CAAC;IACnC,WAAW;CACZ,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;AAEhD,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,UAAU,CAAC,CAAC;AAE9C,MAAM,eAAe,GAAG,MAAM,UAAU,CAAC,2BAA2B,CAAC,QAAQ,CAAC,CAAC;AAE/E,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC;IAC7B,GAAG,CAAC,8BAA8B,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC;IAC3D,cAAc,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;AACxC,CAAC;KAAM,CAAC;IACN,IAAI,CAAC;QACH,GAAG,CAAC,qCAAqC,CAAC,CAAC;QAE3C,MAAM,2BAA2B,CAAC,GAAG,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC;QAEjE,GAAG,CAAC,+CAA+C,CAAC,CAAC;IACvD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,GAAG,CAAC,4CAA4C,EAAE,CAAC,CAAC,CAAC;QAErD,gBAAgB,CAAC,CAAC,CAAC,CAAC;IACtB,CAAC;AACH,CAAC;AAED,MAAM,KAAK,EAAE,CAAC"}
@@ -1,4 +1,3 @@
1
- import "../internal/builtin-plugins/index.js";
2
1
  /**
3
2
  * A configuration variable to be fetched at runtime from
4
3
  * different sources, depending on the user's setup.
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/types/config.ts"],"names":[],"mappings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S,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,mBAAmB,CAAC;IACrC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,qBAAqB,CAAC;CACrD;AAED;;GAEG;AAGH,MAAM,WAAW,mBAAmB;CAAG;AAEvC;;GAEG;AAGH,MAAM,WAAW,qBAAqB;CAAG;AAEzC;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,kBAAkB,CAAC;CAC3B;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,eAAe,CAAC;IACvB,OAAO,EAAE,iBAAiB,CAAC;CAC5B;AAED;;GAEG;AAGH,MAAM,WAAW,eAAe;CAAG;AAEnC;;GAEG;AAGH,MAAM,WAAW,iBAAiB;CAAG"}
@@ -1,4 +1,2 @@
1
- // NOTE: We import the builtin plugins in this module, so that their
2
- // type-extensions are loaded when the user imports `hardhat/types/config`.
3
- import "../internal/builtin-plugins/index.js";
1
+ export {};
4
2
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/types/config.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,2EAA2E;AAC3E,OAAO,sCAAsC,CAAC"}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/types/config.ts"],"names":[],"mappings":""}
@@ -1,7 +1,7 @@
1
1
  import type { GlobalOptionDefinition } from "./arguments.js";
2
2
  import type { HardhatHooks } from "./hooks.js";
3
3
  import type { TaskDefinition } from "./tasks.js";
4
- import "../internal/builtin-plugins/index.js";
4
+ export type * from "../internal/builtin-plugins/index.js";
5
5
  declare module "./config.js" {
6
6
  interface HardhatUserConf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AE,CAAC,CAAC;KACnD,CAAC,CAAC;IAEH;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,YAAY,CAAC,EAAE,4BAA4B,CAAC;IAE5C;;OAEG;IACH,aAAa,CAAC,EAAE,sBAAsB,EAAE,CAAC;IAEzC;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;CAC1B;AAED;;;;GAIG;AACH,MAAM,MAAM,4BAA4B,GAAG;KACxC,iBAAiB,IAAI,MAAM,YAAY,CAAC,CAAC,EAAE,MAAM,OAAO,CAAC;QACxD,OAAO,EAAE,0BAA0B,CAAC,iBAAiB,CAAC,CAAC;KACxD,CAAC;CACH,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,0BAA0B,CACpC,aAAa,SAAS,MAAM,YAAY,IACtC,MAAM,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC"}
@@ -1,4 +1,2 @@
1
- // NOTE: We import the builtin plugins in this module, so that their
2
- // type-extensions are loaded when the user imports `hardhat/types/plugins`.
3
- import "../internal/builtin-plugins/index.js";
1
+ export {};
4
2
  //# sourceMappingURL=plugins.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../../src/types/plugins.ts"],"names":[],"mappings":"AAIA,oEAAoE;AACpE,4EAA4E;AAC5E,OAAO,sCAAsC,CAAC"}
1
+ {"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../../src/types/plugins.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hardhat",
3
- "version": "3.4.3",
3
+ "version": "3.4.5",
4
4
  "description": "Hardhat is an extensible developer tool that helps smart contract developers increase productivity by reliably bringing together the tools they want.",
5
5
  "homepage": "https://hardhat.org",
6
6
  "repository": {
@@ -56,7 +56,6 @@
56
56
  "src/",
57
57
  "templates/",
58
58
  "console.sol",
59
- "coverage.sol",
60
59
  "CHANGELOG.md",
61
60
  "LICENSE",
62
61
  "README.md"
@@ -76,9 +75,9 @@
76
75
  "@nomicfoundation/hardhat-test-utils": "^2.0.3"
77
76
  },
78
77
  "dependencies": {
79
- "@nomicfoundation/edr": "0.12.0-next.31",
78
+ "@nomicfoundation/edr": "0.12.0-next.32",
80
79
  "@nomicfoundation/hardhat-errors": "^3.0.12",
81
- "@nomicfoundation/hardhat-utils": "^4.1.0",
80
+ "@nomicfoundation/hardhat-utils": "^4.1.1",
82
81
  "@nomicfoundation/hardhat-vendored": "^3.0.3",
83
82
  "@nomicfoundation/hardhat-zod-utils": "^3.0.4",
84
83
  "@nomicfoundation/solidity-analyzer": "^0.1.1",
package/src/config.ts CHANGED
@@ -3,9 +3,8 @@ export * from "./internal/core/config.js";
3
3
 
4
4
  export type { HardhatUserConfig } from "./types/config.js";
5
5
 
6
- // NOTE: We import the builtin plugins in this module, so that their
7
- // type-extensions are loaded when the user imports `hardhat/config`.
8
- import "./internal/builtin-plugins/index.js";
6
+ // NOTE: We export the built-in plugin types to load their type extensions
7
+ export type * from "./internal/builtin-plugins/index.js";
9
8
  import type { HardhatUserConfig } from "./types/config.js";
10
9
 
11
10
  import { throwUsingHardhat2PluginError } from "./internal/using-hardhat2-plugin-errors.js";
package/src/hre.ts CHANGED
@@ -1,6 +1,5 @@
1
- // NOTE: We import the builtin plugins in this module, so that their
2
- // type-extensions are loaded when the user imports `hardhat/hre`.
3
- import "./internal/builtin-plugins/index.js";
1
+ // NOTE: We export the built-in plugin types to load their type extensions
2
+ export type * from "./internal/builtin-plugins/index.js";
4
3
 
5
4
  export { importUserConfig } from "./internal/config-loading.js";
6
5
  export { resolveHardhatConfigPath } from "./internal/config-loading.js";
package/src/index.ts CHANGED
@@ -10,9 +10,8 @@ import type { UserInterruptionManager } from "./types/user-interruptions.js";
10
10
 
11
11
  import { getOrCreateGlobalHardhatRuntimeEnvironment } from "./internal/hre-initialization.js";
12
12
 
13
- // NOTE: We import the builtin plugins in this module, so that their
14
- // type-extensions are loaded when the user imports `hardhat`.
15
- import "./internal/builtin-plugins/index.js";
13
+ // NOTE: We export the built-in plugin types to load their type extensions
14
+ export type * from "./internal/builtin-plugins/index.js";
16
15
 
17
16
  const hre: HardhatRuntimeEnvironment =
18
17
  // eslint-disable-next-line no-restricted-syntax -- Allow top-level await here
@@ -1,5 +1,5 @@
1
1
  import type { HardhatPlugin } from "../../../types/plugins.js";
2
- import "./type-extensions.js";
2
+ export type * from "./type-extensions.js";
3
3
 
4
4
  const hardhatPlugin: HardhatPlugin = {
5
5
  id: "builtin:artifacts",
@@ -2,7 +2,7 @@ import type { HardhatPlugin } from "../../../types/plugins.js";
2
2
 
3
3
  import { task } from "../../core/config.js";
4
4
 
5
- import "./type-extensions.js";
5
+ export type * from "./type-extensions.js";
6
6
 
7
7
  const hardhatPlugin: HardhatPlugin = {
8
8
  id: "builtin:clean",
@@ -1,4 +1,3 @@
1
- import "../../../types/hooks.js";
2
1
  declare module "../../../types/hooks.js" {
3
2
  export interface HardhatHooks {
4
3
  clean: CleanHooks;
@@ -74,7 +74,7 @@ export class CoverageManagerImplementation implements CoverageManager {
74
74
  /**
75
75
  * @private exposed for testing purposes only
76
76
  */
77
- public data: CoverageData = [];
77
+ public data: Map<string, number> = new Map();
78
78
 
79
79
  readonly #coveragePath: string;
80
80
 
@@ -91,8 +91,8 @@ export class CoverageManagerImplementation implements CoverageManager {
91
91
  }
92
92
 
93
93
  public async addData(data: CoverageData): Promise<void> {
94
- for (const entry of data) {
95
- this.data.push(entry);
94
+ for (const tag of data) {
95
+ this.data.set(tag, (this.data.get(tag) ?? 0) + 1);
96
96
  }
97
97
 
98
98
  log("Added data", JSON.stringify(data, null, 2));
@@ -122,14 +122,14 @@ export class CoverageManagerImplementation implements CoverageManager {
122
122
  public async clearData(id: string): Promise<void> {
123
123
  const dataPath = await this.#getDataPath(id);
124
124
  await remove(dataPath);
125
- this.data = [];
125
+ this.data = new Map();
126
126
  log("Cleared data from disk and memory");
127
127
  }
128
128
 
129
129
  public async saveData(id: string): Promise<void> {
130
130
  const dataPath = await this.#getDataPath(id);
131
131
  const filePath = path.join(dataPath, `${crypto.randomUUID()}.json`);
132
- const data = this.data;
132
+ const data = Object.fromEntries(this.data);
133
133
  await writeJsonFile(filePath, data);
134
134
  log("Saved data", id, filePath);
135
135
  }
@@ -170,15 +170,19 @@ export class CoverageManagerImplementation implements CoverageManager {
170
170
  * @private exposed for testing purposes only
171
171
  */
172
172
  public async loadData(...ids: string[]): Promise<void> {
173
- this.data = [];
173
+ this.data = new Map();
174
+
174
175
  for (const id of ids) {
175
176
  const dataPath = await this.#getDataPath(id);
176
177
  const filePaths = await getAllFilesMatching(dataPath);
178
+
177
179
  for (const filePath of filePaths) {
178
- const entries = await readJsonFile<CoverageData>(filePath);
179
- for (const entry of entries) {
180
- this.data.push(entry);
180
+ const entries = await readJsonFile<Record<string, number>>(filePath);
181
+
182
+ for (const [tag, count] of Object.entries(entries)) {
183
+ this.data.set(tag, (this.data.get(tag) ?? 0) + count);
181
184
  }
185
+
182
186
  log("Loaded data", id, filePath);
183
187
  }
184
188
  }
@@ -188,7 +192,7 @@ export class CoverageManagerImplementation implements CoverageManager {
188
192
  * @private exposed for testing purposes only
189
193
  */
190
194
  public async getReport(): Promise<Report> {
191
- const allExecutedTags = new Set(this.data);
195
+ const allExecutedTags = this.data;
192
196
 
193
197
  const reportPromises = Array.from(this.filesMetadata.entries()).map(
194
198
  async ([fileRelativePath, fileStatements]) => {
@@ -3,20 +3,16 @@ import type { CoverageMetadata } from "../types.js";
3
3
 
4
4
  import path from "node:path";
5
5
 
6
+ import { getCoverageLibrary } from "@nomicfoundation/edr/coverage";
6
7
  import { HardhatError } from "@nomicfoundation/hardhat-errors";
7
8
  import { createDebug } from "@nomicfoundation/hardhat-utils/debug";
8
9
  import { ensureError } from "@nomicfoundation/hardhat-utils/error";
9
- import { readUtf8File } from "@nomicfoundation/hardhat-utils/fs";
10
- import { findClosestPackageRoot } from "@nomicfoundation/hardhat-utils/package";
11
10
 
12
11
  import { getCoverageManager } from "../helpers/accessors.js";
13
12
  import { instrumentSolidityFileForCompilationJob } from "../instrumentation.js";
14
13
 
15
14
  const log = createDebug("hardhat:core:coverage:hook-handlers:solidity");
16
15
 
17
- const COVERAGE_LIBRARY_PATH =
18
- "__hardhat_coverage_library_a3e9cfe2-41b4-4a1f-ad9e-ac62dd82979e.sol";
19
-
20
16
  export default async (): Promise<Partial<SolidityHooks>> => ({
21
17
  preprocessProjectFileBeforeBuilding: async (
22
18
  context,
@@ -37,7 +33,6 @@ export default async (): Promise<Partial<SolidityHooks>> => ({
37
33
  compilationJobSolcVersion: solcVersion,
38
34
  sourceName,
39
35
  fileContent,
40
- coverageLibraryPath: COVERAGE_LIBRARY_PATH,
41
36
  });
42
37
 
43
38
  // TODO: Remove this once EDR starts returning line information as part
@@ -99,14 +94,16 @@ export default async (): Promise<Partial<SolidityHooks>> => ({
99
94
  },
100
95
  preprocessSolcInputBeforeBuilding: async (context, solcInput, next) => {
101
96
  if (context.globalOptions.coverage) {
97
+ const coverageLib = getCoverageLibrary();
98
+
102
99
  // NOTE: We check for a source name clash here. It could happen if the user
103
100
  // wanted to compile a source with our highly unlikely name by chance or
104
101
  // if we accidentally tried to preprocess the same solc input twice.
105
- if (solcInput.sources[COVERAGE_LIBRARY_PATH] !== undefined) {
102
+ if (solcInput.sources[coverageLib.filename] !== undefined) {
106
103
  throw new HardhatError(
107
104
  HardhatError.ERRORS.CORE.COVERAGE.IMPORT_PATH_ALREADY_DEFINED,
108
105
  {
109
- importPath: COVERAGE_LIBRARY_PATH,
106
+ importPath: coverageLib.filename,
110
107
  },
111
108
  );
112
109
  }
@@ -114,11 +111,9 @@ export default async (): Promise<Partial<SolidityHooks>> => ({
114
111
  // NOTE: We add the coverage.sol straight into sources here. The alternative
115
112
  // would be to do it during the resolution phase. However, we decided this
116
113
  // is a simpler solution, at least for now.
117
- const packageRoot = await findClosestPackageRoot(import.meta.url);
118
- const coverageSolPath = path.join(packageRoot, "coverage.sol");
119
-
120
- const content = await readUtf8File(coverageSolPath);
121
- solcInput.sources[COVERAGE_LIBRARY_PATH] = { content };
114
+ solcInput.sources[coverageLib.filename] = {
115
+ content: coverageLib.content,
116
+ };
122
117
  }
123
118
 
124
119
  return await next(context, solcInput);
@@ -2,7 +2,7 @@ import type { HardhatPlugin } from "../../../types/plugins.js";
2
2
 
3
3
  import { globalFlag } from "../../core/config.js";
4
4
 
5
- import "./type-extensions.js";
5
+ export type * from "./type-extensions.js";
6
6
 
7
7
  const hardhatPlugin: HardhatPlugin = {
8
8
  id: "builtin:coverage",
@@ -20,8 +20,6 @@ import {
20
20
  * @param sourceName The source name of the file, as present in the compilation
21
21
  * job.
22
22
  * @param fileContent The contents of the file.
23
- * @param coverageLibraryPath The path to the coverage library. i.e. where to
24
- * import it from.
25
23
  * @returns An object with the instrumented source and its metadata, and the
26
24
  * solidity version used to instrument the sources.
27
25
  */
@@ -29,12 +27,10 @@ export function instrumentSolidityFileForCompilationJob({
29
27
  compilationJobSolcVersion,
30
28
  sourceName,
31
29
  fileContent,
32
- coverageLibraryPath,
33
30
  }: {
34
31
  compilationJobSolcVersion: string;
35
32
  sourceName: string;
36
33
  fileContent: string;
37
- coverageLibraryPath: string;
38
34
  }): {
39
35
  source: string;
40
36
  metadata: InstrumentationMetadata[];
@@ -64,7 +60,6 @@ export function instrumentSolidityFileForCompilationJob({
64
60
  fileContent,
65
61
  sourceName,
66
62
  instrumentationVersion,
67
- coverageLibraryPath,
68
63
  );
69
64
 
70
65
  return { source, metadata, instrumentationVersion };
@@ -1,4 +1,3 @@
1
- import "../../../types/global-options.js";
2
1
  declare module "../../../types/global-options.js" {
3
2
  export interface GlobalOptions {
4
3
  coverage: boolean;
@@ -3,7 +3,7 @@ import type { HardhatPlugin } from "../../../types/plugins.js";
3
3
  import { ArgumentType } from "../../../types/arguments.js";
4
4
  import { globalFlag, globalOption, overrideTask } from "../../core/config.js";
5
5
 
6
- import "./type-extensions.js";
6
+ export type * from "./type-extensions.js";
7
7
 
8
8
  const hardhatPlugin: HardhatPlugin = {
9
9
  id: "builtin:gas-analytics",
@@ -1,4 +1,3 @@
1
- import "../../../types/global-options.js";
2
1
  declare module "../../../types/global-options.js" {
3
2
  export interface GlobalOptions {
4
3
  gasStats: boolean;
@@ -14,21 +14,21 @@ import solidityTest from "./solidity-test/index.js";
14
14
  import telemetry from "./telemetry/index.js";
15
15
  import test from "./test/index.js";
16
16
 
17
- // Note: When importing a plugin, you have to export its types, so that its
18
- // type extensions, if any, also get loaded.
17
+ // NOTE: We export the built-in plugin types to have a centralized way to
18
+ // re-export them and force their type extensions to be loaded.
19
19
  export type * from "./artifacts/index.js";
20
- export type * from "./solidity/index.js";
21
- export type * from "./test/index.js";
22
- export type * from "./solidity-test/index.js";
23
- export type * from "./gas-analytics/index.js";
24
- export type * from "./network-manager/index.js";
25
20
  export type * from "./clean/index.js";
26
21
  export type * from "./console/index.js";
27
- export type * from "./run/index.js";
28
- export type * from "./node/index.js";
29
- export type * from "./flatten/index.js";
30
22
  export type * from "./coverage/index.js";
23
+ export type * from "./flatten/index.js";
24
+ export type * from "./gas-analytics/index.js";
25
+ export type * from "./network-manager/index.js";
26
+ export type * from "./node/index.js";
27
+ export type * from "./run/index.js";
28
+ export type * from "./solidity/index.js";
29
+ export type * from "./solidity-test/index.js";
31
30
  export type * from "./telemetry/index.js";
31
+ export type * from "./test/index.js";
32
32
 
33
33
  // This array should be kept in order, respecting the dependencies between the
34
34
  // plugins.
@@ -29,24 +29,23 @@ export function createSolidityErrorWithStackTrace(
29
29
  ): SolidityError {
30
30
  const originalPrepareStackTrace = Error.prepareStackTrace;
31
31
 
32
+ assertHardhatInvariant(
33
+ originalPrepareStackTrace !== undefined,
34
+ "Error.prepareStackTrace should be defined",
35
+ );
36
+
32
37
  try {
33
38
  Error.prepareStackTrace = (error, stack) => {
34
39
  // Skip error management related stack traces
35
- const adjustedStack = stack.slice(1);
40
+ const [, ...adjustedStack] = stack;
36
41
 
42
+ const prefix = [];
37
43
  for (const entry of stackTrace) {
38
44
  const callsite = encodeStackTraceEntry(entry);
39
- if (callsite !== undefined) {
40
- adjustedStack.unshift(callsite);
41
- }
45
+ if (callsite !== undefined) prefix.push(callsite);
42
46
  }
43
-
44
- assertHardhatInvariant(
45
- originalPrepareStackTrace !== undefined,
46
- "Error.prepareStackTrace should be defined",
47
- );
48
-
49
- return originalPrepareStackTrace(error, adjustedStack);
47
+ prefix.reverse();
48
+ return originalPrepareStackTrace(error, [...prefix, ...adjustedStack]);
50
49
  };
51
50
 
52
51
  const message =
@@ -3,10 +3,10 @@ import type { HardhatPlugin } from "../../../types/plugins.js";
3
3
  import { ArgumentType } from "../../../types/arguments.js";
4
4
  import { globalOption } from "../../core/config.js";
5
5
 
6
- import "./type-extensions/config.js";
7
- import "./type-extensions/global-options.js";
8
- import "./type-extensions/hooks.js";
9
- import "./type-extensions/hre.js";
6
+ export type * from "./type-extensions/config.js";
7
+ export type * from "./type-extensions/global-options.js";
8
+ export type * from "./type-extensions/hooks.js";
9
+ export type * from "./type-extensions/hre.js";
10
10
 
11
11
  const hardhatPlugin: HardhatPlugin = {
12
12
  id: "builtin:network-manager",
@@ -1,6 +1,5 @@
1
1
  import type { ChainType, DefaultChainType } from "../../../../types/network.js";
2
2
 
3
- import "../../../../types/config.js";
4
3
  declare module "../../../../types/config.js" {
5
4
  export interface HardhatUserConfig {
6
5
  chainDescriptors?: ChainDescriptorsUserConfig;
@@ -1,4 +1,3 @@
1
- import "../../../../types/global-options.js";
2
1
  declare module "../../../../types/global-options.js" {
3
2
  export interface GlobalOptions {
4
3
  network: string;
@@ -9,7 +9,6 @@ import type {
9
9
  import type { CoverageData } from "../../coverage/types.js";
10
10
  import type { GasMeasurement } from "../../gas-analytics/types.js";
11
11
 
12
- import "../../../../types/hooks.js";
13
12
  declare module "../../../../types/hooks.js" {
14
13
  export interface HardhatHooks {
15
14
  network: NetworkHooks;
@@ -1,6 +1,5 @@
1
1
  import type { NetworkManager } from "../../../../types/network.js";
2
2
 
3
- import "../../../../types/hre.js";
4
3
  declare module "../../../../types/hre.js" {
5
4
  export interface HardhatRuntimeEnvironment {
6
5
  network: NetworkManager;