2023-05-11 11:11:00 +00:00
|
|
|
# beacon_chain
|
2024-02-29 13:24:08 +00:00
|
|
|
# Copyright (c) 2023-2024 Status Research & Development GmbH
|
2023-05-11 11:11:00 +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.
|
|
|
|
|
2024-02-29 13:24:08 +00:00
|
|
|
{.push raises: [].}
|
|
|
|
|
2023-05-11 11:11:00 +00:00
|
|
|
import
|
|
|
|
unittest2,
|
|
|
|
../beacon_chain/networking/network_metadata,
|
|
|
|
../beacon_chain/spec/forks
|
|
|
|
|
|
|
|
{.used.}
|
|
|
|
|
|
|
|
template checkRoot(name, root) =
|
|
|
|
let
|
|
|
|
metadata = getMetadataForNetwork(name)
|
|
|
|
cfg = metadata.cfg
|
|
|
|
state = newClone(readSszForkedHashedBeaconState(
|
2023-09-08 05:53:27 +00:00
|
|
|
metadata.cfg, metadata.genesis.bakedBytes))
|
2023-05-11 11:11:00 +00:00
|
|
|
|
|
|
|
check:
|
|
|
|
$getStateRoot(state[]) == root
|
|
|
|
|
|
|
|
suite "Network metadata":
|
|
|
|
test "mainnet":
|
|
|
|
checkRoot(
|
|
|
|
"mainnet",
|
|
|
|
"7e76880eb67bbdc86250aa578958e9d0675e64e714337855204fb5abaaf82c2b")
|
|
|
|
|
|
|
|
test "sepolia":
|
|
|
|
checkRoot(
|
|
|
|
"sepolia",
|
2024-04-03 23:25:36 +00:00
|
|
|
"fb9afe32150fa39f4b346be2519a67e2a4f5efcd50a1dc192c3f6b3d013d2798")
|