From e821476c07560c8810acc768bb30a7abd2d00e2b Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Wed, 22 Jan 2020 11:27:45 -0700 Subject: [PATCH] explicitly use Optiona type for fork_version in compute_domain Co-Authored-By: Carl Beekhuizen --- scripts/build_spec.py | 2 +- specs/phase0/beacon-chain.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build_spec.py b/scripts/build_spec.py index 114832bc2a..16dd0d21d1 100644 --- a/scripts/build_spec.py +++ b/scripts/build_spec.py @@ -31,7 +31,7 @@ SSZObject = TypeVar('SSZObject', bound=SSZType) ''' PHASE1_IMPORTS = '''from typing import ( - Any, Dict, Set, Sequence, MutableSequence, NewType, Tuple, Union, TypeVar + Any, Dict, Set, Sequence, MutableSequence, NewType, Optional, Tuple, Union, TypeVar ) from math import ( log2, diff --git a/specs/phase0/beacon-chain.md b/specs/phase0/beacon-chain.md index 478a2daa12..7f2e873bfb 100644 --- a/specs/phase0/beacon-chain.md +++ b/specs/phase0/beacon-chain.md @@ -788,7 +788,7 @@ def compute_activation_exit_epoch(epoch: Epoch) -> Epoch: #### `compute_domain` ```python -def compute_domain(domain_type: DomainType, fork_version: Version=None) -> Domain: +def compute_domain(domain_type: DomainType, fork_version: Optional[Version]=None) -> Domain: """ Return the domain for the ``domain_type`` and ``fork_version``. """