From fb84fed8effcf5d97c5695f07e37980e73a15cc5 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 10 Jan 2017 11:21:29 +0100 Subject: [PATCH] rename decodeLocals decodeFromStack --- src/solidity/localDecoder.js | 4 ++-- src/solidity/types/Address.js | 2 +- src/solidity/types/ArrayType.js | 2 +- src/solidity/types/Bool.js | 2 +- src/solidity/types/DynamicByteArray.js | 2 +- src/solidity/types/Enum.js | 2 +- src/solidity/types/FixedByteArray.js | 2 +- src/solidity/types/Int.js | 2 +- src/solidity/types/StringType.js | 4 ++-- src/solidity/types/Struct.js | 2 +- src/solidity/types/Uint.js | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/solidity/localDecoder.js b/src/solidity/localDecoder.js index bbbfedd43a..026881c134 100644 --- a/src/solidity/localDecoder.js +++ b/src/solidity/localDecoder.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] = '' } diff --git a/src/solidity/types/Address.js b/src/solidity/types/Address.js index 9735911c96..de7dacdba6 100644 --- a/src/solidity/types/Address.js +++ b/src/solidity/types/Address.js @@ -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 { diff --git a/src/solidity/types/ArrayType.js b/src/solidity/types/ArrayType.js index 0aa8f9fa19..62afc195c2 100644 --- a/src/solidity/types/ArrayType.js +++ b/src/solidity/types/ArrayType.js @@ -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 diff --git a/src/solidity/types/Bool.js b/src/solidity/types/Bool.js index f890cfa0e1..4ae8472cbc 100644 --- a/src/solidity/types/Bool.js +++ b/src/solidity/types/Bool.js @@ -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 { diff --git a/src/solidity/types/DynamicByteArray.js b/src/solidity/types/DynamicByteArray.js index 0530e03648..633705d669 100644 --- a/src/solidity/types/DynamicByteArray.js +++ b/src/solidity/types/DynamicByteArray.js @@ -35,7 +35,7 @@ class DynamicByteArray extends ValueType { } } - decodeLocals (stackDepth, stack, memory) { + decodeFromStack (stackDepth, stack, memory) { if (stack.length - 1 < stackDepth) { return { value: '0x', diff --git a/src/solidity/types/Enum.js b/src/solidity/types/Enum.js index 3464aff57e..8928d9cb18 100644 --- a/src/solidity/types/Enum.js +++ b/src/solidity/types/Enum.js @@ -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 diff --git a/src/solidity/types/FixedByteArray.js b/src/solidity/types/FixedByteArray.js index eab5618d89..76459e2ccf 100644 --- a/src/solidity/types/FixedByteArray.js +++ b/src/solidity/types/FixedByteArray.js @@ -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 { diff --git a/src/solidity/types/Int.js b/src/solidity/types/Int.js index 77d2cc037d..8a6b22cbf3 100644 --- a/src/solidity/types/Int.js +++ b/src/solidity/types/Int.js @@ -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 { diff --git a/src/solidity/types/StringType.js b/src/solidity/types/StringType.js index af10c8e736..2daefbf69d 100644 --- a/src/solidity/types/StringType.js +++ b/src/solidity/types/StringType.js @@ -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) } diff --git a/src/solidity/types/Struct.js b/src/solidity/types/Struct.js index aa593ee7f1..ecdbded5e8 100644 --- a/src/solidity/types/Struct.js +++ b/src/solidity/types/Struct.js @@ -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 diff --git a/src/solidity/types/Uint.js b/src/solidity/types/Uint.js index 2a161d3e77..a0dfe7f0d2 100644 --- a/src/solidity/types/Uint.js +++ b/src/solidity/types/Uint.js @@ -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 {