Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def generate(self) -> StateTransitionFixture:

if cached_state is not None:
state = cached_state
elif block_spec.skip_slot_processing:
elif block_spec.skip_slot_processing and not block_spec.check_state_transition:
state = spec.process_block(state, block)
else:
state = spec.state_transition(state, block=block)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ class BlockSpec(CamelModel):
skip_slot_processing: bool = False
"""Skip automatic slot advancement before processing, to exercise slot-mismatch failures."""

check_state_transition: bool = False
"""Call `state_transition` after block is generated by `_build_block_from_spec`."""

def resolve_proposer_index(self, num_validators: int) -> ValidatorIndex:
"""Return the proposer index, falling back to the spec's round-robin schedule."""
if self.proposer_index is not None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ def test_process_slots_target_equal_to_state_slot_rejected(
state_transition_test(
pre=pre_state,
blocks=[
BlockSpec(slot=Slot(1)),
BlockSpec(
slot=Slot(1),
skip_slot_processing=True,
check_state_transition=True,
),
],
post=None,
expected_rejection=ExpectedRejection(
Expand Down
Loading