Commit fb84fed8 authored by yann300's avatar yann300

rename decodeLocals decodeFromStack

parent e7c45d29
...@@ -9,8 +9,8 @@ function solidityLocals (vmtraceIndex, internalTreeCall, stack, memory) { ...@@ -9,8 +9,8 @@ function solidityLocals (vmtraceIndex, internalTreeCall, stack, memory) {
memory = formatMemory(memory) 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.decodeFromStack) {
locals[variable.name] = variable.type.decodeLocals(variable.stackDepth, stack, memory) locals[variable.name] = variable.type.decodeFromStack(variable.stackDepth, stack, memory)
} else { } else {
locals[variable.name] = '' locals[variable.name] = ''
} }
......
...@@ -12,7 +12,7 @@ class Address extends ValueType { ...@@ -12,7 +12,7 @@ class Address extends ValueType {
return '0x' + value.toUpperCase() return '0x' + value.toUpperCase()
} }
decodeLocals (stackDepth, stack, memory) { decodeFromStack (stackDepth, stack, memory) {
if (stackDepth >= stack.length) { if (stackDepth >= stack.length) {
return '0x0000000000000000000000000000000000000000' return '0x0000000000000000000000000000000000000000'
} else { } else {
......
...@@ -56,7 +56,7 @@ class ArrayType { ...@@ -56,7 +56,7 @@ class ArrayType {
} }
} }
decodeLocals (stackDepth, stack, memory) { decodeFromStack (stackDepth, stack, memory) {
if (stack.length - 1 < stackDepth) { if (stack.length - 1 < stackDepth) {
return [] return []
} else { // TODO manage decoding locals from storage } else { // TODO manage decoding locals from storage
......
...@@ -13,7 +13,7 @@ Bool.prototype.decodeFromStorage = function (location, storageContent) { ...@@ -13,7 +13,7 @@ Bool.prototype.decodeFromStorage = function (location, storageContent) {
return value !== '00' return value !== '00'
} }
Bool.prototype.decodeLocals = function (stackDepth, stack, memory) { Bool.prototype.decodeFromStack = function (stackDepth, stack, memory) {
if (stack.length - 1 < stackDepth) { if (stack.length - 1 < stackDepth) {
return false return false
} else { } else {
......
...@@ -35,7 +35,7 @@ class DynamicByteArray extends ValueType { ...@@ -35,7 +35,7 @@ class DynamicByteArray extends ValueType {
} }
} }
decodeLocals (stackDepth, stack, memory) { decodeFromStack (stackDepth, stack, memory) {
if (stack.length - 1 < stackDepth) { if (stack.length - 1 < stackDepth) {
return { return {
value: '0x', value: '0x',
......
...@@ -21,7 +21,7 @@ Enum.prototype.decodeFromStorage = function (location, storageContent) { ...@@ -21,7 +21,7 @@ Enum.prototype.decodeFromStorage = function (location, storageContent) {
return output(value, this.enumDef) return output(value, this.enumDef)
} }
Enum.prototype.decodeLocals = function (stackDepth, stack, memory) { Enum.prototype.decodeFromStack = function (stackDepth, stack, memory) {
var defaultValue = 0 var defaultValue = 0
if (stack.length - 1 < stackDepth) { if (stack.length - 1 < stackDepth) {
defaultValue = 0 defaultValue = 0
......
...@@ -12,7 +12,7 @@ class FixedByteArray extends ValueType { ...@@ -12,7 +12,7 @@ class FixedByteArray extends ValueType {
return '0x' + value.toUpperCase() return '0x' + value.toUpperCase()
} }
decodeLocals (stackDepth, stack, memory) { decodeFromStack (stackDepth, stack, memory) {
if (stack.length - 1 < stackDepth) { if (stack.length - 1 < stackDepth) {
return '0x' return '0x'
} else { } else {
......
...@@ -12,7 +12,7 @@ Int.prototype.decodeFromStorage = function (location, storageContent) { ...@@ -12,7 +12,7 @@ Int.prototype.decodeFromStorage = function (location, storageContent) {
return util.decodeInt(location, storageContent, this.storageBytes, true) return util.decodeInt(location, storageContent, this.storageBytes, true)
} }
Int.prototype.decodeLocals = function (stackDepth, stack, memory) { Int.prototype.decodeFromStack = function (stackDepth, stack, memory) {
if (stackDepth >= stack.length) { if (stackDepth >= stack.length) {
return '0' return '0'
} else { } else {
......
...@@ -12,8 +12,8 @@ class StringType extends DynamicBytes { ...@@ -12,8 +12,8 @@ class StringType extends DynamicBytes {
return format(decoded) return format(decoded)
} }
decodeLocals (stackDepth, stack, memory) { decodeFromStack (stackDepth, stack, memory) {
var decoded = super.decodeLocals(stackDepth, stack, memory) var decoded = super.decodeFromStack(stackDepth, stack, memory)
return format(decoded) return format(decoded)
} }
......
...@@ -21,7 +21,7 @@ class Struct { ...@@ -21,7 +21,7 @@ class Struct {
return ret return ret
} }
decodeLocals (stackDepth, stack, memory) { decodeFromStack (stackDepth, stack, memory) {
if (stack.length - 1 < stackDepth) { if (stack.length - 1 < stackDepth) {
return {} return {}
} else { // TODO manage decoding locals from storage } else { // TODO manage decoding locals from storage
......
...@@ -12,7 +12,7 @@ Uint.prototype.decodeFromStorage = function (location, storageContent) { ...@@ -12,7 +12,7 @@ Uint.prototype.decodeFromStorage = function (location, storageContent) {
return util.decodeInt(location, storageContent, this.storageBytes, false) return util.decodeInt(location, storageContent, this.storageBytes, false)
} }
Uint.prototype.decodeLocals = function (stackDepth, stack, memory) { Uint.prototype.decodeFromStack = function (stackDepth, stack, memory) {
if (stackDepth >= stack.length) { if (stackDepth >= stack.length) {
return '0' return '0'
} else { } else {
......
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