2018-12-04 13:26:25 +00:00
|
|
|
# beacon_chain
|
2021-08-18 18:57:58 +00:00
|
|
|
# Copyright (c) 2018-2021 Status Research & Development GmbH
|
2018-12-04 13:26:25 +00:00
|
|
|
# Licensed and distributed under either of
|
2019-11-25 15:30:02 +00:00
|
|
|
# * 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).
|
2018-12-04 13:26:25 +00:00
|
|
|
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
|
|
|
|
2021-08-18 18:57:58 +00:00
|
|
|
{.push raises: [Defect].}
|
|
|
|
|
|
|
|
# Import this module to get access to `hash_tree_root` for spec types
|
2019-11-14 10:47:55 +00:00
|
|
|
|
2021-04-28 16:41:02 +00:00
|
|
|
import
|
2021-10-21 20:27:06 +00:00
|
|
|
ssz_serialization/merkleization,
|
2021-08-18 18:57:58 +00:00
|
|
|
./ssz_codec,
|
2021-09-28 18:08:03 +00:00
|
|
|
./datatypes/[phase0, altair]
|
2019-11-18 12:48:41 +00:00
|
|
|
|
2021-08-18 18:57:58 +00:00
|
|
|
export ssz_codec, merkleization
|
2021-09-28 18:08:03 +00:00
|
|
|
|
|
|
|
func hash_tree_root*(x: phase0.HashedBeaconState | altair.HashedBeaconState) {.
|
|
|
|
error: "HashedBeaconState should not be hashed".}
|
|
|
|
|
|
|
|
func hash_tree_root*(x: phase0.SomeSignedBeaconBlock | altair.SomeSignedBeaconBlock) {.
|
|
|
|
error: "SignedBeaconBlock should not be hashed".}
|