From 4af45597d53a2750b0f4c216d3a90e4087c801f8 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 6 Aug 2018 09:55:55 +0200 Subject: [PATCH] commit added vm acount (for fixing account balance) --- src/universal-dapp.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/universal-dapp.js b/src/universal-dapp.js index 5cd70814d7..7bc0d91603 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -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')) } }