This commit is contained in:
Danny Ryan 2019-12-12 06:57:11 -07:00
parent 86fb3acd59
commit 199933cb26
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A
1 changed files with 12 additions and 11 deletions

View File

@ -61,6 +61,8 @@
- [`bls_aggregate_pubkeys`](#bls_aggregate_pubkeys)
- [Predicates](#predicates)
- [`is_active_validator`](#is_active_validator)
- [`is_eligible_for_activation_queue`](#is_eligible_for_activation_queue)
- [`is_eligible_for_activation`](#is_eligible_for_activation)
- [`is_slashable_validator`](#is_slashable_validator)
- [`is_slashable_attestation_data`](#is_slashable_attestation_data)
- [`is_valid_indexed_attestation`](#is_valid_indexed_attestation)
@ -591,16 +593,6 @@ def is_active_validator(validator: Validator, epoch: Epoch) -> bool:
return validator.activation_epoch <= epoch < validator.exit_epoch
```
#### `is_slashable_validator`
```python
def is_slashable_validator(validator: Validator, epoch: Epoch) -> bool:
"""
Check if ``validator`` is slashable.
"""
return (not validator.slashed) and (validator.activation_epoch <= epoch < validator.withdrawable_epoch)
```
#### `is_eligible_for_activation_queue`
```python
@ -614,7 +606,6 @@ def is_eligible_for_activation_queue(validator: Validator) -> bool:
)
```
#### `is_eligible_for_activation`
```python
@ -630,6 +621,16 @@ def is_eligible_for_activation(state: BeaconState, validator: Validator) -> bool
)
```
#### `is_slashable_validator`
```python
def is_slashable_validator(validator: Validator, epoch: Epoch) -> bool:
"""
Check if ``validator`` is slashable.
"""
return (not validator.slashed) and (validator.activation_epoch <= epoch < validator.withdrawable_epoch)
```
#### `is_slashable_attestation_data`
```python