fix: set correct secret type enum value

Former-commit-id: 065efd65685db4f9f1b39f726e08f60496fcb9a9 [formerly 4939807db8f50d5bf9cecc4bdba7f9ac0b9620d0] [formerly 966aef25b4bc017fe1858cebe3ba385238020d49 [formerly 2028051989]]
Former-commit-id: b776cf0762a5d737489c1ad59a9346f37f80e728 [formerly 3c0a2d1709d3b53527c8cf27f37d786fb92e4066]
Former-commit-id: 417f09f6bd8dbbd972fd5cd3d16bc1dbd59b882e
This commit is contained in:
cedoor
2022-01-21 14:06:44 +01:00
parent af155c36dd
commit c38602e6f3

View File

@@ -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<bigint> = 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<bigint> = 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)
})
})
})
})