Re-add toString function for proper hex logs of content keys (#2508)
This commit is contained in:
parent
6d03acec30
commit
157fb4f1ef
|
@ -7,9 +7,9 @@
|
||||||
|
|
||||||
{.push raises: [].}
|
{.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
|
type
|
||||||
Bytes2* = ByteVector[2]
|
Bytes2* = ByteVector[2]
|
||||||
|
@ -19,6 +19,9 @@ type
|
||||||
ContentKeyByteList* = ByteList[2048] # The encoded content key
|
ContentKeyByteList* = ByteList[2048] # The encoded content key
|
||||||
BlockHash* = MDigest[32 * 8] # Bytes32
|
BlockHash* = MDigest[32 * 8] # Bytes32
|
||||||
|
|
||||||
|
func `$`*(x: ByteList[2048]): string =
|
||||||
|
x.asSeq.to0xHex()
|
||||||
|
|
||||||
func decodeRlp*(input: openArray[byte], T: type): Result[T, string] =
|
func decodeRlp*(input: openArray[byte], T: type): Result[T, string] =
|
||||||
try:
|
try:
|
||||||
ok(rlp.decode(input, T))
|
ok(rlp.decode(input, T))
|
||||||
|
|
Loading…
Reference in New Issue