From 422b042e32d5d1dadc5f72b69ea0784b7b8f886d Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 10 Jan 2017 13:42:56 +0100 Subject: [PATCH] es6 class function --- src/solidity/types/Bool.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/solidity/types/Bool.js b/src/solidity/types/Bool.js index 4ae8472cbc..ee004b646f 100644 --- a/src/solidity/types/Bool.js +++ b/src/solidity/types/Bool.js @@ -6,24 +6,24 @@ class Bool extends ValueType { constructor () { super(1, 1, 'bool') } -} -Bool.prototype.decodeFromStorage = function (location, storageContent) { - var value = util.extractHexValue(location, storageContent, this.storageBytes) - return value !== '00' -} + decodeFromStorage (location, storageContent) { + var value = util.extractHexValue(location, storageContent, this.storageBytes) + return value !== '00' + } -Bool.prototype.decodeFromStack = function (stackDepth, stack, memory) { - if (stack.length - 1 < stackDepth) { - return false - } else { - return util.extractHexByteSlice(stack[stack.length - 1 - stackDepth], this.storageBytes, 0) !== '00' + decodeFromStack (stackDepth, stack, memory) { + if (stack.length - 1 < stackDepth) { + return false + } else { + return util.extractHexByteSlice(stack[stack.length - 1 - stackDepth], this.storageBytes, 0) !== '00' + } } -} -Bool.prototype.decodeFromMemory = function (offset, memory) { - var value = memory.substr(offset, 64) - return util.extractHexByteSlice(value, this.storageBytes, 0) !== '00' + decodeFromMemory (offset, memory) { + var value = memory.substr(offset, 64) + return util.extractHexByteSlice(value, this.storageBytes, 0) !== '00' + } } module.exports = Bool