From 48bc6b91bb288cee5859c1a854772fe8fa95585b Mon Sep 17 00:00:00 2001 From: erhant Date: Tue, 10 Sep 2024 00:14:45 +0300 Subject: [PATCH] bump minor ver + small lint fix [skip ci] --- package.json | 2 +- tests/configs.test.ts | 71 ++++++++++++++++++++++--------------------- 2 files changed, 37 insertions(+), 36 deletions(-) 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); + }); + }) + ) + ); });