diff --git a/src/circuit.ts b/src/circuit.ts index f59394c..9690975 100644 --- a/src/circuit.ts +++ b/src/circuit.ts @@ -37,9 +37,9 @@ export class Circuit { } async compile() { - this._compile() + await this._compile() - if(!this._circuitConfig.isTauFileGiven){ + if(!this._circuitConfig.powerOfTauFp || this._circuitConfig.powerOfTauFp.length < 1){ await this.downloadPowerOfTauFile() } await this._genZKey() @@ -148,7 +148,7 @@ export class Circuit { try{ await this.downloadFileOverHttp(tauFileUrl, localTaufilePath) } catch(err){ - console.log("Tau File Download Error: ", err) + log.error("Tau File Download Error: ", err) } } diff --git a/src/configParser.ts b/src/configParser.ts index 0f6c62b..37e7769 100644 --- a/src/configParser.ts +++ b/src/configParser.ts @@ -135,11 +135,8 @@ export class ConfigParser { cktName: cktName, inputFilePath: this._getCircuitInputPath(inputDir, c), outputDir: cktOutputDir, - isTauFileGiven: c.powerOfTauFp? true: false, - powerOfTauFp: path.resolve( - c.powerOfTauFp ? c.powerOfTauFp : path.join(cktOutputDir, `power_of_tau.ptau`) - // Calculate total constraints from r1cs file, and download it - ), + // powerOfTau file is dowloaded according to the total constraints and this powerOfTauFp is assigned in downloadPowerOfTauFile function + powerOfTauFp: c.powerOfTauFp ? path.resolve(c.powerOfTauFp) : '', // This is not used since circom spits the output files in a fixed dir structure. It is here for consistency. jsPath: path.join(cktOutputDir, `${cktName}_js`), // This is here for consistency. It is not used but the output of wasm file in same as wasmPath. diff --git a/src/types.ts b/src/types.ts index c636e7a..4993e13 100644 --- a/src/types.ts +++ b/src/types.ts @@ -59,7 +59,6 @@ export type CircuitConfig = { cktName: string; inputFilePath: string; outputDir: string; - isTauFileGiven: boolean; powerOfTauFp: string; jsPath: string; wasmPath: string;