@@ -202,23 +202,23 @@ def test_bump_back_to_yourself(self):
202
202
self .generate (self .nodes [0 ], 1 )
203
203
204
204
# Create a tx with two outputs. recipient and change.
205
- tx = wallet .send (outputs = {wallet .getnewaddress (): 9 }, fee_rate = 2 )
205
+ tx = wallet .send (outputs = {wallet .getnewaddress (): 9 }, fee_rate = 500 )
206
206
tx_info = wallet .gettransaction (txid = tx ["txid" ], verbose = True )
207
207
assert_equal (len (tx_info ["decoded" ]["vout" ]), 2 )
208
208
assert_equal (len (tx_info ["decoded" ]["vin" ]), 2 )
209
209
210
210
# Bump tx, send coins back to change address.
211
211
change_addr = get_change_address (tx ["txid" ], wallet )[0 ]
212
212
out_amount = 10
213
- bumped = wallet .bumpfee (txid = tx ["txid" ], options = {"fee_rate" : 20 , "outputs" : [{change_addr : out_amount }]})
213
+ bumped = wallet .bumpfee (txid = tx ["txid" ], options = {"fee_rate" : 900 , "outputs" : [{change_addr : out_amount }]})
214
214
bumped_tx = wallet .gettransaction (txid = bumped ["txid" ], verbose = True )
215
215
assert_equal (len (bumped_tx ["decoded" ]["vout" ]), 1 )
216
216
assert_equal (len (bumped_tx ["decoded" ]["vin" ]), 2 )
217
217
assert_equal (bumped_tx ["decoded" ]["vout" ][0 ]["value" ] + bumped ["fee" ], out_amount )
218
218
219
219
# Bump tx again, now test send fewer coins back to change address.
220
220
out_amount = 6
221
- bumped = wallet .bumpfee (txid = bumped ["txid" ], options = {"fee_rate" : 40 , "outputs" : [{change_addr : out_amount }]})
221
+ bumped = wallet .bumpfee (txid = bumped ["txid" ], options = {"fee_rate" : 1000 , "outputs" : [{change_addr : out_amount }]})
222
222
bumped_tx = wallet .gettransaction (txid = bumped ["txid" ], verbose = True )
223
223
assert_equal (len (bumped_tx ["decoded" ]["vout" ]), 2 )
224
224
assert_equal (len (bumped_tx ["decoded" ]["vin" ]), 2 )
@@ -228,7 +228,7 @@ def test_bump_back_to_yourself(self):
228
228
229
229
# Bump tx again, send more coins back to change address. The process will add another input to cover the target.
230
230
out_amount = 12
231
- bumped = wallet .bumpfee (txid = bumped ["txid" ], options = {"fee_rate" : 80 , "outputs" : [{change_addr : out_amount }]})
231
+ bumped = wallet .bumpfee (txid = bumped ["txid" ], options = {"fee_rate" : 1200 , "outputs" : [{change_addr : out_amount }]})
232
232
bumped_tx = wallet .gettransaction (txid = bumped ["txid" ], verbose = True )
233
233
assert_equal (len (bumped_tx ["decoded" ]["vout" ]), 2 )
234
234
assert_equal (len (bumped_tx ["decoded" ]["vin" ]), 3 )
@@ -269,38 +269,38 @@ def test_provided_change_pos(self, rbf_node):
269
269
def test_single_output (self ):
270
270
self .log .info ("Test that single output txs can be bumped" )
271
271
node = self .nodes [1 ]
272
-
272
+
273
273
node .createwallet ("single_out_rbf" )
274
274
wallet = node .get_wallet_rpc ("single_out_rbf" )
275
-
275
+
276
276
addr = wallet .getnewaddress ()
277
- amount = Decimal ("0.001 " )
277
+ amount = Decimal ("0.009 " )
278
278
# Make 2 UTXOs
279
279
self .nodes [0 ].sendtoaddress (addr , amount )
280
280
self .nodes [0 ].sendtoaddress (addr , amount )
281
281
self .generate (self .nodes [0 ], 1 )
282
282
utxos = wallet .listunspent ()
283
-
284
- tx = wallet .sendall (recipients = [wallet .getnewaddress ()], fee_rate = 2 , options = {"inputs" : [utxos [0 ]]})
285
-
283
+
284
+ tx = wallet .sendall (recipients = [wallet .getnewaddress ()], fee_rate = 500 , options = {"inputs" : [utxos [0 ]]})
285
+
286
286
# Set the only output with a crazy high feerate as change, should fail as the output would be dust
287
- assert_raises_rpc_error (- 4 , "The transaction amount is too small to pay the fee" , wallet .bumpfee , txid = tx ["txid" ], options = {"fee_rate" : 1100 , "original_change_index" : 0 })
288
-
287
+ assert_raises_rpc_error (- 4 , "The transaction amount is too small to pay the fee" , wallet .bumpfee , txid = tx ["txid" ], options = {"fee_rate" : 9100 , "original_change_index" : 0 })
288
+
289
289
# Specify single output as change successfully
290
- bumped = wallet .bumpfee (txid = tx ["txid" ], options = {"fee_rate" : 10 , "original_change_index" : 0 })
290
+ bumped = wallet .bumpfee (txid = tx ["txid" ], options = {"fee_rate" : 510 , "original_change_index" : 0 })
291
291
bumped_tx = wallet .gettransaction (txid = bumped ["txid" ], verbose = True )
292
- assert_equal (len (bumped_tx ["decoded" ]["vout" ]), 1 )
292
+ assert_equal (len (bumped_tx ["decoded" ]["vout" ]), 2 )
293
293
assert_equal (len (bumped_tx ["decoded" ]["vin" ]), 1 )
294
- assert_equal (bumped_tx ["decoded" ]["vout" ][0 ]["value" ] + bumped ["fee" ], amount )
295
- assert_fee_amount (bumped ["fee" ], bumped_tx ["decoded" ]["vsize" ], Decimal (10 ) / Decimal (1e8 ) * 1000 )
296
-
294
+ assert_equal (bumped_tx ["decoded" ]["vout" ][0 ]["value" ] + bumped_tx [ "decoded" ][ "vout" ][ 1 ][ "value" ] + bumped ["fee" ], amount )
295
+ assert_fee_amount (bumped ["fee" ], bumped_tx ["decoded" ]["vsize" ], Decimal (510 ) / Decimal (1e8 ) * 1000 )
296
+
297
297
# Bumping without specifying change adds a new input and output
298
- bumped = wallet .bumpfee (txid = bumped ["txid" ], options = {"fee_rate" : 20 })
298
+ bumped = wallet .bumpfee (txid = bumped ["txid" ], options = {"fee_rate" : 520 })
299
299
bumped_tx = wallet .gettransaction (txid = bumped ["txid" ], verbose = True )
300
300
assert_equal (len (bumped_tx ["decoded" ]["vout" ]), 2 )
301
- assert_equal (len (bumped_tx ["decoded" ]["vin" ]), 2 )
302
- assert_fee_amount (bumped ["fee" ], bumped_tx ["decoded" ]["vsize" ], Decimal (20 ) / Decimal (1e8 ) * 1000 )
303
-
301
+ assert_equal (len (bumped_tx ["decoded" ]["vin" ]), 1 )
302
+ assert_fee_amount (bumped ["fee" ], bumped_tx ["decoded" ]["vsize" ], Decimal (520 ) / Decimal (1e8 ) * 1000 )
303
+
304
304
wallet .unloadwallet ()
305
305
306
306
def test_simple_bumpfee_succeeds (self , mode , rbf_node , peer_node , dest_address ):
0 commit comments