mirror of
https://github.com/logos-messaging/logos-delivery.git
synced 2026-05-05 14:29:29 +00:00
fix(rest): properly check if rln is used (#2205)
* fix(rest): properly check if rln is used * fix(apis): fix remaining usage of defined(rln)
This commit is contained in:
parent
a0ef3c2fbf
commit
2cb0989a28
@ -118,7 +118,7 @@ proc installRelayApiHandlers*(node: WakuNode, server: RpcServer, cache: MessageC
|
|||||||
raise newException(ValueError, "Failed to publish: unknown RLN proof validation result")
|
raise newException(ValueError, "Failed to publish: unknown RLN proof validation result")
|
||||||
|
|
||||||
# if we reach here its either a non-RLN message or a RLN message with a valid proof
|
# if we reach here its either a non-RLN message or a RLN message with a valid proof
|
||||||
debug "Publishing message", pubSubTopic=pubsubTopic, rln=defined(rln)
|
debug "Publishing message", pubSubTopic=pubsubTopic, rln=not node.wakuRlnRelay.isNil()
|
||||||
let publishFut = node.publish(some(pubsubTopic), message)
|
let publishFut = node.publish(some(pubsubTopic), message)
|
||||||
if not await publishFut.withTimeout(futTimeout):
|
if not await publishFut.withTimeout(futTimeout):
|
||||||
raise newException(ValueError, "Failed to publish: timed out")
|
raise newException(ValueError, "Failed to publish: timed out")
|
||||||
@ -217,7 +217,7 @@ proc installRelayApiHandlers*(node: WakuNode, server: RpcServer, cache: MessageC
|
|||||||
raise newException(ValueError, "Failed to publish: unknown RLN proof validation result")
|
raise newException(ValueError, "Failed to publish: unknown RLN proof validation result")
|
||||||
|
|
||||||
# if we reach here its either a non-RLN message or a RLN message with a valid proof
|
# if we reach here its either a non-RLN message or a RLN message with a valid proof
|
||||||
debug "Publishing message", contentTopic=message.contentTopic, rln=defined(rln)
|
debug "Publishing message", contentTopic=message.contentTopic, rln=not node.wakuRlnRelay.isNil()
|
||||||
let publishFut = node.publish(none(PubsubTopic), message)
|
let publishFut = node.publish(none(PubsubTopic), message)
|
||||||
if not await publishFut.withTimeout(futTimeout):
|
if not await publishFut.withTimeout(futTimeout):
|
||||||
raise newException(ValueError, "Failed to publish: timed out")
|
raise newException(ValueError, "Failed to publish: timed out")
|
||||||
|
|||||||
@ -174,7 +174,7 @@ proc installRelayApiHandlers*(router: var RestRouter, node: WakuNode, cache: Mes
|
|||||||
return RestApiResponse.internalServerError("Failed to publish: unknown RLN proof validation result")
|
return RestApiResponse.internalServerError("Failed to publish: unknown RLN proof validation result")
|
||||||
|
|
||||||
# if we reach here its either a non-RLN message or a RLN message with a valid proof
|
# if we reach here its either a non-RLN message or a RLN message with a valid proof
|
||||||
debug "Publishing message", pubSubTopic=pubSubTopic, rln=defined(rln)
|
debug "Publishing message", pubSubTopic=pubSubTopic, rln=not node.wakuRlnRelay.isNil()
|
||||||
if not (waitFor node.publish(some(pubSubTopic), message).withTimeout(futTimeout)):
|
if not (waitFor node.publish(some(pubSubTopic), message).withTimeout(futTimeout)):
|
||||||
error "Failed to publish message to topic", pubSubTopic=pubSubTopic
|
error "Failed to publish message to topic", pubSubTopic=pubSubTopic
|
||||||
return RestApiResponse.internalServerError("Failed to publish: timedout")
|
return RestApiResponse.internalServerError("Failed to publish: timedout")
|
||||||
@ -304,7 +304,7 @@ proc installRelayApiHandlers*(router: var RestRouter, node: WakuNode, cache: Mes
|
|||||||
return RestApiResponse.internalServerError("Failed to publish: unknown RLN proof validation result")
|
return RestApiResponse.internalServerError("Failed to publish: unknown RLN proof validation result")
|
||||||
|
|
||||||
# if we reach here its either a non-RLN message or a RLN message with a valid proof
|
# if we reach here its either a non-RLN message or a RLN message with a valid proof
|
||||||
debug "Publishing message", contentTopic=message.contentTopic, rln=defined(rln)
|
debug "Publishing message", contentTopic=message.contentTopic, rln=not node.wakuRlnRelay.isNil()
|
||||||
if not (waitFor node.publish(none(PubSubTopic), message).withTimeout(futTimeout)):
|
if not (waitFor node.publish(none(PubSubTopic), message).withTimeout(futTimeout)):
|
||||||
error "Failed to publish message to topic", contentTopic=message.contentTopic
|
error "Failed to publish message to topic", contentTopic=message.contentTopic
|
||||||
return RestApiResponse.internalServerError("Failed to publish: timedout")
|
return RestApiResponse.internalServerError("Failed to publish: timedout")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user