diff --git a/lib/tests/test.js b/lib/tests/test.js index d594ab3e..a15bb7b9 100644 --- a/lib/tests/test.js +++ b/lib/tests/test.js @@ -216,13 +216,6 @@ class Test { self.engine.events.emit(constants.events.contractConfigChanged, self.engine.config.contractsConfig); next(); }, - function deploy(next) { - self.engine.deployManager.gasLimit = 6000000; - self.engine.contractsManager.gasLimit = 6000000; - self.engine.deployManager.fatalErrors = true; - self.engine.deployManager.deployOnlyOnConfig = true; - self.engine.events.request('deploy:contracts', next); - }, function getAccounts(next) { self.web3.eth.getAccounts(function (err, accounts) { if (err) { @@ -233,6 +226,23 @@ class Test { next(null, accounts); }); }, + function getBalance(accounts, next) { + self.web3.eth.getBalance(self.web3.eth.defaultAccount).then((balance) => { + if (parseInt(balance, 10) === 0) { + console.warn("Warning: default account has no funds"); + } + next(null, accounts); + }).catch((err) => { next(err); }); + }, + function deploy(accounts, next) { + self.engine.deployManager.gasLimit = 6000000; + self.engine.contractsManager.gasLimit = 6000000; + self.engine.deployManager.fatalErrors = true; + self.engine.deployManager.deployOnlyOnConfig = true; + self.engine.events.request('deploy:contracts', () => { + next(null, accounts); + }); + }, function createContractObject(accounts, next) { async.each(Object.keys(self.engine.contractsManager.contracts), (contractName, eachCb) => { const contract = self.engine.contractsManager.contracts[contractName];