mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-02-17 13:06:34 +00:00
wrong end epoch test
This commit is contained in:
parent
235c3d6841
commit
e49519a53b
@ -85,6 +85,29 @@ def test_success_since_max_epochs_per_crosslink(spec, state):
|
|||||||
yield from run_attestation_processing(spec, state, attestation)
|
yield from run_attestation_processing(spec, state, attestation)
|
||||||
|
|
||||||
|
|
||||||
|
@with_all_phases
|
||||||
|
@spec_state_test
|
||||||
|
def test_wrong_end_epoch_with_max_epochs_per_crosslink(spec, state):
|
||||||
|
for _ in range(spec.MAX_EPOCHS_PER_CROSSLINK + 2):
|
||||||
|
next_epoch(spec, state)
|
||||||
|
apply_empty_block(spec, state)
|
||||||
|
|
||||||
|
attestation = get_valid_attestation(spec, state)
|
||||||
|
data = attestation.data
|
||||||
|
# test logic sanity check: make sure the attestation only includes MAX_EPOCHS_PER_CROSSLINK epochs
|
||||||
|
assert data.crosslink.end_epoch - data.crosslink.start_epoch == spec.MAX_EPOCHS_PER_CROSSLINK
|
||||||
|
# Now change it to be different
|
||||||
|
data.crosslink.end_epoch += 1
|
||||||
|
|
||||||
|
sign_attestation(spec, state, attestation)
|
||||||
|
|
||||||
|
for _ in range(spec.MIN_ATTESTATION_INCLUSION_DELAY):
|
||||||
|
next_slot(spec, state)
|
||||||
|
apply_empty_block(spec, state)
|
||||||
|
|
||||||
|
yield from run_attestation_processing(spec, state, attestation, False)
|
||||||
|
|
||||||
|
|
||||||
@with_all_phases
|
@with_all_phases
|
||||||
@always_bls
|
@always_bls
|
||||||
@spec_state_test
|
@spec_state_test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user