Commit 58e603c7 authored by yann300's avatar yann300

format memory before decoding

parent b37b0d0c
......@@ -6,6 +6,7 @@ function solidityLocals (vmtraceIndex, internalTreeCall, stack, memory) {
return { 'error': 'Can\'t display locals. reason: compilation result might not have been provided' }
}
var locals = {}
memory = formatMemory(memory)
for (var local in scope.locals) {
let variable = scope.locals[local]
if (variable.type.decodeLocals) {
......@@ -17,6 +18,13 @@ function solidityLocals (vmtraceIndex, internalTreeCall, stack, memory) {
return locals
}
function formatMemory (memory) {
if (memory instanceof Array) {
memory = memory.join('').replace(/0x/g, '')
}
return memory
}
module.exports = {
solidityLocals: solidityLocals
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment