@@ -172,10 +172,13 @@ def test_batch_requests(self):
172
172
self .log .info ("Testing nonstandard jsonrpc 1.0 version number is accepted..." )
173
173
self .test_batch_request (lambda idx : BatchOptions (request_fields = {"jsonrpc" : "1.0" }))
174
174
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..." )
176
179
self .test_batch_request (lambda idx : BatchOptions (
177
180
request_fields = {"jsonrpc" : "2.1" },
178
- response_fields = { "result" : None , "error" : { "code" : RPC_INVALID_REQUEST , "message" : "JSON-RPC version not supported" }} ))
181
+ ))
179
182
180
183
def test_http_status_codes (self ):
181
184
self .log .info ("Testing HTTP status codes for JSON-RPC 1.1 requests..." )
@@ -201,11 +204,11 @@ def test_http_status_codes(self):
201
204
expect_http_rpc_status (200 , RPC_INVALID_PARAMETER , self .nodes [0 ], "getblockhash" , [42 ], 2 , False )
202
205
# force-send invalidly formatted requests
203
206
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 )
206
209
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 )
209
212
210
213
self .log .info ("Testing HTTP status codes for JSON-RPC 2.0 notifications..." )
211
214
# Not notification: id exists
0 commit comments