diff --git a/test/functional/test_framework/authproxy.py b/test/functional/test_framework/authproxy.py index e4f970cba92891..5fe519b3e1d7a2 100644 --- a/test/functional/test_framework/authproxy.py +++ b/test/functional/test_framework/authproxy.py @@ -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):