@@ -12,7 +12,7 @@ pub(crate) mod logging;
1212
1313use logging:: TestLogWriter ;
1414
15- use ldk_node:: config:: { Config , EsploraSyncConfig } ;
15+ use ldk_node:: config:: { Config , ElectrumSyncConfig , EsploraSyncConfig } ;
1616use ldk_node:: io:: sqlite_store:: SqliteStore ;
1717use ldk_node:: payment:: { PaymentDirection , PaymentKind , PaymentStatus } ;
1818use ldk_node:: {
@@ -255,6 +255,7 @@ type TestNode = Node;
255255#[ derive( Clone ) ]
256256pub ( crate ) enum TestChainSource < ' a > {
257257 Esplora ( & ' a ElectrsD ) ,
258+ Electrum ( & ' a ElectrsD ) ,
258259 BitcoindRpc ( & ' a BitcoinD ) ,
259260}
260261
@@ -313,6 +314,13 @@ pub(crate) fn setup_node(
313314 sync_config. lightning_wallet_sync_interval_secs = 100000 ;
314315 builder. set_chain_source_esplora ( esplora_url. clone ( ) , Some ( sync_config) ) ;
315316 } ,
317+ TestChainSource :: Electrum ( electrsd) => {
318+ let electrum_url = format ! ( "tcp://{}" , electrsd. electrum_url) ;
319+ let mut sync_config = ElectrumSyncConfig :: default ( ) ;
320+ sync_config. onchain_wallet_sync_interval_secs = 100000 ;
321+ sync_config. lightning_wallet_sync_interval_secs = 100000 ;
322+ builder. set_chain_source_electrum ( electrum_url. clone ( ) , Some ( sync_config) ) ;
323+ } ,
316324 TestChainSource :: BitcoindRpc ( bitcoind) => {
317325 let rpc_host = bitcoind. params . rpc_socket . ip ( ) . to_string ( ) ;
318326 let rpc_port = bitcoind. params . rpc_socket . port ( ) ;
0 commit comments