Merge pull request #879 from terenc3t/patch-58

Add comment for get_crosslink_committee_for_attestation
This commit is contained in:
Danny Ryan 2019-04-05 02:22:34 -06:00 committed by GitHub
commit 690e4faff7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -1041,9 +1041,12 @@ def verify_merkle_branch(leaf: Bytes32, proof: List[Bytes32], depth: int, index:
```python ```python
def get_crosslink_committee_for_attestation(state: BeaconState, def get_crosslink_committee_for_attestation(state: BeaconState,
attestation_data: AttestationData) -> List[ValidatorIndex]: attestation_data: AttestationData) -> List[ValidatorIndex]:
# Find the committee in the list with the desired shard """
Return the crosslink committee corresponding to ``attestation_data``.
"""
crosslink_committees = get_crosslink_committees_at_slot(state, attestation_data.slot) crosslink_committees = get_crosslink_committees_at_slot(state, attestation_data.slot)
# Find the committee in the list with the desired shard
assert attestation_data.shard in [shard for _, shard in crosslink_committees] assert attestation_data.shard in [shard for _, shard in crosslink_committees]
crosslink_committee = [committee for committee, shard in crosslink_committees if shard == attestation_data.shard][0] crosslink_committee = [committee for committee, shard in crosslink_committees if shard == attestation_data.shard][0]