arnaucube
arnaucube/circomPublic Self-hosted repository
circom/test/inout.js
test/inout.jsRaw
 1const chai = require("chai");
 2const path = require("path");
 3
 4const c_tester = require("../index.js").c_tester;
 5const stringifyBigInts = require("snarkjs").stringifyBigInts;
 6
 7
 8describe("inout test", function () {
 9    this.timeout(100000);
10    it("Should compile a code with vars inside a for", async () => {
11        const cir = await c_tester(path.join(__dirname, "circuits", "inout.circom"));
12
13        const out = await cir.calculateWitness({in1: 1, in2: [2,3], in3:[[4,5], [6,7], [8,9]]});
14
15        // console.log(JSON.stringify(stringifyBigInts(out),null,1));
16        await cir.assertOut(out, {out1: 1, out2: [2,3], out3: [[4,5], [6,7],[8,9]]} );
17
18        await cir.release();
19    });
20});