aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-10-21 10:14:45 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-10-21 10:14:47 +0200
commit548ad5ef7f60c53336dfec27feb0d30e23c72d79 (patch)
treebf4ad106b3100cd17ca8882ae3b46495135ac23a
parent9aa4ddb410b2efc1806358b6f6474d33a315bff4 (diff)
parent4ac8c89ad96de9ad61cad756b10c9dee2d9e1405 (diff)
Merge bitcoin/bitcoin#23281: test: check that bumpfee RPC fails for txs with descendants in mempool
4ac8c89ad96de9ad61cad756b10c9dee2d9e1405 test: check that bumpfee RPC fails for txs with descendants in mempool (Sebastian Falbesoner) Pull request description: This PR adds missing test coverage for the bumpfee RPC error _"Transaction has descendants in the mempool"_, https://github.com/bitcoin/bitcoin/blob/6419bdfeb130b20ccfed229d9ba7eca7f385d036/src/wallet/feebumper.cpp#L29-L32 which is thrown if the bumped tx has descendants in the mempool and is _not_ connected to the bitcoin wallet (for those, the error "Transaction has descendants in the Wallet" is thrown a few lines above). To achieve that, the test framework's MiniWallet is used. ACKs for top commit: brunoerg: tACK 4ac8c89ad96de9ad61cad756b10c9dee2d9e1405 promag: Code review ACK 4ac8c89ad96de9ad61cad756b10c9dee2d9e1405. Nice stuff! lsilva01: Tested ACK 4ac8c89 cad756b10c9dee2d9e1405 on Ubuntu 20.04. stratospher: tested ACK 4ac8c89. Tree-SHA512: 83e99f9dd2b140c0c0597c0c36c9c948fa334871be40e58a5e004440698d9685661c69bb83ab937d30f692545a3799705f991b31904f2ef31a2fbc3ae1179fa8
-rwxr-xr-xtest/functional/wallet_bumpfee.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/functional/wallet_bumpfee.py b/test/functional/wallet_bumpfee.py
index a1676fffa5..46a5df4a8e 100755
--- a/test/functional/wallet_bumpfee.py
+++ b/test/functional/wallet_bumpfee.py
@@ -32,6 +32,8 @@ from test_framework.util import (
assert_greater_than,
assert_raises_rpc_error,
)
+from test_framework.wallet import MiniWallet
+
WALLET_PASSPHRASE = "test"
WALLET_PASSPHRASE_TIMEOUT = 3600
@@ -265,6 +267,14 @@ def test_bumpfee_with_descendant_fails(self, rbf_node, rbf_node_address, dest_ad
tx = rbf_node.signrawtransactionwithwallet(tx)
rbf_node.sendrawtransaction(tx["hex"])
assert_raises_rpc_error(-8, "Transaction has descendants in the wallet", rbf_node.bumpfee, parent_id)
+
+ # create tx with descendant in the mempool by using MiniWallet
+ miniwallet = MiniWallet(rbf_node)
+ parent_id = spend_one_input(rbf_node, miniwallet.get_address())
+ tx = rbf_node.gettransaction(txid=parent_id, verbose=True)['decoded']
+ miniwallet.scan_tx(tx)
+ miniwallet.send_self_transfer(from_node=rbf_node)
+ assert_raises_rpc_error(-8, "Transaction has descendants in the mempool", rbf_node.bumpfee, parent_id)
self.clear_mempool()