Skip to content

Commit

Permalink
authproxy: Add support for RPC named arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
laanwj committed Jan 5, 2017
1 parent 406f35d commit 5865d41
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions qa/rpc-tests/test_framework/authproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,16 @@ def _request(self, method, path, postdata):
self.__conn.request(method, path, postdata, headers)
return self._get_response()

def __call__(self, *args):
def __call__(self, *args, **argsn):
AuthServiceProxy.__id_count += 1

log.debug("-%s-> %s %s"%(AuthServiceProxy.__id_count, self._service_name,
json.dumps(args, default=EncodeDecimal, ensure_ascii=self.ensure_ascii)))
if args and argsn:
raise ValueError('Cannot handle both named and positional arguments')
postdata = json.dumps({'version': '1.1',
'method': self._service_name,
'params': args,
'params': args or argsn,
'id': AuthServiceProxy.__id_count}, default=EncodeDecimal, ensure_ascii=self.ensure_ascii)
response = self._request('POST', self.__url.path, postdata.encode('utf-8'))
if response['error'] is not None:
Expand Down

0 comments on commit 5865d41

Please sign in to comment.