Skip to content

Commit

Permalink
Merge pull request #1586 from ethereum/fix-default-compute-domain
Browse files Browse the repository at this point in the history
fix default value in compute_domain
  • Loading branch information
protolambda committed Jan 22, 2020
2 parents fe10339 + e821476 commit 9f5f501
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/build_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion specs/phase0/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -788,10 +788,12 @@ def compute_activation_exit_epoch(epoch: Epoch) -> Epoch:
#### `compute_domain`

```python
def compute_domain(domain_type: DomainType, fork_version: Version=GENESIS_FORK_VERSION) -> Domain:
def compute_domain(domain_type: DomainType, fork_version: Optional[Version]=None) -> Domain:
"""
Return the domain for the ``domain_type`` and ``fork_version``.
"""
if fork_version is None:
fork_version = GENESIS_FORK_VERSION
return Domain(domain_type + fork_version)
```

Expand Down

0 comments on commit 9f5f501

Please sign in to comment.