Commit e14125ff authored by yann300's avatar yann300

decodeFromMemory Address, Bool

parent f7de3c1f
...@@ -20,4 +20,10 @@ Address.prototype.decodeLocals = function (stackHeight, stack, memory) { ...@@ -20,4 +20,10 @@ Address.prototype.decodeLocals = function (stackHeight, stack, memory) {
} }
} }
Address.prototype.decodeFromMemory = function (offset, memory) {
var value = memory.substr(offset, 64)
value = util.extractHexByteSlice(value, this.storageBytes, 0)
return value
}
module.exports = Address module.exports = Address
...@@ -20,4 +20,9 @@ Bool.prototype.decodeLocals = function (stackHeight, stack, memory) { ...@@ -20,4 +20,9 @@ Bool.prototype.decodeLocals = function (stackHeight, stack, memory) {
} }
} }
Bool.prototype.decodeFromMemory = function (offset, memory) {
var value = memory.substr(offset, 64)
return util.extractHexByteSlice(value, this.storageBytes, 0) !== '00'
}
module.exports = Bool module.exports = Bool
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