Remove `force_registry_change_at_next_epoch`

This commit is contained in:
Hsiao-Wei Wang 2019-04-07 11:06:14 +10:00
parent 4630b136da
commit 846e2d6147
No known key found for this signature in database
GPG Key ID: 95B070122902DEA4
2 changed files with 0 additions and 17 deletions

View File

@ -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):
empty_block = get_empty_block()
empty_block.slot = state.slot + 1

View File

@ -39,7 +39,6 @@ from build.phase0.utils.merkle_minimal import (
from tests.phase0.helpers import (
build_deposit_data,
build_empty_block_for_next_slot,
force_registry_change_at_next_epoch,
get_valid_attestation,
get_valid_attester_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
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)
@ -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
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)