if error should also return the type name

pull/7/head
yann300 8 years ago
parent 8ea4e5d817
commit 2e8babeb21
  1. 10
      src/solidity/types/RefType.js

@ -20,7 +20,10 @@ class RefType {
*/
decodeFromStack (stackDepth, stack, memory, storage) {
if (stack.length - 1 < stackDepth) {
return { error: '<decoding failed - stack underflow ' + stackDepth + '>' }
return {
error: '<decoding failed - stack underflow ' + stackDepth + '>',
type: this.typeName
}
}
if (!storage) {
storage = {} // TODO this is a fallback, should manage properly locals store in storage
@ -32,7 +35,10 @@ class RefType {
} else if (this.isInMemory()) {
return this.decodeFromMemoryInternal(offset, memory)
} else {
return { error: '<decoding failed - no decoder for ' + this.location + '>' }
return {
error: '<decoding failed - no decoder for ' + this.location + '>',
type: this.typeName
}
}
}

Loading…
Cancel
Save