re-enable test_empty_epoch_transition_not_finalizing for minimal config
This commit is contained in:
parent
f7b3c87715
commit
235c3d6841
|
@ -123,26 +123,29 @@ def test_empty_epoch_transition(spec, state):
|
||||||
assert spec.get_block_root_at_slot(state, slot) == block.parent_root
|
assert spec.get_block_root_at_slot(state, slot) == block.parent_root
|
||||||
|
|
||||||
|
|
||||||
# @with_all_phases
|
@with_all_phases
|
||||||
# @spec_state_test
|
@spec_state_test
|
||||||
# def test_empty_epoch_transition_not_finalizing(spec, state):
|
def test_empty_epoch_transition_not_finalizing(spec, state):
|
||||||
# # copy for later balance lookups.
|
# Don't run for non-minimal configs, it takes very long, and the effect
|
||||||
# pre_state = deepcopy(state)
|
# of calling finalization/justifcation is just the same as with the minimal configuration.
|
||||||
# yield 'pre', state
|
if spec.SLOTS_PER_EPOCH > 8:
|
||||||
|
return
|
||||||
|
|
||||||
# block = build_empty_block_for_next_slot(spec, state)
|
# copy for later balance lookups.
|
||||||
# block.slot += spec.SLOTS_PER_EPOCH * 5
|
pre_balances = list(state.balances)
|
||||||
# sign_block(spec, state, block, proposer_index=0)
|
yield 'pre', state
|
||||||
|
|
||||||
# state_transition_and_sign_block(spec, state, block)
|
spec.process_slots(state, state.slot + (spec.SLOTS_PER_EPOCH * 5))
|
||||||
|
block = build_empty_block_for_next_slot(spec, state, signed=True)
|
||||||
|
state_transition_and_sign_block(spec, state, block)
|
||||||
|
|
||||||
# yield 'blocks', [block]
|
yield 'blocks', [block]
|
||||||
# yield 'post', state
|
yield 'post', state
|
||||||
|
|
||||||
# assert state.slot == block.slot
|
assert state.slot == block.slot
|
||||||
# assert state.finalized_epoch < spec.get_current_epoch(state) - 4
|
assert state.finalized_epoch < spec.get_current_epoch(state) - 4
|
||||||
# for index in range(len(state.validators)):
|
for index in range(len(state.validators)):
|
||||||
# assert get_balance(state, index) < get_balance(pre_state, index)
|
assert state.balances[index] < pre_balances[index]
|
||||||
|
|
||||||
|
|
||||||
@with_all_phases
|
@with_all_phases
|
||||||
|
|
Loading…
Reference in New Issue