@@ -617,6 +617,26 @@ def test_wallet_with_relative_path(self):
617
617
assert_equal (info ["descriptors" ], False )
618
618
assert_equal (info ["format" ], "bdb" )
619
619
620
+ def test_wallet_with_path_ending_in_slash (self ):
621
+ self .log .info ("Test migrating a wallet with a name/path ending in '/'" )
622
+
623
+ # The last directory in the wallet's path
624
+ final_dir = "mywallet"
625
+ wallet_name = f"path/to/{ final_dir } /"
626
+ wallet = self .create_legacy_wallet (wallet_name )
627
+ default = self .master_node .get_wallet_rpc (self .default_wallet_name )
628
+
629
+ addr = wallet .getnewaddress ()
630
+ txid = default .sendtoaddress (addr , 1 )
631
+ self .generate (self .master_node , 1 )
632
+ bals = wallet .getbalances ()
633
+
634
+ _ , wallet = self .migrate_and_get_rpc (wallet_name )
635
+
636
+ assert wallet .gettransaction (txid )
637
+
638
+ assert_equal (bals , wallet .getbalances ())
639
+
620
640
def test_default_wallet (self ):
621
641
self .log .info ("Test migration of the wallet named as the empty string" )
622
642
wallet = self .create_legacy_wallet ("" )
@@ -1508,6 +1528,7 @@ def run_test(self):
1508
1528
self .test_nonexistent ()
1509
1529
self .test_unloaded_by_path ()
1510
1530
self .test_wallet_with_relative_path ()
1531
+ self .test_wallet_with_path_ending_in_slash ()
1511
1532
self .test_default_wallet ()
1512
1533
self .test_direct_file ()
1513
1534
self .test_addressbook ()
0 commit comments