File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -201,6 +201,16 @@ def run_test(self):
201201 self .log .info ("Test the /block and /headers URIs" )
202202 bb_hash = self .nodes [0 ].getbestblockhash ()
203203
204+ # Check result if block does not exists
205+ assert_equal (self .test_rest_request ('/headers/1/0000000000000000000000000000000000000000000000000000000000000000' ), [])
206+ self .test_rest_request ('/block/0000000000000000000000000000000000000000000000000000000000000000' , status = 404 , ret_type = RetType .OBJ )
207+
208+ # Check result if block is not in the active chain
209+ self .nodes [0 ].invalidateblock (bb_hash )
210+ assert_equal (self .test_rest_request ('/headers/1/{}' .format (bb_hash )), [])
211+ self .test_rest_request ('/block/{}' .format (bb_hash ))
212+ self .nodes [0 ].reconsiderblock (bb_hash )
213+
204214 # Check binary format
205215 response = self .test_rest_request ("/block/{}" .format (bb_hash ), req_type = ReqType .BIN , ret_type = RetType .OBJ )
206216 assert_greater_than (int (response .getheader ('content-length' )), 80 )
You can’t perform that action at this time.
0 commit comments