Skip to content

Commit ce8a6bd

Browse files
committed
some small fixes
1 parent a43ff71 commit ce8a6bd

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -908,8 +908,6 @@ def test_justification_update_end_of_epoch(spec, state):
908908
check_head_against_root(spec, store, signed_block.message.hash_tree_root())
909909
payload_state_transition(spec, store, signed_block.message)
910910
assert store.justified_checkpoint.epoch == 4
911-
assert 1 == 0
912-
913911
yield 'steps', test_steps
914912

915913

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ def test_withholding_attack(spec, state):
6565
signed_attack_block = signed_blocks[-1]
6666
for signed_block in signed_blocks[:-1]:
6767
current_root = signed_block.message.hash_tree_root()
68-
state = yield from tick_and_add_block(spec, store, signed_block, test_steps)
69-
state = payload_state_transition(spec, store, signed_block.message)
68+
yield from tick_and_add_block(spec, store, signed_block, test_steps)
69+
payload_state_transition(spec, store, signed_block.message)
7070
check_head_against_root(spec, store, current_root)
7171
head_root = signed_blocks[-2].message.hash_tree_root()
7272
check_head_against_root(spec, store, head_root)
@@ -79,10 +79,12 @@ def test_withholding_attack(spec, state):
7979
assert spec.compute_epoch_at_slot(state.slot) == 5
8080
assert state.current_justified_checkpoint.epoch == 3
8181
# Create two blocks in the honest chain with full attestations, and add to the store
82+
honest_state = state.copy()
8283
for _ in range(2):
83-
signed_block = state_transition_with_full_block(spec, state, True, False)
84+
print("Trying slot", honest_state.slot)
85+
signed_block = state_transition_with_full_block(spec, honest_state, True, False)
8486
yield from tick_and_add_block(spec, store, signed_block, test_steps)
85-
payload_state_transition(spec, store, signed_block.message)
87+
honest_state = payload_state_transition(spec, store, signed_block.message).copy()
8688
# Create final block in the honest chain that includes the justifying attestations from the attack block
8789
honest_block = build_empty_block_for_next_slot(spec, state)
8890
honest_block.body.attestations = signed_attack_block.message.body.attestations

0 commit comments

Comments
 (0)