Commit f681c136 authored by yann300's avatar yann300 Committed by GitHub

Merge pull request #639 from ethereum/fixVMAccounts

fix account balance init
parents 54200e63 9abade28
...@@ -179,8 +179,9 @@ UniversalDApp.prototype._addAccount = function (privateKey, balance) { ...@@ -179,8 +179,9 @@ UniversalDApp.prototype._addAccount = function (privateKey, balance) {
var address = ethJSUtil.privateToAddress(privateKey) var address = ethJSUtil.privateToAddress(privateKey)
// FIXME: we don't care about the callback, but we should still make this proper // FIXME: we don't care about the callback, but we should still make this proper
self.vm.stateManager.putAccountBalance(address, balance || 'f00000000000000001', function cb () {}) self.vm.stateManager.putAccountBalance(address, balance || 'f00000000000000001', function cb () {
self.vm.stateManager.cache.flush(function () {})
})
self.accounts['0x' + address.toString('hex')] = { privateKey: privateKey, nonce: 0 } self.accounts['0x' + address.toString('hex')] = { privateKey: privateKey, nonce: 0 }
} }
} }
......
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