mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-10 22:58:40 +02:00
wallet, test: remove -deprecatedrpc=bip125 from wallet_migration.py
This commit is contained in:
@@ -44,7 +44,7 @@ class WalletMigrationTest(BitcoinTestFramework):
|
|||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
self.supports_cli = False
|
self.supports_cli = False
|
||||||
self.extra_args = [["-deprecatedrpc=bip125"], ["-deprecatedrpc=create_bdb"]]
|
self.extra_args = [[], ["-deprecatedrpc=create_bdb"]]
|
||||||
|
|
||||||
def skip_test_if_missing_module(self):
|
def skip_test_if_missing_module(self):
|
||||||
self.skip_if_no_wallet()
|
self.skip_if_no_wallet()
|
||||||
@@ -181,6 +181,15 @@ class WalletMigrationTest(BitcoinTestFramework):
|
|||||||
return migrate_info, wallet
|
return migrate_info, wallet
|
||||||
|
|
||||||
def test_basic(self):
|
def test_basic(self):
|
||||||
|
# Remove the deprecated response fields that'd be present in the RPC responses
|
||||||
|
# sent by the old node(s).
|
||||||
|
def remove_deprecated_keys(list):
|
||||||
|
deprecated_keys = {"bip125-replaceable"}
|
||||||
|
for obj in list:
|
||||||
|
for key in deprecated_keys:
|
||||||
|
obj.pop(key)
|
||||||
|
return list
|
||||||
|
|
||||||
default = self.master_node.get_wallet_rpc(self.default_wallet_name)
|
default = self.master_node.get_wallet_rpc(self.default_wallet_name)
|
||||||
|
|
||||||
self.log.info("Test migration of a basic keys only wallet without balance")
|
self.log.info("Test migration of a basic keys only wallet without balance")
|
||||||
@@ -236,7 +245,7 @@ class WalletMigrationTest(BitcoinTestFramework):
|
|||||||
|
|
||||||
basic1_migrate, basic1 = self.migrate_and_get_rpc("basic1")
|
basic1_migrate, basic1 = self.migrate_and_get_rpc("basic1")
|
||||||
assert_equal(basic1.getbalance(), bal)
|
assert_equal(basic1.getbalance(), bal)
|
||||||
self.assert_list_txs_equal(basic1.listtransactions(), txs)
|
self.assert_list_txs_equal(basic1.listtransactions(), remove_deprecated_keys(txs))
|
||||||
|
|
||||||
self.log.info("Test backup file can be successfully restored")
|
self.log.info("Test backup file can be successfully restored")
|
||||||
self.old_node.restorewallet("basic1_restored", basic1_migrate['backup_path'])
|
self.old_node.restorewallet("basic1_restored", basic1_migrate['backup_path'])
|
||||||
@@ -244,7 +253,7 @@ class WalletMigrationTest(BitcoinTestFramework):
|
|||||||
basic1_restored_wi = basic1_restored.getwalletinfo()
|
basic1_restored_wi = basic1_restored.getwalletinfo()
|
||||||
assert_equal(basic1_restored_wi['balance'], bal)
|
assert_equal(basic1_restored_wi['balance'], bal)
|
||||||
assert_equal(basic1_restored.listaddressgroupings(), addr_gps)
|
assert_equal(basic1_restored.listaddressgroupings(), addr_gps)
|
||||||
self.assert_list_txs_equal(basic1_restored.listtransactions(), txs)
|
self.assert_list_txs_equal(remove_deprecated_keys(basic1_restored.listtransactions()), txs)
|
||||||
|
|
||||||
# restart master node and verify that everything is still there
|
# restart master node and verify that everything is still there
|
||||||
self.restart_node(0)
|
self.restart_node(0)
|
||||||
@@ -274,7 +283,7 @@ class WalletMigrationTest(BitcoinTestFramework):
|
|||||||
# Now migrate and test that we still have the same balance/transactions
|
# Now migrate and test that we still have the same balance/transactions
|
||||||
_, basic2 = self.migrate_and_get_rpc("basic2")
|
_, basic2 = self.migrate_and_get_rpc("basic2")
|
||||||
assert_equal(basic2.getbalance(), basic2_balance)
|
assert_equal(basic2.getbalance(), basic2_balance)
|
||||||
self.assert_list_txs_equal(basic2.listtransactions(), basic2_txs)
|
self.assert_list_txs_equal(basic2.listtransactions(), remove_deprecated_keys(basic2_txs))
|
||||||
|
|
||||||
# Now test migration on a descriptor wallet
|
# Now test migration on a descriptor wallet
|
||||||
self.log.info("Test \"nothing to migrate\" when the user tries to migrate a loaded wallet with no legacy data")
|
self.log.info("Test \"nothing to migrate\" when the user tries to migrate a loaded wallet with no legacy data")
|
||||||
|
|||||||
Reference in New Issue
Block a user