1- #![ cfg( all( test, feature = "std " ) ) ]
1+ #![ cfg( all( test, feature = "time " ) ) ]
22
33mod common;
44
@@ -12,13 +12,18 @@ use lightning_liquidity::lsps1::client::LSPS1ClientConfig;
1212use lightning_liquidity:: lsps1:: service:: LSPS1ServiceConfig ;
1313use lightning_liquidity:: lsps2:: client:: LSPS2ClientConfig ;
1414use lightning_liquidity:: lsps2:: service:: LSPS2ServiceConfig ;
15+ use lightning_liquidity:: lsps5:: client:: LSPS5ClientConfig ;
16+ use lightning_liquidity:: lsps5:: service:: { DefaultTimeProvider , LSPS5ServiceConfig } ;
1517use lightning_liquidity:: { LiquidityClientConfig , LiquidityServiceConfig } ;
1618
1719use lightning:: ln:: functional_test_utils:: {
1820 create_chanmon_cfgs, create_network, create_node_cfgs, create_node_chanmgrs,
1921} ;
2022use lightning:: ln:: peer_handler:: CustomMessageHandler ;
2123
24+ use std:: sync:: Arc ;
25+ use std:: time:: Duration ;
26+
2227#[ test]
2328fn list_protocols_integration_test ( ) {
2429 let chanmon_cfgs = create_chanmon_cfgs ( 2 ) ;
@@ -30,29 +35,40 @@ fn list_protocols_integration_test() {
3035 let lsps2_service_config = LSPS2ServiceConfig { promise_secret } ;
3136 #[ cfg( lsps1_service) ]
3237 let lsps1_service_config = LSPS1ServiceConfig { supported_options : None , token : None } ;
38+ let lsps5_service_config = LSPS5ServiceConfig {
39+ max_webhooks_per_client : 10 ,
40+ notification_cooldown_hours : Duration :: from_secs ( 3600 ) ,
41+ } ;
3342 let service_config = LiquidityServiceConfig {
3443 #[ cfg( lsps1_service) ]
3544 lsps1_service_config : Some ( lsps1_service_config) ,
3645 lsps2_service_config : Some ( lsps2_service_config) ,
46+ lsps5_service_config : Some ( lsps5_service_config) ,
3747 advertise_service : true ,
3848 } ;
3949
4050 let lsps2_client_config = LSPS2ClientConfig :: default ( ) ;
4151 #[ cfg( lsps1_service) ]
4252 let lsps1_client_config: LSPS1ClientConfig = LSPS1ClientConfig { max_channel_fees_msat : None } ;
53+ let lsps5_client_config = LSPS5ClientConfig :: default ( ) ;
4354 let client_config = LiquidityClientConfig {
4455 #[ cfg( lsps1_service) ]
4556 lsps1_client_config : Some ( lsps1_client_config) ,
4657 #[ cfg( not( lsps1_service) ) ]
4758 lsps1_client_config : None ,
4859 lsps2_client_config : Some ( lsps2_client_config) ,
60+ lsps5_client_config : Some ( lsps5_client_config) ,
4961 } ;
5062
5163 let service_node_id = nodes[ 0 ] . node . get_our_node_id ( ) ;
5264 let client_node_id = nodes[ 1 ] . node . get_our_node_id ( ) ;
5365
54- let LSPSNodes { service_node, client_node } =
55- create_service_and_client_nodes ( nodes, service_config, client_config) ;
66+ let LSPSNodes { service_node, client_node } = create_service_and_client_nodes (
67+ nodes,
68+ service_config,
69+ client_config,
70+ Arc :: new ( DefaultTimeProvider ) ,
71+ ) ;
5672
5773 let client_handler = client_node. liquidity_manager . lsps0_client_handler ( ) ;
5874
@@ -82,11 +98,12 @@ fn list_protocols_integration_test() {
8298 {
8399 assert ! ( protocols. contains( & 1 ) ) ;
84100 assert ! ( protocols. contains( & 2 ) ) ;
85- assert_eq ! ( protocols. len( ) , 2 ) ;
101+ assert ! ( protocols. contains( & 5 ) ) ;
102+ assert_eq ! ( protocols. len( ) , 3 ) ;
86103 }
87104
88105 #[ cfg( not( lsps1_service) ) ]
89- assert_eq ! ( protocols, vec![ 2 ] ) ;
106+ assert_eq ! ( protocols, vec![ 2 , 5 ] ) ;
90107 } ,
91108 _ => panic ! ( "Unexpected event" ) ,
92109 }
0 commit comments