MCPcopy Create free account
hub / github.com/LUX-Core/lux / __call__

Method __call__

test/functional/test_framework/authproxy.py:141–159  ·  view source on GitHub ↗
(self, *args, **argsn)

Source from the content-addressed store, hash-verified

139 return self._get_response()
140
141 def __call__(self, *args, **argsn):
142 AuthServiceProxy.__id_count += 1
143
144 log.debug("-%s-> %s %s"%(AuthServiceProxy.__id_count, self._service_name,
145 json.dumps(args, default=EncodeDecimal, ensure_ascii=self.ensure_ascii)))
146 if args and argsn:
147 raise ValueError('Cannot handle both named and positional arguments')
148 postdata = json.dumps({'version': '1.1',
149 'method': self._service_name,
150 'params': args or argsn,
151 'id': AuthServiceProxy.__id_count}, default=EncodeDecimal, ensure_ascii=self.ensure_ascii)
152 response = self._request('POST', self.__url.path, postdata.encode('utf-8'))
153 if response['error'] is not None:
154 raise JSONRPCException(response['error'])
155 elif 'result' not in response:
156 raise JSONRPCException({
157 'code': -343, 'message': 'missing JSON-RPC result'})
158 else:
159 return response['result']
160
161 def _batch(self, rpc_call_list):
162 postdata = json.dumps(list(rpc_call_list), default=EncodeDecimal, ensure_ascii=self.ensure_ascii)

Callers

nothing calls this directly

Calls 4

_requestMethod · 0.95
debugMethod · 0.80
JSONRPCExceptionClass · 0.70
encodeMethod · 0.45

Tested by

no test coverage detected