aries-cloudagent-python icon indicating copy to clipboard operation
aries-cloudagent-python copied to clipboard

🎨 Clearer error message when anoncreds wallet attempts to issue indy cred

Open ff137 opened this issue 8 months ago • 0 comments

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)

ff137 avatar Apr 16 '25 09:04 ff137