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
c1593fa2
Unverified
Commit
c1593fa2
authored
Oct 11, 2018
by
yann300
Committed by
GitHub
Oct 11, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #991 from ethereum/addNetworkinExecutionContext
add "addProvider" "removeProvider" to execution context
parents
96083a48
f265dffd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
execution-context.js
remix-lib/src/execution/execution-context.js
+20
-0
No files found.
remix-lib/src/execution/execution-context.js
View file @
c1593fa2
...
@@ -85,6 +85,7 @@ function ExecutionContext () {
...
@@ -85,6 +85,7 @@ function ExecutionContext () {
this
.
blockGasLimitDefault
=
4300000
this
.
blockGasLimitDefault
=
4300000
this
.
blockGasLimit
=
this
.
blockGasLimitDefault
this
.
blockGasLimit
=
this
.
blockGasLimitDefault
this
.
customNetWorks
=
{}
this
.
init
=
function
(
config
)
{
this
.
init
=
function
(
config
)
{
if
(
config
.
get
(
'settings/always-use-vm'
))
{
if
(
config
.
get
(
'settings/always-use-vm'
))
{
...
@@ -134,6 +135,20 @@ function ExecutionContext () {
...
@@ -134,6 +135,20 @@ function ExecutionContext () {
}
}
}
}
this
.
removeProvider
=
function
(
name
)
{
if
(
name
&&
this
.
customNetWorks
[
name
])
{
delete
this
.
customNetWorks
[
name
]
self
.
event
.
trigger
(
'removeProvider'
,
[
name
])
}
}
this
.
addProvider
=
function
(
network
)
{
if
(
network
&&
network
.
name
&&
network
.
url
)
{
this
.
customNetWorks
[
network
.
name
]
=
network
self
.
event
.
trigger
(
'addProvider'
,
[
network
])
}
}
this
.
internalWeb3
=
function
()
{
this
.
internalWeb3
=
function
()
{
return
web3
return
web3
}
}
...
@@ -182,6 +197,11 @@ function ExecutionContext () {
...
@@ -182,6 +197,11 @@ function ExecutionContext () {
if
(
context
===
'web3'
)
{
if
(
context
===
'web3'
)
{
confirmCb
(
cb
)
confirmCb
(
cb
)
}
}
if
(
this
.
customNetWorks
[
context
])
{
var
provider
=
this
.
customNetWorks
[
context
]
setProviderFromEndpoint
(
provider
.
url
,
provider
.
name
,
()
=>
{
cb
()
})
}
}
}
this
.
currentblockGasLimit
=
function
()
{
this
.
currentblockGasLimit
=
function
()
{
...
...
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