detach crosslink tests from extra block

This commit is contained in:
protolambda 2019-06-26 00:22:24 +02:00
parent c66031f55c
commit 46dc3f39bb
No known key found for this signature in database
GPG Key ID: EC89FDBB2B4C7623
1 changed files with 3 additions and 13 deletions

View File

@ -3,9 +3,9 @@ from copy import deepcopy
from eth2spec.test.context import spec_state_test, with_all_phases from eth2spec.test.context import spec_state_test, with_all_phases
from eth2spec.test.helpers.state import ( from eth2spec.test.helpers.state import (
next_epoch, next_epoch,
next_slot, next_slot
state_transition_and_sign_block) )
from eth2spec.test.helpers.block import apply_empty_block, build_empty_block_for_next_slot, sign_block from eth2spec.test.helpers.block import apply_empty_block
from eth2spec.test.helpers.attestations import ( from eth2spec.test.helpers.attestations import (
add_attestation_to_state, add_attestation_to_state,
fill_aggregate_attestation, fill_aggregate_attestation,
@ -28,14 +28,6 @@ def test_no_attestations(spec, state):
assert state.previous_crosslinks[shard] == state.current_crosslinks[shard] assert state.previous_crosslinks[shard] == state.current_crosslinks[shard]
def add_block_to_end_of_epoch(spec, state):
slot = state.slot + (spec.SLOTS_PER_EPOCH - state.slot % spec.SLOTS_PER_EPOCH) - 1
block = build_empty_block_for_next_slot(spec, state)
block.slot = slot
sign_block(spec, state, block)
state_transition_and_sign_block(spec, state, block)
@with_all_phases @with_all_phases
@spec_state_test @spec_state_test
def test_single_crosslink_update_from_current_epoch(spec, state): def test_single_crosslink_update_from_current_epoch(spec, state):
@ -51,7 +43,6 @@ def test_single_crosslink_update_from_current_epoch(spec, state):
shard = attestation.data.crosslink.shard shard = attestation.data.crosslink.shard
pre_crosslink = deepcopy(state.current_crosslinks[shard]) pre_crosslink = deepcopy(state.current_crosslinks[shard])
add_block_to_end_of_epoch(spec, state)
yield from run_process_crosslinks(spec, state) yield from run_process_crosslinks(spec, state)
assert state.previous_crosslinks[shard] != state.current_crosslinks[shard] assert state.previous_crosslinks[shard] != state.current_crosslinks[shard]
@ -75,7 +66,6 @@ def test_single_crosslink_update_from_previous_epoch(spec, state):
crosslink_deltas = spec.get_crosslink_deltas(state) crosslink_deltas = spec.get_crosslink_deltas(state)
add_block_to_end_of_epoch(spec, state)
yield from run_process_crosslinks(spec, state) yield from run_process_crosslinks(spec, state)
assert state.previous_crosslinks[shard] != state.current_crosslinks[shard] assert state.previous_crosslinks[shard] != state.current_crosslinks[shard]