From 8798eeef8fd7d4325bdafa408c6b32e5e173f134 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 12 Dec 2016 16:39:13 +0100 Subject: [PATCH] decode bool --- src/solidity/types/Bool.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/solidity/types/Bool.js b/src/solidity/types/Bool.js index 6889b909da..5df3e29fa2 100644 --- a/src/solidity/types/Bool.js +++ b/src/solidity/types/Bool.js @@ -12,4 +12,12 @@ Bool.prototype.decodeFromStorage = function (location, storageContent) { return value !== '00' } +Bool.prototype.decodeLocals = function (stackHeight, stack, memory) { + if (stack.length - 1 < stackHeight) { + return false + } else { + return util.extractHexByteSlice(stack[stack.length - 1 - stackHeight], this.storageBytes, 0) !== '00' + } +} + module.exports = Bool