From e61f0f102d3ccb7d857290ebf60d1e445e5b3955 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Tue, 28 Feb 2017 20:42:03 -0500 Subject: [PATCH] generate storage and communication abi; disable deployment if config is disabled --- lib/contracts/abi.js | 6 ++---- lib/contracts/deploy_manager.js | 7 +++++++ test_app/config/communication.json | 1 + 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/contracts/abi.js b/lib/contracts/abi.js index 7246de69..86480995 100644 --- a/lib/contracts/abi.js +++ b/lib/contracts/abi.js @@ -108,10 +108,8 @@ ABIGenerator.prototype.generateABI = function(options) { result += this.generateProvider(); result += this.generateContracts(options.useEmbarkJS); - - // TODO: disable this for now until refactor is over - //result += this.generateStorageInitialization(options.useEmbarkJS); - //result += this.generateCommunicationInitialization(options.useEmbarkJS); + result += this.generateStorageInitialization(options.useEmbarkJS); + result += this.generateCommunicationInitialization(options.useEmbarkJS); return result; }; diff --git a/lib/contracts/deploy_manager.js b/lib/contracts/deploy_manager.js index 2e2baff7..7a83a954 100644 --- a/lib/contracts/deploy_manager.js +++ b/lib/contracts/deploy_manager.js @@ -8,12 +8,19 @@ var ABIGenerator = require('./abi.js'); var DeployManager = function(options) { this.config = options.config; this.logger = options.logger; + this.blockchainConfig = this.config.blockchainConfig; this.plugins = options.plugins; this.events = options.events; }; DeployManager.prototype.deployContracts = function(done) { var self = this; + + if (self.blockchainConfig === {} || self.blockchainConfig.enabled === false) { + self.logger.info("Blockchain component is disabled in the config".underline); + return done(); + } + async.waterfall([ function buildContracts(callback) { var contractsManager = new ContractsManager({ diff --git a/test_app/config/communication.json b/test_app/config/communication.json index fb96acac..bccfad7d 100644 --- a/test_app/config/communication.json +++ b/test_app/config/communication.json @@ -1,5 +1,6 @@ { "default": { + "enabled": false, "provider": "whisper" } }