convert `shard` and `index` to `CommitteeIndex` in `reset_pending_headers`

This commit is contained in:
ericsson 2021-04-27 14:14:25 +03:00
parent 17bc3c1c72
commit 865a077aa3
1 changed files with 2 additions and 2 deletions

View File

@ -754,8 +754,8 @@ def reset_pending_headers(state: BeaconState) -> None:
next_epoch_start_slot = compute_start_slot_at_epoch(next_epoch) next_epoch_start_slot = compute_start_slot_at_epoch(next_epoch)
for slot in range(next_epoch_start_slot, next_epoch_start_slot + SLOTS_PER_EPOCH): for slot in range(next_epoch_start_slot, next_epoch_start_slot + SLOTS_PER_EPOCH):
for index in range(get_committee_count_per_slot(state, next_epoch)): for index in range(get_committee_count_per_slot(state, next_epoch)):
shard = compute_shard_from_committee_index(state, slot, index) shard = compute_shard_from_committee_index(state, slot, CommitteeIndex(index))
committee_length = len(get_beacon_committee(state, slot, shard)) committee_length = len(get_beacon_committee(state, slot, CommitteeIndex(shard)))
state.current_epoch_pending_shard_headers.append(PendingShardHeader( state.current_epoch_pending_shard_headers.append(PendingShardHeader(
slot=slot, slot=slot,
shard=shard, shard=shard,