pr feedback

This commit is contained in:
Danny Ryan 2021-11-23 11:19:22 -07:00
parent 40f1c85788
commit 975931b5cf
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A
2 changed files with 18 additions and 3 deletions

View File

@ -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

View File

@ -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