From dcd9256e2fbed05d6e39110d5f0abb2b93f039b1 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 26 Dec 2018 12:39:32 -0500 Subject: [PATCH] remove compiler dependency from udapp --- src/universal-dapp-ui.js | 7 ++++++- src/universal-dapp.js | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/universal-dapp-ui.js b/src/universal-dapp-ui.js index 26fcc393a9..130ab33731 100644 --- a/src/universal-dapp-ui.js +++ b/src/universal-dapp-ui.js @@ -24,6 +24,11 @@ var TreeView = require('./app/ui/TreeView') function UniversalDAppUI (udapp, registry) { this.udapp = udapp this.registry = registry + + this.compilerData = {contractsDetails: {}} + registry.get('compiler').api.event.register('compilationFinished', (success, data, source) => { + this.compilerData.contractsDetails = success && data ? data.contracts : {} + }) } function decodeResponseToTreeView (response, fnabi) { @@ -215,7 +220,7 @@ UniversalDAppUI.prototype.getCallButton = function (args) { } // contractsDetails is used to resolve libraries - txFormat.buildData(args.contractName, args.contractAbi, self.udapp.data.contractsDetails, false, args.funABI, args.funABI.type !== 'fallback' ? value : '', (error, data) => { + txFormat.buildData(args.contractName, args.contractAbi, self.compilerData.contractsDetails, false, args.funABI, args.funABI.type !== 'fallback' ? value : '', (error, data) => { if (!error) { if (!args.funABI.constant) { self.registry.logCallback(`${logMsg} pending ... `) diff --git a/src/universal-dapp.js b/src/universal-dapp.js index 56073b0072..bdf89119fe 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -10,7 +10,8 @@ var executionContext = remixLib.execution.executionContext function UniversalDApp (globalRegistry, config) { this.event = new EventManager() - this._deps = { + var self = this + self._deps = { config: globalRegistry.get('config').api, compiler: globalRegistry.get('compiler').api }