mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-02-26 09:15:17 +00:00
Fix is_double_vote
and is_surround_vote
This commit is contained in:
parent
c13c4c5c7b
commit
59d7be60db
@ -1099,9 +1099,7 @@ def is_double_vote(attestation_data_1: AttestationData,
|
|||||||
"""
|
"""
|
||||||
Check if ``attestation_data_1`` and ``attestation_data_2`` have the same target.
|
Check if ``attestation_data_1`` and ``attestation_data_2`` have the same target.
|
||||||
"""
|
"""
|
||||||
target_epoch_1 = slot_to_epoch(attestation_data_1.slot)
|
return attestation_data_1.epoch == attestation_data_2.epoch
|
||||||
target_epoch_2 = slot_to_epoch(attestation_data_2.slot)
|
|
||||||
return target_epoch_1 == target_epoch_2
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### `is_surround_vote`
|
### `is_surround_vote`
|
||||||
@ -1114,10 +1112,7 @@ def is_surround_vote(attestation_data_1: AttestationData,
|
|||||||
"""
|
"""
|
||||||
source_epoch_1 = attestation_data_1.source_epoch
|
source_epoch_1 = attestation_data_1.source_epoch
|
||||||
source_epoch_2 = attestation_data_2.source_epoch
|
source_epoch_2 = attestation_data_2.source_epoch
|
||||||
target_epoch_1 = slot_to_epoch(attestation_data_1.slot)
|
return source_epoch_1 < source_epoch_2 and attestation_data_2.epoch < attestation_data_1.epoch
|
||||||
target_epoch_2 = slot_to_epoch(attestation_data_2.slot)
|
|
||||||
|
|
||||||
return source_epoch_1 < source_epoch_2 and target_epoch_2 < target_epoch_1
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### `integer_squareroot`
|
### `integer_squareroot`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user