mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-18 05:18:30 +00:00
Fix slasher tests (#5906)
* Fix electra tests * Add electra attestations to double vote tests
This commit is contained in:
@@ -63,7 +63,6 @@ pub fn att_slashing(
|
||||
attestation_1: &IndexedAttestation<E>,
|
||||
attestation_2: &IndexedAttestation<E>,
|
||||
) -> AttesterSlashing<E> {
|
||||
// TODO(electra): fix this one we superstruct IndexedAttestation (return the correct type)
|
||||
match (attestation_1, attestation_2) {
|
||||
(IndexedAttestation::Base(att1), IndexedAttestation::Base(att2)) => {
|
||||
AttesterSlashing::Base(AttesterSlashingBase {
|
||||
@@ -71,13 +70,11 @@ pub fn att_slashing(
|
||||
attestation_2: att2.clone(),
|
||||
})
|
||||
}
|
||||
(IndexedAttestation::Electra(att1), IndexedAttestation::Electra(att2)) => {
|
||||
AttesterSlashing::Electra(AttesterSlashingElectra {
|
||||
attestation_1: att1.clone(),
|
||||
attestation_2: att2.clone(),
|
||||
})
|
||||
}
|
||||
_ => panic!("attestations must be of the same type"),
|
||||
// A slashing involving an electra attestation type must return an electra AttesterSlashing type
|
||||
(_, _) => AttesterSlashing::Electra(AttesterSlashingElectra {
|
||||
attestation_1: attestation_1.clone().to_electra().unwrap(),
|
||||
attestation_2: attestation_2.clone().to_electra().unwrap(),
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user