@@ -24,7 +24,7 @@ use common::{
2424 generate_listening_addresses, open_channel, open_channel_push_amt, open_channel_with_all,
2525 premine_and_distribute_funds, premine_blocks, prepare_rbf, random_chain_source, random_config,
2626 setup_bitcoind_and_electrsd, setup_builder, setup_node, setup_two_nodes, splice_in_with_all,
27- wait_for_tx, TestChainSource , TestStoreType , TestSyncStore ,
27+ wait_for_tx, TestChainSource , TestConfig , TestStoreType , TestSyncStore ,
2828} ;
2929use electrsd:: corepc_node:: Node as BitcoinD ;
3030use electrsd:: ElectrsD ;
@@ -2549,15 +2549,19 @@ async fn build_0_6_2_node(
25492549}
25502550
25512551async fn build_0_7_0_node (
2552- bitcoind : & BitcoinD , electrsd : & ElectrsD , storage_path : String , esplora_url : String ,
2553- seed_bytes : [ u8 ; 64 ] ,
2552+ bitcoind : & BitcoinD , electrsd : & ElectrsD , esplora_url : String , seed_bytes : [ u8 ; 64 ] ,
2553+ config : & TestConfig ,
25542554) -> ( u64 , bitcoin:: secp256k1:: PublicKey ) {
25552555 let mut builder_old = ldk_node_070:: Builder :: new ( ) ;
25562556 builder_old. set_network ( bitcoin:: Network :: Regtest ) ;
2557- builder_old. set_storage_dir_path ( storage_path ) ;
2557+ builder_old. set_storage_dir_path ( config . node_config . storage_dir_path . clone ( ) ) ;
25582558 builder_old. set_entropy_seed_bytes ( seed_bytes) ;
25592559 builder_old. set_chain_source_esplora ( esplora_url, None ) ;
2560- let node_old = builder_old. build ( ) . unwrap ( ) ;
2560+ let node_old = match config. store_type {
2561+ TestStoreType :: FilesystemStore => builder_old. build_with_fs_store ( ) . unwrap ( ) ,
2562+ TestStoreType :: Sqlite => builder_old. build ( ) . unwrap ( ) ,
2563+ TestStoreType :: TestSyncStore => panic ! ( "TestSyncStore not supported in v0.7.0 builder" ) ,
2564+ } ;
25612565
25622566 node_old. start ( ) . unwrap ( ) ;
25632567 let addr_old = node_old. onchain_payment ( ) . new_address ( ) . unwrap ( ) ;
@@ -2598,14 +2602,10 @@ async fn do_persistence_backwards_compatibility(version: OldLdkVersion) {
25982602 . await
25992603 } ,
26002604 OldLdkVersion :: V0_7_0 => {
2601- build_0_7_0_node (
2602- & bitcoind,
2603- & electrsd,
2604- storage_path. clone ( ) ,
2605- esplora_url. clone ( ) ,
2606- seed_bytes,
2607- )
2608- . await
2605+ let mut config = TestConfig :: default ( ) ;
2606+ config. store_type = TestStoreType :: Sqlite ;
2607+ config. node_config . storage_dir_path = storage_path. clone ( ) ;
2608+ build_0_7_0_node ( & bitcoind, & electrsd, esplora_url. clone ( ) , seed_bytes, & config) . await
26092609 } ,
26102610 } ;
26112611
0 commit comments