@@ -172,10 +172,13 @@ def test_batch_requests(self):
172172 self .log .info ("Testing nonstandard jsonrpc 1.0 version number is accepted..." )
173173 self .test_batch_request (lambda idx : BatchOptions (request_fields = {"jsonrpc" : "1.0" }))
174174
175- self .log .info ("Testing unrecognized jsonrpc version number is rejected..." )
175+ self .log .info ("Testing nonstandard jsonrpc 1.0 version number is accepted as a Number..." )
176+ self .test_batch_request (lambda idx : BatchOptions (request_fields = {"jsonrpc" : 1.0 }))
177+
178+ self .log .info ("Testing unrecognized jsonrpc version number is accepted as if 1.0..." )
176179 self .test_batch_request (lambda idx : BatchOptions (
177180 request_fields = {"jsonrpc" : "2.1" },
178- response_fields = { "result" : None , "error" : { "code" : RPC_INVALID_REQUEST , "message" : "JSON-RPC version not supported" }} ))
181+ ))
179182
180183 def test_http_status_codes (self ):
181184 self .log .info ("Testing HTTP status codes for JSON-RPC 1.1 requests..." )
@@ -201,11 +204,11 @@ def test_http_status_codes(self):
201204 expect_http_rpc_status (200 , RPC_INVALID_PARAMETER , self .nodes [0 ], "getblockhash" , [42 ], 2 , False )
202205 # force-send invalidly formatted requests
203206 response , status = send_json_rpc (self .nodes [0 ], {"jsonrpc" : 2 , "method" : "getblockcount" })
204- assert_equal (response , {"result" : None , "error" : { "code" : RPC_INVALID_REQUEST , "message" : "jsonrpc field must be a string" } })
205- assert_equal (status , 400 )
207+ assert_equal (response , {"result" : 0 , "error" : None })
208+ assert_equal (status , 200 )
206209 response , status = send_json_rpc (self .nodes [0 ], {"jsonrpc" : "3.0" , "method" : "getblockcount" })
207- assert_equal (response , {"result" : None , "error" : { "code" : RPC_INVALID_REQUEST , "message" : "JSON-RPC version not supported" } })
208- assert_equal (status , 400 )
210+ assert_equal (response , {"result" : 0 , "error" : None })
211+ assert_equal (status , 200 )
209212
210213 self .log .info ("Testing HTTP status codes for JSON-RPC 2.0 notifications..." )
211214 # Not notification: id exists
0 commit comments