make tests work for all forks

This commit is contained in:
realbigsean
2023-05-02 10:00:07 -04:00
parent 93bcd6281c
commit 8edefb7e0d
7 changed files with 847 additions and 677 deletions

View File

@@ -3,7 +3,10 @@
//! determines whether attestations should be aggregated and/or passed to the beacon node.
use super::SubnetServiceMessage;
#[cfg(any(test, feature = "deterministic_long_lived_attnets"))]
#[cfg(any(
all(test, feature = "spec-mainnet"),
feature = "deterministic_long_lived_attnets"
))]
use std::collections::HashSet;
use std::collections::{HashMap, VecDeque};
use std::pin::Pin;
@@ -201,7 +204,7 @@ impl<T: BeaconChainTypes> AttestationService<T> {
}
/// Return count of all currently subscribed subnets (long-lived **and** short-lived).
#[cfg(test)]
#[cfg(all(test, feature = "spec-mainnet"))]
pub fn subscription_count(&self) -> usize {
if self.subscribe_all_subnets {
self.beacon_chain.spec.attestation_subnet_count as usize
@@ -225,7 +228,7 @@ impl<T: BeaconChainTypes> AttestationService<T> {
}
/// Returns whether we are subscribed to a subnet for testing purposes.
#[cfg(test)]
#[cfg(all(test, feature = "spec-mainnet"))]
pub(crate) fn is_subscribed(
&self,
subnet_id: &SubnetId,

View File

@@ -87,7 +87,7 @@ impl<T: BeaconChainTypes> SyncCommitteeService<T> {
}
/// Return count of all currently subscribed subnets.
#[cfg(test)]
#[cfg(all(test, feature = "spec-mainnet"))]
pub fn subscription_count(&self) -> usize {
use types::consts::altair::SYNC_COMMITTEE_SUBNET_COUNT;
if self.subscribe_all_subnets {

View File

@@ -1,3 +1,4 @@
#![cfg(feature = "spec-mainnet")]
use super::*;
use beacon_chain::{
builder::{BeaconChainBuilder, Witness},

File diff suppressed because it is too large Load Diff