es6 class function

pull/7/head
yann300 8 years ago
parent b9decda1d7
commit f591e916f9
  1. 26
      src/solidity/types/Int.js

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

Loading…
Cancel
Save