mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-10 12:11:59 +00:00
state transitions tests: check more fields
This commit is contained in:
15
eth2/state_processing/yaml_utils/expected_state_fields.py
Executable file
15
eth2/state_processing/yaml_utils/expected_state_fields.py
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Script to extract all the fields of the state mentioned in `expected_state` fields of tests
|
||||
# in the `spec` directory. These fields can then be added to the `ExpectedState` struct.
|
||||
# Might take a while to run.
|
||||
|
||||
import os, yaml
|
||||
|
||||
if __name__ == "__main__":
|
||||
yaml_files = (filename for filename in os.listdir("specs") if filename.endswith(".yaml"))
|
||||
parsed_yaml = (yaml.load(open("specs/" + filename, "r")) for filename in yaml_files)
|
||||
all_fields = set()
|
||||
for y in parsed_yaml:
|
||||
all_fields.update(*({key for key in case["expected_state"]} for case in y["test_cases"]))
|
||||
print(all_fields)
|
||||
Reference in New Issue
Block a user