Skip to content
Open
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
10 changes: 5 additions & 5 deletions packages/proof/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ describe("Proof", () => {

const fun = () => generateProof(identity, group, message, scope, 33)

await expect(fun).rejects.toThrow("tree depth must be")
await expect(fun()).rejects.toThrow("tree depth must be")
})

it("Should not generate Semaphore proofs if the identity is not part of the group", async () => {
const group = new Group([1n, 2n])

const fun = () => generateProof(identity, group, message, scope, treeDepth)

await expect(fun).rejects.toThrow("does not exist")
await expect(fun()).rejects.toThrow("does not exist")
})

it("Should generate a Semaphore proof", async () => {
Expand Down Expand Up @@ -80,15 +80,15 @@ describe("Proof", () => {

const fun = () => generateProof(identity, group, message, scope, undefined, "hello" as any)

await expect(fun).rejects.toThrow("is not an object")
await expect(fun()).rejects.toThrow("is not an object")
})

it("Should throw an error because the message value is incorrect", async () => {
const group = new Group([1n, 2n, identity.commitment])

const fun = () => generateProof(identity, group, Number.MAX_VALUE, scope, treeDepth)

await expect(fun).rejects.toThrow("overflow")
await expect(fun()).rejects.toThrow("overflow")
})
})

Expand All @@ -100,7 +100,7 @@ describe("Proof", () => {

const fun = () => verifyProof({ ...proof, merkleTreeDepth: 40 })

await expect(fun).rejects.toThrow("tree depth must be")
await expect(fun()).rejects.toThrow("tree depth must be")
})

it("Should return true if the proof is valid", async () => {
Expand Down