mirror of https://github.com/waku-org/nwaku.git
fix(rln): error in api when rate limit (#2212)
This commit is contained in:
parent
c973b85069
commit
51f36099d5
|
@ -107,7 +107,7 @@ proc installRelayApiHandlers*(node: WakuNode, server: RpcServer, cache: MessageC
|
||||||
if not success:
|
if not success:
|
||||||
raise newException(ValueError, "Failed to publish: error appending RLN proof to message")
|
raise newException(ValueError, "Failed to publish: error appending RLN proof to message")
|
||||||
# validate the message before sending it
|
# validate the message before sending it
|
||||||
let result = node.wakuRlnRelay.validateMessage(message)
|
let result = node.wakuRlnRelay.validateMessageAndUpdateLog(message)
|
||||||
if result == MessageValidationResult.Invalid:
|
if result == MessageValidationResult.Invalid:
|
||||||
raise newException(ValueError, "Failed to publish: invalid RLN proof")
|
raise newException(ValueError, "Failed to publish: invalid RLN proof")
|
||||||
elif result == MessageValidationResult.Spam:
|
elif result == MessageValidationResult.Spam:
|
||||||
|
@ -206,7 +206,7 @@ proc installRelayApiHandlers*(node: WakuNode, server: RpcServer, cache: MessageC
|
||||||
if not success:
|
if not success:
|
||||||
raise newException(ValueError, "Failed to publish: error appending RLN proof to message")
|
raise newException(ValueError, "Failed to publish: error appending RLN proof to message")
|
||||||
# validate the message before sending it
|
# validate the message before sending it
|
||||||
let result = node.wakuRlnRelay.validateMessage(message)
|
let result = node.wakuRlnRelay.validateMessageAndUpdateLog(message)
|
||||||
if result == MessageValidationResult.Invalid:
|
if result == MessageValidationResult.Invalid:
|
||||||
raise newException(ValueError, "Failed to publish: invalid RLN proof")
|
raise newException(ValueError, "Failed to publish: invalid RLN proof")
|
||||||
elif result == MessageValidationResult.Spam:
|
elif result == MessageValidationResult.Spam:
|
||||||
|
|
|
@ -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")
|
return RestApiResponse.internalServerError("Failed to publish: error appending RLN proof to message")
|
||||||
|
|
||||||
# validate the message before sending it
|
# validate the message before sending it
|
||||||
let result = node.wakuRlnRelay.validateMessage(message)
|
let result = node.wakuRlnRelay.validateMessageAndUpdateLog(message)
|
||||||
if result == MessageValidationResult.Invalid:
|
if result == MessageValidationResult.Invalid:
|
||||||
return RestApiResponse.internalServerError("Failed to publish: invalid RLN proof")
|
return RestApiResponse.internalServerError("Failed to publish: invalid RLN proof")
|
||||||
elif result == MessageValidationResult.Spam:
|
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")
|
return RestApiResponse.internalServerError("Failed to publish: error appending RLN proof to message")
|
||||||
|
|
||||||
# validate the message before sending it
|
# validate the message before sending it
|
||||||
let result = node.wakuRlnRelay.validateMessage(message)
|
let result = node.wakuRlnRelay.validateMessageAndUpdateLog(message)
|
||||||
if result == MessageValidationResult.Invalid:
|
if result == MessageValidationResult.Invalid:
|
||||||
return RestApiResponse.internalServerError("Failed to publish: invalid RLN proof")
|
return RestApiResponse.internalServerError("Failed to publish: invalid RLN proof")
|
||||||
elif result == MessageValidationResult.Spam:
|
elif result == MessageValidationResult.Spam:
|
||||||
|
|
Loading…
Reference in New Issue