Skip to content

Commit

Permalink
Merge branch 'master' into rln-relay/consolidate-rln-credential-input…
Browse files Browse the repository at this point in the history
…-paths
  • Loading branch information
staheri14 committed Aug 17, 2022
2 parents 125e762 + 7a30e48 commit cd9dd8b
Show file tree
Hide file tree
Showing 5 changed files with 1,081 additions and 990 deletions.
8 changes: 4 additions & 4 deletions examples/v2/chat2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import ../../waku/v2/protocol/waku_message,
../../waku/common/utils/nat,
./config_chat2

when defined(rln):
when defined(rln) or defined(rlnzerokit):
import
libp2p/protocols/pubsub/rpc/messages,
libp2p/protocols/pubsub/pubsub,
Expand Down Expand Up @@ -219,7 +219,7 @@ proc publish(c: Chat, line: string) =
if encodedPayload.isOk():
var message = WakuMessage(payload: encodedPayload.get(),
contentTopic: c.contentTopic, version: version, timestamp: getNanosecondTime(time))
when defined(rln):
when defined(rln) or defined(rlnzerokit):
if not isNil(c.node.wakuRlnRelay):
# for future version when we support more than one rln protected content topic,
# we should check the message content topic as well
Expand All @@ -241,7 +241,7 @@ proc publish(c: Chat, line: string) =
# No payload encoding/encryption from Waku
var message = WakuMessage(payload: chat2pb.buffer,
contentTopic: c.contentTopic, version: 0, timestamp: getNanosecondTime(time))
when defined(rln):
when defined(rln) or defined(rlnzerokit):
if not isNil(c.node.wakuRlnRelay):
# for future version when we support more than one rln protected content topic,
# we should check the message content topic as well
Expand Down Expand Up @@ -498,7 +498,7 @@ proc processInput(rfd: AsyncFD, rng: ref BrHmacDrbgContext) {.async.} =
let topic = cast[Topic](DefaultTopic)
node.subscribe(topic, handler)

when defined(rln):
when defined(rln) or defined(rlnzerokit):
if conf.rlnRelay:
info "WakuRLNRelay is enabled"

Expand Down
2 changes: 0 additions & 2 deletions tests/v2/test_waku_rln_relay.nim
Original file line number Diff line number Diff line change
Expand Up @@ -755,8 +755,6 @@ suite "Waku rln relay":
proofAdded3 = wakuRlnRelay.appendRLNProof(wm3, time+EPOCH_UNIT_SECONDS)
wm4 = WakuMessage(payload: "Invalid message".toBytes())

echo wm1.proof

# checks proofs are added
check:
proofAdded1
Expand Down
Loading

0 comments on commit cd9dd8b

Please sign in to comment.