Skip to content

Commit 8de413e

Browse files
committed
fix test_withholding_attack
1 parent a3008ff commit 8de413e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/core/pyspec/eth2spec/test/phase0/fork_choice/test_withholding.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def test_withholding_attack(spec, state):
7676
assert spec.compute_epoch_at_slot(state.slot) == 4
7777
assert spec.compute_epoch_at_slot(spec.get_current_slot(store)) == 4
7878
assert state.current_justified_checkpoint.epoch == store.justified_checkpoint.epoch == 3
79+
state = get_store_full_state(spec, store, head_root).copy()
7980

8081
# Create an honest chain in epoch 5 that includes the justifying attestations from the attack block
8182
next_epoch(spec, state)
@@ -88,9 +89,9 @@ def test_withholding_attack(spec, state):
8889
yield from tick_and_add_block(spec, store, signed_block, test_steps)
8990
honest_state = payload_state_transition(spec, store, signed_block.message).copy()
9091
# Create final block in the honest chain that includes the justifying attestations from the attack block
91-
honest_block = build_empty_block_for_next_slot(spec, state)
92+
honest_block = build_empty_block_for_next_slot(spec, honest_state)
9293
honest_block.body.attestations = signed_attack_block.message.body.attestations
93-
signed_honest_block = state_transition_and_sign_block(spec, state, honest_block)
94+
signed_honest_block = state_transition_and_sign_block(spec, honest_state, honest_block)
9495
# Add the honest block to the store
9596
yield from tick_and_add_block(spec, store, signed_honest_block, test_steps)
9697
payload_state_transition(spec, store, signed_honest_block.message)

0 commit comments

Comments
 (0)