diff --git a/libs/remix-debug/src/trace/traceManager.ts b/libs/remix-debug/src/trace/traceManager.ts index d521f580f7..82f0716b66 100644 --- a/libs/remix-debug/src/trace/traceManager.ts +++ b/libs/remix-debug/src/trace/traceManager.ts @@ -190,12 +190,15 @@ export class TraceManager { return this.traceCache.contractCreation[token] } - getMemoryAt (stepIndex) { + getMemoryAt (stepIndex, format = true) { this.checkRequestedStep(stepIndex) const lastChanges = util.findLowerBoundValue(stepIndex, this.traceCache.memoryChanges) if (lastChanges === null) { throw new Error('no memory found') } + if (!format) { + return this.trace[lastChanges].memory + } if (this.traceCache.formattedMemory[lastChanges]) { return this.traceCache.formattedMemory[lastChanges] } diff --git a/libs/remix-debug/test/traceManager.ts b/libs/remix-debug/test/traceManager.ts index 3269bceb4a..8128e21ac8 100644 --- a/libs/remix-debug/test/traceManager.ts +++ b/libs/remix-debug/test/traceManager.ts @@ -164,7 +164,7 @@ tape('TraceManager', function (t) { t.test('TraceManager.getMemoryAt', function (st) { st.plan(3) try { - const result = traceManager.getMemoryAt(0) + const result = traceManager.getMemoryAt(0, false) console.log(result) st.ok(result.length === 0) } catch (error) { @@ -172,7 +172,7 @@ tape('TraceManager', function (t) { } try { - const result = traceManager.getMemoryAt(34) + const result = traceManager.getMemoryAt(34, false) console.log(result) st.ok(result.length === 3) st.ok(result[2] === '0000000000000000000000000000000000000000000000000000000000000060')