diff --git a/src/configParser.ts b/src/configParser.ts index ee52587..ce9e627 100644 --- a/src/configParser.ts +++ b/src/configParser.ts @@ -164,7 +164,9 @@ export class ConfigParser { r1cs: true, json: false, prime: false, - O: 0, + c: false, + wat: false, + O: c.compileOptions ? c.compileOptions.O : 0, verbose: false, }, }; diff --git a/src/types.ts b/src/types.ts index 02cc63a..69cc89a 100644 --- a/src/types.ts +++ b/src/types.ts @@ -19,6 +19,7 @@ export type BuildCircuitInfo = { powerOfTauFp?: string; proofType?: SnarkType; compilationMode?: CompilationMode; + compileOptions?: CompileOptions; }; export type CompilationMode = 'wasm' | 'c'; @@ -75,6 +76,8 @@ export type CompileOptions = { sym: boolean; r1cs: boolean; json: boolean; + c: boolean; + wat: boolean; prime: number | boolean; O: number; verbose: boolean; diff --git a/src/vendors/circom_tester/wasm/tester.js b/src/vendors/circom_tester/wasm/tester.js index 21ed96e..cf499e2 100644 --- a/src/vendors/circom_tester/wasm/tester.js +++ b/src/vendors/circom_tester/wasm/tester.js @@ -87,10 +87,13 @@ async function compile(fileName, options) { if (options.sym) flags += '--sym '; if (options.r1cs) flags += '--r1cs '; if (options.json) flags += '--json '; + if (options.wat) flags += '--wat '; + if (options.c) flags += '--c '; if (options.output) flags += '--output ' + options.output + ' '; if (options.prime) flags += '--prime ' + options.prime + ' '; if (options.O === 0) flags += '--O0 '; if (options.O === 1) flags += '--O1 '; + if (options.O === 2) flags += '--O2 '; if (options.verbose) flags += '--verbose '; try {