Remove `force_registry_change_at_next_epoch`
This commit is contained in:
parent
4630b136da
commit
846e2d6147
|
@ -95,14 +95,6 @@ def create_genesis_state(num_validators, deposit_data_leaves=None):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def force_registry_change_at_next_epoch(state):
|
|
||||||
# artificially trigger registry update at next epoch transition
|
|
||||||
state.finalized_epoch = get_current_epoch(state) - 1
|
|
||||||
for crosslink in state.latest_crosslinks:
|
|
||||||
crosslink.epoch = state.finalized_epoch
|
|
||||||
state.validator_registry_update_epoch = state.finalized_epoch - 1
|
|
||||||
|
|
||||||
|
|
||||||
def build_empty_block_for_next_slot(state):
|
def build_empty_block_for_next_slot(state):
|
||||||
empty_block = get_empty_block()
|
empty_block = get_empty_block()
|
||||||
empty_block.slot = state.slot + 1
|
empty_block.slot = state.slot + 1
|
||||||
|
|
|
@ -39,7 +39,6 @@ from build.phase0.utils.merkle_minimal import (
|
||||||
from tests.phase0.helpers import (
|
from tests.phase0.helpers import (
|
||||||
build_deposit_data,
|
build_deposit_data,
|
||||||
build_empty_block_for_next_slot,
|
build_empty_block_for_next_slot,
|
||||||
force_registry_change_at_next_epoch,
|
|
||||||
get_valid_attestation,
|
get_valid_attestation,
|
||||||
get_valid_attester_slashing,
|
get_valid_attester_slashing,
|
||||||
get_valid_proposer_slashing,
|
get_valid_proposer_slashing,
|
||||||
|
@ -285,8 +284,6 @@ def test_voluntary_exit(state):
|
||||||
|
|
||||||
# move state forward PERSISTENT_COMMITTEE_PERIOD epochs to allow for exit
|
# move state forward PERSISTENT_COMMITTEE_PERIOD epochs to allow for exit
|
||||||
pre_state.slot += spec.PERSISTENT_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
|
pre_state.slot += spec.PERSISTENT_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
|
||||||
# artificially trigger registry update at next epoch transition
|
|
||||||
force_registry_change_at_next_epoch(pre_state)
|
|
||||||
|
|
||||||
post_state = deepcopy(pre_state)
|
post_state = deepcopy(pre_state)
|
||||||
|
|
||||||
|
@ -338,12 +335,6 @@ def test_no_exit_churn_too_long_since_change(state):
|
||||||
#
|
#
|
||||||
# move state forward PERSISTENT_COMMITTEE_PERIOD epochs to allow for exit
|
# move state forward PERSISTENT_COMMITTEE_PERIOD epochs to allow for exit
|
||||||
pre_state.slot += spec.PERSISTENT_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
|
pre_state.slot += spec.PERSISTENT_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
|
||||||
# artificially trigger registry update at next epoch transition
|
|
||||||
force_registry_change_at_next_epoch(pre_state)
|
|
||||||
# make epochs since registry update greater than LATEST_SLASHED_EXIT_LENGTH
|
|
||||||
pre_state.validator_registry_update_epoch = (
|
|
||||||
get_current_epoch(pre_state) - spec.LATEST_SLASHED_EXIT_LENGTH
|
|
||||||
)
|
|
||||||
|
|
||||||
post_state = deepcopy(pre_state)
|
post_state = deepcopy(pre_state)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue