PR feedback from Terence and Danny: refactor `get_committee_count_delta`
This commit is contained in:
parent
30f72dd696
commit
5f10ac13bf
|
@ -558,13 +558,9 @@ def get_indexed_attestation(beacon_state: BeaconState, attestation: Attestation)
|
||||||
```python
|
```python
|
||||||
def get_committee_count_delta(state: BeaconState, start_slot: Slot, stop_slot: Slot) -> uint64:
|
def get_committee_count_delta(state: BeaconState, start_slot: Slot, stop_slot: Slot) -> uint64:
|
||||||
"""
|
"""
|
||||||
Return the sum of committee counts between ``[start_slot, stop_slot)``.
|
Return the sum of committee counts in range ``[start_slot, stop_slot)``.
|
||||||
"""
|
"""
|
||||||
committee_sum = 0
|
return sum(get_committee_count_at_slot(state, Slot(slot)) for slot in range(start_slot, stop_slot))
|
||||||
for slot in range(start_slot, stop_slot):
|
|
||||||
count = get_committee_count_at_slot(state, Slot(slot))
|
|
||||||
committee_sum += count
|
|
||||||
return committee_sum
|
|
||||||
```
|
```
|
||||||
|
|
||||||
#### `get_start_shard`
|
#### `get_start_shard`
|
||||||
|
|
Loading…
Reference in New Issue