mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 12:47:05 +00:00
resolve merge conflicts
This commit is contained in:
@@ -3570,44 +3570,48 @@ impl ApiTester {
|
||||
}
|
||||
|
||||
#[allow(clippy::await_holding_lock)] // This is a test, so it should be fine.
|
||||
pub async fn test_get_validator_aggregate_attestation(self) -> Self {
|
||||
if self
|
||||
pub async fn test_get_validator_aggregate_attestation_v1(self) -> Self {
|
||||
let attestation = self
|
||||
.chain
|
||||
.spec
|
||||
.fork_name_at_slot::<E>(self.chain.slot().unwrap())
|
||||
.electra_enabled()
|
||||
{
|
||||
for attestation in self.chain.naive_aggregation_pool.read().iter() {
|
||||
let result = self
|
||||
.client
|
||||
.get_validator_aggregate_attestation_v2(
|
||||
attestation.data().slot,
|
||||
attestation.data().tree_hash_root(),
|
||||
attestation.committee_index().expect("committee index"),
|
||||
)
|
||||
.await
|
||||
.unwrap()
|
||||
.unwrap()
|
||||
.data;
|
||||
let expected = attestation;
|
||||
.head_beacon_block()
|
||||
.message()
|
||||
.body()
|
||||
.attestations()
|
||||
.next()
|
||||
.unwrap()
|
||||
.clone_as_attestation();
|
||||
let result = self
|
||||
.client
|
||||
.get_validator_aggregate_attestation_v1(
|
||||
attestation.data().slot,
|
||||
attestation.data().tree_hash_root(),
|
||||
)
|
||||
.await
|
||||
.unwrap()
|
||||
.unwrap()
|
||||
.data;
|
||||
let expected = attestation;
|
||||
|
||||
assert_eq!(&result, expected);
|
||||
}
|
||||
} else {
|
||||
let attestation = self
|
||||
.chain
|
||||
.head_beacon_block()
|
||||
.message()
|
||||
.body()
|
||||
.attestations()
|
||||
.next()
|
||||
.unwrap()
|
||||
.clone_as_attestation();
|
||||
assert_eq!(result, expected);
|
||||
|
||||
self
|
||||
}
|
||||
|
||||
pub async fn test_get_validator_aggregate_attestation_v2(self) -> Self {
|
||||
let attestations = self
|
||||
.chain
|
||||
.naive_aggregation_pool
|
||||
.read()
|
||||
.iter()
|
||||
.cloned()
|
||||
.collect::<Vec<_>>();
|
||||
for attestation in attestations {
|
||||
let result = self
|
||||
.client
|
||||
.get_validator_aggregate_attestation_v1(
|
||||
.get_validator_aggregate_attestation_v2(
|
||||
attestation.data().slot,
|
||||
attestation.data().tree_hash_root(),
|
||||
attestation.committee_index().expect("committee index"),
|
||||
)
|
||||
.await
|
||||
.unwrap()
|
||||
@@ -3617,7 +3621,6 @@ impl ApiTester {
|
||||
|
||||
assert_eq!(result, expected);
|
||||
}
|
||||
|
||||
self
|
||||
}
|
||||
|
||||
@@ -6805,19 +6808,36 @@ async fn get_validator_attestation_data_with_skip_slots() {
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
async fn get_validator_aggregate_attestation() {
|
||||
async fn get_validator_aggregate_attestation_v1() {
|
||||
ApiTester::new()
|
||||
.await
|
||||
.test_get_validator_aggregate_attestation()
|
||||
.test_get_validator_aggregate_attestation_v1()
|
||||
.await;
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
async fn get_validator_aggregate_attestation_with_skip_slots() {
|
||||
async fn get_validator_aggregate_attestation_v2() {
|
||||
ApiTester::new()
|
||||
.await
|
||||
.test_get_validator_aggregate_attestation_v2()
|
||||
.await;
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
async fn get_validator_aggregate_attestation_with_skip_slots_v1() {
|
||||
ApiTester::new()
|
||||
.await
|
||||
.skip_slots(E::slots_per_epoch() * 2)
|
||||
.test_get_validator_aggregate_attestation()
|
||||
.test_get_validator_aggregate_attestation_v1()
|
||||
.await;
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
async fn get_validator_aggregate_attestation_with_skip_slots_v2() {
|
||||
ApiTester::new()
|
||||
.await
|
||||
.skip_slots(E::slots_per_epoch() * 2)
|
||||
.test_get_validator_aggregate_attestation_v2()
|
||||
.await;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user