mirror of https://github.com/embarklabs/embark.git
remove unneded plugin dependency from abi
This commit is contained in:
parent
655114b394
commit
38aca05e28
15
lib/abi.js
15
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});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue