mvoe solidity state into vmdebugger logic class

pull/1/head
Iuri Matias 6 years ago committed by yann300
parent 9139a78547
commit 3beaf5cb12
  1. 31
      src/app/debugger/debuggerUI/VmDebugger.js

@ -46,6 +46,8 @@ class VmDebuggerLogic {
this._solidityProxy = _solidityProxy this._solidityProxy = _solidityProxy
this._callTree = _callTree this._callTree = _callTree
this.storageResolver = null this.storageResolver = null
this.debuggerSolidityState = new DebuggerSolidityState(_parentUI, _traceManager, _codeManager, _solidityProxy)
} }
start () { start () {
@ -54,6 +56,9 @@ class VmDebuggerLogic {
this.listenToTraceManagerEvents() this.listenToTraceManagerEvents()
this.listenToFullStorageChanges() this.listenToFullStorageChanges()
this.listenToNewChanges() this.listenToNewChanges()
this.debuggerSolidityState.init()
this.listenToSolidityStateEvents()
} }
listenToEvents () { listenToEvents () {
@ -208,6 +213,7 @@ class VmDebuggerLogic {
const self = this const self = this
self._parent.event.register('newTraceLoaded', this, function () { self._parent.event.register('newTraceLoaded', this, function () {
self.storageResolver = new StorageResolver({web3: self._parent.web3}) self.storageResolver = new StorageResolver({web3: self._parent.web3})
self.debuggerSolidityState.storageResolver = self.storageResolver
self.event.trigger('newTrace', []) self.event.trigger('newTrace', [])
}) })
@ -218,6 +224,19 @@ class VmDebuggerLogic {
}) })
} }
listenToSolidityStateEvents () {
const self = this
this.debuggerSolidityState.event.register('solidityState', this, function (state) {
self.event.trigger('solidityState', [state])
})
this.debuggerSolidityState.event.register('solidityStateMessage', this, function (message) {
self.event.trigger('solidityStateMessage', [message])
})
this.debuggerSolidityState.event.register('solidityStateUpdating', this, function () {
self.event.trigger('solidityStateUpdating', [])
})
}
} }
function VmDebugger (_parentUI, _traceManager, _codeManager, _solidityProxy, _callTree) { function VmDebugger (_parentUI, _traceManager, _codeManager, _solidityProxy, _callTree) {
@ -274,16 +293,16 @@ function VmDebugger (_parentUI, _traceManager, _codeManager, _solidityProxy, _ca
self.stepDetail.updateField('vm trace step', index) self.stepDetail.updateField('vm trace step', index)
}) })
this.debuggerSolidityState = new DebuggerSolidityState(_parentUI, _traceManager, _codeManager, _solidityProxy) // this.debuggerSolidityState = new DebuggerSolidityState(_parentUI, _traceManager, _codeManager, _solidityProxy)
this.solidityState = new SolidityState() this.solidityState = new SolidityState()
this.debuggerSolidityState.init() // this.debuggerSolidityState.init()
this.debuggerSolidityState.event.register('solidityState', this, function (state) { this.vmDebuggerLogic.event.register('solidityState', this, function (state) {
self.solidityState.update(state) self.solidityState.update(state)
}) })
this.debuggerSolidityState.event.register('solidityStateMessage', this, function (message) { this.vmDebuggerLogic.event.register('solidityStateMessage', this, function (message) {
self.solidityState.setMessage(message) self.solidityState.setMessage(message)
}) })
this.debuggerSolidityState.event.register('solidityStateUpdating', this, function () { this.vmDebuggerLogic.event.register('solidityStateUpdating', this, function () {
self.solidityState.setUpdating() self.solidityState.setUpdating()
}) })
@ -318,7 +337,7 @@ function VmDebugger (_parentUI, _traceManager, _codeManager, _solidityProxy, _ca
this.vmDebuggerLogic.event.register('newTrace', () => { this.vmDebuggerLogic.event.register('newTrace', () => {
if (!self.view) return if (!self.view) return
self.debuggerSolidityState.storageResolver = self.vmDebuggerLogic.storageResolver // self.debuggerSolidityState.storageResolver = self.vmDebuggerLogic.storageResolver
self.debuggerSolidityLocals.storageResolver = self.vmDebuggerLogic.storageResolver self.debuggerSolidityLocals.storageResolver = self.vmDebuggerLogic.storageResolver
// self.solidityState.storageResolver = self.storageResolver // self.solidityState.storageResolver = self.storageResolver
// self.fullStoragesChangesPanel.storageResolver = self.storageResolver // self.fullStoragesChangesPanel.storageResolver = self.storageResolver

Loading…
Cancel
Save