cleanups to get_seed

1) Put `domain_type` and `epoch` upfront. This pattern can be reused for signature domains.
2) Change `int_to_bytes(epoch, length=32)` to `int_to_bytes(epoch, length=8)` to match `uint64` length.
This commit is contained in:
Justin 2019-09-22 21:04:48 +01:00 committed by Danny Ryan
parent 47a818c705
commit a183125595
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A
1 changed files with 1 additions and 1 deletions

View File

@ -875,7 +875,7 @@ def get_seed(state: BeaconState, epoch: Epoch, domain_type: DomainType) -> Hash:
Return the seed at ``epoch``.
"""
mix = get_randao_mix(state, Epoch(epoch + EPOCHS_PER_HISTORICAL_VECTOR - MIN_SEED_LOOKAHEAD - 1)) # Avoid underflow
return hash(domain_type + mix + int_to_bytes(epoch, length=32))
return hash(domain_type + int_to_bytes(epoch, length=8) + mix)
```
#### `get_committee_count`