From 8e1333aad198025cb43640b07f52e7e8deeaa76b Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Thu, 15 Aug 2019 19:01:40 +0800 Subject: [PATCH] Add `SSZVariableName` custom type --- scripts/build_spec.py | 1 + test_libs/pyspec/eth2spec/utils/ssz/ssz_typing.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/build_spec.py b/scripts/build_spec.py index 07306af8a..10e6034f2 100644 --- a/scripts/build_spec.py +++ b/scripts/build_spec.py @@ -55,6 +55,7 @@ from eth2spec.utils.ssz.ssz_impl import ( ) from eth2spec.utils.ssz.ssz_typing import ( BasicValue, Elements, BaseList, SSZType, + SSZVariableName, Container, List, Vector, Bytes, BytesN, Bitlist, Bitvector, Bits, Bytes1, Bytes4, Bytes8, Bytes32, Bytes48, Bytes96, uint64, bit, boolean, diff --git a/test_libs/pyspec/eth2spec/utils/ssz/ssz_typing.py b/test_libs/pyspec/eth2spec/utils/ssz/ssz_typing.py index 1f199e6e1..bcccb91b2 100644 --- a/test_libs/pyspec/eth2spec/utils/ssz/ssz_typing.py +++ b/test_libs/pyspec/eth2spec/utils/ssz/ssz_typing.py @@ -1,8 +1,11 @@ -from typing import Dict, Iterator +from typing import Dict, Iterator, NewType import copy from types import GeneratorType +SSZVariableName = NewType('SSZVariableName', str) + + class DefaultingTypeMeta(type): def default(cls): raise Exception("Not implemented")