Skip to content

Commit 1dd4eb6

Browse files
committed
fix previous forks tests
1 parent 76eef4c commit 1dd4eb6

File tree

6 files changed

+6
-10
lines changed

6 files changed

+6
-10
lines changed

tests/core/pyspec/eth2spec/test/helpers/fork_choice.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def add_attester_slashing(spec, store, attester_slashing, test_steps, valid=True
292292

293293
def get_formatted_head_output(spec, store):
294294
head = spec.get_head(store)
295-
if is_post_eip7732:
295+
if is_post_eip7732(spec):
296296
return {
297297
'slot': int(head.slot),
298298
'root': encode_hex(head.root),
@@ -404,7 +404,6 @@ def find_next_justifying_slot(spec,
404404
signed_blocks = []
405405
justifying_slot = None
406406
while justifying_slot is None:
407-
previous_header_root = temp_state.latest_block_header.hash_tree_root()
408407
signed_block = state_transition_with_full_block(
409408
spec,
410409
temp_state,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def _apply_base_block_a(spec, state, store, test_steps):
3434
payload_state_transition(spec, store, signed_block_a.message)
3535
head = spec.get_head(store)
3636
expected_root = signed_block_a.message.hash_tree_root()
37-
if is_post_eip7732:
37+
if is_post_eip7732(spec):
3838
assert head.root == expected_root
3939
else:
4040
check_head_against_root(spec, store, signed_block_a.message.hash_tree_root())

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import random
2-
3-
from eth_utils import encode_hex
42
from eth2spec.test.context import (
53
spec_state_test,
64
with_altair_and_later,
@@ -124,7 +122,6 @@ def test_split_tie_breaker_no_attestations(spec, state):
124122
on_tick_and_append_step(spec, store, time, test_steps)
125123

126124
yield from add_block(spec, store, signed_block_1, test_steps)
127-
post_state_1 = state.copy()
128125
payload_state_transition(spec, store, signed_block_1.message)
129126
yield from add_block(spec, store, signed_block_2, test_steps)
130127
payload_state_transition(spec, store, signed_block_2.message)
@@ -259,6 +256,7 @@ def test_filtered_block_tree(spec, state):
259256

260257
yield 'steps', test_steps
261258

259+
262260
# This test is skipped in EIP-7732 because the block's slot decides first on weight ties
263261
@with_altair_until_eip7732
264262
@spec_state_test

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from eth_utils import encode_hex
21
from eth2spec.test.context import (
32
spec_state_test,
43
with_altair_and_later,
@@ -397,9 +396,10 @@ def _run_include_votes_of_another_empty_chain(spec, state, enough_ffg, is_justif
397396
):
398397
block.body.attestations = attestations_for_y.pop(0)
399398
signed_block_z = state_transition_and_sign_block(spec, state, block)
399+
payload_state_transition_no_store(spec, state, block)
400400
if signed_block_y != signed_block_z:
401401
yield from tick_and_add_block(spec, store, signed_block_z, test_steps)
402-
state = payload_state_transition(spec, store, signed_block_z.message).copy()
402+
payload_state_transition(spec, store, signed_block_z.message)
403403
if is_ready_to_justify(spec, state):
404404
break
405405

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from eth_utils import encode_hex
21
from eth2spec.test.context import (
32
spec_state_test,
43
with_altair_and_later,

tests/core/pyspec/eth2spec/test/phase0/unittests/fork_choice/test_on_attestation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def run_on_attestation(spec, state, store, attestation, valid=True):
2020
spec.on_attestation(store, attestation)
2121

2222
sample_index = indexed_attestation.attesting_indices[0]
23-
if is_post_eip7732:
23+
if is_post_eip7732(spec):
2424
latest_message = spec.LatestMessage(
2525
slot=attestation.data.slot,
2626
root=attestation.data.beacon_block_root,

0 commit comments

Comments
 (0)