Apply suggestions from Terence

Co-authored-by: terence tsao <terence@prysmaticlabs.com>
This commit is contained in:
Hsiao-Wei Wang 2020-06-01 17:56:22 +08:00 committed by GitHub
parent 2dc041807a
commit 92db6da508
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -578,7 +578,7 @@ def get_start_shard(state: BeaconState, slot: Slot) -> Shard:
```python ```python
def get_shard(state: BeaconState, attestation: Attestation) -> Shard: def get_shard(state: BeaconState, attestation: Attestation) -> Shard:
""" """
Return the shard that the given attestation is attesting. Return the shard that the given ``attestation`` is attesting.
""" """
return compute_shard_from_committee_index(state, attestation.data.index, attestation.data.slot) return compute_shard_from_committee_index(state, attestation.data.index, attestation.data.slot)
``` ```
@ -588,7 +588,7 @@ def get_shard(state: BeaconState, attestation: Attestation) -> Shard:
```python ```python
def get_latest_slot_for_shard(state: BeaconState, shard: Shard) -> Slot: def get_latest_slot_for_shard(state: BeaconState, shard: Shard) -> Slot:
""" """
Return the latest slot number of the given shard. Return the latest slot number of the given ``shard``.
""" """
return state.shard_states[shard].slot return state.shard_states[shard].slot
``` ```
@ -598,7 +598,7 @@ def get_latest_slot_for_shard(state: BeaconState, shard: Shard) -> Slot:
```python ```python
def get_offset_slots(state: BeaconState, shard: Shard) -> Sequence[Slot]: def get_offset_slots(state: BeaconState, shard: Shard) -> Sequence[Slot]:
""" """
Return the offset slots of the given shard. Return the offset slots of the given ``shard``.
The offset slot are after the latest slot and before current slot. The offset slot are after the latest slot and before current slot.
""" """
return compute_offset_slots(get_latest_slot_for_shard(state, shard), state.slot) return compute_offset_slots(get_latest_slot_for_shard(state, shard), state.slot)