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
d3f21359
Unverified
Commit
d3f21359
authored
Aug 14, 2018
by
yann300
Committed by
GitHub
Aug 14, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1444 from ethereum/yann300-patch-19
Commit added vm acount (for fixing account balance)
parents
14bf2644
4af45597
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
universal-dapp.js
src/universal-dapp.js
+2
-0
No files found.
src/universal-dapp.js
View file @
d3f21359
...
@@ -82,6 +82,7 @@ UniversalDApp.prototype.resetAPI = function (transactionContextAPI) {
...
@@ -82,6 +82,7 @@ UniversalDApp.prototype.resetAPI = function (transactionContextAPI) {
UniversalDApp
.
prototype
.
createVMAccount
=
function
(
privateKey
,
balance
,
cb
)
{
UniversalDApp
.
prototype
.
createVMAccount
=
function
(
privateKey
,
balance
,
cb
)
{
this
.
_addAccount
(
privateKey
,
balance
)
this
.
_addAccount
(
privateKey
,
balance
)
executionContext
.
vm
().
stateManager
.
cache
.
flush
(
function
()
{})
privateKey
=
new
Buffer
(
privateKey
,
'hex'
)
privateKey
=
new
Buffer
(
privateKey
,
'hex'
)
cb
(
null
,
'0x'
+
ethJSUtil
.
privateToAddress
(
privateKey
).
toString
(
'hex'
))
cb
(
null
,
'0x'
+
ethJSUtil
.
privateToAddress
(
privateKey
).
toString
(
'hex'
))
}
}
...
@@ -104,6 +105,7 @@ UniversalDApp.prototype.newAccount = function (password, cb) {
...
@@ -104,6 +105,7 @@ UniversalDApp.prototype.newAccount = function (password, cb) {
privateKey
=
crypto
.
randomBytes
(
32
)
privateKey
=
crypto
.
randomBytes
(
32
)
}
while
(
!
ethJSUtil
.
isValidPrivate
(
privateKey
))
}
while
(
!
ethJSUtil
.
isValidPrivate
(
privateKey
))
this
.
_addAccount
(
privateKey
,
'0x56BC75E2D63100000'
)
this
.
_addAccount
(
privateKey
,
'0x56BC75E2D63100000'
)
executionContext
.
vm
().
stateManager
.
cache
.
flush
(
function
()
{})
cb
(
null
,
'0x'
+
ethJSUtil
.
privateToAddress
(
privateKey
).
toString
(
'hex'
))
cb
(
null
,
'0x'
+
ethJSUtil
.
privateToAddress
(
privateKey
).
toString
(
'hex'
))
}
}
}
}
...
...
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