fix debugging with source code

pull/3418/head
yann300 2 years ago committed by Aniket
parent f2d2d3d309
commit 7e2ca3de19
  1. 13
      libs/remix-core-plugin/src/lib/compiler-fetch-and-compile.ts

@ -43,7 +43,14 @@ export class FetchAndCompile extends Plugin {
async resolve (contractAddress, codeAtAddress, targetPath) {
contractAddress = toChecksumAddress(contractAddress)
const localCompilation = async () => await this.call('compilerArtefacts', 'get', contractAddress) ? await this.call('compilerArtefacts', 'get', contractAddress) : await this.call('compilerArtefacts', 'get', '__last') ? await this.call('compilerArtefacts', 'get', '__last') : null
const localCompilation = async () => {
const contractData = await this.call('compilerArtefacts', 'getContractDataFromByteCode', codeAtAddress)
if (contractData) {
return await this.call('compilerArtefacts', 'getCompilerAbstract', contractData.file)
}
else
return await this.call('compilerArtefacts', 'get', '__last')
}
const resolved = await this.call('compilerArtefacts', 'get', contractAddress)
if (resolved) return resolved
@ -87,8 +94,7 @@ export class FetchAndCompile extends Plugin {
return localCompilation()
}
if (!network) return localCompilation()
if (!this.sourceVerifierNetWork.includes(network.name)) return localCompilation()
if (!this.sourceVerifierNetWork.includes(network.name)) {
// check if the contract if part of the local compilation result
const compilation = await localCompilation()
if (compilation) {
@ -103,6 +109,7 @@ export class FetchAndCompile extends Plugin {
return compilation
}
}
}
targetPath = `${targetPath}/${network.id}/${contractAddress}`
let data

Loading…
Cancel
Save