Skip to content

Commit

Permalink
test: fix types on tests
Browse files Browse the repository at this point in the history
Former-commit-id: fa4d986
  • Loading branch information
cedoor committed Mar 28, 2024
1 parent 663bea7 commit 197a7ae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions packages/group/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe("Group", () => {
it("Should create a group", () => {
const group = new Group()

expect(group.root).toBe("0")
expect(group.root).toBe(0n)
expect(group.depth).toBe(0)
expect(group.size).toBe(0)
})
Expand All @@ -19,7 +19,7 @@ describe("Group", () => {
group2.addMember(2n)
group2.addMember(3n)

expect(group.root).toContain(group2.root)
expect(group.root).toBe(group2.root)
expect(group.depth).toBe(2)
expect(group.size).toBe(3)
})
Expand Down Expand Up @@ -64,7 +64,7 @@ describe("Group", () => {
group.updateMember(0, 1n)

expect(group.size).toBe(2)
expect(group.members[0]).toBe("1")
expect(group.members[0]).toBe(1n)
})
})

Expand All @@ -76,7 +76,7 @@ describe("Group", () => {
group.removeMember(0)

expect(group.size).toBe(2)
expect(group.members[0]).toBe("0")
expect(group.members[0]).toBe(0n)
})
})

Expand All @@ -88,7 +88,7 @@ describe("Group", () => {

const proof = group.generateMerkleProof(0)

expect(proof.leaf).toBe("1")
expect(proof.leaf).toBe(1n)
})
})

Expand Down
4 changes: 2 additions & 2 deletions packages/proof/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe("Proof", () => {
proof = await generateProof(identity, group, message, scope, treeDepth)

expect(typeof proof).toBe("object")
expect(proof.merkleTreeRoot).toBe(group.root)
expect(BigInt(proof.merkleTreeRoot)).toBe(group.root)
}, 20000)

it("Should generate a Semaphore proof passing a Merkle proof instead of a group", async () => {
Expand All @@ -56,7 +56,7 @@ describe("Proof", () => {
proof = await generateProof(identity, group.generateMerkleProof(2), message, scope, treeDepth)

expect(typeof proof).toBe("object")
expect(proof.merkleTreeRoot).toBe(group.root)
expect(BigInt(proof.merkleTreeRoot)).toBe(group.root)
}, 20000)
})

Expand Down

0 comments on commit 197a7ae

Please sign in to comment.