Commit fb84fed8 authored by yann300's avatar yann300

rename decodeLocals decodeFromStack

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