From e79c7632e6e82ecc53563da6d8727ce4475078c6 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Tue, 14 Aug 2018 10:52:31 -0700 Subject: simplify method interface --- packages/sol-compiler/src/compiler.ts | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'packages/sol-compiler') diff --git a/packages/sol-compiler/src/compiler.ts b/packages/sol-compiler/src/compiler.ts index 3b46d7b46..cf12825c4 100644 --- a/packages/sol-compiler/src/compiler.ts +++ b/packages/sol-compiler/src/compiler.ts @@ -215,25 +215,29 @@ export class Compiler { const compiled = this._compile(solcInstance, input.standardInput); for (const contractPath of input.contractsToCompile) { - await this._verifyAndPersistCompilationAsync( + await this._verifyAndPersistCompiledContractAsync( contractPath, - contractData[contractPath].contractName, + contractData[contractPath], fullSolcVersion, compiled, - contractData[contractPath].sourceTreeHashHex, - contractData[contractPath].currentArtifactIfExists, ); } } } - private async _verifyAndPersistCompilationAsync( + private async _verifyAndPersistCompiledContractAsync( contractPath: string, - contractName: string, + contractMetadata: { + currentArtifactIfExists: ContractArtifact | void; + sourceTreeHashHex: string; + contractName: string; + }, fullSolcVersion: string, compiled: solc.StandardOutput, - sourceTreeHashHex: string, - currentArtifactIfExists: ContractArtifact | void, ): Promise { + const contractName = contractMetadata.contractName; + const sourceTreeHashHex = contractMetadata.sourceTreeHashHex; + const currentArtifactIfExists = contractMetadata.currentArtifactIfExists; + const compiledData = compiled.contracts[contractPath][contractName]; if (_.isUndefined(compiledData)) { throw new Error( -- cgit v1.2.3