@@ -29,9 +29,9 @@ def skip_test_if_missing_module(self):
2929
3030 def test_send (self , from_wallet , to_wallet = None , amount = None , data = None ,
3131 arg_conf_target = None , arg_estimate_mode = None ,
32- conf_target = None , estimate_mode = None , add_to_wallet = None ,psbt = None ,
33- inputs = None ,add_inputs = None ,change_address = None ,change_position = None ,change_type = None ,
34- include_watching = None ,locktime = None ,lock_unspents = None ,replaceable = None ,subtract_fee_from_outputs = None ,
32+ conf_target = None , estimate_mode = None , add_to_wallet = None , psbt = None ,
33+ inputs = None , add_inputs = None , change_address = None , change_position = None , change_type = None ,
34+ include_watching = None , locktime = None , lock_unspents = None , replaceable = None , subtract_fee_from_outputs = None ,
3535 expect_error = None ):
3636 assert (amount is None ) != (data is None )
3737
@@ -92,13 +92,13 @@ def test_send(self, from_wallet, to_wallet=None, amount=None, data=None,
9292 res = from_wallet .send (outputs = outputs , conf_target = arg_conf_target , estimate_mode = arg_estimate_mode , options = options )
9393 else :
9494 try :
95- assert_raises_rpc_error (expect_error [0 ],expect_error [1 ],from_wallet .send ,
96- outputs = outputs ,conf_target = arg_conf_target ,estimate_mode = arg_estimate_mode ,options = options )
95+ assert_raises_rpc_error (expect_error [0 ], expect_error [1 ], from_wallet .send ,
96+ outputs = outputs , conf_target = arg_conf_target , estimate_mode = arg_estimate_mode , options = options )
9797 except AssertionError :
9898 # Provide debug info if the test fails
9999 self .log .error ("Unexpected successful result:" )
100100 self .log .error (options )
101- res = from_wallet .send (outputs = outputs ,conf_target = arg_conf_target ,estimate_mode = arg_estimate_mode ,options = options )
101+ res = from_wallet .send (outputs = outputs , conf_target = arg_conf_target , estimate_mode = arg_estimate_mode , options = options )
102102 self .log .error (res )
103103 if "txid" in res and add_to_wallet :
104104 self .log .error ("Transaction details:" )
@@ -131,7 +131,7 @@ def test_send(self, from_wallet, to_wallet=None, amount=None, data=None,
131131 assert tx
132132 assert_equal (tx ["bip125-replaceable" ], "yes" if replaceable else "no" )
133133 # Ensure transaction exists in the mempool:
134- tx = from_wallet .getrawtransaction (res ["txid" ],True )
134+ tx = from_wallet .getrawtransaction (res ["txid" ], True )
135135 assert tx
136136 if amount :
137137 if subtract_fee_from_outputs :
@@ -164,7 +164,7 @@ def run_test(self):
164164 self .nodes [1 ].createwallet (wallet_name = "w2" )
165165 w2 = self .nodes [1 ].get_wallet_rpc ("w2" )
166166 # w3 is a watch-only wallet, based on w2
167- self .nodes [1 ].createwallet (wallet_name = "w3" ,disable_private_keys = True )
167+ self .nodes [1 ].createwallet (wallet_name = "w3" , disable_private_keys = True )
168168 w3 = self .nodes [1 ].get_wallet_rpc ("w3" )
169169 for _ in range (3 ):
170170 a2_receive = w2 .getnewaddress ()
@@ -188,7 +188,7 @@ def run_test(self):
188188 self .sync_blocks ()
189189
190190 # w4 has private keys enabled, but only contains watch-only keys (from w2)
191- self .nodes [1 ].createwallet (wallet_name = "w4" ,disable_private_keys = False )
191+ self .nodes [1 ].createwallet (wallet_name = "w4" , disable_private_keys = False )
192192 w4 = self .nodes [1 ].get_wallet_rpc ("w4" )
193193 for _ in range (3 ):
194194 a2_receive = w2 .getnewaddress ()
@@ -253,7 +253,7 @@ def run_test(self):
253253 self .test_send (from_wallet = w0 , to_wallet = w1 , amount = 1 , conf_target = - 1 , estimate_mode = "sat/b" ,
254254 expect_error = (- 3 , "Amount out of range" ))
255255 # Fee rate of 0.1 satoshi per byte should throw an error
256- # TODO: error should say 1.000 sat/b
256+ # TODO: error should use sat/b
257257 self .test_send (from_wallet = w0 , to_wallet = w1 , amount = 1 , conf_target = 0.1 , estimate_mode = "sat/b" ,
258258 expect_error = (- 4 , "Fee rate (0.00000100 BTC/kB) is lower than the minimum fee rate setting (0.00001000 BTC/kB)" ))
259259
@@ -325,7 +325,8 @@ def run_test(self):
325325 locked_coins = w0 .listlockunspent ()
326326 assert_equal (len (locked_coins ), 1 )
327327 # Locked coins are automatically unlocked when manually selected
328- self .test_send (from_wallet = w0 , to_wallet = w1 , amount = 1 , inputs = [utxo1 ],add_to_wallet = False )
328+ res = self .test_send (from_wallet = w0 , to_wallet = w1 , amount = 1 , inputs = [utxo1 ], add_to_wallet = False )
329+ assert res ["complete" ]
329330
330331 self .log .info ("Replaceable..." )
331332 res = self .test_send (from_wallet = w0 , to_wallet = w1 , amount = 1 , add_to_wallet = True , replaceable = True )
0 commit comments