Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Commit

Permalink
Merge pull request #714 from ralexstokes/validator-spec-updates
Browse files Browse the repository at this point in the history
Updates for almost v0.8
  • Loading branch information
ralexstokes authored Jul 9, 2019
2 parents cca7c7d + 6129606 commit 2644c23
Show file tree
Hide file tree
Showing 120 changed files with 6,872 additions and 9,765 deletions.
35 changes: 25 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ common: &common
- ~/.cache/pip
- ~/.local
- ./eggs
- .pytest_cache/v/eth2/bls/key-cache
key: cache-v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}

geth_steps: &geth_steps
Expand Down Expand Up @@ -304,12 +305,18 @@ jobs:
- image: circleci/python:3.6
environment:
TOXENV: py36-wheel-cli
py36-plugins:
py36-eth1-plugins:
<<: *common
docker:
- image: circleci/python:3.6
environment:
TOXENV: py36-plugins
TOXENV: py36-eth1-plugins
py36-eth2-plugins:
<<: *common
docker:
- image: circleci/python:3.6
environment:
TOXENV: py36-eth2-plugins

py37-rpc-state-quadratic:
<<: *common
Expand Down Expand Up @@ -384,12 +391,18 @@ jobs:
- image: circleci/python:3.7
environment:
TOXENV: py37-wheel-cli
py37-plugins:
py37-eth1-plugins:
<<: *common
docker:
- image: circleci/python:3.7
environment:
TOXENV: py37-eth1-plugins
py37-eth2-plugins:
<<: *common
docker:
- image: circleci/python:3.7
environment:
TOXENV: py37-plugins
TOXENV: py37-eth2-plugins

docker-image-build-test:
machine: true
Expand All @@ -408,11 +421,12 @@ workflows:
- py37-wheel-cli
- py37-p2p
- py37-eth2-core
- py37-eth2-fixtures
# temporarily disable fixtures tests while we update
# - py37-eth2-fixtures
- py37-eth2-integration
- py37-eth2-plugins
# - py37-libp2p
- py37-bls-bindings
- py37-plugins
- py37-eth1-plugins

- py37-rpc-state-quadratic
- py37-rpc-state-sstore
Expand All @@ -431,11 +445,12 @@ workflows:
- py36-wheel-cli
- py36-p2p
- py36-eth2-core
- py36-eth2-fixtures
# temporarily disable fixtures tests while we update
# - py36-eth2-fixtures
- py36-eth2-integration
- py36-eth2-plugins
# - py36-libp2p
- py36-bls-bindings
- py36-plugins
- py36-eth1-plugins

- py36-integration
- py36-lightchain_integration
Expand Down
116 changes: 0 additions & 116 deletions eth2/_utils/blobs.py

This file was deleted.

10 changes: 0 additions & 10 deletions eth2/_utils/numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,6 @@ def bitwise_xor(a: Hash32, b: Hash32) -> Hash32:
return Hash32(result)


def is_power_of_two(value: int) -> bool:
"""
Check if ``value`` is a power of two integer.
"""
if value == 0:
return False
else:
return bool(value and not (value & (value - 1)))


def integer_squareroot(value: int) -> int:
"""
Return the integer square root of ``value``.
Expand Down
28 changes: 23 additions & 5 deletions eth2/_utils/tuple.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from typing import (
Any,
Callable,
Tuple,
TypeVar,
)
Expand All @@ -11,16 +13,19 @@
VType = TypeVar('VType')


def update_tuple_item(tuple_data: Tuple[VType, ...],
index: int,
new_value: VType) -> Tuple[VType, ...]:
def update_tuple_item_with_fn(tuple_data: Tuple[VType, ...],
index: int,
fn: Callable[[VType, Any], VType],
*args: Any) -> Tuple[VType, ...]:
"""
Update the ``index``th item of ``tuple_data`` to ``new_value``
Update the ``index``th item of ``tuple_data`` to the result of calling ``fn`` on the existing
value.
"""
list_data = list(tuple_data)

try:
list_data[index] = new_value
old_value = list_data[index]
list_data[index] = fn(old_value, *args)
except IndexError:
raise ValidationError(
"the length of the given tuple_data is {}, the given index {} is out of index".format(
Expand All @@ -30,3 +35,16 @@ def update_tuple_item(tuple_data: Tuple[VType, ...],
)
else:
return tuple(list_data)


def update_tuple_item(tuple_data: Tuple[VType, ...],
index: int,
new_value: VType) -> Tuple[VType, ...]:
"""
Update the ``index``th item of ``tuple_data`` to ``new_value``
"""
return update_tuple_item_with_fn(
tuple_data,
index,
lambda *_: new_value
)
Empty file removed eth2/beacon/_utils/__init__.py
Empty file.
132 changes: 0 additions & 132 deletions eth2/beacon/_utils/random.py

This file was deleted.

Loading

0 comments on commit 2644c23

Please sign in to comment.