diff --git a/lib/contracts/deploy_manager.js b/lib/contracts/deploy_manager.js index e01b8632..0293b97c 100644 --- a/lib/contracts/deploy_manager.js +++ b/lib/contracts/deploy_manager.js @@ -54,7 +54,8 @@ DeployManager.prototype.deployContracts = function(done) { if (err) { return callback(new Error(err)); } - var selectedAccount = self.config.blockchainConfig.account.address; + var accountConfig = self.config.blockchainConfig.account; + var selectedAccount = accountConfig && accountConfig.address; web3.eth.defaultAccount = (selectedAccount || accounts[0]); callback(null, contractsManager, web3); }); diff --git a/lib/core/engine.js b/lib/core/engine.js index 41b44e88..582f615b 100644 --- a/lib/core/engine.js +++ b/lib/core/engine.js @@ -44,7 +44,8 @@ Engine.prototype.startService = function(serviceName, _options) { throw new Error("unknown service: " + serviceName); } - this.logger.trace("calling: " + serviceName + "(" + JSON.stringify(options) + ")"); + // need to be careful with circular references due to passing the web3 object + //this.logger.trace("calling: " + serviceName + "(" + JSON.stringify(options) + ")"); return service.apply(this, [options]); }; diff --git a/lib/core/test.js b/lib/core/test.js index 71855931..ac1b5e37 100644 --- a/lib/core/test.js +++ b/lib/core/test.js @@ -74,13 +74,20 @@ Test.prototype.deployAll = function(contractsConfig, cb) { self.engine.events.on('abi-contracts-vanila', function(vanillaABI) { callback(null, vanillaABI); }); - self.engine.deployManager.deployContracts(function() { + self.engine.deployManager.deployContracts(function(err, result) { + if (err) { + console.log(err); + callback(err); + } }); } ], function(err, result) { if (err) { - throw new Error(err); + console.log("got error"); + process.exit(); } + // this should be part of the waterfall and not just something done at the + // end self.web3.eth.getAccounts(function(err, accounts) { if (err) { throw new Error(err);