Commit cdf7f442 authored by yann300's avatar yann300

format memory before decoding

parent dc07c26d
...@@ -6,6 +6,7 @@ function solidityLocals (vmtraceIndex, internalTreeCall, stack, memory) { ...@@ -6,6 +6,7 @@ function solidityLocals (vmtraceIndex, internalTreeCall, stack, memory) {
return { 'error': 'Can\'t display locals. reason: compilation result might not have been provided' } return { 'error': 'Can\'t display locals. reason: compilation result might not have been provided' }
} }
var locals = {} var locals = {}
memory = formatMemory(memory)
for (var local in scope.locals) { for (var local in scope.locals) {
let variable = scope.locals[local] let variable = scope.locals[local]
if (variable.type.decodeLocals) { if (variable.type.decodeLocals) {
...@@ -17,6 +18,13 @@ function solidityLocals (vmtraceIndex, internalTreeCall, stack, memory) { ...@@ -17,6 +18,13 @@ function solidityLocals (vmtraceIndex, internalTreeCall, stack, memory) {
return locals return locals
} }
function formatMemory (memory) {
if (memory instanceof Array) {
memory = memory.join('').replace(/0x/g, '')
}
return memory
}
module.exports = { module.exports = {
solidityLocals: solidityLocals 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