add udappUI to app object and update references

pull/1/head
Iuri Matias 7 years ago
parent 93c62d9e92
commit 976c211526
  1. 4
      src/app.js
  2. 8
      src/app/tabs/run-tab.js

@ -265,7 +265,6 @@ function run () {
})
var udappUI = new UniversalDAppUI(udapp)
console.dir(udappUI)
udapp.reset({}, transactionContextAPI)
udapp.event.register('debugRequested', this, function (txResult) {
@ -582,6 +581,9 @@ function run () {
udapp: () => {
return udapp
},
udappUI: () => {
return udappUI
},
switchFile: function (path) {
fileManager.switchFile(path)
},

@ -379,7 +379,7 @@ function makeRecorder (events, appAPI, appEvents) {
if (txArray.length) {
noInstancesText.style.display = 'none'
recorder.run(txArray, accounts, options, abis, linkReferences, (abi, address, contractName) => {
instanceContainer.appendChild(appAPI.udapp().renderInstanceFromABI(abi, address, contractName))
instanceContainer.appendChild(appAPI.udappUI().renderInstanceFromABI(abi, address, contractName))
})
}
} else {
@ -484,7 +484,7 @@ function contractDropdown (events, appAPI, appEvents, instanceContainer) {
}
noInstancesText.style.display = 'none'
var address = isVM ? txResult.result.createdAddress : txResult.result.contractAddress
instanceContainer.appendChild(appAPI.udapp().renderInstance(selectedContract.contract.object, address, selectContractNames.value))
instanceContainer.appendChild(appAPI.udappUI().renderInstance(selectedContract.contract.object, address, selectContractNames.value))
} else {
appAPI.logMessage(`creation of ${selectedContract.name} errored: ` + error)
}
@ -509,11 +509,11 @@ function contractDropdown (events, appAPI, appEvents, instanceContainer) {
} catch (e) {
return modalDialogCustom.alert('Failed to parse the current file as JSON ABI.')
}
instanceContainer.appendChild(appAPI.udapp().renderInstanceFromABI(abi, address, address))
instanceContainer.appendChild(appAPI.udappUI().renderInstanceFromABI(abi, address, address))
})
} else {
var contract = appAPI.getContract(contractNames.children[contractNames.selectedIndex].innerHTML)
instanceContainer.appendChild(appAPI.udapp().renderInstance(contract.object, address, selectContractNames.value))
instanceContainer.appendChild(appAPI.udappUI().renderInstance(contract.object, address, selectContractNames.value))
}
}

Loading…
Cancel
Save