remove direct reference to tx and pass it as an arg

pull/1/head
Iuri Matias 6 years ago committed by yann300
parent 1173d936a9
commit 673b1db782
  1. 2
      src/app/debugger/debugger/SolidityLocals.js
  2. 11
      src/app/debugger/debugger/VmDebugger.js
  3. 2
      src/app/debugger/debugger/debugger.js
  4. 2
      src/app/debugger/debugger/solidityState.js

@ -47,7 +47,7 @@ class DebuggerSolidityLocals {
var stack = result[0].value
var memory = result[1].value
try {
var storageViewer = new StorageViewer({ stepIndex: self.stepManager.currentStepIndex, tx: self.parent.tx, address: result[2].value }, self.storageResolver, self.traceManager)
var storageViewer = new StorageViewer({ stepIndex: self.stepManager.currentStepIndex, tx: self.tx, address: result[2].value }, self.storageResolver, self.traceManager)
localDecoder.solidityLocals(self.stepManager.currentStepIndex, self.internalTreeCall, stack, memory, storageViewer, sourceLocation).then((locals) => {
if (!locals.error) {
self.event.trigger('solidityLocals', [locals])

@ -10,7 +10,7 @@ var DebuggerSolidityLocals = require('./solidityLocals')
class VmDebuggerLogic {
constructor (_parentUI, _stepManager, _traceManager, _codeManager, _solidityProxy, _callTree) {
constructor (_parentUI, tx, _stepManager, _traceManager, _codeManager, _solidityProxy, _callTree) {
this.event = new EventManager()
this._parentUI = _parentUI
this._parent = this._parentUI.debugger
@ -20,9 +20,10 @@ class VmDebuggerLogic {
this._solidityProxy = _solidityProxy
this._callTree = _callTree
this.storageResolver = null
this.tx = tx
this.debuggerSolidityState = new DebuggerSolidityState(_parentUI, _stepManager, _traceManager, _codeManager, _solidityProxy)
this.debuggerSolidityLocals = new DebuggerSolidityLocals(_parentUI, _stepManager, _traceManager, _callTree)
this.debuggerSolidityState = new DebuggerSolidityState(_parentUI, tx, _stepManager, _traceManager, _codeManager, _solidityProxy)
this.debuggerSolidityLocals = new DebuggerSolidityLocals(_parentUI, tx, _stepManager, _traceManager, _callTree)
}
start () {
@ -111,7 +112,7 @@ class VmDebuggerLogic {
if (error) return
if (!self.storageResolver) return
var storageViewer = new StorageViewer({ stepIndex: self.stepManager.currentStepIndex, tx: self._parentUI.tx, address: address }, self.storageResolver, self._traceManager)
var storageViewer = new StorageViewer({ stepIndex: self.stepManager.currentStepIndex, tx: self.tx, address: address }, self.storageResolver, self._traceManager)
storageViewer.storageRange((error, storage) => {
if (error) {
@ -185,7 +186,7 @@ class VmDebuggerLogic {
var storageJSON = {}
for (var k in self.addresses) {
var address = self.addresses[k]
var storageViewer = new StorageViewer({ stepIndex: self.stepManager.currentStepIndex, tx: self._parent.tx, address: address }, self.storageResolver, self._traceManager)
var storageViewer = new StorageViewer({ stepIndex: self.stepManager.currentStepIndex, tx: self.tx, address: address }, self.storageResolver, self._traceManager)
storageViewer.storageRange(function (error, result) {
if (!error) {
storageJSON[address] = result

@ -91,7 +91,7 @@ Debugger.prototype.debug = function (parent, tx, loadingCb) {
})
})
this.vmDebuggerLogic = new VmDebuggerLogic(parent, this.step_manager, this.debugger.traceManager, this.debugger.codeManager, this.debugger.solidityProxy, this.debugger.callTree)
this.vmDebuggerLogic = new VmDebuggerLogic(parent, tx, this.step_manager, this.debugger.traceManager, this.debugger.codeManager, this.debugger.solidityProxy, this.debugger.callTree)
loadingCb()
this.debugger.debug(tx)

@ -66,7 +66,7 @@ class DebuggerSolidityState {
extractStateVariables (stateVars, address) {
const self = this
var storageViewer = new StorageViewer({ stepIndex: self.stepManager.currentStepIndex, tx: self.parent.tx, address: address }, self.storageResolver, self.traceManager)
var storageViewer = new StorageViewer({ stepIndex: self.stepManager.currentStepIndex, tx: self.tx, address: address }, self.storageResolver, self.traceManager)
stateDecoder.decodeState(stateVars, storageViewer).then((result) => {
self.event.trigger('solidityStateMessage', [''])
if (result.error) {

Loading…
Cancel
Save