mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-20 15:38:55 +00:00
Revert the spec. Only handle it in tests
This commit is contained in:
parent
3d853b0ec9
commit
6fb9b0a9a4
@ -623,9 +623,6 @@ def update_latest_messages(store: Store, attesting_indices: Sequence[ValidatorIn
|
||||
|
||||
```python
|
||||
def on_tick(store: Store, time: uint64) -> None:
|
||||
# Precondition
|
||||
assert time >= store.time
|
||||
|
||||
# If the ``store.time`` falls behind, while loop catches up slot by slot
|
||||
# to ensure that every previous slot is processed with ``on_tick_per_slot``
|
||||
tick_slot = (time - store.genesis_time) // SECONDS_PER_SLOT
|
||||
|
@ -60,7 +60,8 @@ def tick_and_add_block(spec, store, signed_block, test_steps, valid=True,
|
||||
block_time = pre_state.genesis_time + signed_block.message.slot * spec.config.SECONDS_PER_SLOT
|
||||
while store.time < block_time:
|
||||
time = pre_state.genesis_time + (spec.get_current_slot(store) + 1) * spec.config.SECONDS_PER_SLOT
|
||||
on_tick_and_append_step(spec, store, time, test_steps)
|
||||
if time > store.time:
|
||||
on_tick_and_append_step(spec, store, time, test_steps)
|
||||
|
||||
post_state = yield from add_block(
|
||||
spec, store, signed_block, test_steps,
|
||||
@ -144,6 +145,7 @@ def get_blobs_file_name(blobs=None, blobs_root=None):
|
||||
|
||||
|
||||
def on_tick_and_append_step(spec, store, time, test_steps):
|
||||
assert time >= store.time
|
||||
if store.time < time:
|
||||
spec.on_tick(store, time)
|
||||
test_steps.append({'tick': int(time)})
|
||||
|
Loading…
x
Reference in New Issue
Block a user