diff --git a/lib/modules/storage/index.js b/lib/modules/storage/index.js index 1cefc429e..5631c203a 100644 --- a/lib/modules/storage/index.js +++ b/lib/modules/storage/index.js @@ -6,16 +6,10 @@ const SwarmModule = require('../swarm'); class Storage { constructor(embark, options){ const self = this; - this._embark = embark; - this._options = options; - this._storageConfig = options.storageConfig; - this._webServerConfig = options.webServerConfig; - this._blockchainConfig = options.blockchainConfig; - this._servicesMonitor = options.servicesMonitor; - this._events = options.events; - this._logger = options.logger; + this.embark = embark; + this.storageConfig = embark.config.storageConfig; - if (!this._storageConfig.enabled) return; + if (!this.storageConfig.enabled) return; this.addSetProviders(); @@ -38,10 +32,10 @@ class Storage { */ addSetProviders() { // filter list of dapp connections based on available_providers set in config - let hasSwarm = _.contains(this._storageConfig.available_providers, 'swarm'); // don't need to eval this in every loop iteration + let hasSwarm = _.contains(this.storageConfig.available_providers, 'swarm'); // don't need to eval this in every loop iteration // contains valid dapp storage providers - this._validDappProviders = _.filter(this._storageConfig.dappConnection, (conn) => { - return _.contains(self._storageConfig.available_providers, conn.provider) || (conn === '$BZZ' && hasSwarm); + this._validDappProviders = _.filter(this.storageConfig.dappConnection, (conn) => { + return _.contains(self.storageConfig.available_providers, conn.provider) || (conn === '$BZZ' && hasSwarm); }); let code = `\nEmbarkJS.Storage.setProviders(${JSON.stringify(this._validDappProviders)});`; @@ -49,7 +43,7 @@ class Storage { return (this._validDappProviders !== undefined && this._validDappProviders.length > 0 && storageConfig.enabled === true); }; - this._embark.addProviderInit('storage', code, shouldInit); + this.embark.addProviderInit('storage', code, shouldInit); } }