aries-cloudagent-python
aries-cloudagent-python copied to clipboard
🎨 Clearer error message when anoncreds wallet attempts to issue indy cred
The wallet-type assertion is done for issuing anoncreds (requires askar-anoncreds), but not done for indy (requires askar), and when an anoncreds wallet attempts to issue indy, something errors downstream and error message isn't clear.
An assertion method similar to is_not_anoncreds_profile_raise_web_exception can be added to the IndyCredFormatHandler, or to the route method for issue_credential.
PS: there should be a to-do logged for removing this "shim":
class IndyCredFormatHandler(V20CredFormatHandler):
"""Indy credential format handler."""
format = V20CredFormat.Format.INDY
anoncreds_handler = None
def __init__(self, profile: Profile):
"""Shim initialization to check for new AnonCreds library."""
super().__init__(profile)
# Temporary shim while the new anoncreds library integration is in progress
wallet_type = profile.settings.get_value("wallet.type")
if wallet_type == "askar-anoncreds":
self.anoncreds_handler = AnonCredsCredFormatHandler(profile)