Skip to content

Commit

Permalink
replace handlers.nim appendRLNProof with unsafe override for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
stubbsta committed May 8, 2024
1 parent cbcfa74 commit dbc7d55
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions waku/waku_api/rest/relay/handlers.nim
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import
../serdes,
../responses,
../rest_serdes,
./types
./types,
../../../../../tests/waku_rln_relay/rln/waku_rln_relay_utils

from std/times import getTime
from std/times import toUnix
Expand Down Expand Up @@ -155,7 +156,7 @@ proc installRelayApiHandlers*(
if not node.wakuRlnRelay.isNil():
# append the proof to the message

node.wakuRlnRelay.appendRLNProof(message, float64(getTime().toUnix())).isOkOr:
node.wakuRlnRelay.unsafeAppendRLNProof(message, float64(getTime().toUnix())).isOkOr:
return RestApiResponse.internalServerError(
"Failed to publish: error appending RLN proof to message: " & $error
)
Expand Down Expand Up @@ -266,7 +267,7 @@ proc installRelayApiHandlers*(

# if RLN is mounted, append the proof to the message
if not node.wakuRlnRelay.isNil():
node.wakuRlnRelay.appendRLNProof(message, float64(getTime().toUnix())).isOkOr:
node.wakuRlnRelay.unsafeAppendRLNProof(message, float64(getTime().toUnix())).isOkOr:
return RestApiResponse.internalServerError(
"Failed to publish: error appending RLN proof to message: " & $error
)
Expand Down

0 comments on commit dbc7d55

Please sign in to comment.