@@ -20,6 +20,10 @@ use bitcoin::{
20
20
} ;
21
21
use miniscript:: { Descriptor , DescriptorPublicKey } ;
22
22
23
+ use bdk_wallet:: persist_test_utils:: {
24
+ persist_keychains, persist_network, persist_single_keychain, persist_wallet_changeset,
25
+ } ;
26
+
23
27
mod common;
24
28
use common:: * ;
25
29
@@ -419,3 +423,43 @@ fn single_descriptor_wallet_persist_and_recover() {
419
423
"single descriptor wallet should refuse change descriptor param"
420
424
) ;
421
425
}
426
+
427
+ #[ test]
428
+ fn wallet_changeset_is_persisted ( ) {
429
+ persist_wallet_changeset ( "store.db" , |path| {
430
+ Ok ( bdk_file_store:: Store :: create ( DB_MAGIC , path) ?)
431
+ } ) ;
432
+ persist_wallet_changeset :: < bdk_chain:: rusqlite:: Connection , _ > ( "store.sqlite" , |path| {
433
+ Ok ( bdk_chain:: rusqlite:: Connection :: open ( path) ?)
434
+ } ) ;
435
+ }
436
+
437
+ #[ test]
438
+ fn keychains_are_persisted ( ) {
439
+ persist_keychains ( "store.db" , |path| {
440
+ Ok ( bdk_file_store:: Store :: create ( DB_MAGIC , path) ?)
441
+ } ) ;
442
+ persist_keychains :: < bdk_chain:: rusqlite:: Connection , _ > ( "store.sqlite" , |path| {
443
+ Ok ( bdk_chain:: rusqlite:: Connection :: open ( path) ?)
444
+ } ) ;
445
+ }
446
+
447
+ #[ test]
448
+ fn single_keychain_is_persisted ( ) {
449
+ persist_single_keychain ( "store.db" , |path| {
450
+ Ok ( bdk_file_store:: Store :: create ( DB_MAGIC , path) ?)
451
+ } ) ;
452
+ persist_single_keychain :: < bdk_chain:: rusqlite:: Connection , _ > ( "store.sqlite" , |path| {
453
+ Ok ( bdk_chain:: rusqlite:: Connection :: open ( path) ?)
454
+ } ) ;
455
+ }
456
+
457
+ #[ test]
458
+ fn network_is_persisted ( ) {
459
+ persist_network ( "store.db" , |path| {
460
+ Ok ( bdk_file_store:: Store :: create ( DB_MAGIC , path) ?)
461
+ } ) ;
462
+ persist_network :: < bdk_chain:: rusqlite:: Connection , _ > ( "store.sqlite" , |path| {
463
+ Ok ( bdk_chain:: rusqlite:: Connection :: open ( path) ?)
464
+ } ) ;
465
+ }
0 commit comments