rename pyspec pkg to eth2spec

This commit is contained in:
protolambda 2019-04-03 14:18:17 +11:00
parent 51ed40916f
commit 9e010da118
No known key found for this signature in database
GPG Key ID: EC89FDBB2B4C7623
25 changed files with 32 additions and 32 deletions

2
.gitignore vendored
View File

@ -12,4 +12,4 @@ yaml_tests/
.pytest_cache
# Dynamically built from Markdown spec
test_libs/pyspec/pyspec/phase0/spec.py
test_libs/pyspec/eth2spec/phase0/spec.py

View File

@ -12,7 +12,7 @@ GENERATORS = $(sort $(dir $(wildcard $(GENERATOR_DIR)/*/)))
YAML_TEST_TARGETS = $(patsubst $(GENERATOR_DIR)/%, $(YAML_TEST_DIR)/%, $(GENERATORS))
GENERATOR_VENVS = $(patsubst $(GENERATOR_DIR)/%, $(GENERATOR_DIR)/%venv, $(GENERATORS))
PY_SPEC_PHASE_0_TARGETS = $(PY_SPEC_DIR)/pyspec/phase0/spec.py
PY_SPEC_PHASE_0_TARGETS = $(PY_SPEC_DIR)/eth2spec/phase0/spec.py
PY_SPEC_ALL_TARGETS = $(PY_SPEC_PHASE_0_TARGETS)
@ -40,7 +40,7 @@ pyspec: $(PY_SPEC_ALL_TARGETS)
phase0: $(PY_SPEC_PHASE_0_TARGETS)
$(PY_SPEC_DIR)/pyspec/phase0/spec.py:
$(PY_SPEC_DIR)/eth2spec/phase0/spec.py:
python3 $(SCRIPT_DIR)/phase0/build_spec.py $(SPEC_DIR)/core/0_beacon-chain.md $@

View File

@ -35,6 +35,6 @@ The following are the broad design goals for Ethereum 2.0:
Documentation on the different components used during spec writing can be found here:
* [YAML Test Generators](test_generators/README.md)
* [Executable Python Spec](test_libs/pyspec/README.md)
* [Executable Python Spec](test_libs/eth2spec/README.md)
* [Py-tests](py_tests/README.md)

View File

@ -1,12 +1,12 @@
from copy import deepcopy
import pytest
import pyspec.phase0.spec as spec
import eth2spec.phase0.spec as spec
from pyspec.phase0.state_transition import (
from eth2spec.phase0.state_transition import (
state_transition,
)
from pyspec.phase0.spec import (
from eth2spec.phase0.spec import (
get_current_epoch,
process_attestation,
slot_to_epoch,

View File

@ -1,8 +1,8 @@
from copy import deepcopy
import pytest
import pyspec.phase0.spec as spec
from pyspec.phase0.spec import (
import eth2spec.phase0.spec as spec
from eth2spec.phase0.spec import (
get_balance,
get_beacon_proposer_index,
process_attester_slashing,

View File

@ -2,7 +2,7 @@ from copy import deepcopy
import pytest
from pyspec.phase0.spec import (
from eth2spec.phase0.spec import (
get_beacon_proposer_index,
cache_state,
advance_slot,

View File

@ -1,9 +1,9 @@
from copy import deepcopy
import pytest
import pyspec.phase0.spec as spec
import eth2spec.phase0.spec as spec
from pyspec.phase0.spec import (
from eth2spec.phase0.spec import (
get_balance,
ZERO_HASH,
process_deposit,

View File

@ -1,8 +1,8 @@
from copy import deepcopy
import pytest
import pyspec.phase0.spec as spec
from pyspec.phase0.spec import (
import eth2spec.phase0.spec as spec
from eth2spec.phase0.spec import (
get_balance,
get_current_epoch,
process_proposer_slashing,

View File

@ -1,9 +1,9 @@
from copy import deepcopy
import pytest
import pyspec.phase0.spec as spec
import eth2spec.phase0.spec as spec
from pyspec.phase0.spec import (
from eth2spec.phase0.spec import (
get_active_validator_indices,
get_current_epoch,
process_voluntary_exit,

View File

@ -1,6 +1,6 @@
import pytest
from pyspec.phase0 import spec
from eth2spec.phase0 import spec
from .helpers import (
create_genesis_state,

View File

@ -2,9 +2,9 @@ from copy import deepcopy
from py_ecc import bls
import pyspec.phase0.spec as spec
from pyspec.utils.minimal_ssz import signed_root
from pyspec.phase0.spec import (
import eth2spec.phase0.spec as spec
from eth2spec.utils.minimal_ssz import signed_root
from eth2spec.phase0.spec import (
# constants
EMPTY_SIGNATURE,
ZERO_HASH,
@ -35,7 +35,7 @@ from pyspec.phase0.spec import (
verify_merkle_branch,
hash,
)
from pyspec.utils.merkle_minimal import (
from eth2spec.utils.merkle_minimal import (
calc_merkle_tree_from_leaves,
get_merkle_proof,
get_merkle_root,

View File

@ -3,10 +3,10 @@ from copy import deepcopy
import pytest
from py_ecc import bls
import pyspec.phase0.spec as spec
import eth2spec.phase0.spec as spec
from pyspec.utils.minimal_ssz import signed_root
from pyspec.phase0.spec import (
from eth2spec.utils.minimal_ssz import signed_root
from eth2spec.phase0.spec import (
# constants
EMPTY_SIGNATURE,
ZERO_HASH,
@ -28,10 +28,10 @@ from pyspec.phase0.spec import (
verify_merkle_branch,
hash,
)
from pyspec.phase0.state_transition import (
from eth2spec.phase0.state_transition import (
state_transition,
)
from pyspec.utils.merkle_minimal import (
from eth2spec.utils.merkle_minimal import (
calc_merkle_tree_from_leaves,
get_merkle_proof,
get_merkle_root,

View File

@ -13,8 +13,8 @@ from typing import (
NewType,
Tuple,
)
from pyspec.utils.minimal_ssz import *
from pyspec.utils.bls_stub import *
from eth2spec.utils.minimal_ssz import *
from eth2spec.utils.bls_stub import *
""")

View File

@ -113,7 +113,7 @@ if __name__ == "__main__":
And to use the pyspec:
```
from pyspec.phase0 import spec
from eth2spec.phase0 import spec
```
Recommendations:

View File

@ -13,13 +13,13 @@ 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/pyspec/phase0/spec.py`
Or, to build a single file, specify the path, e.g. `make test_libs/pyspec/eth2spec/phase0/spec.py`
## Contributing
Contributions are welcome, but consider implementing your idea as part of the spec itself first.
The pyspec is not a replacement.
If you see opportunity to include any of the `pyspec/utils/` code in the spec,
If you see opportunity to include any of the `pyspec/eth2spec/utils/` code in the spec,
please submit an issue or PR.
## License

View File

@ -1,4 +1,4 @@
from pyspec.utils.minimal_ssz import hash_tree_root
from eth2spec.utils.minimal_ssz import hash_tree_root
def jsonize(value, typ, include_hash_tree_roots=False):