diff --git a/apps/chat2/chat2.nim b/apps/chat2/chat2.nim index cbb32f027b..7fb4551d26 100644 --- a/apps/chat2/chat2.nim +++ b/apps/chat2/chat2.nim @@ -189,9 +189,9 @@ proc publish(c: Chat, line: string) = # we should check the message content topic as well let appendRes = c.node.wakuRlnRelay.appendRLNProof(message, float64(time)) if appendRes.isErr(): - debug "could not append rate limit proof to the message", success=success + debug "could not append rate limit proof to the message" else: - debug "rate limit proof is appended to the message", success=success + debug "rate limit proof is appended to the message" let decodeRes = RateLimitProof.init(message.proof) if decodeRes.isErr(): error "could not decode the RLN proof" diff --git a/tests/node/test_wakunode_relay_rln.nim b/tests/node/test_wakunode_relay_rln.nim index d70c85151b..6b8acdee61 100644 --- a/tests/node/test_wakunode_relay_rln.nim +++ b/tests/node/test_wakunode_relay_rln.nim @@ -58,7 +58,7 @@ proc sendRlnMessage( payload: seq[byte] = "Hello".toBytes(), ): Future[bool] {.async.} = var message = WakuMessage(payload: payload, contentTopic: contentTopic) - doAssert(not client.wakuRlnRelay.appendRLNProof(message, epochTime()).isErr()) + doAssert(client.wakuRlnRelay.appendRLNProof(message, epochTime()).isOk()) discard await client.publish(some(pubsubTopic), message) let isCompleted = await completionFuture.withTimeout(FUTURE_TIMEOUT) return isCompleted @@ -249,18 +249,18 @@ suite "Waku RlnRelay - End to End": WakuMessage(payload: @payload150kibPlus, contentTopic: contentTopic) doAssert( - not client.wakuRlnRelay.appendRLNProof(message1b, epoch + EpochUnitSeconds * 0).isErr() + client.wakuRlnRelay.appendRLNProof(message1b, epoch + EpochUnitSeconds * 0).isOk() ) doAssert( - not client.wakuRlnRelay.appendRLNProof(message1kib, epoch + EpochUnitSeconds * 1).isErr() + client.wakuRlnRelay.appendRLNProof(message1kib, epoch + EpochUnitSeconds * 1).isOk() ) doAssert( - not client.wakuRlnRelay.appendRLNProof(message150kib, epoch + EpochUnitSeconds * 2).isErr() + client.wakuRlnRelay.appendRLNProof(message150kib, epoch + EpochUnitSeconds * 2).isOk() ) doAssert( - not client.wakuRlnRelay.appendRLNProof( + client.wakuRlnRelay.appendRLNProof( message151kibPlus, epoch + EpochUnitSeconds * 3 - ).isErr() + ).isOk() ) # When sending the 1B message diff --git a/tests/waku_rln_relay/test_waku_rln_relay.nim b/tests/waku_rln_relay/test_waku_rln_relay.nim index 481c89aa9d..9e7a1ec736 100644 --- a/tests/waku_rln_relay/test_waku_rln_relay.nim +++ b/tests/waku_rln_relay/test_waku_rln_relay.nim @@ -687,9 +687,9 @@ suite "Waku rln relay": # ensure proofs are added require: - proofAdded1 - proofAdded2 - proofAdded3 + proofAdded1.isOk() + proofAdded2.isOk() + proofAdded3.isOk() # validate messages # validateMessage proc checks the validity of the message fields and adds it to the log (if valid) diff --git a/tests/waku_rln_relay/test_wakunode_rln_relay.nim b/tests/waku_rln_relay/test_wakunode_rln_relay.nim index 4f2365315a..c57a68b83f 100644 --- a/tests/waku_rln_relay/test_wakunode_rln_relay.nim +++ b/tests/waku_rln_relay/test_wakunode_rln_relay.nim @@ -85,7 +85,7 @@ procSuite "WakuNode - RLN relay": # prepare the epoch var message = WakuMessage(payload: @payload, contentTopic: contentTopic) - doAssert(node1.wakuRlnRelay.appendRLNProof(message, epochTime())) + doAssert(node1.wakuRlnRelay.appendRLNProof(message, epochTime()).isOk()) ## node1 publishes a message with a rate limit proof, the message is then relayed to node2 which in turn @@ -155,12 +155,12 @@ procSuite "WakuNode - RLN relay": for i in 0..<3: var message = WakuMessage(payload: ("Payload_" & $i).toBytes(), contentTopic: contentTopics[0]) - doAssert(nodes[0].wakuRlnRelay.appendRLNProof(message, epochTime)) + doAssert(nodes[0].wakuRlnRelay.appendRLNProof(message, epochTime).isOk()) messages1.add(message) for i in 0..<3: var message = WakuMessage(payload: ("Payload_" & $i).toBytes(), contentTopic: contentTopics[1]) - doAssert(nodes[1].wakuRlnRelay.appendRLNProof(message, epochTime)) + doAssert(nodes[1].wakuRlnRelay.appendRLNProof(message, epochTime).isOk()) messages2.add(message) # publish 3 messages from node[0] (last 2 are spam, window is 10 secs) @@ -346,9 +346,9 @@ procSuite "WakuNode - RLN relay": # check proofs are added correctly check: - proofAdded1 - proofAdded2 - proofAdded3 + proofAdded1.isOk() + proofAdded2.isOk() + proofAdded3.isOk() # relay handler for node3 var completionFut1 = newFuture[bool]() @@ -452,9 +452,9 @@ procSuite "WakuNode - RLN relay": # check proofs are added correctly check: - proofAdded1 - proofAdded2 - proofAdded3 + proofAdded1.isOk() + proofAdded2.isOk() + proofAdded3.isOk() # relay handler for node2 var completionFut1 = newFuture[bool]()