Skip to content

Commit

Permalink
fix(rln-relay): handle invalid deletes (#1717)
Browse files Browse the repository at this point in the history
  • Loading branch information
rymnc authored May 5, 2023
1 parent 68a39c6 commit 81dffee
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/v2/waku_rln_relay/test_waku_rln_relay.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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))

Expand Down

0 comments on commit 81dffee

Please sign in to comment.