eth2.0-specs/test_libs/pyspec
protolambda 23d6b468e3 Work towards testing all edge-cases of SSZ, for known (static) object types 2019-04-19 12:06:00 +10:00
..
eth2spec Work towards testing all edge-cases of SSZ, for known (static) object types 2019-04-19 12:06:00 +10:00
tests re-add crosslink tests and ensure pass 2019-04-18 11:16:50 -06:00
README.md Move pytests for faster dev iteration 2019-04-17 17:47:56 +10:00
requirements.txt Move pytests for faster dev iteration 2019-04-17 17:47:56 +10:00
setup.py Move pytests for faster dev iteration 2019-04-17 17:47:56 +10:00

README.md

ETH 2.0 PySpec

The Python executable spec is built from the ETH 2.0 specification, 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.

Building

All the dynamic parts of the spec can be build at once with make pyspec.

Alternatively, you can build a sub-set of the pyspec: make phase0.

Or, to build a single file, specify the path, e.g. make test_libs/pyspec/eth2spec/phase0/spec.py

Py-tests

These tests are not intended for client-consumption. These tests are sanity tests, to verify if the spec itself is consistent.

How to run tests

Automated

Run make test from the root of the spec repository.

Manual

From within the pyspec folder:

Install dependencies:

python3 -m venv venv
. venv/bin/activate
pip3 install -r requirements.txt

Note: make sure to run make pyspec from the root of the specs repository, to build the parts of the pyspec module derived from the markdown specs.

Run the tests:

pytest -m minimal_config .

Contributing

Contributions are welcome, but consider implementing your idea as part of the spec itself first. The pyspec is not a replacement.

License

Same as the spec itself, see LICENSE file in spec repository root.