From 81dffee893ad48c943fe49ea40043e6e547c5b45 Mon Sep 17 00:00:00 2001 From: Aaryamann Challani <43716372+rymnc@users.noreply.github.com> Date: Fri, 5 May 2023 15:48:06 +0530 Subject: [PATCH] fix(rln-relay): handle invalid deletes (#1717) --- tests/v2/waku_rln_relay/test_waku_rln_relay.nim | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/v2/waku_rln_relay/test_waku_rln_relay.nim b/tests/v2/waku_rln_relay/test_waku_rln_relay.nim index 1991de5258..73ff90bcde 100644 --- a/tests/v2/waku_rln_relay/test_waku_rln_relay.nim +++ b/tests/v2/waku_rln_relay/test_waku_rln_relay.nim @@ -152,10 +152,16 @@ suite "Waku rln relay": let rlnInstance = createRLNInstance() require: rlnInstance.isOk() + # generate an identity credential + let rln = rlnInstance.get() + let idCredentialRes = rln.membershipKeyGen() + require: + idCredentialRes.isOk() + rln.insertMember(idCredentialRes.get().idCommitment) # delete the first member let deletedMemberIndex = MembershipIndex(0) - let deletionSuccess = deleteMember(rlnInstance.get(), deletedMemberIndex) + let deletionSuccess = rln.deleteMember(deletedMemberIndex) check: deletionSuccess @@ -191,6 +197,11 @@ suite "Waku rln relay": require: rlnInstance.isOk() let rln = rlnInstance.get() + + let idCredentialRes = rln.membershipKeyGen() + require: + idCredentialRes.isOk() + rln.insertMember(idCredentialRes.get().idCommitment) check: rln.removeMember(MembershipIndex(0))