From 33c457006fce4e1535096ea875c744890dfa1b93 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 14 Dec 2016 13:24:35 +0100 Subject: [PATCH] decodeFromMemory FixedByteArray --- src/solidity/types/FixedByteArray.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/solidity/types/FixedByteArray.js b/src/solidity/types/FixedByteArray.js index 434dc1852f..275838d5c9 100644 --- a/src/solidity/types/FixedByteArray.js +++ b/src/solidity/types/FixedByteArray.js @@ -17,8 +17,13 @@ FixedByteArray.prototype.decodeLocals = function (stackHeight, stack, memory) { 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) + return '0x' + value.substr(2, 2 * this.storageBytes).toUpperCase() } } +FixedByteArray.prototype.decodeFromMemory = function (offset, memory) { + var value = memory.substr(offset, 64) + return util.extractHexByteSlice(value, this.storageBytes, 0).toUpperCase() +} + module.exports = FixedByteArray