mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-02-03 06:13:31 +00:00
fix small bug in sytax
This commit is contained in:
parent
cf06cb59c3
commit
23ef802da5
@ -2089,7 +2089,7 @@ def update_validator_registry(state: BeaconState) -> None:
|
||||
activate_validator(state, index, is_genesis=False)
|
||||
|
||||
# Exit validators within the allowable balance churn
|
||||
if state.current_epoch < state.validator_registry_update_epoch + LATEST_SLASHED_EXIT_LENGTH:
|
||||
if current_epoch < state.validator_registry_update_epoch + LATEST_SLASHED_EXIT_LENGTH:
|
||||
balance_churn = (
|
||||
state.latest_slashed_balances[state.validator_registry_update_epoch % LATEST_SLASHED_EXIT_LENGTH] -
|
||||
state.latest_slashed_balances[current_epoch % LATEST_SLASHED_EXIT_LENGTH]
|
||||
|
@ -316,12 +316,18 @@ def test_attestation(state, pubkeys, privkeys):
|
||||
|
||||
def test_voluntary_exit(state, pubkeys, privkeys):
|
||||
pre_state = deepcopy(state)
|
||||
validator_index = get_active_validator_indices(pre_state.validator_registry, get_current_epoch(pre_state))[-1]
|
||||
validator_index = get_active_validator_indices(
|
||||
pre_state.validator_registry,
|
||||
get_current_epoch(pre_state)
|
||||
)[-1]
|
||||
|
||||
# move state forward PERSISTENT_COMMITTEE_PERIOD epochs to allow for exit
|
||||
pre_state.slot += spec.PERSISTENT_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
|
||||
# artificially trigger registry update at next epoch transition
|
||||
pre_state.validator_registry_update_epoch -= 1
|
||||
pre_state.finalized_epoch = get_current_epoch(pre_state) - 1
|
||||
for crosslink in pre_state.latest_crosslinks:
|
||||
crosslink.epoch = pre_state.finalized_epoch
|
||||
pre_state.validator_registry_update_epoch = pre_state.finalized_epoch - 1
|
||||
|
||||
post_state = deepcopy(pre_state)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user