-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add vector gen and tests
- Loading branch information
Showing
2 changed files
with
414 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); | ||
}); | ||
|
||
}); |
Oops, something went wrong.