The executable Python spec is built from the consensus specifications, complemented with the necessary helper functions for hashing, BLS, and more.
With this executable spec, test-generators can easily create test-vectors for client implementations, and the spec itself can be verified to be consistent and coherent through sanity tests implemented with pytest.
These tests are not intended for client-consumption. These tests are testing the spec itself, to verify consistency and provide feedback on modifications of the spec. However, most of the tests can be run in generator-mode, to output test vectors for client-consumption.
To run all tests:
make testTo run all tests under the minimal preset:
make test preset=minimalOr, to run a specific test function specify k=<test-name>:
make test k=test_verify_kzg_proofOr, to run all tests under a single fork specify fork=<name>:
make test fork=phase0Note: these options can be used together, like:
make test preset=minimal k=test_verify_kzg_proof fork=denebRun make test coverage=true to enable coverage tracking and generate reports.
Reports are saved at:
- HTML report:
tests/core/pyspec/.htmlcov/index.html - JSON report:
tests/core/pyspec/.htmlcov/coverage.json
To open the HTML report in a browser:
xdg-open tests/core/pyspec/.htmlcov/index.html # Linux
open tests/core/pyspec/.htmlcov/index.html # macOSContributions are welcome, but consider implementing your idea as part of the spec itself first. The pyspec is not a replacement.
Same as the spec itself; see LICENSE file in the specs repository root.