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
0d78a7d1
Commit
0d78a7d1
authored
Feb 08, 2018
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
re-add queryValue function to the waterfall; update to take into account value and gasLimit
parent
5823627b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
5 deletions
+20
-5
universal-dapp.js
src/universal-dapp.js
+20
-5
No files found.
src/universal-dapp.js
View file @
0d78a7d1
...
@@ -211,10 +211,25 @@ UniversalDApp.prototype.runTx = function (args, cb) {
...
@@ -211,10 +211,25 @@ UniversalDApp.prototype.runTx = function (args, cb) {
}
}
next
(
null
,
3000000
)
next
(
null
,
3000000
)
},
},
function
getAccount
(
gasLimit
,
next
)
{
function
queryValue
(
gasLimit
,
next
)
{
if
(
args
.
value
)
{
return
next
(
null
,
args
.
value
,
gasLimit
)
}
if
(
args
.
useCall
)
return
next
(
null
,
0
,
gasLimit
)
if
(
self
.
transactionContextAPI
.
getValue
)
{
self
.
transactionContextAPI
.
getValue
(
function
(
err
,
value
)
{
next
(
err
,
value
,
gasLimit
)
})
}
next
(
null
,
0
,
gasLimit
)
},
function
getAccount
(
value
,
gasLimit
,
next
)
{
if
(
args
.
from
)
{
return
next
(
null
,
args
.
from
,
value
,
gasLimit
)
}
if
(
self
.
transactionContextAPI
.
getAddress
)
{
if
(
self
.
transactionContextAPI
.
getAddress
)
{
return
self
.
transactionContextAPI
.
getAddress
(
function
(
err
,
address
)
{
return
self
.
transactionContextAPI
.
getAddress
(
function
(
err
,
address
)
{
next
(
err
,
address
,
gasLimit
)
next
(
err
,
address
,
value
,
gasLimit
)
})
})
}
}
self
.
getAccounts
(
function
(
err
,
accounts
)
{
self
.
getAccounts
(
function
(
err
,
accounts
)
{
...
@@ -225,11 +240,11 @@ UniversalDApp.prototype.runTx = function (args, cb) {
...
@@ -225,11 +240,11 @@ UniversalDApp.prototype.runTx = function (args, cb) {
if
(
executionContext
.
isVM
()
&&
!
self
.
accounts
[
address
])
{
if
(
executionContext
.
isVM
()
&&
!
self
.
accounts
[
address
])
{
return
next
(
'Invalid account selected'
)
return
next
(
'Invalid account selected'
)
}
}
next
(
null
,
address
,
gasLimit
)
next
(
null
,
address
,
value
,
gasLimit
)
})
})
},
},
function
runTransaction
(
fromAddress
,
gasLimit
,
next
)
{
function
runTransaction
(
fromAddress
,
value
,
gasLimit
,
next
)
{
var
tx
=
{
to
:
args
.
to
,
data
:
args
.
data
.
dataHex
,
useCall
:
args
.
useCall
,
from
:
fromAddress
,
value
:
args
.
value
,
gasLimit
:
gasLimit
}
var
tx
=
{
to
:
args
.
to
,
data
:
args
.
data
.
dataHex
,
useCall
:
args
.
useCall
,
from
:
fromAddress
,
value
:
value
,
gasLimit
:
gasLimit
}
var
payLoad
=
{
funAbi
:
args
.
data
.
funAbi
,
funArgs
:
args
.
data
.
funArgs
,
contractBytecode
:
args
.
data
.
contractBytecode
,
contractName
:
args
.
data
.
contractName
}
var
payLoad
=
{
funAbi
:
args
.
data
.
funAbi
,
funArgs
:
args
.
data
.
funArgs
,
contractBytecode
:
args
.
data
.
contractBytecode
,
contractName
:
args
.
data
.
contractName
}
var
timestamp
=
Date
.
now
()
var
timestamp
=
Date
.
now
()
...
...
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