fix: libwaku store request parsing (#3294)

This commit is contained in:
gabrielmer 2025-02-12 18:35:50 +02:00 committed by GitHub
parent f0e8cf521a
commit b792bee695
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -23,9 +23,11 @@ type StoreRequest* = object
func fromJsonNode(
T: type StoreRequest, jsonContent: JsonNode
): Result[StoreQueryRequest, string] =
let contentTopics = collect(newSeq):
for cTopic in jsonContent["content_topics"].getElems():
cTopic.getStr()
var contentTopics: seq[string]
if jsonContent.contains("content_topics"):
contentTopics = collect(newSeq):
for cTopic in jsonContent["content_topics"].getElems():
cTopic.getStr()
var msgHashes: seq[WakuMessageHash]
if jsonContent.contains("message_hashes"):