mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-12 19:54:34 +00:00
add no salshed proposer test
This commit is contained in:
parent
2afbd8a02d
commit
ad636a8252
26
tests/phase0/test_process_block_header.py
Normal file
26
tests/phase0/test_process_block_header.py
Normal file
@ -0,0 +1,26 @@
|
||||
from copy import deepcopy
|
||||
import pytest
|
||||
|
||||
|
||||
from build.phase0.spec import (
|
||||
get_beacon_proposer_index,
|
||||
process_block_header,
|
||||
)
|
||||
from tests.phase0.helpers import (
|
||||
build_empty_block_for_next_slot,
|
||||
)
|
||||
|
||||
# mark entire file as 'sanity' and 'header'
|
||||
pytestmark = [pytest.mark.sanity, pytest.mark.header]
|
||||
|
||||
|
||||
def test_proposer_slashed(state):
|
||||
pre_state = deepcopy(state)
|
||||
|
||||
block = build_empty_block_for_next_slot(pre_state)
|
||||
proposer_index = get_beacon_proposer_index(pre_state, block.slot)
|
||||
pre_state.validator_registry[proposer_index].slashed = True
|
||||
with pytest.raises(AssertionError):
|
||||
process_block_header(pre_state, block)
|
||||
|
||||
return state, [block], None
|
Loading…
x
Reference in New Issue
Block a user