mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-10 06:16:25 +00:00
2d52d5cbfe
* convert some asserts to doAsserts to keep them in release mode builds; rename get_initial_beacon_state to get_genesis_beacon_state to track spec; switch target spec version to 0.3.0; switch references to penalize_validator to slash_validator/slashValidator to track spec; make some function returns safer by omitting 'return' * 2x shuffling speedup by hoisting pivot calculations per https://github.com/protolambda/eth2-shuffle
19 lines
792 B
Nim
19 lines
792 B
Nim
# beacon_chain
|
|
# Copyright (c) 2018 Status Research & Development GmbH
|
|
# Licensed and distributed under either of
|
|
# * MIT license (license terms in the root directory or at http://opensource.org/licenses/MIT).
|
|
# * Apache v2 license (license terms in the root directory or at http://www.apache.org/licenses/LICENSE-2.0).
|
|
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
|
|
|
import
|
|
sequtils, unittest,
|
|
./testutil,
|
|
../beacon_chain/extras,
|
|
../beacon_chain/spec/[beaconstate, datatypes, digest]
|
|
|
|
suite "Beacon state":
|
|
test "Smoke test get_genesis_beacon_state":
|
|
let state = get_genesis_beacon_state(
|
|
makeInitialDeposits(SLOTS_PER_EPOCH, {}), 0, Eth1Data(), {})
|
|
check: state.validator_registry.len == SLOTS_PER_EPOCH
|