Commit f591e916 authored by yann300's avatar yann300

es6 class function

parent b9decda1
......@@ -6,23 +6,23 @@ class Int extends ValueType {
constructor (storageBytes) {
super(1, storageBytes, 'int')
}
}
Int.prototype.decodeFromStorage = function (location, storageContent) {
decodeFromStorage (location, storageContent) {
return util.decodeInt(location, storageContent, this.storageBytes, true)
}
}
Int.prototype.decodeFromStack = function (stackDepth, stack, memory) {
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) {
decodeFromMemory (offset, memory) {
var value = memory.substr(offset, 64)
return util.decodeIntFromHex(value, 32, true)
}
}
module.exports = Int
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment