add new CalldataPanel

pull/1/head
Iuri Matias 6 years ago committed by yann300
parent 7f5520ec90
commit 6926147663
  1. 5
      src/app/debugger/debuggerUI/VmDebugger.js
  2. 33
      src/app/debugger/debuggerUI/vmDebugger/CalldataPanel.js

@ -1,7 +1,7 @@
'use strict'
var csjs = require('csjs-inject')
var CodeListView = require('./vmDebugger/CodeListView')
var CalldataPanel = require('../remix-debugger/src/ui/CalldataPanel')
var CalldataPanel = require('./vmDebugger/CalldataPanel')
var MemoryPanel = require('../remix-debugger/src/ui/MemoryPanel')
var CallstackPanel = require('../remix-debugger/src/ui/CallstackPanel')
var StackPanel = require('../remix-debugger/src/ui/StackPanel')
@ -38,10 +38,11 @@ function VmDebugger (_parentUI, _traceManager, _codeManager, _solidityProxy, _ca
self.asmCode.changed([], '', -1)
})
this.calldataPanel = new CalldataPanel(_parentUI, _traceManager)
this.stackPanel = new StackPanel(_parentUI, _traceManager)
this.storagePanel = new StoragePanel(_parentUI, _traceManager)
this.memoryPanel = new MemoryPanel(_parentUI, _traceManager)
this.calldataPanel = new CalldataPanel(_parentUI, _traceManager)
this.callstackPanel = new CallstackPanel(_parentUI, _traceManager)
this.stepDetail = new StepDetail(_parentUI, _traceManager)
this.solidityState = new SolidityState(_parentUI, _traceManager, _codeManager, _solidityProxy)

@ -0,0 +1,33 @@
'use strict'
var DropdownPanel = require('./DropdownPanel')
var yo = require('yo-yo')
function CalldataPanel (_parentUI, _traceManager) {
this._parentUI = _parentUI
this.traceManager = _traceManager
this.basicPanel = new DropdownPanel('Call Data', {json: true})
this.init()
}
CalldataPanel.prototype.render = function () {
return yo`<div id='calldatapanel' >${this.basicPanel.render()}</div>`
}
CalldataPanel.prototype.init = function () {
var self = this
this._parentUI.event.register('indexChanged', this, function (index) {
if (index < 0) return
if (self._parentUI.currentStepIndex !== index) return
self.traceManager.getCallDataAt(index, function (error, calldata) {
if (error) {
self.basicPanel.update({})
console.log(error)
} else if (self._parentUI.currentStepIndex === index) {
self.basicPanel.update(calldata)
}
})
})
}
module.exports = CalldataPanel
Loading…
Cancel
Save