Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-add toString function for proper hex logs of content keys #2508

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading