@@ -13,7 +13,7 @@ use std::collections::HashMap;
1313
1414use ldk_node:: entropy:: NodeEntropy ;
1515use ldk_node:: Builder ;
16- use rand:: { rng, Rng } ;
16+ use rand:: { rng, RngCore } ;
1717
1818#[ tokio:: test( flavor = "multi_thread" , worker_threads = 1 ) ]
1919async fn channel_full_cycle_with_vss_store ( ) {
@@ -55,74 +55,6 @@ async fn channel_full_cycle_with_vss_store() {
5555 . await ;
5656}
5757
58- #[ tokio:: test( flavor = "multi_thread" , worker_threads = 1 ) ]
59- async fn vss_v0_schema_backwards_compatibility ( ) {
60- let ( bitcoind, electrsd) = common:: setup_bitcoind_and_electrsd ( ) ;
61- let esplora_url = format ! ( "http://{}" , electrsd. esplora_url. as_ref( ) . unwrap( ) ) ;
62- let vss_base_url = std:: env:: var ( "TEST_VSS_BASE_URL" ) . unwrap ( ) ;
63-
64- let storage_path = common:: random_storage_path ( ) . to_str ( ) . unwrap ( ) . to_owned ( ) ;
65- let mut seed_bytes = [ 42u8 ; 64 ] ;
66- rand:: thread_rng ( ) . fill_bytes ( & mut seed_bytes) ;
67- let node_entropy = NodeEntropy :: from_seed_bytes ( seed_bytes) ;
68-
69- // Setup a v0.6.2 `Node` persisted with the v0 scheme.
70- let ( old_balance, old_node_id) = {
71- let mut builder_old = ldk_node_062:: Builder :: new ( ) ;
72- builder_old. set_network ( bitcoin:: Network :: Regtest ) ;
73- builder_old. set_storage_dir_path ( storage_path. clone ( ) ) ;
74- builder_old. set_entropy_seed_bytes ( seed_bytes) ;
75- builder_old. set_chain_source_esplora ( esplora_url. clone ( ) , None ) ;
76- let node_old = builder_old
77- . build_with_vss_store ( vss_base_url. clone ( ) , "" . to_owned ( ) , HashMap :: new ( ) )
78- . unwrap ( ) ;
79-
80- node_old. start ( ) . unwrap ( ) ;
81- let addr_old = node_old. onchain_payment ( ) . new_address ( ) . unwrap ( ) ;
82- common:: premine_and_distribute_funds (
83- & bitcoind. client ,
84- & electrsd. client ,
85- vec ! [ addr_old] ,
86- bitcoin:: Amount :: from_sat ( 100_000 ) ,
87- )
88- . await ;
89- node_old. sync_wallets ( ) . unwrap ( ) ;
90-
91- let balance = node_old. list_balances ( ) . spendable_onchain_balance_sats ;
92- assert ! ( balance > 0 ) ;
93- let node_id = node_old. node_id ( ) ;
94-
95- // Workaround necessary as v0.6.2's VSS runtime wasn't dropsafe in a tokio context.
96- tokio:: task:: block_in_place ( move || {
97- node_old. stop ( ) . unwrap ( ) ;
98- drop ( node_old) ;
99- } ) ;
100-
101- ( balance, node_id)
102- } ;
103-
104- // Now ensure we can still reinit from the same backend.
105- let mut builder_new = Builder :: new ( ) ;
106- builder_new. set_network ( bitcoin:: Network :: Regtest ) ;
107- builder_new. set_storage_dir_path ( storage_path) ;
108- builder_new. set_chain_source_esplora ( esplora_url, None ) ;
109-
110- let node_new = builder_new
111- . build_with_vss_store ( node_entropy, vss_base_url, "" . to_owned ( ) , HashMap :: new ( ) )
112- . unwrap ( ) ;
113-
114- node_new. start ( ) . unwrap ( ) ;
115- node_new. sync_wallets ( ) . unwrap ( ) ;
116-
117- let new_balance = node_new. list_balances ( ) . spendable_onchain_balance_sats ;
118- let new_node_id = node_new. node_id ( ) ;
119-
120- assert_eq ! ( old_node_id, new_node_id) ;
121- assert_eq ! ( old_balance, new_balance) ;
122-
123- node_new. stop ( ) . unwrap ( ) ;
124- }
125-
12658#[ tokio:: test( flavor = "multi_thread" , worker_threads = 1 ) ]
12759async fn vss_node_restart ( ) {
12860 let ( bitcoind, electrsd) = common:: setup_bitcoind_and_electrsd ( ) ;
@@ -131,7 +63,7 @@ async fn vss_node_restart() {
13163
13264 let storage_path = common:: random_storage_path ( ) . to_str ( ) . unwrap ( ) . to_owned ( ) ;
13365 let mut seed_bytes = [ 42u8 ; 64 ] ;
134- rand:: thread_rng ( ) . fill_bytes ( & mut seed_bytes) ;
66+ rand:: rng ( ) . fill_bytes ( & mut seed_bytes) ;
13567 let node_entropy = NodeEntropy :: from_seed_bytes ( seed_bytes) ;
13668
13769 // Setup initial node and fund it.
0 commit comments