From f747c757c5b4bebce2851b71be7e686e1391d49e Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Thu, 20 Oct 2016 23:31:42 -0400 Subject: [PATCH] if the contract is set to not deploy, display information correctly on the dashboard --- lib/contracts.js | 22 +++++++++++++++++----- lib/deploy.js | 5 +++++ 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/lib/contracts.js b/lib/contracts.js index edd6146c..1a982204 100644 --- a/lib/contracts.js +++ b/lib/contracts.js @@ -177,11 +177,23 @@ ContractsManager.prototype.contractsState = function() { for(var className in this.contracts) { var contract = this.contracts[className]; - data.push([ - className.green, - (contract.deployedAddress || '...').green, - ((contract.deployedAddress !== undefined) ? "\t\tDeployed".green : "\t\tPending".magenta) - ]); + var contractData; + + if (contract.deploy === false) { + contractData = [ + className.green, + 'Interface or set to not deploy'.green, + "n/a".green + ] + } else { + contractData = [ + className.green, + (contract.deployedAddress || '...').green, + ((contract.deployedAddress !== undefined) ? "\t\tDeployed".green : "\t\tPending".magenta) + ] + } + + data.push(contractData); } return data; diff --git a/lib/deploy.js b/lib/deploy.js index 6003d37b..0fdaf4b3 100644 --- a/lib/deploy.js +++ b/lib/deploy.js @@ -18,6 +18,11 @@ var Deploy = function(options) { Deploy.prototype.checkAndDeployContract = function(contract, params, callback) { var self = this; + if (contract.deploy === false) { + self.logger.contractsState(self.contractsManager.contractsState()); + return callback(); + } + if (contract.address !== undefined) { // determine arguments