Skip to content

Commit

Permalink
Run Deneb on_block tests in Electra but not 7594
Browse files Browse the repository at this point in the history
  • Loading branch information
potuz committed Aug 14, 2024
1 parent 13ac373 commit 29f38ae
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
6 changes: 6 additions & 0 deletions tests/core/pyspec/eth2spec/test/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,12 @@ def decorator(fn):
return with_phases([phase for phase in all_phases if is_post_fork(phase, earliest_phase)])(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):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from eth2spec.test.context import (
spec_state_test,
with_phases,
with_all_phases_from_except,
)

from eth2spec.test.helpers.constants import DENEB
Expand Down Expand Up @@ -36,7 +36,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 +71,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 +99,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 +127,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 +155,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 29f38ae

Please sign in to comment.