Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
0f875dd9
Commit
0f875dd9
authored
Sep 08, 2018
by
Iuri Matias
Committed by
yann300
Nov 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup
parent
c2be6045
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
38 deletions
+21
-38
SolidityState.js
src/app/debugger/debuggerUI/vmDebugger/SolidityState.js
+18
-29
StepDetail.js
src/app/debugger/debuggerUI/vmDebugger/StepDetail.js
+3
-9
No files found.
src/app/debugger/debuggerUI/vmDebugger/SolidityState.js
View file @
0f875dd9
...
@@ -13,6 +13,7 @@ function SolidityState (_parent, _traceManager, _codeManager, _solidityProxy) {
...
@@ -13,6 +13,7 @@ function SolidityState (_parent, _traceManager, _codeManager, _solidityProxy) {
this
.
solidityProxy
=
_solidityProxy
this
.
solidityProxy
=
_solidityProxy
this
.
basicPanel
=
new
DropdownPanel
(
'Solidity State'
,
{
this
.
basicPanel
=
new
DropdownPanel
(
'Solidity State'
,
{
json
:
true
,
json
:
true
,
// TODO: used by TreeView ui
formatSelf
:
solidityTypeFormatter
.
formatSelf
,
formatSelf
:
solidityTypeFormatter
.
formatSelf
,
extractData
:
solidityTypeFormatter
.
extractData
extractData
:
solidityTypeFormatter
.
extractData
})
})
...
@@ -24,11 +25,10 @@ function SolidityState (_parent, _traceManager, _codeManager, _solidityProxy) {
...
@@ -24,11 +25,10 @@ function SolidityState (_parent, _traceManager, _codeManager, _solidityProxy) {
}
}
SolidityState
.
prototype
.
render
=
function
()
{
SolidityState
.
prototype
.
render
=
function
()
{
if
(
!
this
.
view
)
{
if
(
this
.
view
)
return
this
.
view
=
yo
`<div id='soliditystate' >
this
.
view
=
yo
`<div id='soliditystate' >
${
this
.
basicPanel
.
render
()}
${
this
.
basicPanel
.
render
()}
</div>`
</div>`
}
return
this
.
view
return
this
.
view
}
}
...
@@ -63,41 +63,30 @@ SolidityState.prototype.init = function () {
...
@@ -63,41 +63,30 @@ SolidityState.prototype.init = function () {
function
decode
(
self
,
index
)
{
function
decode
(
self
,
index
)
{
self
.
traceManager
.
getCurrentCalledAddressAt
(
self
.
parent
.
currentStepIndex
,
(
error
,
address
)
=>
{
self
.
traceManager
.
getCurrentCalledAddressAt
(
self
.
parent
.
currentStepIndex
,
(
error
,
address
)
=>
{
if
(
error
)
{
if
(
error
)
{
self
.
basicPanel
.
update
({})
return
self
.
basicPanel
.
update
({})
console
.
log
(
error
)
}
}
else
{
if
(
self
.
stateVariablesByAddresses
[
address
])
{
if
(
self
.
stateVariablesByAddresses
[
address
])
{
return
extractStateVariables
(
self
,
self
.
stateVariablesByAddresses
[
address
],
address
)
extractStateVariables
(
self
,
self
.
stateVariablesByAddresses
[
address
],
address
)
}
else
{
self
.
solidityProxy
.
extractStateVariablesAt
(
index
,
function
(
error
,
stateVars
)
{
if
(
error
)
{
self
.
basicPanel
.
update
({})
console
.
log
(
error
)
}
else
{
self
.
stateVariablesByAddresses
[
address
]
=
stateVars
extractStateVariables
(
self
,
stateVars
,
address
)
}
})
}
}
}
self
.
solidityProxy
.
extractStateVariablesAt
(
index
,
function
(
error
,
stateVars
)
{
if
(
error
)
{
return
self
.
basicPanel
.
update
({})
}
self
.
stateVariablesByAddresses
[
address
]
=
stateVars
extractStateVariables
(
self
,
stateVars
,
address
)
})
})
})
}
}
function
extractStateVariables
(
self
,
stateVars
,
address
)
{
function
extractStateVariables
(
self
,
stateVars
,
address
)
{
var
storageViewer
=
new
StorageViewer
({
var
storageViewer
=
new
StorageViewer
({
stepIndex
:
self
.
parent
.
currentStepIndex
,
tx
:
self
.
parent
.
tx
,
address
:
address
},
self
.
storageResolver
,
self
.
traceManager
)
stepIndex
:
self
.
parent
.
currentStepIndex
,
tx
:
self
.
parent
.
tx
,
address
:
address
},
self
.
storageResolver
,
self
.
traceManager
)
stateDecoder
.
decodeState
(
stateVars
,
storageViewer
).
then
((
result
)
=>
{
stateDecoder
.
decodeState
(
stateVars
,
storageViewer
).
then
((
result
)
=>
{
self
.
basicPanel
.
setMessage
(
''
)
self
.
basicPanel
.
setMessage
(
''
)
if
(
!
result
.
error
)
{
if
(
result
.
error
)
{
self
.
basicPanel
.
update
(
result
)
return
self
.
basicPanel
.
setMessage
(
result
.
error
)
}
else
{
self
.
basicPanel
.
setMessage
(
result
.
error
)
}
}
self
.
basicPanel
.
update
(
result
)
})
})
}
}
module
.
exports
=
SolidityState
module
.
exports
=
SolidityState
src/app/debugger/debuggerUI/vmDebugger/StepDetail.js
View file @
0f875dd9
var
yo
=
require
(
'yo-yo'
)
var
yo
=
require
(
'yo-yo'
)
var
DropdownPanel
=
require
(
'./DropdownPanel'
)
var
DropdownPanel
=
require
(
'./DropdownPanel'
)
function
StepDetail
(
_parentUI
,
_traceManager
)
{
function
StepDetail
()
{
this
.
basicPanel
=
new
DropdownPanel
(
'Step detail'
,
{
json
:
true
,
displayContentOnly
:
true
})
this
.
basicPanel
=
new
DropdownPanel
(
'Step detail'
,
{
json
:
true
,
displayContentOnly
:
true
})
this
.
detail
=
{
'vm trace step'
:
'-'
,
'execution step'
:
'-'
,
'add memory'
:
''
,
'gas'
:
''
,
'remaining gas'
:
'-'
,
'loaded address'
:
'-'
}
this
.
detail
=
{
'vm trace step'
:
'-'
,
'execution step'
:
'-'
,
'add memory'
:
''
,
'gas'
:
''
,
'remaining gas'
:
'-'
,
'loaded address'
:
'-'
}
this
.
view
}
}
StepDetail
.
prototype
.
reset
=
function
()
{
StepDetail
.
prototype
.
reset
=
function
()
{
this
.
detail
=
{
this
.
detail
=
{
'vm trace step'
:
'-'
,
'execution step'
:
'-'
,
'add memory'
:
''
,
'gas'
:
''
,
'remaining gas'
:
'-'
,
'loaded address'
:
'-'
}
'vm trace step'
:
'-'
,
'execution step'
:
'-'
,
'add memory'
:
''
,
'gas'
:
''
,
'remaining gas'
:
'-'
,
'loaded address'
:
'-'
}
this
.
basicPanel
.
update
(
this
.
detail
)
this
.
basicPanel
.
update
(
this
.
detail
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment