Add `assert time >= store.time` to `on_tick`
This commit is contained in:
parent
36f0bb0ed6
commit
3d853b0ec9
|
@ -623,6 +623,9 @@ def update_latest_messages(store: Store, attesting_indices: Sequence[ValidatorIn
|
||||||
|
|
||||||
```python
|
```python
|
||||||
def on_tick(store: Store, time: uint64) -> None:
|
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
|
# 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``
|
# to ensure that every previous slot is processed with ``on_tick_per_slot``
|
||||||
tick_slot = (time - store.genesis_time) // SECONDS_PER_SLOT
|
tick_slot = (time - store.genesis_time) // SECONDS_PER_SLOT
|
||||||
|
|
|
@ -144,6 +144,7 @@ def get_blobs_file_name(blobs=None, blobs_root=None):
|
||||||
|
|
||||||
|
|
||||||
def on_tick_and_append_step(spec, store, time, test_steps):
|
def on_tick_and_append_step(spec, store, time, test_steps):
|
||||||
|
if store.time < time:
|
||||||
spec.on_tick(store, time)
|
spec.on_tick(store, time)
|
||||||
test_steps.append({'tick': int(time)})
|
test_steps.append({'tick': int(time)})
|
||||||
output_store_checks(spec, store, test_steps)
|
output_store_checks(spec, store, test_steps)
|
||||||
|
|
Loading…
Reference in New Issue