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
e064f0d7
Commit
e064f0d7
authored
Feb 15, 2017
by
Alex Beregszaszi
Committed by
GitHub
Feb 15, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #423 from ethereum/async-newaccount
Make udapp.newAccount() async
parents
5c9ed0ec
57060c9c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
universal-dapp.js
src/universal-dapp.js
+4
-3
No files found.
src/universal-dapp.js
View file @
e064f0d7
...
...
@@ -55,18 +55,19 @@ UniversalDApp.prototype.reset = function (contracts, transactionContextAPI, rend
})
}
UniversalDApp
.
prototype
.
newAccount
=
function
(
password
)
{
UniversalDApp
.
prototype
.
newAccount
=
function
(
password
,
cb
)
{
if
(
!
this
.
executionContext
.
isVM
())
{
if
(
!
this
.
personalMode
)
{
throw
new
Error
(
'Not running in personal mode'
)
return
cb
(
'Not running in personal mode'
)
}
this
.
web3
.
personal
.
newAccount
(
password
)
this
.
web3
.
personal
.
newAccount
(
password
,
cb
)
}
else
{
var
privateKey
do
{
privateKey
=
crypto
.
randomBytes
(
32
)
}
while
(
!
ethJSUtil
.
isValidPrivate
(
privateKey
))
this
.
_addAccount
(
privateKey
)
cb
(
null
,
'0x'
+
ethJSUtil
.
privateToAddress
(
privateKey
))
}
}
...
...
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