From 327953852d2034ebf6acf7eb7d39af84314b91b2 Mon Sep 17 00:00:00 2001 From: protolambda Date: Sat, 22 Jun 2019 01:47:53 +0200 Subject: [PATCH] test invalid shard in attestation --- .../block_processing/test_process_attestation.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test_libs/pyspec/eth2spec/test/phase_0/block_processing/test_process_attestation.py b/test_libs/pyspec/eth2spec/test/phase_0/block_processing/test_process_attestation.py index 2b34ab405..79af0b202 100644 --- a/test_libs/pyspec/eth2spec/test/phase_0/block_processing/test_process_attestation.py +++ b/test_libs/pyspec/eth2spec/test/phase_0/block_processing/test_process_attestation.py @@ -148,6 +148,20 @@ def test_wrong_shard(spec, state): yield from run_attestation_processing(spec, state, attestation, False) +@with_all_phases +@spec_state_test +def test_invalid_shard(spec, state): + attestation = get_valid_attestation(spec, state) + state.slot += spec.MIN_ATTESTATION_INCLUSION_DELAY + + # off by one (with respect to valid range) on purpose + attestation.data.crosslink.shard = spec.SHARD_COUNT + + sign_attestation(spec, state, attestation) + + yield from run_attestation_processing(spec, state, attestation, False) + + @with_all_phases @spec_state_test def test_new_source_epoch(spec, state):