From dbb46ad7dcb491e246d230c1ccc19a67bbd1aed1 Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Tue, 31 Jul 2018 11:15:49 +0100 Subject: [PATCH] Reset account --- lib/tests/test.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/tests/test.js b/lib/tests/test.js index 26f8c9c02..032a7baac 100644 --- a/lib/tests/test.js +++ b/lib/tests/test.js @@ -50,6 +50,16 @@ class Test { if (this.provider) { this.provider.stop(); } + + if (this.simOptions.accounts) { + this.simOptions.accounts = this.simOptions.accounts.map((account) => { + if (!account.hexBalance) { + account.hexBalance = '0x8AC7230489E80000'; // 10 ether + } + return {balance: account.hexBalance, secretKey: account.privateKey}; + }); + } + if (this.simOptions.host) { let {host, port, type, protocol, accounts} = this.simOptions; if (!protocol) { @@ -83,14 +93,6 @@ class Test { }); } - if (this.simOptions.accounts) { - this.simOptions.accounts = this.simOptions.accounts.map((account) => { - if (!account.hexBalance) { - account.hexBalance = '0x8AC7230489E80000'; // 10 ether - } - return {balance: account.hexBalance, secretKey: account.privateKey}; - }); - } if (!this.sim) { this.sim = getSimulator(); } @@ -189,7 +191,10 @@ class Test { } if (accounts) { self.simOptions.accounts = AccountParser.parseAccountsConfig(accounts, self.web3); + } else { + self.simOptions.account = null; } + Object.assign(self.simOptions, { host, port,