wallet, test: remove -deprecatedrpc=bip125 from wallet_migration.py
What changed, and why it matters
This is a routine test-only cleanup. A Bitcoin Core functional test was still starting one node with a deprecated RPC compatibility flag (-deprecatedrpc=bip125). The patch removes that flag and adjusts the test assertions to ignore the now-removed 'bip125-replaceable' field when comparing transaction lists. No production code, no wallet logic, and no network behavior changed.
No security action needed. Review as normal test maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies test/functional/wallet_migration.py only. It stops passing -deprecatedrpc=bip125 to the ‘master’ node and adds a helper that strips the bip125-replaceable key from RPC responses before comparing transaction lists. This aligns the test with the removal of the deprecated BIP125 RPC field; it is a test-maintenance change with no security-relevant code path affected.
Changed components
test/functional/wallet_migration.pyInspect captured patch +13 / −4
diff --git a/test/functional/wallet_migration.py b/test/functional/wallet_migration.py
index 42b2a47b..306482a9 100755
--- a/test/functional/wallet_migration.py
+++ b/test/functional/wallet_migration.py
@@ -44,7 +44,7 @@ class WalletMigrationTest(BitcoinTestFramework):
self.setup_clean_chain = True
self.num_nodes = 2
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):
self.skip_if_no_wallet()
@@ -181,6 +181,15 @@ class WalletMigrationTest(BitcoinTestFramework):
return migrate_info, wallet
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)
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")
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.old_node.restorewallet("basic1_restored", basic1_migrate['backup_path'])
@@ -244,7 +253,7 @@ class WalletMigrationTest(BitcoinTestFramework):
basic1_restored_wi = basic1_restored.getwalletinfo()
assert_equal(basic1_restored_wi['balance'], bal)
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
self.restart_node(0)
@@ -274,7 +283,7 @@ class WalletMigrationTest(BitcoinTestFramework):
# Now migrate and test that we still have the same balance/transactions
_, basic2 = self.migrate_and_get_rpc("basic2")
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
self.log.info("Test \"nothing to migrate\" when the user tries to migrate a loaded wallet with no legacy data")
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.