Skip to content

Commit

Permalink
Feature/linked multi tests (#132)
Browse files Browse the repository at this point in the history
* add vector gen and tests
  • Loading branch information
vmidyllic authored Apr 9, 2024
1 parent 7a1e04d commit cdb8a59
Show file tree
Hide file tree
Showing 2 changed files with 414 additions and 0 deletions.
44 changes: 44 additions & 0 deletions test/linked/linked.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import {expect} from "chai";
import {describe} from "mocha";

const path = require("path");
const wasmTester = require("circom_tester").wasm;

describe("Test linkedMultiQuery10.circom", function () {

this.timeout(600000);

let circuit;

before(async () => {
circuit = await wasmTester(
path.join(__dirname, "../../circuits", "linkedMultiQuery10.circom"),
{
output: path.join(__dirname, "circuits", "build"),
recompile: true,
},
);

});

after(async () => {
circuit.release()
})

const basePath = '../../testvectorgen/credentials/linked/testdata/linked'
const tests = [

require(`${basePath}/one_query.json`),
require(`${basePath}/two_queries.json`),

];

tests.forEach(({ desc, inputs, expOut }) => {
it(`${desc}`, async function () {
const w = await circuit.calculateWitness(inputs, true);
await circuit.assertOut(w, expOut);
await circuit.checkConstraints(w);
});
});

});
Loading

0 comments on commit cdb8a59

Please sign in to comment.