2018-11-29 05:23:40 +00:00
|
|
|
# beacon_chain
|
2021-04-26 19:41:35 +00:00
|
|
|
# Copyright (c) 2018-2021 Status Research & Development GmbH
|
2018-11-29 05:23:40 +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-11-29 05:23:40 +00:00
|
|
|
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
|
|
|
|
2019-11-14 10:47:55 +00:00
|
|
|
{.used.}
|
|
|
|
|
2018-11-29 05:23:40 +00:00
|
|
|
import
|
2021-04-28 16:41:02 +00:00
|
|
|
unittest2,
|
|
|
|
../beacon_chain/spec/[beaconstate, datatypes, digest, presets],
|
|
|
|
./testutil, ./testblockutil
|
2018-11-29 05:23:40 +00:00
|
|
|
|
2021-04-28 16:41:02 +00:00
|
|
|
suite "Beacon state" & preset():
|
2021-05-04 10:19:11 +00:00
|
|
|
test "Smoke test initialize_beacon_state_from_eth1" & preset():
|
|
|
|
let state = initialize_beacon_state_from_eth1(
|
2020-07-07 23:02:14 +00:00
|
|
|
defaultRuntimePreset, Eth2Digest(), 0, makeInitialDeposits(SLOTS_PER_EPOCH, {}), {})
|
2020-07-26 18:55:48 +00:00
|
|
|
check: state.validators.lenu64 == SLOTS_PER_EPOCH
|