wallet, test: remove -deprecatedrpc=bip125 from wallet_listtransactions.py
What changed, and why it matters
This commit only changes a single test file. It removes the use of a deprecated RPC option and deletes test assertions that checked a now-removed 'bip125-replaceable' field in wallet transaction output. There is no change to the actual Bitcoin Core wallet or node code that users run, so this cannot affect live wallets, funds, or network security.
No security action needed. This is a routine test-maintenance commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch updates test/functional/wallet_listtransactions.py to stop passing -deprecatedrpc=bip125 and to remove assertions verifying the bip125-replaceable field in listtransactions, gettransaction, and listsinceblock RPC responses. This is a test-only cleanup following the removal of the deprecated bip125-replaceable field from wallet RPC output. No production code is modified.
Changed components
test/functional/wallet_listtransactions.pyInspect captured patch +4 / −42
diff --git a/test/functional/wallet_listtransactions.py b/test/functional/wallet_listtransactions.py
index d2bdd9b4..80afe45d 100755
--- a/test/functional/wallet_listtransactions.py
+++ b/test/functional/wallet_listtransactions.py
@@ -31,7 +31,7 @@ class ListTransactionsTest(BitcoinTestFramework):
self.num_nodes = 3
# whitelist peers to speed up tx relay / mempool sync
self.noban_tx_relay = True
- self.extra_args = [["-walletrbf=0", "-deprecatedrpc=bip125"]] * self.num_nodes
+ self.extra_args = [["-walletrbf=0"]] * self.num_nodes
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
@@ -126,13 +126,11 @@ class ListTransactionsTest(BitcoinTestFramework):
return i
return None
- self.log.info("Test txs w/o opt-in RBF (bip125-replaceable=no)")
+ self.log.info("Test txs w/o opt-in RBF")
# Chain a few transactions that don't opt in.
txid_1 = self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 1)
assert not is_opt_in(self.nodes[0], txid_1)
- assert_array_result(self.nodes[0].listtransactions(), {"txid": txid_1}, {"bip125-replaceable": "no"})
self.sync_mempools()
- assert_array_result(self.nodes[1].listtransactions(), {"txid": txid_1}, {"bip125-replaceable": "no"})
# Tx2 will build off tx1, still not opting in to RBF.
utxo_to_use = get_unconfirmed_utxo_entry(self.nodes[0], txid_1)
@@ -149,11 +147,9 @@ class ListTransactionsTest(BitcoinTestFramework):
# ...and check the result
assert not is_opt_in(self.nodes[1], txid_2)
- assert_array_result(self.nodes[1].listtransactions(), {"txid": txid_2}, {"bip125-replaceable": "no"})
self.sync_mempools()
- assert_array_result(self.nodes[0].listtransactions(), {"txid": txid_2}, {"bip125-replaceable": "no"})
- self.log.info("Test txs with opt-in RBF (bip125-replaceable=yes)")
+ self.log.info("Test txs with opt-in RBF")
# Tx3 will opt-in to RBF
utxo_to_use = get_unconfirmed_utxo_entry(self.nodes[0], txid_2)
inputs = [{"txid": txid_2, "vout": utxo_to_use["vout"]}]
@@ -164,11 +160,8 @@ class ListTransactionsTest(BitcoinTestFramework):
tx3 = tx3_modified.serialize().hex()
tx3_signed = self.nodes[0].signrawtransactionwithwallet(tx3)['hex']
txid_3 = self.nodes[0].sendrawtransaction(tx3_signed)
-
assert is_opt_in(self.nodes[0], txid_3)
- assert_array_result(self.nodes[0].listtransactions(), {"txid": txid_3}, {"bip125-replaceable": "yes"})
self.sync_mempools()
- assert_array_result(self.nodes[1].listtransactions(), {"txid": txid_3}, {"bip125-replaceable": "yes"})
# Tx4 will chain off tx3. Doesn't signal itself, but depends on one
# that does.
@@ -178,13 +171,9 @@ class ListTransactionsTest(BitcoinTestFramework):
tx4 = self.nodes[1].createrawtransaction(inputs=inputs, outputs=outputs, replaceable=False)
tx4_signed = self.nodes[1].signrawtransactionwithwallet(tx4)["hex"]
txid_4 = self.nodes[1].sendrawtransaction(tx4_signed)
-
assert not is_opt_in(self.nodes[1], txid_4)
- assert_array_result(self.nodes[1].listtransactions(), {"txid": txid_4}, {"bip125-replaceable": "yes"})
- self.sync_mempools()
- assert_array_result(self.nodes[0].listtransactions(), {"txid": txid_4}, {"bip125-replaceable": "yes"})
- self.log.info("Test tx with unknown RBF state (bip125-replaceable=unknown)")
+ self.log.info("Test tx with unknown RBF state")
# Replace tx3, and check that tx4 becomes unknown
tx3_b = tx3_modified
tx3_b.vout[0].nValue -= int(Decimal("0.004") * COIN) # bump the fee
@@ -193,33 +182,6 @@ class ListTransactionsTest(BitcoinTestFramework):
txid_3b = self.nodes[0].sendrawtransaction(tx3_b_signed, 0)
assert is_opt_in(self.nodes[0], txid_3b)
- assert_array_result(self.nodes[0].listtransactions(), {"txid": txid_4}, {"bip125-replaceable": "unknown"})
- self.sync_mempools()
- assert_array_result(self.nodes[1].listtransactions(), {"txid": txid_4}, {"bip125-replaceable": "unknown"})
-
- self.log.info("Test bip125-replaceable status with gettransaction RPC")
- for n in self.nodes[0:2]:
- assert_equal(n.gettransaction(txid_1)["bip125-replaceable"], "no")
- assert_equal(n.gettransaction(txid_2)["bip125-replaceable"], "no")
- assert_equal(n.gettransaction(txid_3)["bip125-replaceable"], "yes")
- assert_equal(n.gettransaction(txid_3b)["bip125-replaceable"], "yes")
- assert_equal(n.gettransaction(txid_4)["bip125-replaceable"], "unknown")
-
- self.log.info("Test bip125-replaceable status with listsinceblock")
- for n in self.nodes[0:2]:
- txs = {tx['txid']: tx['bip125-replaceable'] for tx in n.listsinceblock()['transactions']}
- assert_equal(txs[txid_1], "no")
- assert_equal(txs[txid_2], "no")
- assert_equal(txs[txid_3], "yes")
- assert_equal(txs[txid_3b], "yes")
- assert_equal(txs[txid_4], "unknown")
-
- self.log.info("Test mined transactions are no longer bip125-replaceable")
- self.generate(self.nodes[0], 1)
- assert txid_3b not in self.nodes[0].getrawmempool()
- assert_equal(self.nodes[0].gettransaction(txid_3b)["bip125-replaceable"], "no")
- assert_equal(self.nodes[0].gettransaction(txid_4)["bip125-replaceable"], "unknown")
-
def run_externally_generated_address_test(self):
"""Test behavior when receiving address is not in the address book."""
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.