1//! Test-only mocking code for [`SyncStatus`].
23// This code is currently unused with some feature combinations.
4#![allow(dead_code)]
56use crate::components::sync::RecentSyncLengths;
78use super::SyncStatus;
910// TODO: move these methods to RecentSyncLengths
11impl SyncStatus {
12/// Feed the given [`RecentSyncLengths`] it order to make the matching
13 /// [`SyncStatus`] report that it's close to the tip.
14pub(crate) fn sync_close_to_tip(recent_syncs: &mut RecentSyncLengths) {
15for _ in 0..RecentSyncLengths::MAX_RECENT_LENGTHS {
16 recent_syncs.push_extend_tips_length(1);
17 }
18 }
1920/// Feed the given [`RecentSyncLengths`] it order to make the matching
21 /// [`SyncStatus`] report that it's not close to the tip.
22pub(crate) fn sync_far_from_tip(recent_syncs: &mut RecentSyncLengths) {
23for _ in 0..RecentSyncLengths::MAX_RECENT_LENGTHS {
24 recent_syncs.push_extend_tips_length(Self::MIN_DIST_FROM_TIP * 10);
25 }
26 }
27}