@@ -239,7 +239,8 @@ impl<
239239 G ,
240240 & ' a ( dyn UtxoLookup + Send + Sync ) ,
241241 L ,
242- > where
242+ >
243+ where
243244 L :: Target : Logger ,
244245{
245246 /// Initializes a new [`GossipSync::Rapid`] variant.
@@ -256,7 +257,8 @@ impl<'a, L: Deref>
256257 & ' a NetworkGraph < L > ,
257258 & ' a ( dyn UtxoLookup + Send + Sync ) ,
258259 L ,
259- > where
260+ >
261+ where
260262 L :: Target : Logger ,
261263{
262264 /// Initializes a new [`GossipSync::None`] variant.
@@ -1162,7 +1164,7 @@ impl Drop for BackgroundProcessor {
11621164 }
11631165}
11641166
1165- #[ cfg( all( feature = "std" , test) ) ]
1167+ #[ cfg( all( feature = "std" , feature = "time" , test) ) ]
11661168mod tests {
11671169 use super :: { BackgroundProcessor , GossipSync , FRESHNESS_TIMER } ;
11681170 use bitcoin:: constants:: { genesis_block, ChainHash } ;
@@ -1207,7 +1209,8 @@ mod tests {
12071209 use lightning:: util:: sweep:: { OutputSpendStatus , OutputSweeperSync , PRUNE_DELAY_BLOCKS } ;
12081210 use lightning:: util:: test_utils;
12091211 use lightning:: { get_event, get_event_msg} ;
1210- use lightning_liquidity:: lsps5:: service:: TimeProvider ;
1212+ #[ cfg( feature = "time" ) ]
1213+ use lightning_liquidity:: lsps5:: service:: DefaultTimeProvider ;
12111214 use lightning_liquidity:: LiquidityManager ;
12121215 use lightning_persister:: fs_store:: FilesystemStore ;
12131216 use lightning_rapid_gossip_sync:: RapidGossipSync ;
@@ -1650,16 +1653,6 @@ mod tests {
16501653 path. to_str ( ) . unwrap ( ) . to_string ( )
16511654 }
16521655
1653- pub struct DefaultTimeProvider ;
1654-
1655- #[ cfg( feature = "std" ) ]
1656- impl TimeProvider for DefaultTimeProvider {
1657- fn duration_since_epoch ( & self ) -> Duration {
1658- use std:: time:: { SystemTime , UNIX_EPOCH } ;
1659- SystemTime :: now ( ) . duration_since ( UNIX_EPOCH ) . expect ( "system time before Unix epoch" )
1660- }
1661- }
1662-
16631656 fn create_nodes ( num_nodes : usize , persist_dir : & str ) -> ( String , Vec < Node > ) {
16641657 let persist_temp_path = env:: temp_dir ( ) . join ( persist_dir) ;
16651658 let persist_dir = persist_temp_path. to_string_lossy ( ) . to_string ( ) ;
@@ -1761,15 +1754,13 @@ mod tests {
17611754 Arc :: clone ( & logger) ,
17621755 Arc :: clone ( & keys_manager) ,
17631756 ) ) ;
1764- let time_provider = Arc :: new ( DefaultTimeProvider ) ;
1765- let liquidity_manager = Arc :: new ( LiquidityManager :: new_with_custom_time_provider (
1757+ let liquidity_manager = Arc :: new ( LiquidityManager :: new (
17661758 Arc :: clone ( & keys_manager) ,
17671759 Arc :: clone ( & manager) ,
17681760 None ,
17691761 None ,
17701762 None ,
17711763 None ,
1772- time_provider,
17731764 ) ) ;
17741765 let node = Node {
17751766 node : manager,
0 commit comments