1
- #![ cfg( all( test, feature = "std " ) ) ]
1
+ #![ cfg( all( test, feature = "time " ) ) ]
2
2
3
3
mod common;
4
4
@@ -12,13 +12,18 @@ use lightning_liquidity::lsps1::client::LSPS1ClientConfig;
12
12
use lightning_liquidity:: lsps1:: service:: LSPS1ServiceConfig ;
13
13
use lightning_liquidity:: lsps2:: client:: LSPS2ClientConfig ;
14
14
use lightning_liquidity:: lsps2:: service:: LSPS2ServiceConfig ;
15
+ use lightning_liquidity:: lsps5:: client:: LSPS5ClientConfig ;
16
+ use lightning_liquidity:: lsps5:: service:: { DefaultTimeProvider , LSPS5ServiceConfig } ;
15
17
use lightning_liquidity:: { LiquidityClientConfig , LiquidityServiceConfig } ;
16
18
17
19
use lightning:: ln:: functional_test_utils:: {
18
20
create_chanmon_cfgs, create_network, create_node_cfgs, create_node_chanmgrs,
19
21
} ;
20
22
use lightning:: ln:: peer_handler:: CustomMessageHandler ;
21
23
24
+ use std:: sync:: Arc ;
25
+ use std:: time:: Duration ;
26
+
22
27
#[ test]
23
28
fn list_protocols_integration_test ( ) {
24
29
let chanmon_cfgs = create_chanmon_cfgs ( 2 ) ;
@@ -30,29 +35,40 @@ fn list_protocols_integration_test() {
30
35
let lsps2_service_config = LSPS2ServiceConfig { promise_secret } ;
31
36
#[ cfg( lsps1_service) ]
32
37
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
+ } ;
33
42
let service_config = LiquidityServiceConfig {
34
43
#[ cfg( lsps1_service) ]
35
44
lsps1_service_config : Some ( lsps1_service_config) ,
36
45
lsps2_service_config : Some ( lsps2_service_config) ,
46
+ lsps5_service_config : Some ( lsps5_service_config) ,
37
47
advertise_service : true ,
38
48
} ;
39
49
40
50
let lsps2_client_config = LSPS2ClientConfig :: default ( ) ;
41
51
#[ cfg( lsps1_service) ]
42
52
let lsps1_client_config: LSPS1ClientConfig = LSPS1ClientConfig { max_channel_fees_msat : None } ;
53
+ let lsps5_client_config = LSPS5ClientConfig :: default ( ) ;
43
54
let client_config = LiquidityClientConfig {
44
55
#[ cfg( lsps1_service) ]
45
56
lsps1_client_config : Some ( lsps1_client_config) ,
46
57
#[ cfg( not( lsps1_service) ) ]
47
58
lsps1_client_config : None ,
48
59
lsps2_client_config : Some ( lsps2_client_config) ,
60
+ lsps5_client_config : Some ( lsps5_client_config) ,
49
61
} ;
50
62
51
63
let service_node_id = nodes[ 0 ] . node . get_our_node_id ( ) ;
52
64
let client_node_id = nodes[ 1 ] . node . get_our_node_id ( ) ;
53
65
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
+ ) ;
56
72
57
73
let client_handler = client_node. liquidity_manager . lsps0_client_handler ( ) ;
58
74
@@ -82,11 +98,12 @@ fn list_protocols_integration_test() {
82
98
{
83
99
assert ! ( protocols. contains( & 1 ) ) ;
84
100
assert ! ( protocols. contains( & 2 ) ) ;
85
- assert_eq ! ( protocols. len( ) , 2 ) ;
101
+ assert ! ( protocols. contains( & 5 ) ) ;
102
+ assert_eq ! ( protocols. len( ) , 3 ) ;
86
103
}
87
104
88
105
#[ cfg( not( lsps1_service) ) ]
89
- assert_eq ! ( protocols, vec![ 2 ] ) ;
106
+ assert_eq ! ( protocols, vec![ 2 , 5 ] ) ;
90
107
} ,
91
108
_ => panic ! ( "Unexpected event" ) ,
92
109
}
0 commit comments