Diff reduction

This commit is contained in:
dapplion
2024-06-18 19:38:35 +02:00
parent d26473621a
commit 7521f97ca5

View File

@@ -1308,9 +1308,10 @@ async fn verify_block_for_gossip_doppelganger_detection() {
} }
}; };
match indexed_attestation { for index in match indexed_attestation {
IndexedAttestation::Base(indexed_attestation) => { IndexedAttestation::Base(att) => att.attesting_indices.into_iter(),
for &index in &indexed_attestation.attesting_indices { IndexedAttestation::Electra(att) => att.attesting_indices.into_iter(),
} {
let index = index as usize; let index = index as usize;
assert!(harness.chain.validator_seen_at_epoch(index, epoch)); assert!(harness.chain.validator_seen_at_epoch(index, epoch));
@@ -1336,35 +1337,6 @@ async fn verify_block_for_gossip_doppelganger_detection() {
.expect("should check if gossip aggregator was observed")); .expect("should check if gossip aggregator was observed"));
} }
} }
IndexedAttestation::Electra(indexed_attestation) => {
for &index in &indexed_attestation.attesting_indices {
let index = index as usize;
assert!(harness.chain.validator_seen_at_epoch(index, epoch));
// Check the correct beacon cache is populated
assert!(harness
.chain
.observed_block_attesters
.read()
.validator_has_been_observed(epoch, index)
.expect("should check if block attester was observed"));
assert!(!harness
.chain
.observed_gossip_attesters
.read()
.validator_has_been_observed(epoch, index)
.expect("should check if gossip attester was observed"));
assert!(!harness
.chain
.observed_aggregators
.read()
.validator_has_been_observed(epoch, index)
.expect("should check if gossip aggregator was observed"));
}
}
};
}
} }
#[tokio::test] #[tokio::test]