Merge pull request #508 from embark-framework/test_fixes
warn if configured account has no funds
This commit is contained in:
commit
03870953a7
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue