File tree 2 files changed +18
-2
lines changed
packages/hardhat-core/src/internal/hardhat-network/provider
2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -232,11 +232,24 @@ export function edrTracingStepToMinimalInterpreterStep(
232
232
export function edrTracingMessageResultToMinimalEVMResult (
233
233
tracingMessageResult : TracingMessageResult
234
234
) : MinimalEVMResult {
235
- return {
235
+ const executionResult = tracingMessageResult . executionResult . result ;
236
+
237
+ // only SuccessResult has logs
238
+ const success = "logs" in executionResult ;
239
+
240
+ const minimalEVMResult : MinimalEVMResult = {
236
241
execResult : {
237
- executionGasUsed : tracingMessageResult . executionResult . result . gasUsed ,
242
+ executionGasUsed : executionResult . gasUsed ,
243
+ success,
238
244
} ,
239
245
} ;
246
+
247
+ // only success and exceptional halt have reason
248
+ if ( "reason" in executionResult ) {
249
+ minimalEVMResult . execResult . reason = executionResult . reason ;
250
+ }
251
+
252
+ return minimalEVMResult ;
240
253
}
241
254
242
255
export function edrTracingMessageToMinimalMessage (
Original file line number Diff line number Diff line change
1
+ import type { ExceptionalHalt , SuccessReason } from "@nomicfoundation/edr" ;
1
2
import type { Address } from "@nomicfoundation/ethereumjs-util" ;
2
3
3
4
/**
@@ -16,7 +17,9 @@ export interface MinimalInterpreterStep {
16
17
}
17
18
18
19
export interface MinimalExecResult {
20
+ success : boolean ;
19
21
executionGasUsed : bigint ;
22
+ reason ?: SuccessReason | ExceptionalHalt ;
20
23
}
21
24
22
25
export interface MinimalEVMResult {
You can’t perform that action at this time.
0 commit comments