mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-15 05:04:32 +00:00
25 lines
1.1 KiB
Markdown
25 lines
1.1 KiB
Markdown
|
# 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
|
||
|
|
||
|
```yaml
|
||
|
description: string -- description of test case, purely for debugging purposes
|
||
|
bls_required: bool -- optional, true if the test validity is strictly dependent on BLS being ON. False otherwise.
|
||
|
bls_ignored: bool -- optional, true if the test validity is strictly dependent on BLS being OFF. False otherwise.
|
||
|
pre: BeaconState -- state before running through the transitions.
|
||
|
slots: N -- amount of slots to process, N being a positive numer.
|
||
|
post: BeaconState -- state after applying all the transitions.
|
||
|
```
|
||
|
|
||
|
The transition with pure time, no blocks, is known as `state_transition_to(state, slot)` in the spec.
|
||
|
This runs state-caching (pure slot transition) and epoch processing (every E slots).
|
||
|
|
||
|
To process the data, call `state_transition_to(pre, pre.slot + N)`. And see if `pre` mutated into the equivalent of `post`.
|
||
|
|
||
|
|
||
|
## Condition
|
||
|
|
||
|
The resulting state should match the expected `post` state.
|