mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-11 18:04:18 +00:00
Add test for ActiveSamplingRequest (#6307)
* Add test for ActiveSamplingRequest * Fix the column_indexes field from the requested ones to the responded ones * Fix clippy errors * Move tests to tests.rs * Fix unused import * Fix clippy error * Merge branch 'unstable' into fork/add-test-for-active-sampling-request # Conflicts: # beacon_node/network/Cargo.toml # beacon_node/network/src/sync/sampling.rs * Merge branch 'unstable' into fork/add-test-for-active-sampling-request
This commit is contained in:
@@ -71,6 +71,9 @@ use std::time::Duration;
|
||||
use tokio::sync::mpsc;
|
||||
use types::{BlobSidecar, DataColumnSidecar, EthSpec, Hash256, SignedBeaconBlock, Slot};
|
||||
|
||||
#[cfg(test)]
|
||||
use types::ColumnIndex;
|
||||
|
||||
/// The number of slots ahead of us that is allowed before requesting a long-range (batch) Sync
|
||||
/// from a peer. If a peer is within this tolerance (forwards or backwards), it is treated as a
|
||||
/// fully sync'd peer.
|
||||
@@ -334,6 +337,17 @@ impl<T: BeaconChainTypes> SyncManager<T> {
|
||||
self.sampling.active_sampling_requests()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) fn assert_sampling_request_status(
|
||||
&self,
|
||||
block_root: Hash256,
|
||||
ongoing: &Vec<ColumnIndex>,
|
||||
no_peers: &Vec<ColumnIndex>,
|
||||
) {
|
||||
self.sampling
|
||||
.assert_sampling_request_status(block_root, ongoing, no_peers);
|
||||
}
|
||||
|
||||
fn network_globals(&self) -> &NetworkGlobals<T::EthSpec> {
|
||||
self.network.network_globals()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user