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
1d349b05
Unverified
Commit
1d349b05
authored
Jul 24, 2019
by
yann300
Committed by
GitHub
Jul 24, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2219 from ethereum/addTraceTransaction
adding `retrieveTrace` to the remix-plugin API
parents
912bb8b2
2f9e3640
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
24 deletions
+54
-24
debugger-tab.js
src/app/tabs/debugger-tab.js
+6
-2
debuggerUI.js
src/app/tabs/debugger/debuggerUI.js
+48
-22
No files found.
src/app/tabs/debugger-tab.js
View file @
1d349b05
...
@@ -9,7 +9,7 @@ import * as packageJson from '../../../package.json'
...
@@ -9,7 +9,7 @@ import * as packageJson from '../../../package.json'
const
profile
=
{
const
profile
=
{
name
:
'debugger'
,
name
:
'debugger'
,
displayName
:
'Debugger'
,
displayName
:
'Debugger'
,
methods
:
[
'debug'
],
methods
:
[
'debug'
,
'getTrace'
],
events
:
[],
events
:
[],
icon
:
'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xNjk2IDk2MHEwIDI2LTE5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4LjUtNjUgMzYuNS04MiAyOS05NyAxM3YtODk2aC0xMjh2ODk2cS01MSAwLTEwMS41LTEzLjV0LTg3LTMzLTY2LTM5LTQzLjUtMzIuNWwtMTUtMTQtMTgzIDIwN3EtMjAgMjEtNDggMjEtMjQgMC00My0xNi0xOS0xOC0yMC41LTQ0LjV0MTUuNS00Ni41bDIwMi0yMjdxLTU4LTExNC01OC0yNzRoLTIyNHEtMjYgMC00NS0xOXQtMTktNDUgMTktNDUgNDUtMTloMjI0di0yOTRsLTE3My0xNzNxLTE5LTE5LTE5LTQ1dDE5LTQ1IDQ1LTE5IDQ1IDE5bDE3MyAxNzNoODQ0bDE3My0xNzNxMTktMTkgNDUtMTl0NDUgMTkgMTkgNDUtMTkgNDVsLTE3MyAxNzN2Mjk0aDIyNHEyNiAwIDQ1IDE5dDE5IDQ1em0tNDgwLTU3NmgtNjQwcTAtMTMzIDkzLjUtMjI2LjV0MjI2LjUtOTMuNSAyMjYuNSA5My41IDkzLjUgMjI2LjV6Ii8+PC9zdmc+'
,
description
:
'Debug transactions'
,
description
:
'Debug transactions'
,
...
@@ -38,7 +38,11 @@ class DebuggerTab extends ViewPlugin {
...
@@ -38,7 +38,11 @@ class DebuggerTab extends ViewPlugin {
}
}
debug
(
hash
)
{
debug
(
hash
)
{
if
(
this
.
debugger
)
this
.
debuggerUI
.
debug
(
hash
)
if
(
this
.
debuggerUI
)
this
.
debuggerUI
.
debug
(
hash
)
}
getTrace
(
hash
)
{
return
this
.
debuggerUI
.
getTrace
(
hash
)
}
}
debugger
()
{
debugger
()
{
...
...
src/app/tabs/debugger/debuggerUI.js
View file @
1d349b05
...
@@ -103,38 +103,64 @@ class DebuggerUI {
...
@@ -103,38 +103,64 @@ class DebuggerUI {
return
this
.
isActive
return
this
.
isActive
}
}
startDebugging
(
blockNumber
,
txNumber
,
tx
)
{
getDebugWeb3
()
{
const
self
=
this
return
new
Promise
((
resolve
,
reject
)
=>
{
executionContext
.
detectNetwork
((
error
,
network
)
=>
{
let
web3
if
(
error
||
!
network
)
{
web3
=
init
.
web3DebugNode
(
executionContext
.
web3
())
}
else
{
const
webDebugNode
=
init
.
web3DebugNode
(
network
.
name
)
web3
=
!
webDebugNode
?
executionContext
.
web3
()
:
webDebugNode
}
init
.
extendWeb3
(
web3
)
resolve
(
web3
)
})
})
}
async
startDebugging
(
blockNumber
,
txNumber
,
tx
)
{
if
(
this
.
debugger
)
this
.
unLoad
()
if
(
this
.
debugger
)
this
.
unLoad
()
let
compilers
=
this
.
registry
.
get
(
'compilersartefacts'
).
api
let
compilers
=
this
.
registry
.
get
(
'compilersartefacts'
).
api
let
lastCompilationResult
let
lastCompilationResult
if
(
compilers
[
'__last'
])
lastCompilationResult
=
compilers
[
'__last'
]
if
(
compilers
[
'__last'
])
lastCompilationResult
=
compilers
[
'__last'
]
executionContext
.
detectNetwork
((
error
,
network
)
=>
{
let
web3
=
await
this
.
getDebugWeb3
()
let
web3
this
.
debugger
=
new
Debugger
({
if
(
error
||
!
network
)
{
web3
,
web3
=
init
.
web3DebugNode
(
executionContext
.
web3
())
offsetToLineColumnConverter
:
this
.
registry
.
get
(
'offsettolinecolumnconverter'
).
api
,
}
else
{
compiler
:
{
lastCompilationResult
}
var
webDebugNode
=
init
.
web3DebugNode
(
network
.
name
)
})
web3
=
(
!
webDebugNode
?
executionContext
.
web3
()
:
webDebugNode
)
}
this
.
listenToEvents
()
init
.
extendWeb3
(
web3
)
this
.
debugger
.
debug
(
blockNumber
,
txNumber
,
tx
,
()
=>
{
this
.
debugger
=
new
Debugger
({
this
.
stepManager
=
new
StepManagerUI
(
this
.
debugger
.
step_manager
)
this
.
vmDebugger
=
new
VmDebugger
(
this
.
debugger
.
vmDebuggerLogic
)
this
.
txBrowser
.
setState
({
blockNumber
,
txNumber
,
debugging
:
true
})
this
.
renderDebugger
()
}).
catch
((
error
)
=>
{
toaster
(
error
)
this
.
unLoad
()
})
}
getTrace
(
hash
)
{
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
const
compilers
=
this
.
registry
.
get
(
'compilersartefacts'
).
api
let
lastCompilationResult
if
(
compilers
[
'__last'
])
lastCompilationResult
=
compilers
[
'__last'
]
const
web3
=
await
this
.
getDebugWeb3
()
const
debug
=
new
Debugger
({
web3
,
web3
,
offsetToLineColumnConverter
:
this
.
registry
.
get
(
'offsettolinecolumnconverter'
).
api
,
offsetToLineColumnConverter
:
this
.
registry
.
get
(
'offsettolinecolumnconverter'
).
api
,
compiler
:
{
lastCompilationResult
}
compiler
:
{
lastCompilationResult
}
})
})
debug
.
debugger
.
traceManager
.
traceRetriever
.
getTrace
(
hash
,
(
error
,
trace
)
=>
{
this
.
listenToEvents
()
if
(
error
)
return
reject
(
error
)
this
.
debugger
.
debug
(
blockNumber
,
txNumber
,
tx
,
()
=>
{
resolve
(
trace
)
self
.
stepManager
=
new
StepManagerUI
(
this
.
debugger
.
step_manager
)
self
.
vmDebugger
=
new
VmDebugger
(
this
.
debugger
.
vmDebuggerLogic
)
self
.
txBrowser
.
setState
({
blockNumber
,
txNumber
,
debugging
:
true
})
self
.
renderDebugger
()
}).
catch
((
error
)
=>
{
toaster
(
error
)
this
.
unLoad
()
})
})
})
})
}
}
...
...
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