From 92d613d373b11f5576d5655c8a1d2c81d4d92dee Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 1 Oct 2018 14:41:39 +0200 Subject: [PATCH] remove use of compiler in universal-dapp --- src/app/tabs/run-tab.js | 6 +++--- src/universal-dapp-ui.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index 50502c12e8..643d27e324 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -476,7 +476,6 @@ function contractDropdown (events, self) { function loadFromAddress () { var noInstancesText = self._view.noInstancesText if (noInstancesText.parentNode) { noInstancesText.parentNode.removeChild(noInstancesText) } - var selectedContract = getSelectedContract() var address = atAddressButtonInput.value if (!ethJSUtil.isValidAddress(address)) { return modalDialogCustom.alert('Invalid address.') @@ -492,10 +491,11 @@ function contractDropdown (events, self) { } catch (e) { return modalDialogCustom.alert('Failed to parse the current file as JSON ABI.') } - instanceContainer.appendChild(self._deps.udappUI.renderInstanceFromABI(abi, address, address, selectedContract.compiler)) + instanceContainer.appendChild(self._deps.udappUI.renderInstanceFromABI(abi, address, address)) }) } else { - instanceContainer.appendChild(self._deps.udappUI.renderInstance(selectedContract.contract.object, address, selectContractNames.value, selectedContract.compiler)) + var selectedContract = getSelectedContract() + instanceContainer.appendChild(self._deps.udappUI.renderInstance(selectedContract.contract.object, address, selectContractNames.value)) } } diff --git a/src/universal-dapp-ui.js b/src/universal-dapp-ui.js index 3d640decc5..a900ff2cd9 100644 --- a/src/universal-dapp-ui.js +++ b/src/universal-dapp-ui.js @@ -12,20 +12,20 @@ function UniversalDAppUI (udapp, opts = {}) { this.udapp = udapp } -UniversalDAppUI.prototype.renderInstance = function (contract, address, contractName, compiler) { +UniversalDAppUI.prototype.renderInstance = function (contract, address, contractName) { var noInstances = document.querySelector('[class^="noInstancesText"]') if (noInstances) { noInstances.parentNode.removeChild(noInstances) } var abi = this.udapp.getABI(contract) - return this.renderInstanceFromABI(abi, address, contractName, compiler) + return this.renderInstanceFromABI(abi, address, contractName) } // TODO this function was named before "appendChild". // this will render an instance: contract name, contract address, and all the public functions // basically this has to be called for the "atAddress" (line 393) and when a contract creation succeed // this returns a DOM element -UniversalDAppUI.prototype.renderInstanceFromABI = function (contractABI, address, contractName, compiler) { +UniversalDAppUI.prototype.renderInstanceFromABI = function (contractABI, address, contractName) { var self = this address = (address.slice(0, 2) === '0x' ? '' : '0x') + address.toString('hex') var instance = yo`
`