From d10cc002d55fe506bd949a170194becc61fe9fba Mon Sep 17 00:00:00 2001 From: Potuz Date: Wed, 14 Aug 2024 08:46:57 -0300 Subject: [PATCH] Run Deneb on_block tests in Electra but not 7594 --- tests/core/pyspec/eth2spec/test/context.py | 7 +++++++ .../test/deneb/fork_choice/test_on_block.py | 17 ++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/tests/core/pyspec/eth2spec/test/context.py b/tests/core/pyspec/eth2spec/test/context.py index e805e1c12..8b2e8de6d 100644 --- a/tests/core/pyspec/eth2spec/test/context.py +++ b/tests/core/pyspec/eth2spec/test/context.py @@ -429,6 +429,13 @@ def with_all_phases_from(earliest_phase, all_phases=ALL_PHASES): return decorator +def with_all_phases_from_except(earliest_phase, except_phases=None): + """ + A decorator factory for running a tests with every phase except the ones listed + """ + return with_all_phases_from(earliest_phase, [phase for phase in ALL_PHASES if phase not in except_phases]) + + def with_all_phases_except(exclusion_phases): """ A decorator factory for running a tests with every phase except the ones listed diff --git a/tests/core/pyspec/eth2spec/test/deneb/fork_choice/test_on_block.py b/tests/core/pyspec/eth2spec/test/deneb/fork_choice/test_on_block.py index 2334fcdc8..a7e7f784e 100644 --- a/tests/core/pyspec/eth2spec/test/deneb/fork_choice/test_on_block.py +++ b/tests/core/pyspec/eth2spec/test/deneb/fork_choice/test_on_block.py @@ -2,10 +2,13 @@ from random import Random from eth2spec.test.context import ( spec_state_test, - with_phases, + with_all_phases_from_except, ) -from eth2spec.test.helpers.constants import DENEB +from eth2spec.test.helpers.constants import ( + DENEB, + EIP7594, +) from eth2spec.test.helpers.block import ( build_empty_block_for_next_slot, @@ -36,7 +39,7 @@ def get_block_with_blob(spec, state, rng=None): return block, blobs, blob_kzg_proofs -@with_phases([DENEB]) +@with_all_phases_from_except(DENEB, [EIP7594]) @spec_state_test def test_simple_blob_data(spec, state): rng = Random(1234) @@ -71,7 +74,7 @@ def test_simple_blob_data(spec, state): yield 'steps', test_steps -@with_phases([DENEB]) +@with_all_phases_from_except(DENEB, [EIP7594]) @spec_state_test def test_invalid_incorrect_proof(spec, state): rng = Random(1234) @@ -99,7 +102,7 @@ def test_invalid_incorrect_proof(spec, state): yield 'steps', test_steps -@with_phases([DENEB]) +@with_all_phases_from_except(DENEB, [EIP7594]) @spec_state_test def test_invalid_data_unavailable(spec, state): rng = Random(1234) @@ -127,7 +130,7 @@ def test_invalid_data_unavailable(spec, state): yield 'steps', test_steps -@with_phases([DENEB]) +@with_all_phases_from_except(DENEB, [EIP7594]) @spec_state_test def test_invalid_wrong_proofs_length(spec, state): rng = Random(1234) @@ -155,7 +158,7 @@ def test_invalid_wrong_proofs_length(spec, state): yield 'steps', test_steps -@with_phases([DENEB]) +@with_all_phases_from_except(DENEB, [EIP7594]) @spec_state_test def test_invalid_wrong_blobs_length(spec, state): rng = Random(1234)