Make linter happy

This commit is contained in:
Hsiao-Wei Wang 2019-06-21 23:00:30 -06:00
parent 99df7da94a
commit 183fa3c776
No known key found for this signature in database
GPG Key ID: 95B070122902DEA4
2 changed files with 8 additions and 5 deletions

View File

@ -524,9 +524,11 @@ class BeaconState(Container):
# Shuffling
start_shard: Shard
randao_mixes: Vector[Hash, EPOCHS_PER_HISTORICAL_VECTOR]
active_index_roots: Vector[Hash, EPOCHS_PER_HISTORICAL_VECTOR] # Digests of the active registry, for light clients
# Digests of the active registry, for light clients
active_index_roots: Vector[Hash, EPOCHS_PER_HISTORICAL_VECTOR]
# Slashings
slashed_balances: Vector[Gwei, EPOCHS_PER_SLASHED_BALANCES_VECTOR] # Sums of the effective balances of slashed validators
# Sums of the effective balances of slashed validators
slashed_balances: Vector[Gwei, EPOCHS_PER_SLASHED_BALANCES_VECTOR]
# Attestations
previous_epoch_attestations: List[PendingAttestation]
current_epoch_attestations: List[PendingAttestation]
@ -1515,7 +1517,10 @@ def process_slashings(state: BeaconState) -> None:
total_penalties = total_at_end - total_at_start
for index, validator in enumerate(state.validators):
if validator.slashed and current_epoch == validator.withdrawable_epoch - EPOCHS_PER_SLASHED_BALANCES_VECTOR // 2:
if (
validator.slashed and
current_epoch == validator.withdrawable_epoch - EPOCHS_PER_SLASHED_BALANCES_VECTOR // 2
):
penalty = max(
validator.effective_balance * min(total_penalties * 3, total_balance) // total_balance,
validator.effective_balance // MIN_SLASHING_PENALTY_QUOTIENT

View File

@ -1,5 +1,3 @@
from typing import List
from eth2spec.utils.ssz.ssz_impl import signing_root, hash_tree_root
from eth2spec.test.context import with_all_phases, with_state, bls_switch