Skip to content

Commit

Permalink
Re-add toString function for proper hex logs of content keys (#2508)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeme committed Jul 19, 2024
1 parent 6d03ace commit 157fb4f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fluffy/common/common_types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

{.push raises: [].}

import results, ssz_serialization, eth/rlp, nimcrypto/hash
import results, ssz_serialization, stew/byteutils, eth/rlp, nimcrypto/hash

export hash
export hash, ssz_serialization

type
Bytes2* = ByteVector[2]
Expand All @@ -19,6 +19,9 @@ type
ContentKeyByteList* = ByteList[2048] # The encoded content key
BlockHash* = MDigest[32 * 8] # Bytes32

func `$`*(x: ByteList[2048]): string =
x.asSeq.to0xHex()

func decodeRlp*(input: openArray[byte], T: type): Result[T, string] =
try:
ok(rlp.decode(input, T))
Expand Down

0 comments on commit 157fb4f

Please sign in to comment.