@@ -12,7 +12,7 @@ pub(crate) mod logging;
12
12
13
13
use logging:: TestLogWriter ;
14
14
15
- use ldk_node:: config:: { Config , EsploraSyncConfig } ;
15
+ use ldk_node:: config:: { Config , ElectrumSyncConfig , EsploraSyncConfig } ;
16
16
use ldk_node:: io:: sqlite_store:: SqliteStore ;
17
17
use ldk_node:: payment:: { PaymentDirection , PaymentKind , PaymentStatus } ;
18
18
use ldk_node:: {
@@ -255,6 +255,7 @@ type TestNode = Node;
255
255
#[ derive( Clone ) ]
256
256
pub ( crate ) enum TestChainSource < ' a > {
257
257
Esplora ( & ' a ElectrsD ) ,
258
+ Electrum ( & ' a ElectrsD ) ,
258
259
BitcoindRpc ( & ' a BitcoinD ) ,
259
260
}
260
261
@@ -313,6 +314,13 @@ pub(crate) fn setup_node(
313
314
sync_config. lightning_wallet_sync_interval_secs = 100000 ;
314
315
builder. set_chain_source_esplora ( esplora_url. clone ( ) , Some ( sync_config) ) ;
315
316
} ,
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
+ } ,
316
324
TestChainSource :: BitcoindRpc ( bitcoind) => {
317
325
let rpc_host = bitcoind. params . rpc_socket . ip ( ) . to_string ( ) ;
318
326
let rpc_port = bitcoind. params . rpc_socket . port ( ) ;
0 commit comments