aries-cloudagent-python
aries-cloudagent-python copied to clipboard
:bug: `set_rev_reg_state` in revocation_anoncreds is unimplemented
Here is the set_rev_reg_state method in revocation_anoncreds:
async def set_rev_reg_state(request: web.BaseRequest):
"""Request handler to set a revocation registry state manually.
Args:
request: aiohttp request object
Returns:
The revocation registry record, updated
"""
context: AdminRequestContext = request["context"]
profile = context.profile
is_not_anoncreds_profile_raise_web_exception(profile)
rev_reg_id = request.match_info["rev_reg_id"]
state = request.query.get("state")
try:
revocation = AnonCredsRevocation(profile)
rev_reg_def = await revocation.set_rev_reg_state(rev_reg_id, state)
if rev_reg_def is None:
raise web.HTTPNotFound(reason="No rev reg def found")
except AnonCredsIssuerError as e:
raise web.HTTPInternalServerError(reason=str(e)) from e
rev_reg = await _get_issuer_rev_reg_record(profile, rev_reg_id)
return web.json_response({"result": rev_reg.serialize()})
Note:
rev_reg_def = await revocation.set_rev_reg_state(rev_reg_id, state)
if rev_reg_def is None:
raise web.HTTPNotFound(reason="No rev reg def found")
Let's look at that revocation.set_rev_reg_state method:
async def set_rev_reg_state(self, rev_reg_id, state):
"""Update Revocation Registry state."""
pass
Oh. it's not implemented, and returns None.
So, HTTPNotFound(reason="No rev reg def found") will always be raised.
Either this should be implemented or removed