Commit 2230e917 authored by yann300's avatar yann300

use solidity type formatter

parent d2352759
'use strict'
var DropdownPanel = require('./DropdownPanel')
var localDecoder = require('../solidity/localDecoder')
var solidityTypeFormatter = require('./SolidityTypeFormatter')
var yo = require('yo-yo')
class SolidityLocals {
......@@ -9,7 +10,11 @@ class SolidityLocals {
this.parent = _parent
this.internalTreeCall = internalTreeCall
this.traceManager = _traceManager
this.basicPanel = new DropdownPanel('Solidity Locals', {json: true})
this.basicPanel = new DropdownPanel('Solidity Locals', {
json: true,
formatData: solidityTypeFormatter.formatData,
extractData: solidityTypeFormatter.extractData
})
this.init()
}
......
'use strict'
var DropdownPanel = require('./DropdownPanel')
var stateDecoder = require('../solidity/stateDecoder')
var solidityTypeFormatter = require('./SolidityTypeFormatter')
var yo = require('yo-yo')
function SolidityState (_parent, _traceManager, _codeManager, _solidityProxy) {
......@@ -8,7 +9,11 @@ function SolidityState (_parent, _traceManager, _codeManager, _solidityProxy) {
this.traceManager = _traceManager
this.codeManager = _codeManager
this.solidityProxy = _solidityProxy
this.basicPanel = new DropdownPanel('Solidity State', {json: true})
this.basicPanel = new DropdownPanel('Solidity State', {
json: true,
formatData: solidityTypeFormatter.formatData,
extractData: solidityTypeFormatter.extractData
})
this.init()
}
......
......@@ -40,7 +40,7 @@ class TreeView {
var children = Object.keys(data.children).map((innerkey) => {
return this.renderObject(data.children[innerkey], innerkey, expand)
})
return this.formatData(key, data.self, children, expand)
return this.formatDataInternal(key, data, children, expand)
}
renderProperties (json, expand) {
......@@ -50,8 +50,8 @@ class TreeView {
return yo`<ul style=${this.cssList}>${children}</ul>`
}
formatDataDefault (key, self, children, expand) {
var label = yo`<span style=${this.cssLabel}><label style='width: 10px'></label><label>${key}: ${self}</label></span>`
formatDataInternal (key, data, children, expand) {
var label = yo`<span style=${this.cssLabel}><label style='width: 10px'></label>${this.formatData(key, data)}</span>`
var renderedChildren = ''
if (children.length) {
renderedChildren = yo`<ul style=${this.cssList}>${children}</ul>`
......@@ -66,6 +66,10 @@ class TreeView {
return yo`<li style=${this.cssList}>${label}${renderedChildren}</li>`
}
formatDataDefault (key, data) {
return yo`<label>${key}: ${data.self}</label>`
}
extractDataDefault (item, key) {
var ret = {}
if (item instanceof Array) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment