mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-02-17 21:16:52 +00:00
Merge pull request #1586 from ethereum/fix-default-compute-domain
fix default value in compute_domain
This commit is contained in:
commit
9f5f501e5b
@ -31,7 +31,7 @@ from eth2spec.utils.hash_function import hash
|
||||
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,
|
||||
|
@ -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)
|
||||
```
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user