es6 class function

pull/7/head
yann300 8 years ago
parent 31ad4d06bf
commit 422b042e32
  1. 12
      src/solidity/types/Bool.js

@ -6,24 +6,24 @@ class Bool extends ValueType {
constructor () {
super(1, 1, 'bool')
}
}
Bool.prototype.decodeFromStorage = function (location, storageContent) {
decodeFromStorage (location, storageContent) {
var value = util.extractHexValue(location, storageContent, this.storageBytes)
return value !== '00'
}
}
Bool.prototype.decodeFromStack = function (stackDepth, stack, memory) {
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) {
decodeFromMemory (offset, memory) {
var value = memory.substr(offset, 64)
return util.extractHexByteSlice(value, this.storageBytes, 0) !== '00'
}
}
module.exports = Bool

Loading…
Cancel
Save