@@ -29,9 +29,9 @@ def skip_test_if_missing_module(self):
29
29
30
30
def test_send (self , from_wallet , to_wallet = None , amount = None , data = None ,
31
31
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 ,
35
35
expect_error = None ):
36
36
assert (amount is None ) != (data is None )
37
37
@@ -92,13 +92,13 @@ def test_send(self, from_wallet, to_wallet=None, amount=None, data=None,
92
92
res = from_wallet .send (outputs = outputs , conf_target = arg_conf_target , estimate_mode = arg_estimate_mode , options = options )
93
93
else :
94
94
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 )
97
97
except AssertionError :
98
98
# Provide debug info if the test fails
99
99
self .log .error ("Unexpected successful result:" )
100
100
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 )
102
102
self .log .error (res )
103
103
if "txid" in res and add_to_wallet :
104
104
self .log .error ("Transaction details:" )
@@ -131,7 +131,7 @@ def test_send(self, from_wallet, to_wallet=None, amount=None, data=None,
131
131
assert tx
132
132
assert_equal (tx ["bip125-replaceable" ], "yes" if replaceable else "no" )
133
133
# Ensure transaction exists in the mempool:
134
- tx = from_wallet .getrawtransaction (res ["txid" ],True )
134
+ tx = from_wallet .getrawtransaction (res ["txid" ], True )
135
135
assert tx
136
136
if amount :
137
137
if subtract_fee_from_outputs :
@@ -164,7 +164,7 @@ def run_test(self):
164
164
self .nodes [1 ].createwallet (wallet_name = "w2" )
165
165
w2 = self .nodes [1 ].get_wallet_rpc ("w2" )
166
166
# 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 )
168
168
w3 = self .nodes [1 ].get_wallet_rpc ("w3" )
169
169
for _ in range (3 ):
170
170
a2_receive = w2 .getnewaddress ()
@@ -188,7 +188,7 @@ def run_test(self):
188
188
self .sync_blocks ()
189
189
190
190
# 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 )
192
192
w4 = self .nodes [1 ].get_wallet_rpc ("w4" )
193
193
for _ in range (3 ):
194
194
a2_receive = w2 .getnewaddress ()
@@ -253,7 +253,7 @@ def run_test(self):
253
253
self .test_send (from_wallet = w0 , to_wallet = w1 , amount = 1 , conf_target = - 1 , estimate_mode = "sat/b" ,
254
254
expect_error = (- 3 , "Amount out of range" ))
255
255
# 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
257
257
self .test_send (from_wallet = w0 , to_wallet = w1 , amount = 1 , conf_target = 0.1 , estimate_mode = "sat/b" ,
258
258
expect_error = (- 4 , "Fee rate (0.00000100 BTC/kB) is lower than the minimum fee rate setting (0.00001000 BTC/kB)" ))
259
259
@@ -325,7 +325,8 @@ def run_test(self):
325
325
locked_coins = w0 .listlockunspent ()
326
326
assert_equal (len (locked_coins ), 1 )
327
327
# 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" ]
329
330
330
331
self .log .info ("Replaceable..." )
331
332
res = self .test_send (from_wallet = w0 , to_wallet = w1 , amount = 1 , add_to_wallet = True , replaceable = True )
0 commit comments