Merge with spec update

This commit is contained in:
Anton Nashatyrev 2019-01-15 11:32:19 +03:00
commit 5321fee1cd
1 changed files with 4 additions and 3 deletions

View File

@ -935,11 +935,12 @@ def get_shard_committees_at_slot(state: BeaconState,
"""
Returns the list of ``(committee, shard)`` tuples for the ``slot``.
"""
earliest_slot = state.slot - (state.slot % EPOCH_LENGTH) - EPOCH_LENGTH
assert earliest_slot <= slot < earliest_slot + EPOCH_LENGTH * 2
state_epoch_slot = state.slot - (state.slot % EPOCH_LENGTH)
assert state_epoch_slot <= slot + EPOCH_LENGTH
assert slot < state_epoch_slot + EPOCH_LENGTH
offset = slot % EPOCH_LENGTH
if slot < earliest_slot + EPOCH_LENGTH:
if slot < state_epoch_slot:
committees_per_slot = get_previous_epoch_committee_count_per_slot(state)
shuffling = get_shuffling(
state.previous_epoch_randao_mix,