@@ -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 ;
@@ -2457,15 +2457,19 @@ async fn build_0_6_2_node(
24572457}
24582458
24592459async fn build_0_7_0_node (
2460- bitcoind : & BitcoinD , electrsd : & ElectrsD , storage_path : String , esplora_url : String ,
2461- seed_bytes : [ u8 ; 64 ] ,
2460+ bitcoind : & BitcoinD , electrsd : & ElectrsD , esplora_url : String , seed_bytes : [ u8 ; 64 ] ,
2461+ config : & TestConfig ,
24622462) -> ( u64 , bitcoin:: secp256k1:: PublicKey ) {
24632463 let mut builder_old = ldk_node_070:: Builder :: new ( ) ;
24642464 builder_old. set_network ( bitcoin:: Network :: Regtest ) ;
2465- builder_old. set_storage_dir_path ( storage_path ) ;
2465+ builder_old. set_storage_dir_path ( config . node_config . storage_dir_path . clone ( ) ) ;
24662466 builder_old. set_entropy_seed_bytes ( seed_bytes) ;
24672467 builder_old. set_chain_source_esplora ( esplora_url, None ) ;
2468- let node_old = builder_old. build ( ) . unwrap ( ) ;
2468+ let node_old = match config. store_type {
2469+ TestStoreType :: FilesystemStore => builder_old. build_with_fs_store ( ) . unwrap ( ) ,
2470+ TestStoreType :: Sqlite => builder_old. build ( ) . unwrap ( ) ,
2471+ TestStoreType :: TestSyncStore => panic ! ( "TestSyncStore not supported in v0.7.0 builder" ) ,
2472+ } ;
24692473
24702474 node_old. start ( ) . unwrap ( ) ;
24712475 let addr_old = node_old. onchain_payment ( ) . new_address ( ) . unwrap ( ) ;
@@ -2506,14 +2510,10 @@ async fn do_persistence_backwards_compatibility(version: OldLdkVersion) {
25062510 . await
25072511 } ,
25082512 OldLdkVersion :: V0_7_0 => {
2509- build_0_7_0_node (
2510- & bitcoind,
2511- & electrsd,
2512- storage_path. clone ( ) ,
2513- esplora_url. clone ( ) ,
2514- seed_bytes,
2515- )
2516- . await
2513+ let mut config = TestConfig :: default ( ) ;
2514+ config. store_type = TestStoreType :: Sqlite ;
2515+ config. node_config . storage_dir_path = storage_path. clone ( ) ;
2516+ build_0_7_0_node ( & bitcoind, & electrsd, esplora_url. clone ( ) , seed_bytes, & config) . await
25172517 } ,
25182518 } ;
25192519
0 commit comments