fix(rln): error in api when rate limit (#2212)

This commit is contained in:
Alvaro Revuelta 2023-11-21 19:24:31 +01:00 committed by GitHub
parent c973b85069
commit 51f36099d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 13 deletions

View File

@ -107,7 +107,7 @@ proc installRelayApiHandlers*(node: WakuNode, server: RpcServer, cache: MessageC
if not success:
raise newException(ValueError, "Failed to publish: error appending RLN proof to message")
# validate the message before sending it
let result = node.wakuRlnRelay.validateMessage(message)
let result = node.wakuRlnRelay.validateMessageAndUpdateLog(message)
if result == MessageValidationResult.Invalid:
raise newException(ValueError, "Failed to publish: invalid RLN proof")
elif result == MessageValidationResult.Spam:
@ -206,7 +206,7 @@ proc installRelayApiHandlers*(node: WakuNode, server: RpcServer, cache: MessageC
if not success:
raise newException(ValueError, "Failed to publish: error appending RLN proof to message")
# validate the message before sending it
let result = node.wakuRlnRelay.validateMessage(message)
let result = node.wakuRlnRelay.validateMessageAndUpdateLog(message)
if result == MessageValidationResult.Invalid:
raise newException(ValueError, "Failed to publish: invalid RLN proof")
elif result == MessageValidationResult.Spam:

View File

@ -139,7 +139,7 @@ proc installRelayApiHandlers*(router: var RestRouter, node: WakuNode, cache: Mes
return RestApiResponse.internalServerError("Failed to publish: error appending RLN proof to message")
# validate the message before sending it
let result = node.wakuRlnRelay.validateMessage(message)
let result = node.wakuRlnRelay.validateMessageAndUpdateLog(message)
if result == MessageValidationResult.Invalid:
return RestApiResponse.internalServerError("Failed to publish: invalid RLN proof")
elif result == MessageValidationResult.Spam:
@ -244,7 +244,7 @@ proc installRelayApiHandlers*(router: var RestRouter, node: WakuNode, cache: Mes
return RestApiResponse.internalServerError("Failed to publish: error appending RLN proof to message")
# validate the message before sending it
let result = node.wakuRlnRelay.validateMessage(message)
let result = node.wakuRlnRelay.validateMessageAndUpdateLog(message)
if result == MessageValidationResult.Invalid:
return RestApiResponse.internalServerError("Failed to publish: invalid RLN proof")
elif result == MessageValidationResult.Spam: