Skip to content

Commit 4ccbe1a

Browse files
authored
Merge pull request #7102 from NomicFoundation/chore/bump-edr
Upgrade to @NomicFoundation/edr v0.12.0-next.3 and add created address in trace
2 parents aa27484 + dc79972 commit 4ccbe1a

File tree

13 files changed

+97
-41
lines changed

13 files changed

+97
-41
lines changed

.changeset/proud-colts-itch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"hardhat": minor
3+
---
4+
5+
Upgraded EDR dependency to @nomicfoundation/edr v0.12.0-next.3

.changeset/real-emus-begin.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"hardhat": patch
3+
---
4+
5+
Upgraded EDR dependency to @nomicfoundation/edr v0.12.0-next.2

.changeset/spicy-bugs-sit.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"hardhat": patch
3+
---
4+
5+
Added the addresses of created contracts in call traces

.changeset/spotty-pianos-confess.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"hardhat": minor
3+
---
4+
5+
Removed deprecated JSON-RPC methods: `eth_mining`, `net_listening`, `net_peerCount`, `hardhat_addCompilationResult`, `hardhat_intervalMine`, and `hardhat_reset`.

pnpm-lock.yaml

Lines changed: 36 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

v-next/hardhat/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
"typescript": "~5.8.0"
8686
},
8787
"dependencies": {
88-
"@nomicfoundation/edr": "0.12.0-next.1",
88+
"@nomicfoundation/edr": "0.12.0-next.3",
8989
"@nomicfoundation/hardhat-errors": "workspace:^3.0.0-next.26",
9090
"@nomicfoundation/hardhat-utils": "workspace:^3.0.0-next.26",
9191
"@nomicfoundation/hardhat-zod-utils": "workspace:^3.0.0-next.26",

v-next/hardhat/src/internal/builtin-plugins/network-manager/edr/stack-traces/solidity-stack-trace.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import type {
2424
ContractTooLargeErrorStackTraceEntry,
2525
InternalFunctionCallStackEntry,
2626
ContractCallRunOutOfGasError,
27+
CheatcodeErrorStackTraceEntry,
2728
} from "@nomicfoundation/edr";
2829

2930
import {
@@ -102,6 +103,7 @@ export type SolidityStackTraceEntry =
102103
| UnmappedSolc063RevertErrorStackTraceEntry
103104
| ContractTooLargeErrorStackTraceEntry
104105
| InternalFunctionCallStackEntry
105-
| ContractCallRunOutOfGasError;
106+
| ContractCallRunOutOfGasError
107+
| CheatcodeErrorStackTraceEntry;
106108

107109
export type SolidityStackTrace = SolidityStackTraceEntry[];

v-next/hardhat/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-solidity-errors.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ export function encodeStackTraceEntry(
8989
case StackTraceEntryType.RETURNDATA_SIZE_ERROR:
9090
case StackTraceEntryType.NONCONTRACT_ACCOUNT_CALLED_ERROR:
9191
case StackTraceEntryType.CALL_FAILED_ERROR:
92+
case StackTraceEntryType.CHEATCODE_ERROR:
9293
case StackTraceEntryType.DIRECT_LIBRARY_CALL_ERROR:
9394
return sourceReferenceToSolidityCallsite(stackTraceEntry.sourceReference);
9495

@@ -265,6 +266,7 @@ function getMessageFromLastStackTraceEntry(
265266
return `VM Exception while processing transaction: ${panicMessage}`;
266267

267268
case StackTraceEntryType.CUSTOM_ERROR:
269+
case StackTraceEntryType.CHEATCODE_ERROR:
268270
return `VM Exception while processing transaction: ${stackTraceEntry.message}`;
269271

270272
case StackTraceEntryType.OTHER_EXECUTION_ERROR:

v-next/hardhat/src/internal/builtin-plugins/solidity-test/formatters.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ function formatTrace(
109109
): NestedArray<string> {
110110
const {
111111
success,
112+
address,
112113
contract,
113114
inputs,
114115
gasUsed,
@@ -132,15 +133,15 @@ function formatTrace(
132133
let openingLine: string;
133134
let closingLine: string | undefined;
134135
if (kind === CallKind.Create) {
135-
openingLine = `[${gasUsed}] ${colorizer.yellow("→ new")} ${contract}`;
136+
openingLine = `[${gasUsed}] ${colorizer.yellow("→ new")} ${contract ?? "<unknown>"}@${address}`;
136137
// TODO: Uncomment this when the formattedInputs starts containing
137138
// the address of where the contract was deployed instead of the code.
138139
// if (formattedInputs !== undefined) {
139140
// openingLine = `${openingLine}@${formattedInputs}`;
140141
// }
141142
} else {
142143
const formattedKind = formatKind(kind);
143-
openingLine = `[${gasUsed}] ${color(contract)}`;
144+
openingLine = `[${gasUsed}] ${color(contract ?? address)}`;
144145
if (formattedInputs !== undefined) {
145146
openingLine = `${openingLine}::${formattedInputs}`;
146147
}

v-next/hardhat/src/internal/builtin-plugins/solidity-test/stack-trace-solidity-errors.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ export function getMessageFromLastStackTraceEntry(
6363
case StackTraceEntryType.CUSTOM_ERROR:
6464
return stackTraceEntry.message;
6565

66+
case StackTraceEntryType.CHEATCODE_ERROR:
67+
return stackTraceEntry.message;
68+
6669
case StackTraceEntryType.CONTRACT_TOO_LARGE_ERROR:
6770
return "Trying to deploy a contract whose code is too large";
6871

0 commit comments

Comments
 (0)