Skip to content

Commit

Permalink
Merge pull request #3883 from potuz/run_deneb_tests_in_electra
Browse files Browse the repository at this point in the history
Run Deneb on_block tests in Electra but not 7594
  • Loading branch information
hwwhww authored Aug 20, 2024
2 parents 13ac373 + d10cc00 commit 5c44de2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
7 changes: 7 additions & 0 deletions tests/core/pyspec/eth2spec/test/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,13 @@ def decorator(fn):
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
Expand Down
17 changes: 10 additions & 7 deletions tests/core/pyspec/eth2spec/test/deneb/fork_choice/test_on_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

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,
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5c44de2

Please sign in to comment.