@@ -20,6 +20,8 @@ use std::time::Duration;
2020use bitcoin:: Amount ;
2121use electrsd:: corepc_node:: Client as BitcoindClient ;
2222use electrsd:: electrum_client:: ElectrumApi ;
23+ #[ cfg( zero_fee_commitment_tests) ]
24+ use ldk_node:: ReserveType ;
2325use ldk_node:: { Event , Node } ;
2426
2527use super :: external_node:: ExternalNode ;
@@ -87,15 +89,15 @@ pub(crate) async fn wait_for_htlcs_settled(
8789 panic ! ( "HTLCs did not settle on {} channel {} within 15s" , peer. name( ) , ext_channel_id) ;
8890}
8991
90- /// Build a fresh LDK node configured for interop tests. Uses electrum at the
92+ /// Build a fresh LDK node configured for interop tests. Uses esplora at the
9193/// docker-compose default port and bumps sync timeouts for combo stress.
9294pub ( crate ) fn setup_ldk_node ( ) -> Node {
9395 let config = crate :: common:: random_config ( ) ;
9496 let mut builder = ldk_node:: Builder :: from_config ( config. node_config ) ;
95- let mut sync_config = ldk_node:: config:: ElectrumSyncConfig :: default ( ) ;
97+ let mut sync_config = ldk_node:: config:: EsploraSyncConfig :: default ( ) ;
9698 sync_config. timeouts_config . onchain_wallet_sync_timeout_secs = 180 ;
9799 sync_config. timeouts_config . lightning_wallet_sync_timeout_secs = 120 ;
98- builder. set_chain_source_electrum ( "tcp ://127.0.0.1:50001 ". to_string ( ) , Some ( sync_config) ) ;
100+ builder. set_chain_source_esplora ( "http ://127.0.0.1:3002 ". to_string ( ) , Some ( sync_config) ) ;
99101 let node = builder. build ( config. node_entropy ) . unwrap ( ) ;
100102 node. start ( ) . unwrap ( ) ;
101103 node
@@ -164,6 +166,20 @@ pub(crate) async fn basic_channel_cycle_scenario<E: ElectrumApi>(
164166 )
165167 . await ;
166168
169+ #[ cfg( zero_fee_commitment_tests) ]
170+ {
171+ let ext_node_id = peer. get_node_id ( ) . await . unwrap ( ) ;
172+ let channel = node
173+ . list_channels ( )
174+ . into_iter ( )
175+ . find ( |channel| channel. user_channel_id == user_ch)
176+ . expect ( "opened channel should be listed" ) ;
177+ assert_eq ! ( channel. counterparty. node_id, ext_node_id) ;
178+ assert ! ( channel. counterparty. features. supports_anchor_zero_fee_commitments( ) ) ;
179+ assert_eq ! ( channel. feerate_sat_per_1000_weight, 0 ) ;
180+ assert_eq ! ( channel. reserve_type, Some ( ReserveType :: Adaptive ) ) ;
181+ }
182+
167183 payment:: send_bolt11_to_peer ( node, peer, 10_000_000 , "basic-send" ) . await ;
168184 payment:: receive_bolt11_payment ( node, peer, 10_000_000 ) . await ;
169185
0 commit comments