@@ -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 ;
@@ -2541,15 +2541,19 @@ async fn build_0_6_2_node(
25412541}
25422542
25432543async fn build_0_7_0_node (
2544- bitcoind : & BitcoinD , electrsd : & ElectrsD , storage_path : String , esplora_url : String ,
2545- seed_bytes : [ u8 ; 64 ] ,
2544+ bitcoind : & BitcoinD , electrsd : & ElectrsD , esplora_url : String , seed_bytes : [ u8 ; 64 ] ,
2545+ config : & TestConfig ,
25462546) -> ( u64 , bitcoin:: secp256k1:: PublicKey ) {
25472547 let mut builder_old = ldk_node_070:: Builder :: new ( ) ;
25482548 builder_old. set_network ( bitcoin:: Network :: Regtest ) ;
2549- builder_old. set_storage_dir_path ( storage_path ) ;
2549+ builder_old. set_storage_dir_path ( config . node_config . storage_dir_path . clone ( ) ) ;
25502550 builder_old. set_entropy_seed_bytes ( seed_bytes) ;
25512551 builder_old. set_chain_source_esplora ( esplora_url, None ) ;
2552- let node_old = builder_old. build ( ) . unwrap ( ) ;
2552+ let node_old = match config. store_type {
2553+ TestStoreType :: FilesystemStore => builder_old. build_with_fs_store ( ) . unwrap ( ) ,
2554+ TestStoreType :: Sqlite => builder_old. build ( ) . unwrap ( ) ,
2555+ TestStoreType :: TestSyncStore => panic ! ( "TestSyncStore not supported in v0.7.0 builder" ) ,
2556+ } ;
25532557
25542558 node_old. start ( ) . unwrap ( ) ;
25552559 let addr_old = node_old. onchain_payment ( ) . new_address ( ) . unwrap ( ) ;
@@ -2590,14 +2594,10 @@ async fn do_persistence_backwards_compatibility(version: OldLdkVersion) {
25902594 . await
25912595 } ,
25922596 OldLdkVersion :: V0_7_0 => {
2593- build_0_7_0_node (
2594- & bitcoind,
2595- & electrsd,
2596- storage_path. clone ( ) ,
2597- esplora_url. clone ( ) ,
2598- seed_bytes,
2599- )
2600- . await
2597+ let mut config = TestConfig :: default ( ) ;
2598+ config. store_type = TestStoreType :: Sqlite ;
2599+ config. node_config . storage_dir_path = storage_path. clone ( ) ;
2600+ build_0_7_0_node ( & bitcoind, & electrsd, esplora_url. clone ( ) , seed_bytes, & config) . await
26012601 } ,
26022602 } ;
26032603
0 commit comments