@@ -72,7 +72,13 @@ def run_test(self):
7272 assert_raises_rpc_error (- 8 , "parameter 3 must be hexadecimal" , self .nodes [0 ].getrawtransaction , tx , True , True )
7373 assert_raises_rpc_error (- 8 , "parameter 3 must be hexadecimal" , self .nodes [0 ].getrawtransaction , tx , True , "foobar" )
7474 assert_raises_rpc_error (- 8 , "parameter 3 must be of length 64" , self .nodes [0 ].getrawtransaction , tx , True , "abcd1234" )
75- assert_raises_rpc_error (- 5 , "Block hash not found" , self .nodes [0 ].getrawtransaction , tx , True , "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" )
75+ assert_raises_rpc_error (- 5 , "Block hash not found" , self .nodes [0 ].getrawtransaction , tx , True , "0000000000000000000000000000000000000000000000000000000000000000" )
76+ # Undo the blocks and check in_active_chain
77+ self .nodes [0 ].invalidateblock (block1 )
78+ gottx = self .nodes [0 ].getrawtransaction (txid = tx , verbose = True , blockhash = block1 )
79+ assert_equal (gottx ['in_active_chain' ], False )
80+ self .nodes [0 ].reconsiderblock (block1 )
81+ assert_equal (self .nodes [0 ].getbestblockhash (), block2 )
7682
7783 #########################
7884 # RAW TX MULTISIG TESTS #
@@ -212,13 +218,13 @@ def run_test(self):
212218 assert_equal (self .nodes [0 ].getrawtransaction (txHash , True )["hex" ], rawTxSigned ['hex' ])
213219
214220 # 6. invalid parameters - supply txid and string "Flase"
215- assert_raises_rpc_error (- 1 ,"not a boolean" , self .nodes [0 ].getrawtransaction , txHash , "Flase" )
221+ assert_raises_rpc_error (- 1 , "not a boolean" , self .nodes [0 ].getrawtransaction , txHash , "Flase" )
216222
217223 # 7. invalid parameters - supply txid and empty array
218- assert_raises_rpc_error (- 1 ,"not a boolean" , self .nodes [0 ].getrawtransaction , txHash , [])
224+ assert_raises_rpc_error (- 1 , "not a boolean" , self .nodes [0 ].getrawtransaction , txHash , [])
219225
220226 # 8. invalid parameters - supply txid and empty dict
221- assert_raises_rpc_error (- 1 ,"not a boolean" , self .nodes [0 ].getrawtransaction , txHash , {})
227+ assert_raises_rpc_error (- 1 , "not a boolean" , self .nodes [0 ].getrawtransaction , txHash , {})
222228
223229 inputs = [ {'txid' : "1d1d4e24ed99057e84c3f80fd8fbec79ed9e1acee37da269356ecea000000000" , 'vout' : 1 , 'sequence' : 1000 }]
224230 outputs = { self .nodes [0 ].getnewaddress () : 1 }
0 commit comments