Fixes typo in `sorted` function.

In keeping with the rest of the code in this document we adhere to valid Python
where possible.

The custom comparator keyword argument for `sorted` is `key` so this commit
updates its usage when sorting validators by exit order.
This commit is contained in:
Alex Stokes 2019-01-06 17:41:11 -06:00
parent c63803a4ec
commit c69fa9a793
No known key found for this signature in database
GPG Key ID: 51CE1721B245C086
1 changed files with 1 additions and 1 deletions

View File

@ -1729,7 +1729,7 @@ def process_penalties_and_exits(state: BeaconState) -> None:
all_indices = list(range(len(state.validator_registry)))
eligible_indices = filter(eligible, all_indices)
sorted_indices = sorted(eligible_indices, filter=lambda index: state.validator_registry[index].exit_count)
sorted_indices = sorted(eligible_indices, key=lambda index: state.validator_registry[index].exit_count)
withdrawn_so_far = 0
for index in sorted_indices:
validator = state.validator_registry[index]