From 157fb4f1ef09aeb382957ff9ada27bdc200ea9dd Mon Sep 17 00:00:00 2001 From: Kim De Mey Date: Fri, 19 Jul 2024 14:48:03 +0200 Subject: [PATCH] Re-add toString function for proper hex logs of content keys (#2508) --- fluffy/common/common_types.nim | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fluffy/common/common_types.nim b/fluffy/common/common_types.nim index 4d8cfee9a7..e45d5057b4 100644 --- a/fluffy/common/common_types.nim +++ b/fluffy/common/common_types.nim @@ -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] @@ -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))