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
f59d81b5
Commit
f59d81b5
authored
Sep 05, 2018
by
Iuri Matias
Committed by
yann300
Nov 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move provider set into debugger class
parent
faab2ff2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
26 deletions
+28
-26
debugger.js
src/app/debugger/debugger.js
+27
-18
debuggerUI.js
src/app/debugger/debuggerUI.js
+1
-8
No files found.
src/app/debugger/debugger.js
View file @
f59d81b5
...
...
@@ -82,6 +82,8 @@ function Debugger (container, sourceHighlighter, localRegistry) {
}
})
// ====================
// listen to events
this
.
debugger
.
event
.
register
(
'newTraceLoaded'
,
this
,
function
()
{
self
.
event
.
trigger
(
'debuggerStatus'
,
[
true
])
})
...
...
@@ -90,6 +92,13 @@ function Debugger (container, sourceHighlighter, localRegistry) {
self
.
_components
.
sourceHighlighter
.
currentSourceLocation
(
null
)
self
.
event
.
trigger
(
'debuggerStatus'
,
[
false
])
})
// ====================
// add providers
this
.
debugger
.
addProvider
(
'vm'
,
executionContext
.
vm
())
this
.
debugger
.
addProvider
(
'injected'
,
executionContext
.
internalWeb3
())
this
.
debugger
.
addProvider
(
'web3'
,
executionContext
.
internalWeb3
())
this
.
debugger
.
switchProvider
(
executionContext
.
getProvider
())
}
/**
...
...
@@ -107,24 +116,24 @@ Debugger.prototype.debug = function (txHash) {
})
}
/**
* add a new web3 provider to remix
*
* @param {String} type - type/name of the provider to add
* @param {Object} obj - provider
*/
Debugger
.
prototype
.
addProvider
=
function
(
type
,
obj
)
{
this
.
debugger
.
addProvider
(
type
,
obj
)
}
/**
* switch the provider
*
* @param {String} type - type/name of the provider to use
*/
Debugger
.
prototype
.
switchProvider
=
function
(
type
)
{
this
.
debugger
.
switchProvider
(
type
)
}
/
/ /
**
//
* add a new web3 provider to remix
//
*
//
* @param {String} type - type/name of the provider to add
//
* @param {Object} obj - provider
//
*/
//
Debugger.prototype.addProvider = function (type, obj) {
//
this.debugger.addProvider(type, obj)
//
}
/
/ /
**
//
* switch the provider
//
*
//
* @param {String} type - type/name of the provider to use
//
*/
//
Debugger.prototype.switchProvider = function (type) {
//
this.debugger.switchProvider(type)
//
}
/**
* get the current provider
...
...
src/app/debugger/debuggerUI.js
View file @
f59d81b5
var
Debugger
=
require
(
'../debugger/debugger'
)
var
executionContext
=
require
(
'../../execution-context'
)
var
SourceHighlighter
=
require
(
'../editor/sourceHighlighter'
)
class
DebuggerUI
{
constructor
(
container
)
{
this
.
transactionDebugger
=
new
Debugger
(
container
,
new
SourceHighlighter
())
this
.
transactionDebugger
.
addProvider
(
'vm'
,
executionContext
.
vm
())
this
.
transactionDebugger
.
addProvider
(
'injected'
,
executionContext
.
internalWeb3
())
this
.
transactionDebugger
.
addProvider
(
'web3'
,
executionContext
.
internalWeb3
())
this
.
transactionDebugger
.
switchProvider
(
executionContext
.
getProvider
())
this
.
isActive
=
false
this
.
listenToEvents
()
}
...
...
@@ -31,7 +24,7 @@ class DebuggerUI {
return
this
.
isActive
}
debug
(
txHash
)
{
debug
(
txHash
)
{
this
.
transactionDebugger
.
debug
(
txHash
)
}
}
...
...
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