fix issue 3888

pull/3973/head
drafish 1 year ago committed by Aniket
parent a34c6b71f3
commit 4549cbc7b0
  1. 4
      libs/remix-ui/run-tab/src/lib/actions/deploy.ts
  2. 19
      libs/remix-ui/terminal/src/lib/actions/terminalAction.ts

@ -155,14 +155,14 @@ export const createInstance = async (
return terminalLogger(plugin, log) return terminalLogger(plugin, log)
} }
const finalCb = (error, contractObject, address) => { const finalCb = async (error, contractObject, address) => {
if (error) { if (error) {
const log = logBuilder(error) const log = logBuilder(error)
return terminalLogger(plugin, log) return terminalLogger(plugin, log)
} }
addInstance(dispatch, { contractData: contractObject, address, name: contractObject.name }) addInstance(dispatch, { contractData: contractObject, address, name: contractObject.name })
const data = plugin.compilersArtefacts.getCompilerAbstract(contractObject.contract.file) const data = await plugin.compilersArtefacts.getCompilerAbstract(contractObject.contract.file)
plugin.compilersArtefacts.addResolvedContract(addressToString(address), data) plugin.compilersArtefacts.addResolvedContract(addressToString(address), data)
if (plugin.REACT_API.ipfsChecked) { if (plugin.REACT_API.ipfsChecked) {

@ -134,7 +134,24 @@ export const initListeningOnNetwork = (plugins, dispatch: React.Dispatch<any>) =
if (resolvedTransaction) { if (resolvedTransaction) {
let compiledContracts = null let compiledContracts = null
if (plugins._deps.compilersArtefacts.__last) { try {
if (tx.to) {
compiledContracts = await plugins._deps.compilersArtefacts.get(tx.to).getContracts()
}
} catch (error) {
console.log(error)
}
try {
const currentFile = plugins._deps.fileManager.getCurrentFile()
if (!compiledContracts && currentFile && currentFile.endsWith('.sol')) {
compiledContracts = await (await plugins._deps.compilersArtefacts.getCompilerAbstract(currentFile)).getContracts()
}
} catch (error) {
console.log(error)
}
if (!compiledContracts && plugins._deps.compilersArtefacts.__last) {
compiledContracts = await plugins._deps.compilersArtefacts.__last.getContracts() compiledContracts = await plugins._deps.compilersArtefacts.__last.getContracts()
} }
await plugins.eventsDecoder.parseLogs(tx, resolvedTransaction.contractName, compiledContracts, async (error, logs) => { await plugins.eventsDecoder.parseLogs(tx, resolvedTransaction.contractName, compiledContracts, async (error, logs) => {

Loading…
Cancel
Save