From 38aca05e28f5fcb8a8145bd1af152a9d240b6490 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Sat, 18 Feb 2017 09:09:36 -0500 Subject: [PATCH] remove unneded plugin dependency from abi --- lib/abi.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/abi.js b/lib/abi.js index e80807d3c..91c087346 100644 --- a/lib/abi.js +++ b/lib/abi.js @@ -1,4 +1,3 @@ -var Plugins = require('./plugins.js'); var ABIGenerator = function(options) { this.blockchainConfig = options.blockchainConfig || {}; @@ -6,16 +5,18 @@ var ABIGenerator = function(options) { this.contractsManager = options.contractsManager; this.rpcHost = options.blockchainConfig && options.blockchainConfig.rpcHost; this.rpcPort = options.blockchainConfig && options.blockchainConfig.rpcPort; - this.plugins = options.plugins || new Plugins({}); + this.plugins = options.plugins; }; ABIGenerator.prototype.generateProvider = function() { var self = this; var result = ""; - var providerPlugins = this.plugins.getPluginsFor('clientWeb3Provider'); + if (this.plugins) { + var providerPlugins = this.plugins.getPluginsFor('clientWeb3Provider'); + } - if (providerPlugins.length > 0) { + if (this.plugins && providerPlugins.length > 0) { providerPlugins.forEach(function(plugin) { result += plugin.generateProvider(self) + "\n"; }); @@ -35,9 +36,11 @@ ABIGenerator.prototype.generateContracts = function(useEmbarkJS) { var self = this; var result = "\n"; - var contractsPlugins = this.plugins.getPluginsFor('contractGeneration'); + if (this.plugins) { + var contractsPlugins = this.plugins.getPluginsFor('contractGeneration'); + } - if (contractsPlugins.length > 0) { + if (this.plugins && contractsPlugins.length > 0) { contractsPlugins.forEach(function(plugin) { result += plugin.generateContracts({contracts: self.contractsManager.contracts}); });