Merge pull request #2359 from ericsson49/ericsson49/fix_pass_set_instead_of_sequence_to_get_total_balance

Fix: pass Set instead of Sequence to get_total_balance
This commit is contained in:
Diederik Loerakker 2021-04-26 20:31:15 +02:00 committed by GitHub
commit ac98da6c7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -539,7 +539,7 @@ def update_pending_votes(state: BeaconState, attestation: Attestation) -> None:
participants = get_attesting_indices(state, attestation.data, pending_header.votes)
participants_balance = get_total_balance(state, participants)
full_committee = get_beacon_committee(state, attestation.data.slot, attestation.data.index)
full_committee_balance = get_total_balance(state, full_committee)
full_committee_balance = get_total_balance(state, set(full_committee))
if participants_balance * 3 >= full_committee_balance * 2:
pending_header.confirmed = True
```
@ -685,7 +685,7 @@ def process_pending_headers(state: BeaconState) -> None:
full_committee = get_beacon_committee(state, slot, shard)
# The set of voters who voted for each header (and their total balances)
voting_sets = [
[v for i, v in enumerate(full_committee) if c.votes[i]]
set(v for i, v in enumerate(full_committee) if c.votes[i])
for c in candidates
]
voting_balances = [