Skip to content

Commit

Permalink
chore(rln-relay): confirm that the provided credential is correct usi…
Browse files Browse the repository at this point in the history
…ng onchain query (#1980)
  • Loading branch information
rymnc committed Sep 4, 2023
1 parent 05c9886 commit be48891
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 14 deletions.
10 changes: 5 additions & 5 deletions tests/waku_rln_relay/test_rln_group_manager_onchain.nim
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ suite "Onchain group manager":
require:
registrations.len == 1
registrations[0].idCommitment == credentials.idCommitment
registrations[0].index == 1
registrations[0].index == 0
fut.complete()
return callback

Expand Down Expand Up @@ -283,7 +283,7 @@ suite "Onchain group manager":
proc callback(registrations: seq[Membership]): Future[void] {.async.} =
if registrations.len == 1 and
registrations[0].idCommitment == credentials[futureIndex].idCommitment and
registrations[0].index == MembershipIndex(futureIndex + 1):
registrations[0].index == MembershipIndex(futureIndex):
futs[futureIndex].complete()
futureIndex += 1
return callback
Expand Down Expand Up @@ -373,7 +373,7 @@ suite "Onchain group manager":
proc callback(registrations: seq[Membership]): Future[void] {.async.} =
if registrations.len == 1 and
registrations[0].idCommitment == credentials.idCommitment and
registrations[0].index == 1:
registrations[0].index == 0:
manager.idCredentials = some(credentials)
manager.membershipIndex = some(registrations[0].index)
fut.complete()
Expand Down Expand Up @@ -443,7 +443,7 @@ suite "Onchain group manager":
proc callback(registrations: seq[Membership]): Future[void] {.async.} =
if registrations.len == 1 and
registrations[0].idCommitment == credentials.idCommitment and
registrations[0].index == 1:
registrations[0].index == 0:
manager.idCredentials = some(credentials)
manager.membershipIndex = some(registrations[0].index)
fut.complete()
Expand Down Expand Up @@ -527,7 +527,7 @@ suite "Onchain group manager":
proc callback(registrations: seq[Membership]): Future[void] {.async.} =
if registrations.len == 1 and
registrations[0].idCommitment == credentials[futureIndex].idCommitment and
registrations[0].index == MembershipIndex(futureIndex + 1):
registrations[0].index == MembershipIndex(futureIndex):
futs[futureIndex].complete()
futureIndex += 1
return callback
Expand Down

0 comments on commit be48891

Please sign in to comment.