Skip to content

Commit 0681cac

Browse files
fvictorioalcuadrado
authored andcommitted
Add full stack and memory to step object
1 parent 221f640 commit 0681cac

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

packages/hardhat-core/src/internal/hardhat-network/provider/utils/convertToEdr.ts

+13-2
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,25 @@ export function edrRpcDebugTraceToHardhat(
208208
export function edrTracingStepToMinimalInterpreterStep(
209209
step: TracingStep
210210
): MinimalInterpreterStep {
211-
return {
211+
const minimalInterpreterStep: MinimalInterpreterStep = {
212212
pc: Number(step.pc),
213213
depth: step.depth,
214214
opcode: {
215215
name: step.opcode,
216216
},
217-
stack: step.stackTop !== undefined ? [step.stackTop] : [],
217+
stack:
218+
step.stack !== undefined
219+
? step.stack
220+
: step.stackTop !== undefined
221+
? [step.stackTop]
222+
: [],
218223
};
224+
225+
if (step.memory !== undefined) {
226+
minimalInterpreterStep.memory = step.memory;
227+
}
228+
229+
return minimalInterpreterStep;
219230
}
220231

221232
export function edrTracingMessageResultToMinimalEVMResult(

packages/hardhat-core/src/internal/hardhat-network/provider/vm/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export interface MinimalInterpreterStep {
1212
name: string;
1313
};
1414
stack: bigint[];
15+
memory?: Uint8Array;
1516
}
1617

1718
export interface MinimalExecResult {

0 commit comments

Comments
 (0)