@@ -230,7 +230,8 @@ impl<
230
230
G ,
231
231
& ' a ( dyn UtxoLookup + Send + Sync ) ,
232
232
L ,
233
- > where
233
+ >
234
+ where
234
235
L :: Target : Logger ,
235
236
{
236
237
/// Initializes a new [`GossipSync::Rapid`] variant.
@@ -247,7 +248,8 @@ impl<'a, L: Deref>
247
248
& ' a NetworkGraph < L > ,
248
249
& ' a ( dyn UtxoLookup + Send + Sync ) ,
249
250
L ,
250
- > where
251
+ >
252
+ where
251
253
L :: Target : Logger ,
252
254
{
253
255
/// Initializes a new [`GossipSync::None`] variant.
@@ -1097,7 +1099,7 @@ impl Drop for BackgroundProcessor {
1097
1099
}
1098
1100
}
1099
1101
1100
- #[ cfg( all( feature = "std" , feature = "time" , test) ) ]
1102
+ #[ cfg( all( feature = "std" , test) ) ]
1101
1103
mod tests {
1102
1104
use super :: { BackgroundProcessor , GossipSync , FRESHNESS_TIMER } ;
1103
1105
use bitcoin:: constants:: { genesis_block, ChainHash } ;
@@ -1142,6 +1144,7 @@ mod tests {
1142
1144
use lightning:: util:: sweep:: { OutputSpendStatus , OutputSweeper , PRUNE_DELAY_BLOCKS } ;
1143
1145
use lightning:: util:: test_utils;
1144
1146
use lightning:: { get_event, get_event_msg} ;
1147
+ use lightning_liquidity:: lsps5:: service:: TimeProvider ;
1145
1148
use lightning_liquidity:: LiquidityManager ;
1146
1149
use lightning_persister:: fs_store:: FilesystemStore ;
1147
1150
use lightning_rapid_gossip_sync:: RapidGossipSync ;
@@ -1578,6 +1581,16 @@ mod tests {
1578
1581
path. to_str ( ) . unwrap ( ) . to_string ( )
1579
1582
}
1580
1583
1584
+ pub struct DefaultTimeProvider ;
1585
+
1586
+ #[ cfg( feature = "std" ) ]
1587
+ impl TimeProvider for DefaultTimeProvider {
1588
+ fn duration_since_epoch ( & self ) -> Duration {
1589
+ use std:: time:: { SystemTime , UNIX_EPOCH } ;
1590
+ SystemTime :: now ( ) . duration_since ( UNIX_EPOCH ) . expect ( "system time before Unix epoch" )
1591
+ }
1592
+ }
1593
+
1581
1594
fn create_nodes ( num_nodes : usize , persist_dir : & str ) -> ( String , Vec < Node > ) {
1582
1595
let persist_temp_path = env:: temp_dir ( ) . join ( persist_dir) ;
1583
1596
let persist_dir = persist_temp_path. to_string_lossy ( ) . to_string ( ) ;
@@ -1676,13 +1689,15 @@ mod tests {
1676
1689
logger. clone ( ) ,
1677
1690
keys_manager. clone ( ) ,
1678
1691
) ) ;
1679
- let liquidity_manager = Arc :: new ( LiquidityManager :: new (
1692
+ let time_provider = Arc :: new ( DefaultTimeProvider ) ;
1693
+ let liquidity_manager = Arc :: new ( LiquidityManager :: new_with_custom_time_provider (
1680
1694
Arc :: clone ( & keys_manager) ,
1681
1695
Arc :: clone ( & manager) ,
1682
1696
None ,
1683
1697
None ,
1684
1698
None ,
1685
1699
None ,
1700
+ time_provider,
1686
1701
) ) ;
1687
1702
let node = Node {
1688
1703
node : manager,
0 commit comments