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
90de6b28
Commit
90de6b28
authored
Oct 08, 2020
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unused file
parent
71f77eab
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
57 deletions
+0
-57
contextManager.js
libs/remix-debug/src/cmdline/contextManager.js
+0
-57
No files found.
libs/remix-debug/src/cmdline/contextManager.js
deleted
100644 → 0
View file @
71f77eab
const
remixLib
=
require
(
'@remix-project/remix-lib'
)
const
EventManager
=
remixLib
.
EventManager
const
Web3Providers
=
remixLib
.
vm
.
Web3Providers
const
DummyProvider
=
remixLib
.
vm
.
DummyProvider
const
init
=
remixLib
.
init
class
ContextManager
{
constructor
(
executionContext
)
{
this
.
executionContext
=
executionContext
this
.
web3
=
this
.
executionContext
.
web3
()
this
.
event
=
new
EventManager
()
}
initProviders
()
{
this
.
web3Providers
=
new
Web3Providers
()
this
.
addProvider
(
'DUMMYWEB3'
,
new
DummyProvider
())
this
.
switchProvider
(
'DUMMYWEB3'
)
this
.
addProvider
(
'vm'
,
this
.
executionContext
.
vm
())
this
.
addProvider
(
'injected'
,
this
.
executionContext
.
internalWeb3
())
this
.
addProvider
(
'web3'
,
this
.
executionContext
.
internalWeb3
())
this
.
switchProvider
(
this
.
executionContext
.
getProvider
())
}
getWeb3
()
{
return
this
.
web3
}
addProvider
(
type
,
obj
)
{
this
.
web3Providers
.
addProvider
(
type
,
obj
)
this
.
event
.
trigger
(
'providerAdded'
,
[
type
])
}
switchProvider
(
type
,
cb
)
{
this
.
web3Providers
.
get
(
type
,
(
error
,
obj
)
=>
{
if
(
error
)
{
return
console
.
log
(
'provider '
+
type
+
' not defined'
)
}
this
.
web3
=
obj
this
.
executionContext
.
detectNetwork
((
error
,
network
)
=>
{
if
(
error
||
!
network
)
{
this
.
web3
=
obj
}
else
{
var
webDebugNode
=
init
.
web3DebugNode
(
network
.
name
)
this
.
web3
=
(
!
webDebugNode
?
obj
:
webDebugNode
)
}
this
.
event
.
trigger
(
'providerChanged'
,
[
type
,
this
.
web3
])
if
(
cb
)
return
cb
()
})
this
.
event
.
trigger
(
'providerChanged'
,
[
type
,
this
.
web3
])
})
}
}
module
.
exports
=
ContextManager
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