@@ -17,7 +17,7 @@ def setup_network(self, split=False):
1717 self .is_network_split = False
1818
1919 def run_test (self ):
20- print ("Mining blocks..." )
20+ self . log . info ("Mining blocks..." )
2121 self .nodes [0 ].generate (1 )
2222 self .nodes [1 ].generate (1 )
2323 timestamp = self .nodes [1 ].getblock (self .nodes [1 ].getbestblockhash ())['mediantime' ]
@@ -48,7 +48,7 @@ def run_test (self):
4848 # RPC importmulti -----------------------------------------------
4949
5050 # Bitcoin Address
51- print ("Should import an address" )
51+ self . log . info ("Should import an address" )
5252 address = self .nodes [0 ].validateaddress (self .nodes [0 ].getnewaddress ())
5353 result = self .nodes [1 ].importmulti ([{
5454 "scriptPubKey" : {
@@ -64,7 +64,7 @@ def run_test (self):
6464 watchonly_address = address ['address' ]
6565 watchonly_timestamp = timestamp
6666
67- print ("Should not import an invalid address" )
67+ self . log . info ("Should not import an invalid address" )
6868 result = self .nodes [1 ].importmulti ([{
6969 "scriptPubKey" : {
7070 "address" : "not valid address" ,
@@ -76,7 +76,7 @@ def run_test (self):
7676 assert_equal (result [0 ]['error' ]['message' ], 'Invalid address' )
7777
7878 # ScriptPubKey + internal
79- print ("Should import a scriptPubKey with internal flag" )
79+ self . log . info ("Should import a scriptPubKey with internal flag" )
8080 address = self .nodes [0 ].validateaddress (self .nodes [0 ].getnewaddress ())
8181 result = self .nodes [1 ].importmulti ([{
8282 "scriptPubKey" : address ['scriptPubKey' ],
@@ -90,7 +90,7 @@ def run_test (self):
9090 assert_equal (address_assert ['timestamp' ], timestamp )
9191
9292 # ScriptPubKey + !internal
93- print ("Should not import a scriptPubKey without internal flag" )
93+ self . log . info ("Should not import a scriptPubKey without internal flag" )
9494 address = self .nodes [0 ].validateaddress (self .nodes [0 ].getnewaddress ())
9595 result = self .nodes [1 ].importmulti ([{
9696 "scriptPubKey" : address ['scriptPubKey' ],
@@ -106,7 +106,7 @@ def run_test (self):
106106
107107
108108 # Address + Public key + !Internal
109- print ("Should import an address with public key" )
109+ self . log . info ("Should import an address with public key" )
110110 address = self .nodes [0 ].validateaddress (self .nodes [0 ].getnewaddress ())
111111 result = self .nodes [1 ].importmulti ([{
112112 "scriptPubKey" : {
@@ -123,7 +123,7 @@ def run_test (self):
123123
124124
125125 # ScriptPubKey + Public key + internal
126- print ("Should import a scriptPubKey with internal and with public key" )
126+ self . log . info ("Should import a scriptPubKey with internal and with public key" )
127127 address = self .nodes [0 ].validateaddress (self .nodes [0 ].getnewaddress ())
128128 request = [{
129129 "scriptPubKey" : address ['scriptPubKey' ],
@@ -139,7 +139,7 @@ def run_test (self):
139139 assert_equal (address_assert ['timestamp' ], timestamp )
140140
141141 # ScriptPubKey + Public key + !internal
142- print ("Should not import a scriptPubKey without internal and with public key" )
142+ self . log . info ("Should not import a scriptPubKey without internal and with public key" )
143143 address = self .nodes [0 ].validateaddress (self .nodes [0 ].getnewaddress ())
144144 request = [{
145145 "scriptPubKey" : address ['scriptPubKey' ],
@@ -156,7 +156,7 @@ def run_test (self):
156156 assert_equal ('timestamp' in address_assert , False )
157157
158158 # Address + Private key + !watchonly
159- print ("Should import an address with private key" )
159+ self . log . info ("Should import an address with private key" )
160160 address = self .nodes [0 ].validateaddress (self .nodes [0 ].getnewaddress ())
161161 result = self .nodes [1 ].importmulti ([{
162162 "scriptPubKey" : {
@@ -172,7 +172,7 @@ def run_test (self):
172172 assert_equal (address_assert ['timestamp' ], timestamp )
173173
174174 # Address + Private key + watchonly
175- print ("Should not import an address with private key and with watchonly" )
175+ self . log . info ("Should not import an address with private key and with watchonly" )
176176 address = self .nodes [0 ].validateaddress (self .nodes [0 ].getnewaddress ())
177177 result = self .nodes [1 ].importmulti ([{
178178 "scriptPubKey" : {
@@ -191,7 +191,7 @@ def run_test (self):
191191 assert_equal ('timestamp' in address_assert , False )
192192
193193 # ScriptPubKey + Private key + internal
194- print ("Should import a scriptPubKey with internal and with private key" )
194+ self . log . info ("Should import a scriptPubKey with internal and with private key" )
195195 address = self .nodes [0 ].validateaddress (self .nodes [0 ].getnewaddress ())
196196 result = self .nodes [1 ].importmulti ([{
197197 "scriptPubKey" : address ['scriptPubKey' ],
@@ -206,7 +206,7 @@ def run_test (self):
206206 assert_equal (address_assert ['timestamp' ], timestamp )
207207
208208 # ScriptPubKey + Private key + !internal
209- print ("Should not import a scriptPubKey without internal and with private key" )
209+ self . log . info ("Should not import a scriptPubKey without internal and with private key" )
210210 address = self .nodes [0 ].validateaddress (self .nodes [0 ].getnewaddress ())
211211 result = self .nodes [1 ].importmulti ([{
212212 "scriptPubKey" : address ['scriptPubKey' ],
@@ -233,7 +233,7 @@ def run_test (self):
233233 timestamp = self .nodes [1 ].getblock (self .nodes [1 ].getbestblockhash ())['mediantime' ]
234234 transaction = self .nodes [1 ].gettransaction (transactionid )
235235
236- print ("Should import a p2sh" )
236+ self . log . info ("Should import a p2sh" )
237237 result = self .nodes [1 ].importmulti ([{
238238 "scriptPubKey" : {
239239 "address" : multi_sig_script ['address' ]
@@ -261,7 +261,7 @@ def run_test (self):
261261 timestamp = self .nodes [1 ].getblock (self .nodes [1 ].getbestblockhash ())['mediantime' ]
262262 transaction = self .nodes [1 ].gettransaction (transactionid )
263263
264- print ("Should import a p2sh with respective redeem script" )
264+ self . log . info ("Should import a p2sh with respective redeem script" )
265265 result = self .nodes [1 ].importmulti ([{
266266 "scriptPubKey" : {
267267 "address" : multi_sig_script ['address' ]
@@ -289,7 +289,7 @@ def run_test (self):
289289 timestamp = self .nodes [1 ].getblock (self .nodes [1 ].getbestblockhash ())['mediantime' ]
290290 transaction = self .nodes [1 ].gettransaction (transactionid )
291291
292- print ("Should import a p2sh with respective redeem script and private keys" )
292+ self . log . info ("Should import a p2sh with respective redeem script and private keys" )
293293 result = self .nodes [1 ].importmulti ([{
294294 "scriptPubKey" : {
295295 "address" : multi_sig_script ['address' ]
@@ -316,7 +316,7 @@ def run_test (self):
316316 self .nodes [1 ].generate (1 )
317317 transaction = self .nodes [1 ].gettransaction (transactionid )
318318
319- print ("Should import a p2sh with respective redeem script and private keys" )
319+ self . log . info ("Should import a p2sh with respective redeem script and private keys" )
320320 result = self .nodes [1 ].importmulti ([{
321321 "scriptPubKey" : {
322322 "address" : multi_sig_script ['address' ]
@@ -332,7 +332,7 @@ def run_test (self):
332332
333333
334334 # Address + Public key + !Internal + Wrong pubkey
335- print ("Should not import an address with a wrong public key" )
335+ self . log . info ("Should not import an address with a wrong public key" )
336336 address = self .nodes [0 ].validateaddress (self .nodes [0 ].getnewaddress ())
337337 address2 = self .nodes [0 ].validateaddress (self .nodes [0 ].getnewaddress ())
338338 result = self .nodes [1 ].importmulti ([{
@@ -352,7 +352,7 @@ def run_test (self):
352352
353353
354354 # ScriptPubKey + Public key + internal + Wrong pubkey
355- print ("Should not import a scriptPubKey with internal and with a wrong public key" )
355+ self . log . info ("Should not import a scriptPubKey with internal and with a wrong public key" )
356356 address = self .nodes [0 ].validateaddress (self .nodes [0 ].getnewaddress ())
357357 address2 = self .nodes [0 ].validateaddress (self .nodes [0 ].getnewaddress ())
358358 request = [{
@@ -372,7 +372,7 @@ def run_test (self):
372372
373373
374374 # Address + Private key + !watchonly + Wrong private key
375- print ("Should not import an address with a wrong private key" )
375+ self . log . info ("Should not import an address with a wrong private key" )
376376 address = self .nodes [0 ].validateaddress (self .nodes [0 ].getnewaddress ())
377377 address2 = self .nodes [0 ].validateaddress (self .nodes [0 ].getnewaddress ())
378378 result = self .nodes [1 ].importmulti ([{
@@ -392,7 +392,7 @@ def run_test (self):
392392
393393
394394 # ScriptPubKey + Private key + internal + Wrong private key
395- print ("Should not import a scriptPubKey with internal and with a wrong private key" )
395+ self . log . info ("Should not import a scriptPubKey with internal and with a wrong private key" )
396396 address = self .nodes [0 ].validateaddress (self .nodes [0 ].getnewaddress ())
397397 address2 = self .nodes [0 ].validateaddress (self .nodes [0 ].getnewaddress ())
398398 result = self .nodes [1 ].importmulti ([{
@@ -418,7 +418,7 @@ def run_test (self):
418418 assert_equal (address_assert ['timestamp' ], watchonly_timestamp );
419419
420420 # Bad or missing timestamps
421- print ("Should throw on invalid or missing timestamp values" )
421+ self . log . info ("Should throw on invalid or missing timestamp values" )
422422 assert_raises_message (JSONRPCException , 'Missing required timestamp field for key' ,
423423 self .nodes [1 ].importmulti , [{
424424 "scriptPubKey" : address ['scriptPubKey' ],
0 commit comments