2021-09-24 15:18:54 +00:00
|
|
|
# Nimbus
|
2022-04-13 09:17:07 +00:00
|
|
|
# Copyright (c) 2021-2022 Status Research & Development GmbH
|
2021-09-24 15:18:54 +00:00
|
|
|
# Licensed and distributed under either of
|
|
|
|
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
|
|
|
|
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
|
|
|
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
|
|
|
|
|
|
|
{.push raises: [Defect].}
|
|
|
|
|
|
|
|
import
|
2022-04-13 09:17:07 +00:00
|
|
|
ssz_serialization/types,
|
2022-05-18 20:49:35 +00:00
|
|
|
stew/byteutils, nimcrypto/hash
|
2021-09-24 15:18:54 +00:00
|
|
|
|
2022-06-16 06:50:29 +00:00
|
|
|
export hash
|
|
|
|
|
2021-09-24 15:18:54 +00:00
|
|
|
type
|
|
|
|
ByteList* = List[byte, 2048]
|
|
|
|
Bytes2* = array[2, byte]
|
2021-11-17 16:11:17 +00:00
|
|
|
Bytes32* = array[32, byte]
|
2022-01-06 08:06:05 +00:00
|
|
|
|
2022-05-18 20:49:35 +00:00
|
|
|
ContentId* = UInt256
|
|
|
|
BlockHash* = MDigest[32 * 8] # Bytes32
|
2022-04-13 09:17:07 +00:00
|
|
|
|
|
|
|
func `$`*(x: ByteList): string =
|
|
|
|
x.asSeq.toHex()
|