diff --git a/lib/tests/test.js b/lib/tests/test.js index e5438a28d..d4e6bbca6 100644 --- a/lib/tests/test.js +++ b/lib/tests/test.js @@ -51,6 +51,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) { @@ -84,14 +94,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,