remove use of compiler in universal-dapp

pull/3094/head
yann300 6 years ago
parent b6ca45c0b5
commit 92d613d373
  1. 6
      src/app/tabs/run-tab.js
  2. 6
      src/universal-dapp-ui.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))
}
}

@ -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`<div class="instance ${css.instance} ${css.hidesub}" id="instance${address}"></div>`

Loading…
Cancel
Save