From c38602e6f3da0ef44560882fc9320d1777bc369d Mon Sep 17 00:00:00 2001 From: cedoor Date: Fri, 21 Jan 2022 14:06:44 +0100 Subject: [PATCH] fix: set correct secret type enum value Former-commit-id: 065efd65685db4f9f1b39f726e08f60496fcb9a9 [formerly 4939807db8f50d5bf9cecc4bdba7f9ac0b9620d0] [formerly 966aef25b4bc017fe1858cebe3ba385238020d49 [formerly 2028051989afbdd4d122961ebc6e4a3d123fabc7]] Former-commit-id: b776cf0762a5d737489c1ad59a9346f37f80e728 [formerly 3c0a2d1709d3b53527c8cf27f37d786fb92e4066] Former-commit-id: 417f09f6bd8dbbd972fd5cd3d16bc1dbd59b882e --- packages/protocols/tests/rln.test.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/protocols/tests/rln.test.ts b/packages/protocols/tests/rln.test.ts index 8a58640..df1f0d4 100644 --- a/packages/protocols/tests/rln.test.ts +++ b/packages/protocols/tests/rln.test.ts @@ -12,7 +12,7 @@ beforeAll(() => { for (let i = 0; i < leafIndex; i += 1) { const tmpIdentity = new ZkIdentity() - const tmpCommitment: bigint = tmpIdentity.genIdentityCommitment(SecretType.MULTIPART_SECRET) + const tmpCommitment: bigint = tmpIdentity.genIdentityCommitment(SecretType.MULTIPART) identityCommitments.push(tmpCommitment) } }) @@ -20,9 +20,9 @@ beforeAll(() => { describe("RLN tests", () => { describe("RLN functionalities", () => { it("Generate rln witness", () => { - const identity: ZkIdentity = new ZkIdentity(); - const identityCommitment: bigint = identity.genIdentityCommitment(); - const secretHash: bigint = identity.getMultipartSecretHash(); + const identity: ZkIdentity = new ZkIdentity() + const identityCommitment: bigint = identity.genIdentityCommitment() + const secretHash: bigint = identity.getMultipartSecretHash() const commitments: Array = Object.assign([], identityCommitments) commitments.push(identityCommitment) @@ -40,10 +40,10 @@ describe("RLN tests", () => { /** * Compiled RLN circuits are needed to run this test so it's being skipped in hooks */ - const identity: ZkIdentity = new ZkIdentity(); + const identity: ZkIdentity = new ZkIdentity() const secretHash: bigint = identity.getMultipartSecretHash() - const identityCommitment: bigint = identity.genIdentityCommitment(SecretType.MULTIPART_SECRET); + const identityCommitment: bigint = identity.genIdentityCommitment(SecretType.MULTIPART) const commitments: Array = Object.assign([], identityCommitments) commitments.push(identityCommitment) @@ -71,7 +71,7 @@ describe("RLN tests", () => { expect(res).toBe(true) }, 30000) it("Should retrieve user secret after spaming", () => { - const identity: ZkIdentity = new ZkIdentity(); + const identity: ZkIdentity = new ZkIdentity() const secretHash: bigint = identity.getSecretHash() const signal1 = "hey hey" @@ -90,4 +90,4 @@ describe("RLN tests", () => { expect(retrievedSecret).toEqual(secretHash) }) }) -}) \ No newline at end of file +})