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
f2cd335d
Commit
f2cd335d
authored
Jan 12, 2018
by
ninabreznik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display modal when Ropsten is selected
parent
09bea4e6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
14 deletions
+55
-14
app.js
src/app.js
+4
-1
txRunner.js
src/app/execution/txRunner.js
+47
-11
universal-dapp.js
src/universal-dapp.js
+4
-2
No files found.
src/app.js
View file @
f2cd335d
...
@@ -248,7 +248,10 @@ function run () {
...
@@ -248,7 +248,10 @@ function run () {
logMessage
:
(
msg
)
=>
{
logMessage
:
(
msg
)
=>
{
self
.
_components
.
editorpanel
.
log
({
type
:
'log'
,
value
:
msg
})
self
.
_components
.
editorpanel
.
log
({
type
:
'log'
,
value
:
msg
})
},
},
config
:
self
.
_api
.
config
config
:
self
.
_api
.
config
,
detectNetwork
:
(
cb
)
=>
{
executionContext
.
detectNetwork
(
cb
)
}
},
},
opt
:
{
removable
:
false
,
removable_instances
:
true
}
opt
:
{
removable
:
false
,
removable_instances
:
true
}
})
})
...
...
src/app/execution/txRunner.js
View file @
f2cd335d
...
@@ -27,6 +27,7 @@ function TxRunner (vmaccounts, opts) {
...
@@ -27,6 +27,7 @@ function TxRunner (vmaccounts, opts) {
this
.
blockNumber
=
0
this
.
blockNumber
=
0
this
.
runAsync
=
true
this
.
runAsync
=
true
this
.
config
=
opts
.
config
this
.
config
=
opts
.
config
this
.
detectNetwork
=
opts
.
detectNetwork
if
(
executionContext
.
isVM
())
{
if
(
executionContext
.
isVM
())
{
this
.
blockNumber
=
1150000
// The VM is running in Homestead mode, which started at this block.
this
.
blockNumber
=
1150000
// The VM is running in Homestead mode, which started at this block.
this
.
runAsync
=
false
// We have to run like this cause the VM Event Manager does not support running multiple txs at the same time.
this
.
runAsync
=
false
// We have to run like this cause the VM Event Manager does not support running multiple txs at the same time.
...
@@ -42,7 +43,6 @@ TxRunner.prototype.rawRun = function (args, cb) {
...
@@ -42,7 +43,6 @@ TxRunner.prototype.rawRun = function (args, cb) {
TxRunner
.
prototype
.
execute
=
function
(
args
,
callback
)
{
TxRunner
.
prototype
.
execute
=
function
(
args
,
callback
)
{
var
self
=
this
var
self
=
this
var
from
=
args
.
from
var
from
=
args
.
from
var
to
=
args
.
to
var
to
=
args
.
to
var
data
=
args
.
data
var
data
=
args
.
data
...
@@ -62,11 +62,28 @@ TxRunner.prototype.execute = function (args, callback) {
...
@@ -62,11 +62,28 @@ TxRunner.prototype.execute = function (args, callback) {
}
}
if
(
args
.
useCall
)
{
if
(
args
.
useCall
)
{
tx
.
gas
=
gasLimit
tx
.
gas
=
gasLimit
modalDialog
(
'Confirm transaction'
,
remixdDialog
(
tx
,
self
),
{
label
:
'Confirm'
,
if
(
true
)
{
fn
:
()
=>
{
self
.
detectNetwork
((
err
,
network
)
=>
{
execute
()
if
(
err
)
{
}})
console
.
log
(
err
)
}
else
{
console
.
log
(
network
.
name
)
if
(
network
.
name
===
'Ropsten'
)
{
modalDialog
(
'Confirm transaction'
,
remixdDialog
(
tx
,
self
),
{
label
:
'Confirm'
,
fn
:
()
=>
{
execute
()
}})
}
else
{
execute
()
}
}
})
}
else
{
execute
()
}
function
execute
()
{
function
execute
()
{
executionContext
.
web3
().
eth
.
call
(
tx
,
function
(
error
,
result
)
{
executionContext
.
web3
().
eth
.
call
(
tx
,
function
(
error
,
result
)
{
callback
(
error
,
{
callback
(
error
,
{
...
@@ -93,11 +110,29 @@ TxRunner.prototype.execute = function (args, callback) {
...
@@ -93,11 +110,29 @@ TxRunner.prototype.execute = function (args, callback) {
}
}
tx
.
gas
=
gasEstimation
tx
.
gas
=
gasEstimation
modalDialog
(
'Confirm transaction'
,
remixdDialog
(
tx
,
self
),
{
label
:
'Confirm'
,
if
(
true
)
{
fn
:
()
=>
{
execute
()
self
.
detectNetwork
((
err
,
network
)
=>
{
}})
if
(
err
)
{
console
.
log
(
err
)
}
else
{
console
.
log
(
network
.
name
)
if
(
network
.
name
===
'Ropsten'
)
{
modalDialog
(
'Confirm transaction'
,
remixdDialog
(
tx
,
self
),
{
label
:
'Confirm'
,
fn
:
()
=>
{
execute
()
}})
}
else
{
execute
()
}
}
})
}
else
{
execute
()
}
})
})
function
execute
()
{
function
execute
()
{
var
sendTransaction
=
self
.
personalMode
?
executionContext
.
web3
().
personal
.
sendTransaction
:
executionContext
.
web3
().
eth
.
sendTransaction
var
sendTransaction
=
self
.
personalMode
?
executionContext
.
web3
().
personal
.
sendTransaction
:
executionContext
.
web3
().
eth
.
sendTransaction
...
@@ -114,6 +149,7 @@ TxRunner.prototype.execute = function (args, callback) {
...
@@ -114,6 +149,7 @@ TxRunner.prototype.execute = function (args, callback) {
}
}
}
}
}
}
}
else
{
}
else
{
try
{
try
{
var
account
=
self
.
vmaccounts
[
from
]
var
account
=
self
.
vmaccounts
[
from
]
...
...
src/universal-dapp.js
View file @
f2cd335d
...
@@ -168,7 +168,8 @@ function UniversalDApp (opts = {}) {
...
@@ -168,7 +168,8 @@ function UniversalDApp (opts = {}) {
})
})
self
.
txRunner
=
new
TxRunner
({},
{
self
.
txRunner
=
new
TxRunner
({},
{
personalMode
:
this
.
personalMode
,
personalMode
:
this
.
personalMode
,
config
:
self
.
_api
.
config
config
:
self
.
_api
.
config
,
detectNetwork
:
self
.
_api
.
detectNetwork
})
})
}
}
...
@@ -189,7 +190,8 @@ UniversalDApp.prototype.reset = function (contracts, transactionContextAPI) {
...
@@ -189,7 +190,8 @@ UniversalDApp.prototype.reset = function (contracts, transactionContextAPI) {
}
}
this
.
txRunner
=
new
TxRunner
(
this
.
accounts
,
{
this
.
txRunner
=
new
TxRunner
(
this
.
accounts
,
{
personalMode
:
this
.
personalMode
,
personalMode
:
this
.
personalMode
,
config
:
this
.
_api
.
config
config
:
this
.
_api
.
config
,
detectNetwork
:
this
.
_api
.
detectNetwork
})
})
}
}
...
...
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