@@ -426,30 +426,33 @@ def run_test(self):
426
426
self .sync_all ()
427
427
428
428
# getrawtransaction tests
429
- # 1. valid parameters - only supply txid
430
- assert_equal (self .nodes [0 ].getrawtransaction (txId ), rawTxSigned ['hex' ])
429
+ for n in [0 , 3 ]:
430
+ self .log .info (f"Test getrawtransaction { 'with' if n == 0 else 'without' } -txindex" )
431
+ # 1. valid parameters - only supply txid
432
+ assert_equal (self .nodes [n ].getrawtransaction (txId ), rawTxSigned ['hex' ])
431
433
432
- # 2. valid parameters - supply txid and 0 for non-verbose
433
- assert_equal (self .nodes [0 ].getrawtransaction (txId , 0 ), rawTxSigned ['hex' ])
434
+ # 2. valid parameters - supply txid and 0 for non-verbose
435
+ assert_equal (self .nodes [n ].getrawtransaction (txId , 0 ), rawTxSigned ['hex' ])
434
436
435
- # 3. valid parameters - supply txid and False for non-verbose
436
- assert_equal (self .nodes [0 ].getrawtransaction (txId , False ), rawTxSigned ['hex' ])
437
+ # 3. valid parameters - supply txid and False for non-verbose
438
+ assert_equal (self .nodes [n ].getrawtransaction (txId , False ), rawTxSigned ['hex' ])
437
439
438
- # 4. valid parameters - supply txid and 1 for verbose.
439
- # We only check the "hex" field of the output so we don't need to update this test every time the output format changes.
440
- assert_equal (self .nodes [0 ].getrawtransaction (txId , 1 )["hex" ], rawTxSigned ['hex' ])
440
+ # 4. valid parameters - supply txid and 1 for verbose.
441
+ # We only check the "hex" field of the output so we don't need to update this test every time the output format changes.
442
+ assert_equal (self .nodes [n ].getrawtransaction (txId , 1 )["hex" ], rawTxSigned ['hex' ])
441
443
442
- # 5. valid parameters - supply txid and True for non-verbose
443
- assert_equal (self .nodes [0 ].getrawtransaction (txId , True )["hex" ], rawTxSigned ['hex' ])
444
+ # 5. valid parameters - supply txid and True for non-verbose
445
+ assert_equal (self .nodes [n ].getrawtransaction (txId , True )["hex" ], rawTxSigned ['hex' ])
444
446
445
- # 6. invalid parameters - supply txid and string "Flase"
446
- assert_raises_rpc_error (- 1 , "not a boolean" , self .nodes [0 ].getrawtransaction , txId , "Flase" )
447
+ # 6. invalid parameters - supply txid and invalid boolean values (strings) for verbose
448
+ for value in ["True" , "False" ]:
449
+ assert_raises_rpc_error (- 1 , "not a boolean" , self .nodes [n ].getrawtransaction , txid = txId , verbose = value )
447
450
448
- # 7. invalid parameters - supply txid and empty array
449
- assert_raises_rpc_error (- 1 , "not a boolean" , self .nodes [0 ].getrawtransaction , txId , [])
451
+ # 7. invalid parameters - supply txid and empty array
452
+ assert_raises_rpc_error (- 1 , "not a boolean" , self .nodes [n ].getrawtransaction , txId , [])
450
453
451
- # 8. invalid parameters - supply txid and empty dict
452
- assert_raises_rpc_error (- 1 , "not a boolean" , self .nodes [0 ].getrawtransaction , txId , {})
454
+ # 8. invalid parameters - supply txid and empty dict
455
+ assert_raises_rpc_error (- 1 , "not a boolean" , self .nodes [n ].getrawtransaction , txId , {})
453
456
454
457
####################################
455
458
# TRANSACTION VERSION NUMBER TESTS #
0 commit comments