@@ -210,6 +210,8 @@ def run_test(self):
210
210
assert_equal (self .nodes [2 ].getbalance (), node_2_bal )
211
211
node_0_bal = self .check_fee_amount (self .nodes [0 ].getbalance (), Decimal ('20' ), fee_per_byte , self .get_vsize (self .nodes [2 ].gettransaction (txid )['hex' ]))
212
212
213
+ self .log .info ("Test sendmany" )
214
+
213
215
# Sendmany 10 BTC
214
216
txid = self .nodes [2 ].sendmany ('' , {address : 10 }, 0 , "" , [])
215
217
self .nodes [2 ].generate (1 )
@@ -226,7 +228,7 @@ def run_test(self):
226
228
assert_equal (self .nodes [2 ].getbalance (), node_2_bal )
227
229
node_0_bal = self .check_fee_amount (self .nodes [0 ].getbalance (), node_0_bal + Decimal ('10' ), fee_per_byte , self .get_vsize (self .nodes [2 ].gettransaction (txid )['hex' ]))
228
230
229
- # Sendmany with explicit fee ( BTC/kB)
231
+ self . log . info ( "Test case-insensitive explicit fee rate (sendmany as BTC/kB)" )
230
232
# Throw if no conf_target provided
231
233
assert_raises_rpc_error (- 8 , "Selected estimate_mode bTc/kB requires a fee rate to be specified in conf_target" ,
232
234
self .nodes [2 ].sendmany ,
@@ -252,7 +254,7 @@ def run_test(self):
252
254
node_0_bal += Decimal ('10' )
253
255
assert_equal (self .nodes [0 ].getbalance (), node_0_bal )
254
256
255
- # Sendmany with explicit fee (SAT/B )
257
+ self . log . info ( "Test case-insensitive explicit fee rate (sendmany as sat/B)" )
256
258
# Throw if no conf_target provided
257
259
assert_raises_rpc_error (- 8 , "Selected estimate_mode sat/b requires a fee rate to be specified in conf_target" ,
258
260
self .nodes [2 ].sendmany ,
@@ -280,6 +282,12 @@ def run_test(self):
280
282
node_0_bal += Decimal ('10' )
281
283
assert_equal (self .nodes [0 ].getbalance (), node_0_bal )
282
284
285
+ # Test setting explicit fee rate just below the minimum.
286
+ for unit , fee_rate in {"BTC/kB" : 0.00000999 , "sat/B" : 0.99999999 }.items ():
287
+ self .log .info ("Test sendmany raises 'fee rate too low' if conf_target {} and estimate_mode {} are passed" .format (fee_rate , unit ))
288
+ assert_raises_rpc_error (- 6 , "Fee rate (0.00000999 BTC/kB) is lower than the minimum fee rate setting (0.00001000 BTC/kB)" ,
289
+ self .nodes [2 ].sendmany , amounts = {address : 10 }, estimate_mode = unit , conf_target = fee_rate )
290
+
283
291
self .start_node (3 , self .nodes [3 ].extra_args )
284
292
connect_nodes (self .nodes [0 ], 3 )
285
293
self .sync_all ()
@@ -413,8 +421,7 @@ def run_test(self):
413
421
self .nodes [0 ].generate (1 )
414
422
self .sync_all (self .nodes [0 :3 ])
415
423
416
- # send with explicit btc/kb fee
417
- self .log .info ("test explicit fee (sendtoaddress as btc/kb)" )
424
+ self .log .info ("Test case-insensitive explicit fee rate (sendtoaddress as BTC/kB)" )
418
425
self .nodes [0 ].generate (1 )
419
426
self .sync_all (self .nodes [0 :3 ])
420
427
prebalance = self .nodes [2 ].getbalance ()
@@ -447,9 +454,9 @@ def run_test(self):
447
454
fee = prebalance - postbalance - Decimal ('1' )
448
455
assert_fee_amount (fee , tx_size , Decimal ('0.00002500' ))
449
456
450
- # send with explicit sat/b fee
451
457
self .sync_all (self .nodes [0 :3 ])
452
- self .log .info ("test explicit fee (sendtoaddress as sat/b)" )
458
+
459
+ self .log .info ("Test case-insensitive explicit fee rate (sendtoaddress as sat/B)" )
453
460
self .nodes [0 ].generate (1 )
454
461
prebalance = self .nodes [2 ].getbalance ()
455
462
assert prebalance > 2
@@ -481,6 +488,12 @@ def run_test(self):
481
488
fee = prebalance - postbalance - Decimal ('1' )
482
489
assert_fee_amount (fee , tx_size , Decimal ('0.00002000' ))
483
490
491
+ # Test setting explicit fee rate just below the minimum.
492
+ for unit , fee_rate in {"BTC/kB" : 0.00000999 , "sat/B" : 0.99999999 }.items ():
493
+ self .log .info ("Test sendtoaddress raises 'fee rate too low' if conf_target {} and estimate_mode {} are passed" .format (fee_rate , unit ))
494
+ assert_raises_rpc_error (- 6 , "Fee rate (0.00000999 BTC/kB) is lower than the minimum fee rate setting (0.00001000 BTC/kB)" ,
495
+ self .nodes [2 ].sendtoaddress , address = address , amount = 1 , estimate_mode = unit , conf_target = fee_rate )
496
+
484
497
# 2. Import address from node2 to node1
485
498
self .nodes [1 ].importaddress (address_to_import )
486
499
0 commit comments