Skip to content

Commit

Permalink
Merge branch 'master' into dev/pedro/rn_bin
Browse files Browse the repository at this point in the history
  • Loading branch information
pedromiguelmiranda authored Oct 11, 2024
2 parents a8ec051 + 6e114dc commit 5f6544b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fluffy/rpc/rpc_types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@ proc readValue*(
r.raiseUnexpectedValue("Invalid ENR")

proc writeValue*(w: var JsonWriter[JrpcConv], v: NodeId) {.gcsafe, raises: [IOError].} =
w.writeValue("0x" & v.toHex())
w.writeValue(v.toBytesBE().to0xHex())

proc writeValue*(
w: var JsonWriter[JrpcConv], v: Opt[NodeId]
) {.gcsafe, raises: [IOError].} =
if v.isSome():
w.writeValue("0x" & v.get().toHex())
w.writeValue(v.get())
else:
w.writeValue("0x")

Expand Down Expand Up @@ -139,7 +139,8 @@ proc writeValue*(
) {.gcsafe, raises: [IOError].} =
w.beginRecord()
w.writeField("enrSeq", v.enrSeq)
w.writeField("dataRadius", "0x" & v.dataRadius.toHex)
# Portal json-rpc specifications allows for dropping leading zeroes.
w.writeField("dataRadius", "0x" & v.dataRadius.toHex())
w.endRecord()

proc readValue*(
Expand Down

0 comments on commit 5f6544b

Please sign in to comment.