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
5a2a9a1a
Commit
5a2a9a1a
authored
Feb 02, 2018
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move ui modal dialog from setProviderFromEndPoint to caller; remove ui…
move ui modal dialog from setProviderFromEndPoint to caller; remove ui dependency from execution-context
parent
9cd4a3aa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
run-tab.js
src/app/tabs/run-tab.js
+6
-1
execution-context.js
src/execution-context.js
+1
-4
No files found.
src/app/tabs/run-tab.js
View file @
5a2a9a1a
...
...
@@ -252,7 +252,12 @@ function runTab (container, appAPI, appEvents, opts) {
modalDialogCustom
.
confirm
(
null
,
'Are you sure you want to connect to an ethereum node?'
,
()
=>
{
modalDialogCustom
.
prompt
(
null
,
'Web3 Provider Endpoint'
,
'http://localhost:8545'
,
(
target
)
=>
{
executionContext
.
setProviderFromEndpoint
(
target
,
context
,
setFinalContext
)
executionContext
.
setProviderFromEndpoint
(
target
,
context
,
(
alertMsg
)
=>
{
if
(
alertMsg
)
{
modalDialogCustom
.
alert
(
alertMsg
)
}
setFinalContext
()
})
},
setFinalContext
)
},
setFinalContext
)
...
...
src/execution-context.js
View file @
5a2a9a1a
...
...
@@ -8,7 +8,6 @@ var ethUtil = require('ethereumjs-util')
var
StateManager
=
require
(
'ethereumjs-vm/lib/stateManager'
)
var
Web3VMProvider
=
remixLib
.
vm
.
Web3VMProvider
var
rlp
=
ethUtil
.
rlp
var
modalDialogCustom
=
require
(
'./app/ui/modal-dialog-custom'
)
var
injectedProvider
...
...
@@ -203,7 +202,6 @@ function ExecutionContext () {
// TODO: not used here anymore and needs to be moved
function
setProviderFromEndpoint
(
endpoint
,
context
,
cb
)
{
if
(
!
cb
)
cb
=
()
=>
{}
var
oldProvider
=
web3
.
currentProvider
if
(
endpoint
===
'ipc'
)
{
...
...
@@ -220,8 +218,7 @@ function ExecutionContext () {
web3
.
setProvider
(
oldProvider
)
var
alertMsg
=
'Not possible to connect to the Web3 provider. '
alertMsg
+=
'Make sure the provider is running and a connection is open (via IPC or RPC).'
modalDialogCustom
.
alert
(
alertMsg
)
cb
()
cb
(
alertMsg
)
}
}
this
.
setProviderFromEndpoint
=
setProviderFromEndpoint
;
...
...
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