Skip to content

Commit

Permalink
Adjust call returns size
Browse files Browse the repository at this point in the history
  • Loading branch information
Liquid369 committed Oct 28, 2024
1 parent 42ee9a6 commit 70466c8
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions test/functional/test_framework/authproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,31 +137,25 @@ def get_request(self, *args, **argsn):
def __call__(self, *args, **argsn):
postdata = json.dumps(self.get_request(*args, **argsn), default=EncodeDecimal, ensure_ascii=self.ensure_ascii)
response, status = self._request('POST', self.__url.path, postdata.encode('utf-8'))
log.debug("Raw response content: %s", response)
if not isinstance(response, dict):
raise JSONRPCException({
'code': -342,
'message': 'Received non-JSON or malformed JSON response'
})

if response.get('error') is not None:
raise JSONRPCException(response['error'], status)
elif 'result' not in response:
raise JSONRPCException({
'code': -343, 'message': 'missing JSON-RPC result'}, status)
'code': -343, 'message': 'missing JSON-RPC result'})
elif status != HTTPStatus.OK:
raise JSONRPCException({
'code': -342, 'message': 'non-200 HTTP status code but no JSON-RPC error'}, status)
'code': -342, 'message': 'non-200 HTTP status code but no JSON-RPC error'})
else:
assert response['jsonrpc'] == '2.0'
if status != HTTPStatus.OK:
raise JSONRPCException({
'code': -342, 'message': 'non-200 HTTP status code'}, status)
'code': -342, 'message': 'non-200 HTTP status code'})
if 'error' in response:
raise JSONRPCException(response['error'], status)
elif 'result' not in response:
raise JSONRPCException({
'code': -343, 'message': 'missing JSON-RPC 2.0 result and error'}, status)
'code': -343, 'message': 'missing JSON-RPC 2.0 result and error'})
return response['result']

def batch(self, rpc_call_list):
Expand Down

0 comments on commit 70466c8

Please sign in to comment.