es6 class function

pull/7/head
yann300 8 years ago
parent f591e916f9
commit 60ce2bbbe1
  1. 26
      src/solidity/types/Uint.js

@ -6,23 +6,23 @@ class Uint extends ValueType {
constructor (storageBytes) {
super(1, storageBytes, 'uint')
}
}
Uint.prototype.decodeFromStorage = function (location, storageContent) {
return util.decodeInt(location, storageContent, this.storageBytes, false)
}
decodeFromStorage (location, storageContent) {
return util.decodeInt(location, storageContent, this.storageBytes, false)
}
Uint.prototype.decodeFromStack = function (stackDepth, stack, memory) {
if (stackDepth >= stack.length) {
return '0'
} else {
return util.decodeIntFromHex(stack[stack.length - 1 - stackDepth].replace('0x', ''), this.storageBytes, false)
decodeFromStack (stackDepth, stack, memory) {
if (stackDepth >= stack.length) {
return '0'
} else {
return util.decodeIntFromHex(stack[stack.length - 1 - stackDepth].replace('0x', ''), this.storageBytes, false)
}
}
}
Uint.prototype.decodeFromMemory = function (offset, memory) {
var value = memory.substr(offset, 64)
return util.decodeIntFromHex(value, this.storageBytes, false)
decodeFromMemory (offset, memory) {
var value = memory.substr(offset, 64)
return util.decodeIntFromHex(value, this.storageBytes, false)
}
}
module.exports = Uint

Loading…
Cancel
Save