remove unneded plugin dependency from abi

This commit is contained in:
Iuri Matias 2017-02-18 09:09:36 -05:00
parent 655114b394
commit 38aca05e28
1 changed files with 9 additions and 6 deletions

View File

@ -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});
});