diff --git a/package.json b/package.json index 86cfa12..44f62cb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "circomkit", - "version": "0.2.2", + "version": "0.3.0", "description": "A Circom testing & development environment", "author": "erhant", "license": "MIT", diff --git a/tests/configs.test.ts b/tests/configs.test.ts index 97d575f..a08ed2c 100644 --- a/tests/configs.test.ts +++ b/tests/configs.test.ts @@ -100,7 +100,6 @@ describe('compiling circuits with custom_templates', () => { }); describe('compiling under different directories', () => { - // Fibonacci circuits have only addition constraints so // optimization levels >= 2 result in zero constraints and an invalid r1cs const optimizationLevels = [0, 1]; @@ -118,43 +117,45 @@ describe('compiling under different directories', () => { }, ] as const; - optimizationLevels.map(optimization => cases.map(testcase => - describe(`circomkit with explicit config (--O${optimization}) & input (${testcase.circuit})`, () => { - let circomkit: Circomkit; - - beforeAll(() => { - circomkit = new Circomkit({ - protocol: 'groth16', - optimization, - verbose: false, - logLevel: 'silent', - circuits: './tests/circuits.json', - dirPtau: './tests/ptau', - dirCircuits: './tests/circuits', - dirInputs: './tests/inputs', - dirBuild: `./tests/build/o${optimization}`, + optimizationLevels.map(optimization => + cases.map(testcase => + describe(`circomkit with explicit config (--O${optimization}) & input (${testcase.circuit})`, () => { + let circomkit: Circomkit; + + beforeAll(() => { + circomkit = new Circomkit({ + protocol: 'groth16', + optimization, + verbose: false, + logLevel: 'silent', + circuits: './tests/circuits.json', + dirPtau: './tests/ptau', + dirCircuits: './tests/circuits', + dirInputs: './tests/inputs', + dirBuild: `./tests/build/o${optimization}`, + }); }); - }); - it('should compile with custom config', async () => { - await circomkit.compile(testcase.circuit, { - file: testcase.file, - template: 'Fibonacci', - params: [7], - }); + it('should compile with custom config', async () => { + await circomkit.compile(testcase.circuit, { + file: testcase.file, + template: 'Fibonacci', + params: [7], + }); - await circomkit.info(testcase.circuit); - }); + await circomkit.info(testcase.circuit); + }); - it('should prove with custom input data', async () => { - const path = await circomkit.prove(testcase.circuit, testcase.input, {in: [1, 1]}); - expect(existsSync(path)).toBe(true); - }); + it('should prove with custom input data', async () => { + const path = await circomkit.prove(testcase.circuit, testcase.input, {in: [1, 1]}); + expect(existsSync(path)).toBe(true); + }); - it('should verify the proof', async () => { - const isVerified = await circomkit.verify(testcase.circuit, testcase.input); - expect(isVerified).toBe(true); - }); - }) - )); + it('should verify the proof', async () => { + const isVerified = await circomkit.verify(testcase.circuit, testcase.input); + expect(isVerified).toBe(true); + }); + }) + ) + ); });