Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typization #10

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
235 changes: 93 additions & 142 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@iden3/contracts": "^1.4.7",
"@iden3/js-crypto": "^1.0.3",
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
"@solarity/hardhat-zkit": "^0.1.2",
"@solarity/hardhat-zkit": "^0.2.1",
"@solarity/solidity-lib": "^2.7.3",
"@typechain/ethers-v6": "^0.5.1",
"@types/chai": "^4.3.14",
Expand Down
11 changes: 5 additions & 6 deletions test/blinders/Commitment.test.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import { expect } from "chai";
import { ethers, zkit } from "hardhat";

import { CircuitZKit } from "@solarity/zkit";

import { Reverter } from "../helpers/reverter";

import { CommitmentVerifierVerifier } from "@ethers-v6";
import { CommitmentVerifier } from "@zkit";

describe("Commitment", () => {
const reverter = new Reverter();

let commitmentVerifier: CommitmentVerifierVerifier;
let commitmentCircuit: CircuitZKit;
let commitmentCircuit: CommitmentVerifier;

before("setup", async () => {
const CommitmentMockVerifier = await ethers.getContractFactory("CommitmentVerifierVerifier");
Expand All @@ -31,16 +30,16 @@ describe("Commitment", () => {
});

// Poseidon(1, 2)
expect(proofStruct.publicSignals[0]).to.equal(
expect(proofStruct.publicSignals.commitment).to.equal(
"7853200120776062878684798364095072458815029376092732009249414926327459813530",
);
// Poseidon(1)
expect(proofStruct.publicSignals[1]).to.equal(
expect(proofStruct.publicSignals.nullifierHash).to.equal(
"18586133768512220936620570745912940619677854269274689475585506675881198879027",
);

const [pA, pB, pC, publicSignals] = await commitmentCircuit.generateCalldata(proofStruct);

expect(await commitmentVerifier.verifyProof(pA, pB, pC, publicSignals as any)).to.be.true;
expect(await commitmentVerifier.verifyProof(pA, pB, pC, publicSignals)).to.be.true;
});
});
5 changes: 2 additions & 3 deletions test/data-structures/SparseMerkleTree.test.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import { expect } from "chai";
import { ethers, zkit } from "hardhat";

import { CircuitZKit } from "@solarity/zkit";

import { deployPoseidonFacade } from "../helpers/poseidon/poseidon-deployer";
import { Reverter } from "../helpers/reverter";

import { SparseMerkleTreeMock, SparseMerkleTreeVerifierVerifier } from "@ethers-v6";
import { SparseMerkleTreeVerifier } from "@zkit";

describe("SparseMerkleTree", () => {
const reverter = new Reverter();

let smtCircuit: CircuitZKit;
let smtCircuit: SparseMerkleTreeVerifier;

let smtMock: SparseMerkleTreeMock;
let smtVerifier: SparseMerkleTreeVerifierVerifier;
Expand Down
Loading
Loading