mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Add psbtbumpfee RPC
This commit is contained in:
@@ -123,13 +123,19 @@ def test_simple_bumpfee_succeeds(self, mode, rbf_node, peer_node, dest_address):
|
||||
self.sync_mempools((rbf_node, peer_node))
|
||||
assert rbfid in rbf_node.getrawmempool() and rbfid in peer_node.getrawmempool()
|
||||
if mode == "fee_rate":
|
||||
bumped_psbt = rbf_node.psbtbumpfee(rbfid, {"fee_rate": NORMAL})
|
||||
bumped_tx = rbf_node.bumpfee(rbfid, {"fee_rate": NORMAL})
|
||||
else:
|
||||
bumped_psbt = rbf_node.psbtbumpfee(rbfid)
|
||||
bumped_tx = rbf_node.bumpfee(rbfid)
|
||||
assert_equal(bumped_tx["errors"], [])
|
||||
assert bumped_tx["fee"] > -rbftx["fee"]
|
||||
assert_equal(bumped_tx["origfee"], -rbftx["fee"])
|
||||
assert "psbt" not in bumped_tx
|
||||
assert_equal(bumped_psbt["errors"], [])
|
||||
assert bumped_psbt["fee"] > -rbftx["fee"]
|
||||
assert_equal(bumped_psbt["origfee"], -rbftx["fee"])
|
||||
assert "psbt" in bumped_psbt
|
||||
# check that bumped_tx propagates, original tx was evicted and has a wallet conflict
|
||||
self.sync_mempools((rbf_node, peer_node))
|
||||
assert bumped_tx["txid"] in rbf_node.getrawmempool()
|
||||
@@ -391,7 +397,7 @@ def test_watchonly_psbt(self, peer_node, rbf_node, dest_address):
|
||||
assert_equal(len(watcher.decodepsbt(psbt)["tx"]["vin"]), 1)
|
||||
|
||||
# Bump fee, obnoxiously high to add additional watchonly input
|
||||
bumped_psbt = watcher.bumpfee(original_txid, {"fee_rate": HIGH})
|
||||
bumped_psbt = watcher.psbtbumpfee(original_txid, {"fee_rate": HIGH})
|
||||
assert_greater_than(len(watcher.decodepsbt(bumped_psbt['psbt'])["tx"]["vin"]), 1)
|
||||
assert "txid" not in bumped_psbt
|
||||
assert_equal(bumped_psbt["origfee"], -watcher.gettransaction(original_txid)["fee"])
|
||||
|
||||
Reference in New Issue
Block a user