Skip to content

Commit

Permalink
bump minor ver + small lint fix [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
erhant committed Sep 9, 2024
1 parent ace200f commit 48bc6b9
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 36 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "circomkit",
"version": "0.2.2",
"version": "0.3.0",
"description": "A Circom testing & development environment",
"author": "erhant",
"license": "MIT",
Expand Down
71 changes: 36 additions & 35 deletions tests/configs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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);
});
})
)
);
});

0 comments on commit 48bc6b9

Please sign in to comment.