Unverified Commit d3f21359 authored by yann300's avatar yann300 Committed by GitHub

Merge pull request #1444 from ethereum/yann300-patch-19

Commit added vm acount (for fixing account balance)
parents 14bf2644 4af45597
......@@ -82,6 +82,7 @@ UniversalDApp.prototype.resetAPI = function (transactionContextAPI) {
UniversalDApp.prototype.createVMAccount = function (privateKey, balance, cb) {
this._addAccount(privateKey, balance)
executionContext.vm().stateManager.cache.flush(function () {})
privateKey = new Buffer(privateKey, 'hex')
cb(null, '0x' + ethJSUtil.privateToAddress(privateKey).toString('hex'))
}
......@@ -104,6 +105,7 @@ UniversalDApp.prototype.newAccount = function (password, cb) {
privateKey = crypto.randomBytes(32)
} while (!ethJSUtil.isValidPrivate(privateKey))
this._addAccount(privateKey, '0x56BC75E2D63100000')
executionContext.vm().stateManager.cache.flush(function () {})
cb(null, '0x' + ethJSUtil.privateToAddress(privateKey).toString('hex'))
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment