From 975931b5cfc26f643221c3e043d23de539dd60e7 Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Tue, 23 Nov 2021 11:19:22 -0700 Subject: [PATCH] pr feedback --- .../test/phase0/fork_choice/test_get_head.py | 7 ++++--- .../test/phase0/fork_choice/test_on_block.py | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/tests/core/pyspec/eth2spec/test/phase0/fork_choice/test_get_head.py b/tests/core/pyspec/eth2spec/test/phase0/fork_choice/test_get_head.py index 83e342e08..d2c84fce7 100644 --- a/tests/core/pyspec/eth2spec/test/phase0/fork_choice/test_get_head.py +++ b/tests/core/pyspec/eth2spec/test/phase0/fork_choice/test_get_head.py @@ -117,10 +117,11 @@ def test_split_tie_breaker_no_attestations(spec, state): signed_block_2 = state_transition_and_sign_block(spec, block_2_state, block_2) # Tick time past slot 1 so proposer score boost does not apply - spec.on_tick(store, store.genesis_time + (block_2.slot + 1) * spec.config.SECONDS_PER_SLOT) + time = store.genesis_time + (block_2.slot + 1) * spec.config.SECONDS_PER_SLOT + on_tick_and_append_step(spec, store, time, test_steps) - yield from tick_and_add_block(spec, store, signed_block_1, test_steps) - yield from tick_and_add_block(spec, store, signed_block_2, test_steps) + yield from add_block(spec, store, signed_block_1, test_steps) + yield from add_block(spec, store, signed_block_2, test_steps) highest_root = max(spec.hash_tree_root(block_1), spec.hash_tree_root(block_2)) assert spec.get_head(store) == highest_root diff --git a/tests/core/pyspec/eth2spec/test/phase0/fork_choice/test_on_block.py b/tests/core/pyspec/eth2spec/test/phase0/fork_choice/test_on_block.py index 5c3ba89de..f57522ad7 100644 --- a/tests/core/pyspec/eth2spec/test/phase0/fork_choice/test_on_block.py +++ b/tests/core/pyspec/eth2spec/test/phase0/fork_choice/test_on_block.py @@ -1,4 +1,5 @@ import random +from eth_utils import encode_hex from eth2spec.utils.ssz.ssz_impl import hash_tree_root from eth2spec.test.context import MINIMAL, spec_state_test, with_all_phases, with_presets @@ -755,6 +756,12 @@ def test_proposer_boost(spec, state): assert store.proposer_boost_root == spec.Root() assert spec.get_latest_attesting_balance(store, spec.hash_tree_root(block)) == 0 + test_steps.append({ + 'checks': { + 'proposer_boost_root': encode_hex(store.proposer_boost_root), + } + }) + yield 'steps', test_steps @@ -780,6 +787,13 @@ def test_proposer_boost_root_same_slot_untimely_block(spec, state): spec.config.SECONDS_PER_SLOT // spec.INTERVALS_PER_SLOT) on_tick_and_append_step(spec, store, time, test_steps) yield from add_block(spec, store, signed_block, test_steps) + assert store.proposer_boost_root == spec.Root() + test_steps.append({ + 'checks': { + 'proposer_boost_root': encode_hex(store.proposer_boost_root), + } + }) + yield 'steps', test_steps