2019-05-23 23:03:21 +00:00
|
|
|
# Sanity slots testing
|
|
|
|
|
|
|
|
Sanity tests to cover a series of one or more empty-slot transitions being processed, aiming to cover common changes.
|
|
|
|
|
|
|
|
## Test case format
|
|
|
|
|
2019-07-30 13:06:15 +00:00
|
|
|
### `meta.yaml`
|
|
|
|
|
2019-05-23 23:03:21 +00:00
|
|
|
```yaml
|
2019-07-30 13:06:15 +00:00
|
|
|
description: string -- Optional. Description of test case, purely for debugging purposes.
|
2019-05-28 13:35:00 +00:00
|
|
|
bls_setting: int -- see general test-format spec.
|
2019-05-23 23:03:21 +00:00
|
|
|
```
|
|
|
|
|
2019-07-30 13:06:15 +00:00
|
|
|
|
|
|
|
### `pre.yaml`
|
|
|
|
|
|
|
|
A YAML-encoded `BeaconState`, the state before running the transitions.
|
|
|
|
|
2020-10-08 19:02:18 +00:00
|
|
|
Also available as `pre.ssz_snappy`.
|
2019-07-30 13:06:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
### `slots.yaml`
|
|
|
|
|
|
|
|
An integer. The amount of slots to process (i.e. the difference in slots between pre and post), always a positive number.
|
|
|
|
|
|
|
|
### `post.yaml`
|
|
|
|
|
|
|
|
A YAML-encoded `BeaconState`, the state after applying the transitions.
|
|
|
|
|
2020-10-08 19:02:18 +00:00
|
|
|
Also available as `post.ssz_snappy`.
|
2019-07-30 13:06:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
### Processing
|
|
|
|
|
2019-06-30 13:03:50 +00:00
|
|
|
The transition with pure time, no blocks, is known as `process_slots(state, slot)` in the spec.
|
2019-05-23 23:03:21 +00:00
|
|
|
This runs state-caching (pure slot transition) and epoch processing (every E slots).
|
|
|
|
|
2019-06-30 13:03:50 +00:00
|
|
|
To process the data, call `process_slots(pre, pre.slot + N)`.
|
2019-05-23 23:03:21 +00:00
|
|
|
|
|
|
|
## Condition
|
|
|
|
|
|
|
|
The resulting state should match the expected `post` state.
|