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
7ff0654b
Commit
7ff0654b
authored
Oct 27, 2016
by
Alex Beregszaszi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split out UI settings from runTx
parent
0e37be07
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
8 deletions
+31
-8
universal-dapp.js
src/universal-dapp.js
+31
-8
No files found.
src/universal-dapp.js
View file @
7ff0654b
...
@@ -679,11 +679,6 @@ function tryTillResponse (web3, txhash, done) {
...
@@ -679,11 +679,6 @@ function tryTillResponse (web3, txhash, done) {
UniversalDApp
.
prototype
.
runTx
=
function
(
args
,
cb
)
{
UniversalDApp
.
prototype
.
runTx
=
function
(
args
,
cb
)
{
var
self
=
this
var
self
=
this
var
to
=
args
.
to
var
data
=
args
.
data
if
(
data
.
slice
(
0
,
2
)
!==
'0x'
)
{
data
=
'0x'
+
data
}
var
gasLimit
=
3000000
var
gasLimit
=
3000000
if
(
self
.
getGasLimit
)
{
if
(
self
.
getGasLimit
)
{
...
@@ -703,10 +698,39 @@ UniversalDApp.prototype.runTx = function (args, cb) {
...
@@ -703,10 +698,39 @@ UniversalDApp.prototype.runTx = function (args, cb) {
}
}
}
}
var
from
if
(
self
.
getAddress
)
{
from
=
self
.
getAddress
()
}
else
if
(
self
.
executionContext
.
isVM
())
{
from
=
Object
.
keys
(
self
.
accounts
)[
0
]
}
else
{
from
=
self
.
web3
.
eth
.
accounts
[
0
]
}
return
this
.
rawRunTx
({
from
:
args
.
from
,
to
:
args
.
to
,
data
:
args
.
data
,
value
:
value
,
gasLimit
:
gasLimit
},
cb
)
}
UniversalDApp
.
prototype
.
rawRunTx
=
function
(
args
,
cb
)
{
var
self
=
this
var
from
=
args
.
from
var
to
=
args
.
to
var
data
=
args
.
data
if
(
data
.
slice
(
0
,
2
)
!==
'0x'
)
{
data
=
'0x'
+
data
}
var
value
=
args
.
value
var
gasLimit
=
args
.
gasLimit
var
tx
var
tx
if
(
!
self
.
executionContext
.
isVM
())
{
if
(
!
self
.
executionContext
.
isVM
())
{
tx
=
{
tx
=
{
from
:
self
.
getAddress
?
self
.
getAddress
()
:
self
.
web3
.
eth
.
accounts
[
0
]
,
from
:
from
,
to
:
to
,
to
:
to
,
data
:
data
,
data
:
data
,
value
:
value
value
:
value
...
@@ -739,8 +763,7 @@ UniversalDApp.prototype.runTx = function (args, cb) {
...
@@ -739,8 +763,7 @@ UniversalDApp.prototype.runTx = function (args, cb) {
}
}
}
else
{
}
else
{
try
{
try
{
var
address
=
self
.
getAddress
?
self
.
getAddress
()
:
Object
.
keys
(
self
.
accounts
)[
0
]
var
account
=
self
.
accounts
[
from
]
var
account
=
self
.
accounts
[
address
]
if
(
!
account
)
{
if
(
!
account
)
{
return
cb
(
'Invalid account selected'
)
return
cb
(
'Invalid account selected'
)
}
}
...
...
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