rest: fix GraffitiBytes serialization (#3299)
This commit is contained in:
parent
570379d3d9
commit
1df549143e
|
@ -629,6 +629,17 @@ proc writeValue*(writer: var JsonWriter[RestJson], value: Eth1Address) {.
|
|||
raises: [IOError, Defect].} =
|
||||
writeValue(writer, hexOriginal(distinctBase(value)))
|
||||
|
||||
proc writeValue*(writer: var JsonWriter[RestJson], value: GraffitiBytes)
|
||||
{.raises: [IOError, Defect].} =
|
||||
writeValue(writer, hexOriginal(distinctBase(value)))
|
||||
|
||||
proc readValue*(reader: var JsonReader[RestJson], T: type GraffitiBytes): T
|
||||
{.raises: [IOError, SerializationError, Defect].} =
|
||||
try:
|
||||
init(GraffitiBytes, reader.readValue(string))
|
||||
except ValueError as err:
|
||||
reader.raiseUnexpectedValue err.msg
|
||||
|
||||
## Version
|
||||
proc readValue*(
|
||||
reader: var JsonReader[RestJson],
|
||||
|
|
Loading…
Reference in New Issue