mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-20 15:38:55 +00:00
Fix tests
This commit is contained in:
parent
0754b94948
commit
48618fe866
@ -8,7 +8,13 @@ from eth2spec.test.helpers.execution_payload import (
|
||||
build_state_with_incomplete_transition,
|
||||
build_state_with_complete_transition,
|
||||
)
|
||||
from eth2spec.test.context import spec_state_test, expect_assertion_error, with_bellatrix_and_later
|
||||
from eth2spec.test.context import (
|
||||
BELLATRIX,
|
||||
expect_assertion_error,
|
||||
spec_state_test,
|
||||
with_bellatrix_and_later,
|
||||
with_phases,
|
||||
)
|
||||
from eth2spec.test.helpers.state import next_slot
|
||||
|
||||
|
||||
@ -117,7 +123,7 @@ def test_invalid_bad_execution_regular_payload(spec, state):
|
||||
yield from run_bad_execution_test(spec, state)
|
||||
|
||||
|
||||
@with_bellatrix_and_later
|
||||
@with_phases([BELLATRIX])
|
||||
@spec_state_test
|
||||
def test_bad_parent_hash_first_payload(spec, state):
|
||||
state = build_state_with_incomplete_transition(spec, state)
|
||||
|
@ -0,0 +1,24 @@
|
||||
from eth2spec.test.helpers.execution_payload import (
|
||||
build_empty_execution_payload,
|
||||
compute_el_block_hash,
|
||||
build_state_with_incomplete_transition,
|
||||
)
|
||||
from eth2spec.test.context import (
|
||||
spec_state_test,
|
||||
with_capella_and_later,
|
||||
)
|
||||
from eth2spec.test.helpers.state import next_slot
|
||||
from eth2spec.test.bellatrix.block_processing.test_process_execution_payload import run_execution_payload_processing
|
||||
|
||||
|
||||
@with_capella_and_later
|
||||
@spec_state_test
|
||||
def test_invalid_bad_parent_hash_first_payload(spec, state):
|
||||
state = build_state_with_incomplete_transition(spec, state)
|
||||
next_slot(spec, state)
|
||||
|
||||
execution_payload = build_empty_execution_payload(spec, state)
|
||||
execution_payload.parent_hash = b'\x55' * 32
|
||||
execution_payload.block_hash = compute_el_block_hash(spec, execution_payload)
|
||||
|
||||
yield from run_execution_payload_processing(spec, state, execution_payload, valid=False)
|
@ -30,8 +30,9 @@ if __name__ == "__main__":
|
||||
bellatrix_mods = combine_mods(_new_bellatrix_mods, altair_mods)
|
||||
|
||||
_new_capella_mods = {key: 'eth2spec.test.capella.block_processing.test_process_' + key for key in [
|
||||
'deposit',
|
||||
'bls_to_execution_change',
|
||||
'deposit',
|
||||
'execution_payload',
|
||||
'withdrawals',
|
||||
]}
|
||||
capella_mods = combine_mods(_new_capella_mods, bellatrix_mods)
|
||||
|
Loading…
x
Reference in New Issue
Block a user