diff --git a/.gitignore b/.gitignore index e9b7959725..55148342e1 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,7 @@ docs test-results playwright-report example -packages/discovery/mock_local_storage \ No newline at end of file +packages/discovery/mock_local_storage +.cursorrules +.giga +.cursor \ No newline at end of file diff --git a/packages/rln/src/contract/rln_contract.spec.ts b/packages/rln/src/contract/rln_contract.spec.ts index 876cab0fa8..c05902e6e5 100644 --- a/packages/rln/src/contract/rln_contract.spec.ts +++ b/packages/rln/src/contract/rln_contract.spec.ts @@ -75,6 +75,10 @@ describe("RLN Contract abstraction - RLN", () => { const decryptedCredentials = await rlnContract.registerWithIdentity(identity); + if (!decryptedCredentials) { + throw new Error("Failed to retrieve credentials"); + } + verifyRegistration( decryptedCredentials, identity, diff --git a/packages/rln/src/contract/test-utils.ts b/packages/rln/src/contract/test-utils.ts index db970e914c..9b76999fbb 100644 --- a/packages/rln/src/contract/test-utils.ts +++ b/packages/rln/src/contract/test-utils.ts @@ -130,7 +130,7 @@ export function createRegisterStub( event: "MembershipRegistered", args: { idCommitment: formatIdCommitment(identity.IDCommitmentBigInt), - rateLimit: DEFAULT_RATE_LIMIT, + membershipRateLimit: ethers.BigNumber.from(DEFAULT_RATE_LIMIT), index: ethers.BigNumber.from(1) } } diff --git a/packages/rln/src/keystore/keystore.spec.ts b/packages/rln/src/keystore/keystore.spec.ts index 322c3db688..ddbb233cb7 100644 --- a/packages/rln/src/keystore/keystore.spec.ts +++ b/packages/rln/src/keystore/keystore.spec.ts @@ -231,7 +231,8 @@ describe("Keystore", () => { const membership = { chainId: "0xAA36A7", treeIndex: 8, - address: "0x8e1F3742B987d8BA376c0CBbD7357fE1F003ED71" + address: "0x8e1F3742B987d8BA376c0CBbD7357fE1F003ED71", + rateLimit: undefined } as unknown as MembershipInfo; const store = Keystore.create(); @@ -246,6 +247,11 @@ describe("Keystore", () => { expectedHash, DEFAULT_PASSWORD ); + + if (!actualCredentials) { + throw new Error("Failed to retrieve credentials"); + } + expect(actualCredentials).to.deep.equalInAnyOrder({ identity, membership @@ -276,7 +282,8 @@ describe("Keystore", () => { const membership = { chainId: "0xAA36A7", treeIndex: 8, - address: "0x8e1F3742B987d8BA376c0CBbD7357fE1F003ED71" + address: "0x8e1F3742B987d8BA376c0CBbD7357fE1F003ED71", + rateLimit: undefined } as unknown as MembershipInfo; const store = Keystore.fromObject(NWAKU_KEYSTORE as any);