rename decodeLocals decodeFromStack

pull/7/head
yann300 8 years ago
parent e7c45d29f2
commit fb84fed8ef
  1. 4
      src/solidity/localDecoder.js
  2. 2
      src/solidity/types/Address.js
  3. 2
      src/solidity/types/ArrayType.js
  4. 2
      src/solidity/types/Bool.js
  5. 2
      src/solidity/types/DynamicByteArray.js
  6. 2
      src/solidity/types/Enum.js
  7. 2
      src/solidity/types/FixedByteArray.js
  8. 2
      src/solidity/types/Int.js
  9. 4
      src/solidity/types/StringType.js
  10. 2
      src/solidity/types/Struct.js
  11. 2
      src/solidity/types/Uint.js

@ -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 {

Loading…
Cancel
Save