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
bca94add
Commit
bca94add
authored
Nov 28, 2016
by
yann300
Committed by
Alex Beregszaszi
Dec 02, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix use of accounts in web3 mode
parent
bbc4620c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
15 deletions
+6
-15
universal-dapp.js
src/universal-dapp.js
+6
-15
No files found.
src/universal-dapp.js
View file @
bca94add
...
@@ -57,17 +57,6 @@ UniversalDApp.prototype.reset = function (contracts, getAddress, getValue, getGa
...
@@ -57,17 +57,6 @@ UniversalDApp.prototype.reset = function (contracts, getAddress, getValue, getGa
this
.
_addAccount
(
'dae9801649ba2d95a21e688b56f77905e5667c44ce868ec83f82e838712a2c7a'
)
this
.
_addAccount
(
'dae9801649ba2d95a21e688b56f77905e5667c44ce868ec83f82e838712a2c7a'
)
this
.
_addAccount
(
'd74aa6d18aa79a05f3473dd030a97d3305737cbc8337d940344345c1f6b72eea'
)
this
.
_addAccount
(
'd74aa6d18aa79a05f3473dd030a97d3305737cbc8337d940344345c1f6b72eea'
)
this
.
_addAccount
(
'71975fbf7fe448e004ac7ae54cad0a383c3906055a65468714156a07385e96ce'
)
this
.
_addAccount
(
'71975fbf7fe448e004ac7ae54cad0a383c3906055a65468714156a07385e96ce'
)
}
else
{
var
self
=
this
this
.
getAccounts
(
function
(
error
,
accounts
)
{
if
(
error
)
{
console
.
log
(
'cannot retrieve accounts from web3'
)
}
else
{
accounts
.
map
(
function
(
item
,
index
)
{
self
.
accounts
[
item
]
=
item
})
}
})
}
}
}
}
...
@@ -695,7 +684,6 @@ UniversalDApp.prototype.runTx = function (args, cb) {
...
@@ -695,7 +684,6 @@ UniversalDApp.prototype.runTx = function (args, cb) {
data
:
args
.
data
,
data
:
args
.
data
,
useCall
:
args
.
useCall
useCall
:
args
.
useCall
}
}
var
accounts
=
this
.
accounts
async
.
waterfall
([
async
.
waterfall
([
// query gas limit
// query gas limit
function
(
callback
)
{
function
(
callback
)
{
...
@@ -739,7 +727,8 @@ UniversalDApp.prototype.runTx = function (args, cb) {
...
@@ -739,7 +727,8 @@ UniversalDApp.prototype.runTx = function (args, cb) {
return
callback
(
err
)
return
callback
(
err
)
}
}
tx
.
from
=
accounts
[
ret
]
tx
.
from
=
self
.
executionContext
.
isVM
()
?
self
.
accounts
[
ret
]
:
ret
callback
()
callback
()
})
})
}
else
{
}
else
{
...
@@ -752,10 +741,12 @@ UniversalDApp.prototype.runTx = function (args, cb) {
...
@@ -752,10 +741,12 @@ UniversalDApp.prototype.runTx = function (args, cb) {
return
callback
(
'No accounts available'
)
return
callback
(
'No accounts available'
)
}
}
tx
.
from
=
accounts
[
ret
[
0
]]
if
(
self
.
executionContext
.
isVM
()
&&
!
self
.
accounts
[
ret
[
0
]])
{
if
(
self
.
executionContext
.
isVM
()
&&
!
self
.
accounts
[
tx
.
from
])
{
return
callback
(
'Invalid account selected'
)
return
callback
(
'Invalid account selected'
)
}
}
tx
.
from
=
self
.
executionContext
.
isVM
()
?
self
.
accounts
[
ret
[
0
]]
:
ret
[
0
]
callback
()
callback
()
})
})
}
}
...
...
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