add new stack panel; refactor

pull/1/head
Iuri Matias 6 years ago committed by yann300
parent 5a39449a15
commit 353f4812a5
  1. 16
      src/app/debugger/debuggerUI/VmDebugger.js
  2. 17
      src/app/debugger/debuggerUI/vmDebugger/StackPanel.js

@ -4,7 +4,7 @@ var CodeListView = require('./vmDebugger/CodeListView')
var CalldataPanel = require('./vmDebugger/CalldataPanel')
var MemoryPanel = require('./vmDebugger/MemoryPanel')
var CallstackPanel = require('./vmDebugger/CallstackPanel')
var StackPanel = require('../remix-debugger/src/ui/StackPanel')
var StackPanel = require('./vmDebugger/StackPanel')
var StoragePanel = require('../remix-debugger/src/ui/StoragePanel')
var FullStoragesChangesPanel = require('../remix-debugger/src/ui/FullStoragesChanges')
var StepDetail = require('../remix-debugger/src/ui/StepDetail')
@ -86,6 +86,20 @@ function VmDebugger (_parentUI, _traceManager, _codeManager, _solidityProxy, _ca
})
this.stackPanel = new StackPanel(_parentUI, _traceManager)
_parentUI.event.register('indexChanged', this, function (index) {
if (index < 0) return
if (_parentUI.currentStepIndex !== index) return
_traceManager.getMemoryAt(index, function (error, stack) {
if (error) {
console.log(error)
self.stackPanel.update({})
} else if (_parentUI.currentStepIndex === index) {
self.stackPanel.update(stack)
}
})
})
this.storagePanel = new StoragePanel(_parentUI, _traceManager)
this.stepDetail = new StepDetail(_parentUI, _traceManager)
this.solidityState = new SolidityState(_parentUI, _traceManager, _codeManager, _solidityProxy)

@ -0,0 +1,17 @@
'use strict'
var DropdownPanel = require('./DropdownPanel')
var yo = require('yo-yo')
function StackPanel () {
this.basicPanel = new DropdownPanel('Stack', {json: true, displayContentOnly: false})
}
StackPanel.prototype.update = function (calldata) {
this.basicPanel.update(calldata)
}
StackPanel.prototype.render = function () {
return yo`<div id='stackpanel' >${this.basicPanel.render()}</div>`
}
module.exports = StackPanel
Loading…
Cancel
Save