Skip to content

Commit

Permalink
test: bumpfee with user specified fee_rate ignores walletIncrementalR…
Browse files Browse the repository at this point in the history
…elayFee
  • Loading branch information
ismaelsadeeq committed Jan 25, 2024
1 parent 436e88f commit f58beab
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/functional/wallet_bumpfee.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ def run_test(self):

# Context independent tests
test_feerate_checks_replaced_outputs(self, rbf_node, peer_node)
test_bumpfee_with_feerate_ignores_walletincrementalrelayfee(self, rbf_node, peer_node)

def test_invalid_parameters(self, rbf_node, peer_node, dest_address):
self.log.info('Test invalid parameters')
Expand Down Expand Up @@ -829,5 +830,27 @@ def test_feerate_checks_replaced_outputs(self, rbf_node, peer_node):
self.clear_mempool()


def test_bumpfee_with_feerate_ignores_walletincrementalrelayfee(self, rbf_node, peer_node):
self.log.info('Test that bumpfee with fee_rate ignores walletincrementalrelayfee')
# Make sure there is enough balance
peer_node.sendtoaddress(rbf_node.getnewaddress(), 2)
self.generate(peer_node, 1)

dest_address = peer_node.getnewaddress(address_type="bech32")
tx = rbf_node.send(outputs=[{dest_address: 1}], fee_rate=2)

# Ensure you can not fee bump with a fee_rate below or equal to the original fee_rate
assert_raises_rpc_error(-8, "Insufficient total fee", rbf_node.bumpfee, tx["txid"], {"fee_rate": 1})
assert_raises_rpc_error(-8, "Insufficient total fee", rbf_node.bumpfee, tx["txid"], {"fee_rate": 2})

# Ensure you can not fee bump if the fee_rate is more than original fee_rate but the total fee from new fee_rate is
# less than (original fee + incrementalrelayfee)
assert_raises_rpc_error(-8, "Insufficient total fee", rbf_node.bumpfee, tx["txid"], {"fee_rate": 2.8})

# You can fee bump as long as the new fee set from fee_rate is atleast (original fee + incrementalrelayfee)
rbf_node.bumpfee(tx["txid"], {"fee_rate": 3})
self.clear_mempool()


if __name__ == "__main__":
BumpFeeTest().main()

0 comments on commit f58beab

Please sign in to comment.