diff --git a/lib/tests/test.js b/lib/tests/test.js index a6789da9..f52f4d76 100644 --- a/lib/tests/test.js +++ b/lib/tests/test.js @@ -214,13 +214,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) { @@ -231,6 +224,23 @@ class Test { next(null, accounts); }); }, + function getBalance(accounts, next) { + web3.eth.getBalance(web3.eth.defaultAccount).then((balance) => { + if (parseInt(balance) === 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];