@@ -533,3 +533,46 @@ where
533533 . collect :: < Vec < _ > > ( )
534534 }
535535}
536+
537+ #[ cfg( test) ]
538+ mod tests {
539+ use lightning:: util:: test_utils:: { TestBroadcaster , TestLogger } ;
540+
541+ use crate :: test:: utils:: random_storage_path;
542+ use crate :: wallet:: Wallet ;
543+
544+ use bdk:: blockchain:: esplora:: EsploraBlockchain ;
545+ use bdk:: database:: SqliteDatabase ;
546+ use bdk:: template:: Bip84 ;
547+
548+ use esplora_client:: Builder ;
549+
550+ use bitcoin:: Network ;
551+
552+ use std:: sync:: Arc ;
553+
554+ #[ test]
555+ fn test_broadcasting ( ) {
556+ let storage_path = random_storage_path ( ) ;
557+ let seed_bytes = [ 42u8 ; 64 ] ;
558+ let network = Network :: Regtest ;
559+ let logger = Arc :: new ( TestLogger :: new ( ) ) ;
560+
561+ let xprv = bitcoin:: util:: bip32:: ExtendedPrivKey :: new_master ( network, & seed_bytes) . unwrap ( ) ;
562+
563+ let database_path = format ! ( "{}/bdk_test_wallet.sqlite" , storage_path. display( ) ) ;
564+ let database = SqliteDatabase :: new ( database_path) ;
565+
566+ let bdk_wallet = bdk:: Wallet :: new (
567+ Bip84 ( xprv, bdk:: KeychainKind :: External ) ,
568+ Some ( Bip84 ( xprv, bdk:: KeychainKind :: Internal ) ) ,
569+ network,
570+ database,
571+ )
572+ . unwrap ( ) ;
573+
574+ //let esplora_client = Client::new("asdf");
575+ //let blockchain = EsploraBlockchain::from_client(esplora_client, 20);
576+ //let wallet = Wallet::new(blockchain, bdk_wallet, runtime, logger);
577+ }
578+ }
0 commit comments