fix(wallet) serializing type for collectibles settings to backend

It seems `%*` operator we use in the `rpc` generics doesn't use the
`serializedFieldName` marker and `type` was serialized as `itemType`
and value the enum name instead of `type` and integer value

Updates: #13971
This commit is contained in:
Stefan 2024-03-27 11:31:32 +02:00 committed by Stefan Dunca
parent 26542970ee
commit b1f8c8efa2
3 changed files with 20 additions and 13 deletions

View File

@ -451,3 +451,10 @@ proc fromJson*(t: JsonNode, T: typedesc[CollectiblePreferences]): CollectiblePre
discard t.getProp("key", result.key)
discard t.getProp("position", result.position)
discard t.getProp("visible", result.visible)
proc `%`*(cp: CollectiblePreferences): JsonNode {.inline.} =
result = newJObject()
result["type"] = %int(cp.itemType)
result["key"] = %cp.key
result["position"] = %cp.position
result["visible"] = %cp.visible