@@ -1063,19 +1063,19 @@ def test_external_inputs(self):
1063
1063
high_input_weight = input_weight * 2
1064
1064
1065
1065
# Funding should also work if the input weight is provided
1066
- funded_tx = wallet .fundrawtransaction (raw_tx , input_weights = [{"txid" : ext_utxo ["txid" ], "vout" : ext_utxo ["vout" ], "weight" : input_weight }])
1066
+ funded_tx = wallet .fundrawtransaction (raw_tx , input_weights = [{"txid" : ext_utxo ["txid" ], "vout" : ext_utxo ["vout" ], "weight" : input_weight }], fee_rate = 2 )
1067
1067
signed_tx = wallet .signrawtransactionwithwallet (funded_tx ["hex" ])
1068
1068
signed_tx = self .nodes [0 ].signrawtransactionwithwallet (signed_tx ["hex" ])
1069
1069
assert_equal (self .nodes [0 ].testmempoolaccept ([signed_tx ["hex" ]])[0 ]["allowed" ], True )
1070
1070
assert_equal (signed_tx ["complete" ], True )
1071
1071
# Reducing the weight should have a lower fee
1072
- funded_tx2 = wallet .fundrawtransaction (raw_tx , input_weights = [{"txid" : ext_utxo ["txid" ], "vout" : ext_utxo ["vout" ], "weight" : low_input_weight }])
1072
+ funded_tx2 = wallet .fundrawtransaction (raw_tx , input_weights = [{"txid" : ext_utxo ["txid" ], "vout" : ext_utxo ["vout" ], "weight" : low_input_weight }], fee_rate = 2 )
1073
1073
assert_greater_than (funded_tx ["fee" ], funded_tx2 ["fee" ])
1074
1074
# Increasing the weight should have a higher fee
1075
- funded_tx2 = wallet .fundrawtransaction (raw_tx , input_weights = [{"txid" : ext_utxo ["txid" ], "vout" : ext_utxo ["vout" ], "weight" : high_input_weight }])
1075
+ funded_tx2 = wallet .fundrawtransaction (raw_tx , input_weights = [{"txid" : ext_utxo ["txid" ], "vout" : ext_utxo ["vout" ], "weight" : high_input_weight }], fee_rate = 2 )
1076
1076
assert_greater_than (funded_tx2 ["fee" ], funded_tx ["fee" ])
1077
1077
# The provided weight should override the calculated weight when solving data is provided
1078
- funded_tx3 = wallet .fundrawtransaction (raw_tx , solving_data = {"descriptors" : [desc ]}, input_weights = [{"txid" : ext_utxo ["txid" ], "vout" : ext_utxo ["vout" ], "weight" : high_input_weight }])
1078
+ funded_tx3 = wallet .fundrawtransaction (raw_tx , solving_data = {"descriptors" : [desc ]}, input_weights = [{"txid" : ext_utxo ["txid" ], "vout" : ext_utxo ["vout" ], "weight" : high_input_weight }], fee_rate = 2 )
1079
1079
assert_equal (funded_tx2 ["fee" ], funded_tx3 ["fee" ])
1080
1080
# The feerate should be met
1081
1081
funded_tx4 = wallet .fundrawtransaction (raw_tx , input_weights = [{"txid" : ext_utxo ["txid" ], "vout" : ext_utxo ["vout" ], "weight" : high_input_weight }], fee_rate = 10 )
@@ -1085,8 +1085,8 @@ def test_external_inputs(self):
1085
1085
assert_fee_amount (funded_tx4 ["fee" ], tx4_vsize , Decimal (0.0001 ))
1086
1086
1087
1087
# Funding with weight at csuint boundaries should not cause problems
1088
- funded_tx = wallet .fundrawtransaction (raw_tx , input_weights = [{"txid" : ext_utxo ["txid" ], "vout" : ext_utxo ["vout" ], "weight" : 255 }])
1089
- funded_tx = wallet .fundrawtransaction (raw_tx , input_weights = [{"txid" : ext_utxo ["txid" ], "vout" : ext_utxo ["vout" ], "weight" : 65539 }])
1088
+ funded_tx = wallet .fundrawtransaction (raw_tx , input_weights = [{"txid" : ext_utxo ["txid" ], "vout" : ext_utxo ["vout" ], "weight" : 255 }], fee_rate = 2 )
1089
+ funded_tx = wallet .fundrawtransaction (raw_tx , input_weights = [{"txid" : ext_utxo ["txid" ], "vout" : ext_utxo ["vout" ], "weight" : 65539 }], fee_rate = 2 )
1090
1090
1091
1091
self .nodes [2 ].unloadwallet ("extfund" )
1092
1092
0 commit comments