chore: Bump nimbus and nim to latest available - nim-2.0.12 (#3188)

* Bump nimbus and nim to latest available - nim-2.0.12
* Fix name collision of templates of result.nim and nwaku serdes.nim - unrecognizedFieldWarning
This commit is contained in:
NagyZoltanPeter
2024-12-10 14:42:54 +01:00
committed by GitHub
parent 650a9487e1
commit e2b7149f82
9 changed files with 20 additions and 19 deletions
+1 -1
View File
@@ -87,7 +87,7 @@ proc readValue*(
)
size = some(reader.readValue(uint64))
else:
unrecognizedFieldWarning()
unrecognizedFieldWarning(value)
if sender.isNone():
reader.raiseUnexpectedValue("Field `sender` is missing")
+4 -4
View File
@@ -83,7 +83,7 @@ proc readValue*(
)
connected = some(reader.readValue(bool))
else:
unrecognizedFieldWarning()
unrecognizedFieldWarning(value)
if connected.isNone():
reader.raiseUnexpectedValue("Field `connected` is missing")
@@ -116,7 +116,7 @@ proc readValue*(
reader.raiseUnexpectedField("Multiple `origin` fields found", "WakuPeer")
origin = some(reader.readValue(PeerOrigin))
else:
unrecognizedFieldWarning()
unrecognizedFieldWarning(value)
if multiaddr.isNone():
reader.raiseUnexpectedValue("Field `multiaddr` is missing")
@@ -153,7 +153,7 @@ proc readValue*(
)
contentTopic = some(reader.readValue(string))
else:
unrecognizedFieldWarning()
unrecognizedFieldWarning(value)
if pubsubTopic.isNone():
reader.raiseUnexpectedValue("Field `pubsubTopic` is missing")
@@ -185,7 +185,7 @@ proc readValue*(
)
filterCriteria = some(reader.readValue(seq[FilterTopic]))
else:
unrecognizedFieldWarning()
unrecognizedFieldWarning(value)
if peerId.isNone():
reader.raiseUnexpectedValue("Field `peerId` is missing")
+2 -1
View File
@@ -2,6 +2,7 @@
import chronicles, json_serialization, json_serialization/std/options
import ../../../waku_node, ../serdes
import std/typetraits
#### Types
@@ -47,7 +48,7 @@ proc readValue*(
reader.raiseUnexpectedField("Multiple `enrUri` fields found", "DebugWakuInfo")
enrUri = some(reader.readValue(string))
else:
unrecognizedFieldWarning()
unrecognizedFieldWarning(value)
if listenAddresses.isNone():
reader.raiseUnexpectedValue("Field `listenAddresses` is missing")
+7 -7
View File
@@ -187,7 +187,7 @@ proc readValue*(
of "ephemeral":
ephemeral = some(reader.readValue(bool))
else:
unrecognizedFieldWarning()
unrecognizedFieldWarning(value)
if payload.isNone():
reader.raiseUnexpectedValue("Field `payload` is missing")
@@ -225,7 +225,7 @@ proc readValue*(
of "contentFilters":
contentFilters = some(reader.readValue(seq[ContentTopic]))
else:
unrecognizedFieldWarning()
unrecognizedFieldWarning(value)
if contentFilters.isNone():
reader.raiseUnexpectedValue("Field `contentFilters` is missing")
@@ -262,7 +262,7 @@ proc readValue*(
of "requestId":
requestId = some(reader.readValue(string))
else:
unrecognizedFieldWarning()
unrecognizedFieldWarning(value)
if requestId.isNone():
reader.raiseUnexpectedValue("Field `requestId` is missing")
@@ -296,7 +296,7 @@ proc readValue*(
of "contentFilters":
contentFilters = some(reader.readValue(seq[ContentTopic]))
else:
unrecognizedFieldWarning()
unrecognizedFieldWarning(value)
if requestId.isNone():
reader.raiseUnexpectedValue("Field `requestId` is missing")
@@ -344,7 +344,7 @@ proc readValue*(
of "contentFilters":
contentFilters = some(reader.readValue(seq[ContentTopic]))
else:
unrecognizedFieldWarning()
unrecognizedFieldWarning(value)
if requestId.isNone():
reader.raiseUnexpectedValue("Field `requestId` is missing")
@@ -385,7 +385,7 @@ proc readValue*(
of "requestId":
requestId = some(reader.readValue(string))
else:
unrecognizedFieldWarning()
unrecognizedFieldWarning(value)
if requestId.isNone():
reader.raiseUnexpectedValue("Field `requestId` is missing")
@@ -416,7 +416,7 @@ proc readValue*(
of "statusDesc":
statusDesc = some(reader.readValue(string))
else:
unrecognizedFieldWarning()
unrecognizedFieldWarning(value)
if requestId.isNone():
reader.raiseUnexpectedValue("Field `requestId` is missing")
+1 -1
View File
@@ -65,7 +65,7 @@ proc readValue*(
protocolsHealth = some(reader.readValue(seq[ProtocolHealth]))
else:
unrecognizedFieldWarning()
unrecognizedFieldWarning(value)
if nodeHealth.isNone():
reader.raiseUnexpectedValue("Field `nodeHealth` is missing")
+1 -1
View File
@@ -52,7 +52,7 @@ proc readValue*(
of "message":
message = some(reader.readValue(RelayWakuMessage))
else:
unrecognizedFieldWarning()
unrecognizedFieldWarning(value)
if message.isNone():
reader.raiseUnexpectedValue("Field `message` is missing")
+1 -1
View File
@@ -117,7 +117,7 @@ proc readValue*(
of "ephemeral":
ephemeral = some(reader.readValue(bool))
else:
unrecognizedFieldWarning()
unrecognizedFieldWarning(value)
if payload.isNone() or isEmptyOrWhitespace(string(payload.get())):
reader.raiseUnexpectedValue("Field `payload` is missing or empty")
+2 -2
View File
@@ -20,12 +20,12 @@ createJsonFlavor RestJson
Json.setWriter JsonWriter, PreferredOutput = string
template unrecognizedFieldWarning*() =
template unrecognizedFieldWarning*(field: typed) =
# TODO: There should be a different notification mechanism for informing the
# caller of a deserialization routine for unexpected fields.
# The chonicles import in this module should be removed.
debug "JSON field not recognized by the current version of nwaku. Consider upgrading",
fieldName, typeName = typetraits.name(typeof value)
fieldName, typeName = typetraits.name(typeof field)
type SerdesResult*[T] = Result[T, cstring]