mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-27 15:16:05 +00:00
fix(rln-relay): handle invalid deletes (#1717)
This commit is contained in:
parent
68a39c65bd
commit
81dffee893
@ -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))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user