From 062c65b46165797a3c59c48a0f5159b5b0dc3492 Mon Sep 17 00:00:00 2001 From: wip-abramson Date: Wed, 12 May 2021 17:54:51 +0100 Subject: [PATCH 1/2] fix minor bugs in recovation and issuer api --- aries_cloudcontroller/controllers/issuer.py | 21 ++++++++++++++++--- .../controllers/revocation.py | 6 +++--- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/aries_cloudcontroller/controllers/issuer.py b/aries_cloudcontroller/controllers/issuer.py index e0d48c1c..befcf95f 100644 --- a/aries_cloudcontroller/controllers/issuer.py +++ b/aries_cloudcontroller/controllers/issuer.py @@ -26,9 +26,24 @@ def __init__( self.definitions = definition_controller # Fetch all credential exchange records - async def get_records(self): - - return await self.admin_GET(f"{self.base_url}/records") + async def get_records( + self, + connection_id: str = None, + thread_id: str = None, + state: str = None, + role: str = None, + ): + params = {} + if connection_id: + params["connection_id"] = connection_id + if thread_id: + params["thread_id"] = thread_id + if state: + params["state"] = state + if role: + params["role"] = role + + return await self.admin_GET(f"{self.base_url}/records", params=params) async def get_record_by_id(self, cred_ex_id): return await self.admin_GET(f"{self.base_url}/records/{cred_ex_id}") diff --git a/aries_cloudcontroller/controllers/revocation.py b/aries_cloudcontroller/controllers/revocation.py index 8ba36577..baf88d43 100644 --- a/aries_cloudcontroller/controllers/revocation.py +++ b/aries_cloudcontroller/controllers/revocation.py @@ -15,9 +15,9 @@ def __init__(self, admin_url: str, client_session: ClientSession): async def revoke_credential( self, - cred_ex_id: str = "", - cred_rev_id: str = "", - rev_reg_id: str = "", + cred_ex_id: str = None, + cred_rev_id: str = None, + rev_reg_id: str = None, publish: bool = False, ): """ From 3889b8f065c5239bc20f7a83f6df6d222fa80320 Mon Sep 17 00:00:00 2001 From: r00tb0y Date: Wed, 12 May 2021 19:10:25 +0200 Subject: [PATCH 2/2] Lint to PEP --- aries_cloudcontroller/controllers/issuer.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/aries_cloudcontroller/controllers/issuer.py b/aries_cloudcontroller/controllers/issuer.py index befcf95f..de425518 100644 --- a/aries_cloudcontroller/controllers/issuer.py +++ b/aries_cloudcontroller/controllers/issuer.py @@ -27,11 +27,11 @@ def __init__( # Fetch all credential exchange records async def get_records( - self, - connection_id: str = None, - thread_id: str = None, - state: str = None, - role: str = None, + self, + connection_id: str = None, + thread_id: str = None, + state: str = None, + role: str = None, ): params = {} if connection_id: