From 06c5985772ee875d6c63eda86af6d98d432d1f5e Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 26 Dec 2018 12:06:48 -0500 Subject: [PATCH] fix call to logCallback --- src/app.js | 2 +- src/universal-dapp-ui.js | 15 ++++++++------- src/universal-dapp.js | 1 - 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/app.js b/src/app.js index d14003c9a5..598223283f 100644 --- a/src/app.js +++ b/src/app.js @@ -320,7 +320,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org if (txLink) registry.get('logCallback').api.logCallback(yo`${txLink}`) }) - var udappUI = new UniversalDAppUI(udapp) + var udappUI = new UniversalDAppUI(udapp, registry) registry.put({api: udappUI, name: 'udappUI'}) // ----------------- Tx listener ----------------- diff --git a/src/universal-dapp-ui.js b/src/universal-dapp-ui.js index a6162057a0..26fcc393a9 100644 --- a/src/universal-dapp-ui.js +++ b/src/universal-dapp-ui.js @@ -21,8 +21,9 @@ var modalCustom = require('./app/ui/modal-dialog-custom') var modalDialog = require('./app/ui/modaldialog') var TreeView = require('./app/ui/TreeView') -function UniversalDAppUI (udapp, opts = {}) { +function UniversalDAppUI (udapp, registry) { this.udapp = udapp + this.registry = registry } function decodeResponseToTreeView (response, fnabi) { @@ -217,9 +218,9 @@ UniversalDAppUI.prototype.getCallButton = function (args) { txFormat.buildData(args.contractName, args.contractAbi, self.udapp.data.contractsDetails, false, args.funABI, args.funABI.type !== 'fallback' ? value : '', (error, data) => { if (!error) { if (!args.funABI.constant) { - self.udapp._deps.logCallback(`${logMsg} pending ... `) + self.registry.logCallback(`${logMsg} pending ... `) } else { - self.udapp._deps.logCallback(`${logMsg}`) + self.registry.logCallback(`${logMsg}`) } if (args.funABI.type === 'fallback') data.dataHex = value self.udapp.callFunction(args.address, data, args.funABI, confirmationCb, continueCb, promptCb, (error, txResult) => { @@ -228,7 +229,7 @@ UniversalDAppUI.prototype.getCallButton = function (args) { if (isVM) { var vmError = txExecution.checkVMError(txResult) if (vmError.error) { - self.udapp._deps.logCallback(`${logMsg} errored: ${vmError.message} `) + self.registry.logCallback(`${logMsg} errored: ${vmError.message} `) return } } @@ -237,14 +238,14 @@ UniversalDAppUI.prototype.getCallButton = function (args) { outputCb(decoded) } } else { - self.udapp._deps.logCallback(`${logMsg} errored: ${error} `) + self.registry.logCallback(`${logMsg} errored: ${error} `) } }) } else { - self.udapp._deps.logCallback(`${logMsg} errored: ${error} `) + self.registry.logCallback(`${logMsg} errored: ${error} `) } }, (msg) => { - self.udapp._deps.logCallback(msg) + self.registry.logCallback(msg) }, (data, runTxCallback) => { // called for libraries deployment self.udapp.runTx(data, confirmationCb, runTxCallback) diff --git a/src/universal-dapp.js b/src/universal-dapp.js index a463f04aee..a9c82b0ef5 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -10,7 +10,6 @@ var executionContext = remixLib.execution.executionContext function UniversalDApp (globalRegistry) { this.event = new EventManager() - this.data = {} this._deps = { config: globalRegistry.get('config').api, compiler: globalRegistry.get('compiler').api