mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
Merge 62346bc394 into merged_master (Bitcoin PR bitcoin/bitcoin#28604)
This commit is contained in:
commit
c8cb770b9d
1 changed files with 6 additions and 6 deletions
|
|
@ -1148,19 +1148,19 @@ class RawTransactionsTest(BitcoinTestFramework):
|
|||
high_input_weight = input_weight * 2
|
||||
|
||||
# Funding should also work if the input weight is provided
|
||||
funded_tx = ext_fund.fundrawtransaction(raw_tx, input_weights=[{"txid": ext_utxo["txid"], "vout": ext_utxo["vout"], "weight": input_weight}])
|
||||
funded_tx = ext_fund.fundrawtransaction(raw_tx, input_weights=[{"txid": ext_utxo["txid"], "vout": ext_utxo["vout"], "weight": input_weight}], fee_rate=2)
|
||||
signed_tx = ext_fund.signrawtransactionwithwallet(funded_tx["hex"])
|
||||
signed_tx = self.nodes[0].signrawtransactionwithwallet(signed_tx["hex"])
|
||||
assert_equal(self.nodes[0].testmempoolaccept([signed_tx["hex"]])[0]["allowed"], True)
|
||||
assert_equal(signed_tx["complete"], True)
|
||||
# Reducing the weight should have a lower fee
|
||||
funded_tx2 = ext_fund.fundrawtransaction(raw_tx, input_weights=[{"txid": ext_utxo["txid"], "vout": ext_utxo["vout"], "weight": low_input_weight}])
|
||||
funded_tx2 = ext_fund.fundrawtransaction(raw_tx, input_weights=[{"txid": ext_utxo["txid"], "vout": ext_utxo["vout"], "weight": low_input_weight}], fee_rate=2)
|
||||
assert_greater_than(funded_tx["fee"], funded_tx2["fee"])
|
||||
# Increasing the weight should have a higher fee
|
||||
funded_tx2 = ext_fund.fundrawtransaction(raw_tx, input_weights=[{"txid": ext_utxo["txid"], "vout": ext_utxo["vout"], "weight": high_input_weight}])
|
||||
funded_tx2 = ext_fund.fundrawtransaction(raw_tx, input_weights=[{"txid": ext_utxo["txid"], "vout": ext_utxo["vout"], "weight": high_input_weight}], fee_rate=2)
|
||||
assert_greater_than(funded_tx2["fee"], funded_tx["fee"])
|
||||
# The provided weight should override the calculated weight when solving data is provided
|
||||
funded_tx3 = ext_fund.fundrawtransaction(raw_tx, solving_data={"descriptors": [desc]}, input_weights=[{"txid": ext_utxo["txid"], "vout": ext_utxo["vout"], "weight": high_input_weight}])
|
||||
funded_tx3 = ext_fund.fundrawtransaction(raw_tx, solving_data={"descriptors": [desc]}, input_weights=[{"txid": ext_utxo["txid"], "vout": ext_utxo["vout"], "weight": high_input_weight}], fee_rate=2)
|
||||
assert_equal(funded_tx2["fee"], funded_tx3["fee"])
|
||||
# The feerate should be met
|
||||
funded_tx4 = ext_fund.fundrawtransaction(raw_tx, input_weights=[{"txid": ext_utxo["txid"], "vout": ext_utxo["vout"], "weight": high_input_weight}], fee_rate=10)
|
||||
|
|
@ -1170,8 +1170,8 @@ class RawTransactionsTest(BitcoinTestFramework):
|
|||
assert_fee_amount(funded_tx4["fee"], tx4_vsize, Decimal(0.0001))
|
||||
|
||||
# Funding with weight at csuint boundaries should not cause problems
|
||||
funded_tx = ext_fund.fundrawtransaction(raw_tx, input_weights=[{"txid": ext_utxo["txid"], "vout": ext_utxo["vout"], "weight": 255}])
|
||||
funded_tx = ext_fund.fundrawtransaction(raw_tx, input_weights=[{"txid": ext_utxo["txid"], "vout": ext_utxo["vout"], "weight": 65539}])
|
||||
funded_tx = ext_fund.fundrawtransaction(raw_tx, input_weights=[{"txid": ext_utxo["txid"], "vout": ext_utxo["vout"], "weight": 255}], fee_rate=2)
|
||||
funded_tx = ext_fund.fundrawtransaction(raw_tx, input_weights=[{"txid": ext_utxo["txid"], "vout": ext_utxo["vout"], "weight": 65539}], fee_rate=2)
|
||||
|
||||
self.nodes[2].unloadwallet("extfund")
|
||||
self.nodes[0].unloadwallet("extsend")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue