make Bit check not use "is", and remove duplicate line

This commit is contained in:
protolambda 2019-06-20 23:02:22 +02:00
parent c20372409c
commit 3d8466fd6e
No known key found for this signature in database
GPG Key ID: EC89FDBB2B4C7623
2 changed files with 2 additions and 3 deletions

View File

@ -645,7 +645,7 @@ def is_slashable_validator(validator: Validator, epoch: Epoch) -> bool:
"""
Check if ``validator`` is slashable.
"""
return validator.slashed is False and (validator.activation_epoch <= epoch < validator.withdrawable_epoch)
return (not validator.slashed) and (validator.activation_epoch <= epoch < validator.withdrawable_epoch)
```
### `get_active_validator_indices`

View File

@ -402,12 +402,11 @@ def process_early_derived_secret_reveal(state: BeaconState,
"""
revealed_validator = state.validators[reveal.revealed_index]
masker = state.validators[reveal.masker_index]
derived_secret_location = reveal.epoch % EARLY_DERIVED_SECRET_PENALTY_MAX_FUTURE_EPOCHS
assert reveal.epoch >= get_current_epoch(state) + RANDAO_PENALTY_EPOCHS
assert reveal.epoch < get_current_epoch(state) + EARLY_DERIVED_SECRET_PENALTY_MAX_FUTURE_EPOCHS
assert revealed_validator.slashed is False
assert not revealed_validator.slashed
assert reveal.revealed_index not in state.exposed_derived_secrets[derived_secret_location]
# Verify signature correctness