@@ -1162,7 +1162,7 @@ impl Drop for BackgroundProcessor {
1162
1162
}
1163
1163
}
1164
1164
1165
- #[ cfg( all( feature = "std" , test) ) ]
1165
+ #[ cfg( all( feature = "std" , feature = "time" , test) ) ]
1166
1166
mod tests {
1167
1167
use super :: { BackgroundProcessor , GossipSync , FRESHNESS_TIMER } ;
1168
1168
use bitcoin:: constants:: { genesis_block, ChainHash } ;
@@ -1207,7 +1207,8 @@ mod tests {
1207
1207
use lightning:: util:: sweep:: { OutputSpendStatus , OutputSweeperSync , PRUNE_DELAY_BLOCKS } ;
1208
1208
use lightning:: util:: test_utils;
1209
1209
use lightning:: { get_event, get_event_msg} ;
1210
- use lightning_liquidity:: lsps5:: service:: TimeProvider ;
1210
+ #[ cfg( feature = "time" ) ]
1211
+ use lightning_liquidity:: lsps5:: service:: DefaultTimeProvider ;
1211
1212
use lightning_liquidity:: LiquidityManager ;
1212
1213
use lightning_persister:: fs_store:: FilesystemStore ;
1213
1214
use lightning_rapid_gossip_sync:: RapidGossipSync ;
@@ -1650,16 +1651,6 @@ mod tests {
1650
1651
path. to_str ( ) . unwrap ( ) . to_string ( )
1651
1652
}
1652
1653
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
-
1663
1654
fn create_nodes ( num_nodes : usize , persist_dir : & str ) -> ( String , Vec < Node > ) {
1664
1655
let persist_temp_path = env:: temp_dir ( ) . join ( persist_dir) ;
1665
1656
let persist_dir = persist_temp_path. to_string_lossy ( ) . to_string ( ) ;
@@ -1761,15 +1752,13 @@ mod tests {
1761
1752
Arc :: clone ( & logger) ,
1762
1753
Arc :: clone ( & keys_manager) ,
1763
1754
) ) ;
1764
- let time_provider = Arc :: new ( DefaultTimeProvider ) ;
1765
- let liquidity_manager = Arc :: new ( LiquidityManager :: new_with_custom_time_provider (
1755
+ let liquidity_manager = Arc :: new ( LiquidityManager :: new (
1766
1756
Arc :: clone ( & keys_manager) ,
1767
1757
Arc :: clone ( & manager) ,
1768
1758
None ,
1769
1759
None ,
1770
1760
None ,
1771
1761
None ,
1772
- time_provider,
1773
1762
) ) ;
1774
1763
let node = Node {
1775
1764
node : manager,
0 commit comments