From 9b77ec11f8e091992b74258f39e5633663c5903e Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Sat, 15 Jun 2019 17:32:52 -0400 Subject: [PATCH] Version: Bytes4 --- scripts/build_spec.py | 7 ------- specs/core/0_beacon-chain.md | 5 +++-- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/scripts/build_spec.py b/scripts/build_spec.py index 8f0048b8f..9f5d07b29 100644 --- a/scripts/build_spec.py +++ b/scripts/build_spec.py @@ -67,13 +67,6 @@ from eth2spec.utils.bls import ( from eth2spec.utils.hash_function import hash ''' -NEW_TYPES = { - 'Slot': 'uint64', - 'Epoch': 'uint64', - 'Shard': 'uint64', - 'ValidatorIndex': 'uint64', - 'Gwei': 'uint64', -} BYTE_TYPES = [4, 32, 48, 96] SUNDRY_FUNCTIONS = ''' def get_ssz_type_by_name(name: str) -> Container: diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index a45da2872..8b0c51b04 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -161,6 +161,7 @@ We define the following Python custom types for type hinting and readability: | `Shard` | `uint64` | a shard number | | `ValidatorIndex` | `uint64` | a validator registry index | | `Gwei` | `uint64` | an amount in Gwei | +| `Version` | `Bytes4` | a fork version number | | `BLSPubkey` | `Bytes48` | a BLS12-381 public key | | `BLSSignature` | `Bytes96` | a BLS12-381 signature | @@ -282,9 +283,9 @@ The types are defined topologically to aid in facilitating an executable version ```python class Fork(Container): # Previous fork version - previous_version: Bytes4 + previous_version: Version # Current fork version - current_version: Bytes4 + current_version: Version # Fork epoch number epoch: Epoch ```