Fix `first_committee_at_slot`

This commit is contained in:
Hsiao-Wei Wang 2019-02-08 04:03:13 +08:00 committed by GitHub
parent d4901be198
commit e4f5efadb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -368,14 +368,14 @@ def get_next_epoch_committee_assignments(
registry_change=registry_change, registry_change=registry_change,
) )
selected_committees = [ selected_committees = [
committee # type: Tuple[List[ValidatorIndex], ShardNumber] committee # Tuple[List[ValidatorIndex], ShardNumber]
for committee in crosslink_committees for committee in crosslink_committees
if validator_index in committee[0] if validator_index in committee[0]
] ]
if len(selected_committees) > 0: if len(selected_committees) > 0:
assignment = selected_committees[0] assignment = selected_committees[0]
assignment += (slot,) assignment += (slot,)
first_committee_at_slot = crosslink_committees[0] first_committee_at_slot = crosslink_committees[0][0] # List[ValidatorIndex]
is_proposer = first_committee_at_slot[slot % len(first_committee_at_slot)] == validator_index is_proposer = first_committee_at_slot[slot % len(first_committee_at_slot)] == validator_index
assignment += (is_proposer,) assignment += (is_proposer,)