mirror of
https://github.com/ethereum/consensus-specs.git
synced 2026-02-01 06:35:03 -05:00
Also update test logic accordingly
This commit is contained in:
@@ -110,7 +110,7 @@ def compute_start_slot_at_sync_committee_period(spec, sync_committee_period):
|
||||
|
||||
|
||||
def compute_start_slot_at_next_sync_committee_period(spec, state):
|
||||
sync_committee_period = spec.compute_sync_committee_period(spec.compute_epoch_at_slot(state.slot))
|
||||
sync_committee_period = spec.compute_sync_committee_period_at_slot(state.slot)
|
||||
return compute_start_slot_at_sync_committee_period(spec, sync_committee_period + 1)
|
||||
|
||||
|
||||
|
||||
@@ -68,8 +68,8 @@ def test_process_light_client_update_at_period_boundary(spec, state):
|
||||
|
||||
# Forward to slot before next sync committee period so that next block is final one in period
|
||||
next_slots(spec, state, spec.UPDATE_TIMEOUT - 2)
|
||||
store_period = spec.compute_sync_committee_period(spec.compute_epoch_at_slot(store.optimistic_header.slot))
|
||||
update_period = spec.compute_sync_committee_period(spec.compute_epoch_at_slot(state.slot))
|
||||
store_period = spec.compute_sync_committee_period_at_slot(store.optimistic_header.slot)
|
||||
update_period = spec.compute_sync_committee_period_at_slot(state.slot)
|
||||
assert store_period == update_period
|
||||
|
||||
attested_block = state_transition_with_full_block(spec, state, False, False)
|
||||
@@ -112,8 +112,8 @@ def test_process_light_client_update_timeout(spec, state):
|
||||
|
||||
# Forward to next sync committee period
|
||||
next_slots(spec, state, spec.UPDATE_TIMEOUT)
|
||||
store_period = spec.compute_sync_committee_period(spec.compute_epoch_at_slot(store.optimistic_header.slot))
|
||||
update_period = spec.compute_sync_committee_period(spec.compute_epoch_at_slot(state.slot))
|
||||
store_period = spec.compute_sync_committee_period_at_slot(store.optimistic_header.slot)
|
||||
update_period = spec.compute_sync_committee_period_at_slot(state.slot)
|
||||
assert store_period + 1 == update_period
|
||||
|
||||
attested_block = state_transition_with_full_block(spec, state, False, False)
|
||||
@@ -164,8 +164,8 @@ def test_process_light_client_update_finality_updated(spec, state):
|
||||
# Ensure that finality checkpoint has changed
|
||||
assert state.finalized_checkpoint.epoch == 3
|
||||
# Ensure that it's same period
|
||||
store_period = spec.compute_sync_committee_period(spec.compute_epoch_at_slot(store.optimistic_header.slot))
|
||||
update_period = spec.compute_sync_committee_period(spec.compute_epoch_at_slot(state.slot))
|
||||
store_period = spec.compute_sync_committee_period_at_slot(store.optimistic_header.slot)
|
||||
update_period = spec.compute_sync_committee_period_at_slot(state.slot)
|
||||
assert store_period == update_period
|
||||
|
||||
attested_block = blocks[-1]
|
||||
|
||||
Reference in New Issue
Block a user