From a86acd861a29ae34767f5f7e98adaf269b830355 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Thu, 24 Feb 2022 16:23:27 +0530 Subject: [PATCH] private methods --- .../src/lib/compiler-artefacts.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/libs/remix-core-plugin/src/lib/compiler-artefacts.ts b/libs/remix-core-plugin/src/lib/compiler-artefacts.ts index ebd9a85f30..01a8e23f4a 100644 --- a/libs/remix-core-plugin/src/lib/compiler-artefacts.ts +++ b/libs/remix-core-plugin/src/lib/compiler-artefacts.ts @@ -72,7 +72,7 @@ export class CompilerArtefacts extends Plugin { return contractsData } - getAllContractArtefactsfromOutput (contractsOutput, contractName) { + _getAllContractArtefactsfromOutput (contractsOutput, contractName) { const contractArtefacts = {} for (const filename in contractsOutput) { if(Object.keys(contractsOutput[filename]).includes(contractName)) contractArtefacts[filename + ':' + contractName] = contractsOutput[filename][contractName] @@ -80,7 +80,7 @@ export class CompilerArtefacts extends Plugin { return contractArtefacts } - async getArtefactsFromFE (path, contractName, contractArtefacts) { + async _getArtefactsFromFE (path, contractName, contractArtefacts) { const dirList = await this.call('fileManager', 'dirList', path) if(dirList && dirList.length) { for (const dirPath of dirList) { @@ -90,13 +90,13 @@ export class CompilerArtefacts extends Plugin { let content = await this.call('fileManager', 'readFile', buildFile) if (content) content = JSON.parse(content) const contracts = content.output.contracts - const artefacts = this.getAllContractArtefactsfromOutput(contracts, contractName) + const artefacts = this._getAllContractArtefactsfromOutput(contracts, contractName) Object.assign(contractArtefacts, artefacts) } - } else await this.getArtefactsFromFE (dirPath, contractName, contractArtefacts) - } - } else return -} + } else await this._getArtefactsFromFE (dirPath, contractName, contractArtefacts) + } + } else return + } async getArtefactsByContractName (contractName) { const contractsDataByFilename = this.getAllContractDatas() @@ -108,15 +108,15 @@ export class CompilerArtefacts extends Plugin { return contractsDataByFilename[filename][contract] else { const allContractsData = {} - await this.getArtefactsFromFE ('contracts', contract, allContractsData) + await this._getArtefactsFromFE ('contracts', contract, allContractsData) if(allContractsData[contractName]) return allContractsData[contractName] else throw new Error(`Could not find artifacts for ${contractName}. Compile contract to generate artifacts.`) } } else { - const contractArtefacts = this.getAllContractArtefactsfromOutput(contractsDataByFilename, contractName) + const contractArtefacts = this._getAllContractArtefactsfromOutput(contractsDataByFilename, contractName) let keys = Object.keys(contractArtefacts) if (!keys.length) { - await this.getArtefactsFromFE ('contracts', contractName, contractArtefacts) + await this._getArtefactsFromFE ('contracts', contractName, contractArtefacts) keys = Object.keys(contractArtefacts) } if (keys.length === 1) return contractArtefacts[keys[0]]