fix getTrace with stack items

pull/3316/head
yann300 2 years ago committed by Aniket
parent f5e5147b1b
commit abaa57cb32
  1. 12
      apps/debugger/src/app/debugger-api.ts

@ -1,7 +1,9 @@
import Web3 from 'web3'
import {init , traceHelper, TransactionDebugger as Debugger } from '@remix-project/remix-debug'
import { init , traceHelper, TransactionDebugger as Debugger } from '@remix-project/remix-debug'
import { CompilerAbstract } from '@remix-project/remix-solidity'
import { lineText } from '@remix-ui/editor'
import { util } from '@remix-project/remix-lib'
const { toHexPaddedString } = util
export const DebuggerApiMixin = (Base) => class extends Base {
@ -139,7 +141,13 @@ export const DebuggerApiMixin = (Base) => class extends Base {
})
const trace = await debug.debugger.traceManager.getTrace(hash)
trace.structLogs = trace.structLogs.map((step) => {
step.stack = []
const stack = []
for (const prop in step.stack) {
if (prop !== 'length') {
stack.push(toHexPaddedString(step.stack[prop]))
}
}
step.stack = stack
return step
})
return trace

Loading…
Cancel
Save