|
|
@ -15,6 +15,7 @@ class DebuggerSolidityLocals { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
init (sourceLocation) { |
|
|
|
init (sourceLocation) { |
|
|
|
|
|
|
|
this._sourceLocation = sourceLocation |
|
|
|
var decodeTimeout = null |
|
|
|
var decodeTimeout = null |
|
|
|
if (!this.storageResolver) { |
|
|
|
if (!this.storageResolver) { |
|
|
|
return this.event.trigger('solidityLocalsMessage', ['storage not ready']) |
|
|
|
return this.event.trigger('solidityLocalsMessage', ['storage not ready']) |
|
|
@ -28,7 +29,7 @@ class DebuggerSolidityLocals { |
|
|
|
}, 500) |
|
|
|
}, 500) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
decode (sourceLocation) { |
|
|
|
decode (sourceLocation, cursor) { |
|
|
|
const self = this |
|
|
|
const self = this |
|
|
|
this.event.trigger('solidityLocalsMessage', ['']) |
|
|
|
this.event.trigger('solidityLocalsMessage', ['']) |
|
|
|
this.traceManager.waterfall([ |
|
|
|
this.traceManager.waterfall([ |
|
|
@ -65,12 +66,18 @@ class DebuggerSolidityLocals { |
|
|
|
var memory = result[1].value |
|
|
|
var memory = result[1].value |
|
|
|
try { |
|
|
|
try { |
|
|
|
var storageViewer = new StorageViewer({ stepIndex: this.stepManager.currentStepIndex, tx: this.tx, address: result[2].value }, this.storageResolver, this.traceManager) |
|
|
|
var storageViewer = new StorageViewer({ stepIndex: this.stepManager.currentStepIndex, tx: this.tx, address: result[2].value }, this.storageResolver, this.traceManager) |
|
|
|
localDecoder.solidityLocals(this.stepManager.currentStepIndex, this.internalTreeCall, stack, memory, storageViewer, sourceLocation).then((locals) => { |
|
|
|
localDecoder.solidityLocals(this.stepManager.currentStepIndex, this.internalTreeCall, stack, memory, storageViewer, sourceLocation, cursor).then((locals) => { |
|
|
|
if (!locals.error) { |
|
|
|
if (!cursor) { |
|
|
|
this.event.trigger('solidityLocals', [locals]) |
|
|
|
if (!locals.error) { |
|
|
|
} |
|
|
|
this.event.trigger('solidityLocals', [locals]) |
|
|
|
if (!Object.keys(locals).length) { |
|
|
|
} |
|
|
|
this.event.trigger('solidityLocalsMessage', ['no locals']) |
|
|
|
if (!Object.keys(locals).length) { |
|
|
|
|
|
|
|
this.event.trigger('solidityLocalsMessage', ['no locals']) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
if (!locals.error) { |
|
|
|
|
|
|
|
this.event.trigger('solidityLocalsLoadMoreCompleted', [locals]) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
@ -79,6 +86,17 @@ class DebuggerSolidityLocals { |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
decodeMore () { |
|
|
|
|
|
|
|
console.log('called and works!') |
|
|
|
|
|
|
|
let decodeTimeout = null |
|
|
|
|
|
|
|
if (!this.storageResolver) return this.event.trigger('solidityLocalsMessage', ['storage not ready']) |
|
|
|
|
|
|
|
if (decodeTimeout) window.clearTimeout(decodeTimeout) |
|
|
|
|
|
|
|
this.event.trigger('solidityLocalsUpdating') |
|
|
|
|
|
|
|
decodeTimeout = setTimeout(() => { |
|
|
|
|
|
|
|
this.decode(this._sourceLocation) |
|
|
|
|
|
|
|
}, 500) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
module.exports = DebuggerSolidityLocals |
|
|
|
module.exports = DebuggerSolidityLocals |
|
|
|