Build spec

This commit is contained in:
protolambda 2019-06-20 20:12:17 +02:00
parent 4aefc078e9
commit 439e4d4859
No known key found for this signature in database
GPG Key ID: EC89FDBB2B4C7623
1 changed files with 4 additions and 4 deletions

View File

@ -26,8 +26,7 @@ from eth2spec.utils.ssz.ssz_impl import (
) )
from eth2spec.utils.ssz.ssz_typing import ( from eth2spec.utils.ssz.ssz_typing import (
# unused: uint8, uint16, uint32, uint128, uint256, # unused: uint8, uint16, uint32, uint128, uint256,
uint64, Container, Vector, Bit, Container, List, Vector, Bytes, BytesN, uint64
Bytes4, Bytes32, Bytes48, Bytes96,
) )
from eth2spec.utils.bls import ( from eth2spec.utils.bls import (
bls_aggregate_pubkeys, bls_aggregate_pubkeys,
@ -179,8 +178,9 @@ def dependency_order_ssz_objects(objects: Dict[str, str], custom_types: Dict[str
""" """
items = list(objects.items()) items = list(objects.items())
for key, value in items: for key, value in items:
dependencies = re.findall(r'(: [A-Z][\w[]*)', value) dependencies = re.findall(r'(: [A-Z][\w\[]*)', value)
dependencies = map(lambda x: re.sub(r'\W|Vector|List|Container|Hash|BLSPubkey|BLSSignature|uint\d+|Bytes\d+|bytes', '', x), dependencies) dependencies = filter(lambda x: '_' not in x and x.upper() != x, dependencies) # filter out constants
dependencies = map(lambda x: re.sub(r'\W|Vector|List|Container|Hash|BLSPubkey|BLSSignature|uint\d+|BytesN\[.+\\]|Bytes\[.+\\]|Bytes\d*|bytes\d*', '', x), dependencies)
for dep in dependencies: for dep in dependencies:
if dep in custom_types or len(dep) == 0: if dep in custom_types or len(dep) == 0:
continue continue