Skip to content

Commit

Permalink
handle semantic fork versions ethereum/consensus-specs#738
Browse files Browse the repository at this point in the history
  • Loading branch information
djrtwo committed Mar 12, 2019
1 parent b9ec207 commit b29114f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions spec_pythonizer/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,9 @@ The types are defined topologically to aid in facilitating an executable version
```python
{
# Previous fork version
'previous_version': 'uint64',
'previous_version': 'bytes4',
# Current fork version
'current_version': 'uint64',
'current_version': 'bytes4',
# Fork epoch number
'epoch': 'uint64',
}
Expand Down Expand Up @@ -1106,7 +1106,7 @@ def get_total_balance(state: BeaconState, validators: List[ValidatorIndex]) -> G

```python
def get_fork_version(fork: Fork,
epoch: Epoch) -> int:
epoch: Epoch) -> bytes:
"""
Return the fork version of the given ``epoch``.
"""
Expand All @@ -1125,8 +1125,7 @@ def get_domain(fork: Fork,
"""
Get the domain number that represents the fork meta and signature domain.
"""
fork_version = get_fork_version(fork, epoch)
return fork_version * 2**32 + domain_type
return bytes_to_int(get_fork_version(fork, epoch) + int_to_bytes4(domain_type))
```

### `get_bitfield_bit`
Expand Down

0 comments on commit b29114f

Please sign in to comment.