Skip to content

Commit

Permalink
Merge pull request #3237 from ethereum/sanity-test-hotfix
Browse files Browse the repository at this point in the history
Fix the unsigned block outputs
  • Loading branch information
hwwhww authored Jan 27, 2023
2 parents 127edf3 + 366e3b6 commit 80ba162
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 4 additions & 3 deletions tests/core/pyspec/eth2spec/test/capella/sanity/test_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
next_epoch_via_block,
state_transition_and_sign_block,
transition_to,
transition_to_slot_via_block,
next_slot,
)
from eth2spec.test.helpers.block import (
Expand Down Expand Up @@ -341,7 +340,8 @@ def test_top_up_to_fully_withdrawn_validator(spec, state):
)

# Apply an empty block
signed_block_2 = transition_to_slot_via_block(spec, state, state.slot + 1)
block = build_empty_block_for_next_slot(spec, state)
signed_block_2 = state_transition_and_sign_block(spec, state, block)

# With mainnet preset, it holds
if len(state.validators) <= spec.MAX_VALIDATORS_PER_WITHDRAWALS_SWEEP:
Expand Down Expand Up @@ -387,7 +387,8 @@ def _run_activate_and_partial_withdrawal(spec, state, initial_balance):

blocks = []
# To activate
signed_block = transition_to_slot_via_block(spec, state, state.slot + 1)
block = build_empty_block_for_next_slot(spec, state)
signed_block = state_transition_and_sign_block(spec, state, block)
blocks.append(signed_block)

assert spec.is_active_validator(state.validators[validator_index], spec.get_current_epoch(state))
Expand Down
3 changes: 1 addition & 2 deletions tests/core/pyspec/eth2spec/test/helpers/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ def transition_to_slot_via_block(spec, state, slot):
Transition to ``slot`` via an empty block transition
"""
assert state.slot < slot
signed_block = apply_empty_block(spec, state, slot)
apply_empty_block(spec, state, slot)
assert state.slot == slot
return signed_block


def transition_to_valid_shard_slot(spec, state):
Expand Down

0 comments on commit 80ba162

Please sign in to comment.