Commit ca1a6dad authored by yann300's avatar yann300

fix decode add, int, uint

parent 4979208c
......@@ -13,7 +13,7 @@ Address.prototype.decodeFromStorage = function (location, storageContent) {
}
Address.prototype.decodeLocals = function (stackHeight, stack, memory) {
if (stack.length < stackHeight) {
if (stack.length - 1 < stackHeight) {
return '0x0000000000000000000000000000000000000000'
} else {
return '0x' + util.extractHexByteSlice(stack[stack.length - 1 - stackHeight], this.storageBytes, 0)
......
......@@ -12,7 +12,7 @@ Int.prototype.decodeFromStorage = function (location, storageContent) {
}
Int.prototype.decodeLocals = function (stackHeight, stack, memory) {
if (stack.length < stackHeight) {
if (stack.length - 1 < stackHeight) {
return '0'
} else {
return util.decodeIntFromHex(stack[stack.length - 1 - stackHeight].replace('0x', ''), 32, true)
......
......@@ -12,7 +12,7 @@ Uint.prototype.decodeFromStorage = function (location, storageContent) {
}
Uint.prototype.decodeLocals = function (stackHeight, stack, memory) {
if (stack.length < stackHeight) {
if (stack.length - 1 < stackHeight) {
return '0'
} else {
return util.decodeIntFromHex(stack[stack.length - 1 - stackHeight].replace('0x', ''), this.storageBytes, false)
......
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