From 2e3d94f370b8650824db6bf2a0f54eba8a5477d0 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 12 Dec 2016 16:39:43 +0100 Subject: [PATCH] decode fixedbytearray --- src/solidity/types/FixedByteArray.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/solidity/types/FixedByteArray.js b/src/solidity/types/FixedByteArray.js index 36c9cdd7d1..434dc1852f 100644 --- a/src/solidity/types/FixedByteArray.js +++ b/src/solidity/types/FixedByteArray.js @@ -12,4 +12,13 @@ FixedByteArray.prototype.decodeFromStorage = function (location, storageContent) return '0x' + value.toUpperCase() } +FixedByteArray.prototype.decodeLocals = function (stackHeight, stack, memory) { + if (stack.length - 1 < stackHeight) { + return '0x' + } else { + var value = stack[stack.length - 1 - stackHeight] + return '0x' + value.substr(2, 2 * this.storageBytes).toUpperCase() // util.extractHexByteSlice(stack[stack.length - 1 - stackHeight], this.storageBytes, this.storageBytes) + } +} + module.exports = FixedByteArray