@@ -240,6 +240,30 @@ def sendall_fails_on_missing_input(self):
240
240
foreign_utxo ["vout" ]), self .wallet .sendall , recipients = [self .remainder_target ],
241
241
options = {"inputs" : [foreign_utxo ]})
242
242
243
+ @cleanup
244
+ def sendall_fails_on_no_address (self ):
245
+ self .log .info ("Test sendall fails because no address is provided" )
246
+ self .add_utxos ([19 , 2 ])
247
+
248
+ assert_raises_rpc_error (
249
+ - 8 ,
250
+ "Must provide at least one address without a specified amount" ,
251
+ self .wallet .sendall ,
252
+ []
253
+ )
254
+
255
+ @cleanup
256
+ def sendall_fails_on_specific_inputs_with_send_max (self ):
257
+ self .log .info ("Test sendall fails because send_max is used while specific inputs are provided" )
258
+ self .add_utxos ([15 , 6 ])
259
+ utxo = self .wallet .listunspent ()[0 ]
260
+
261
+ assert_raises_rpc_error (- 8 ,
262
+ "Cannot combine send_max with specific inputs." ,
263
+ self .wallet .sendall ,
264
+ recipients = [self .remainder_target ],
265
+ options = {"inputs" : [utxo ], "send_max" : True })
266
+
243
267
def run_test (self ):
244
268
self .nodes [0 ].createwallet ("activewallet" )
245
269
self .wallet = self .nodes [0 ].get_wallet_rpc ("activewallet" )
@@ -282,5 +306,11 @@ def run_test(self):
282
306
# Fails for the right reasons on missing or previously spent UTXOs
283
307
self .sendall_fails_on_missing_input ()
284
308
309
+ # Sendall fails when no address is provided
310
+ self .sendall_fails_on_no_address ()
311
+
312
+ # Sendall fails when using send_max while specifying inputs
313
+ self .sendall_fails_on_specific_inputs_with_send_max ()
314
+
285
315
if __name__ == '__main__' :
286
316
SendallTest ().main ()
0 commit comments