From 80a37bdb8b67e24040313287b5e3d19d4c6b73df Mon Sep 17 00:00:00 2001 From: Andrew Whitehead Date: Wed, 17 Jan 2024 14:03:29 -0800 Subject: [PATCH 1/3] fix wallet record removal on failure Signed-off-by: Andrew Whitehead --- aries_cloudagent/multitenant/base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aries_cloudagent/multitenant/base.py b/aries_cloudagent/multitenant/base.py index 1d9add0a9a..5c77bbdfca 100644 --- a/aries_cloudagent/multitenant/base.py +++ b/aries_cloudagent/multitenant/base.py @@ -181,6 +181,7 @@ async def create_wallet( ) await wallet_record.save(session) + try: # provision wallet profile = await self.get_wallet_profile( @@ -202,7 +203,8 @@ async def create_wallet( profile, public_did_info.verkey ) except Exception: - await wallet_record.delete_record(session) + async with self._profile.session() as session: + await wallet_record.delete_record(session) raise return wallet_record From e71801e379716751881523e47c74bd461920852a Mon Sep 17 00:00:00 2001 From: Andrew Whitehead Date: Wed, 17 Jan 2024 14:03:44 -0800 Subject: [PATCH 2/3] add type hint Signed-off-by: Andrew Whitehead --- aries_cloudagent/wallet/models/wallet_record.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aries_cloudagent/wallet/models/wallet_record.py b/aries_cloudagent/wallet/models/wallet_record.py index ea6e0f4928..a1f16c3beb 100644 --- a/aries_cloudagent/wallet/models/wallet_record.py +++ b/aries_cloudagent/wallet/models/wallet_record.py @@ -80,7 +80,7 @@ def wallet_key(self) -> Optional[str]: return self.settings.get("wallet.key") @property - def wallet_key_derivation_method(self): + def wallet_key_derivation_method(self) -> Optional[str]: """Accessor for the key derivation method of the wallet.""" return self.settings.get("wallet.key_derivation_method") From 1317dbd7c572f68ec34b723698c2ae23b5466082 Mon Sep 17 00:00:00 2001 From: Andrew Whitehead Date: Wed, 17 Jan 2024 14:03:52 -0800 Subject: [PATCH 3/3] adjust log message Signed-off-by: Andrew Whitehead --- aries_cloudagent/config/argparse.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aries_cloudagent/config/argparse.py b/aries_cloudagent/config/argparse.py index 5a842c7575..c8485c1bfb 100644 --- a/aries_cloudagent/config/argparse.py +++ b/aries_cloudagent/config/argparse.py @@ -1700,13 +1700,13 @@ def get_settings(self, args: Namespace) -> dict: settings["wallet.replace_public_did"] = True if args.recreate_wallet: settings["wallet.recreate"] = True - # check required settings for 'indy' wallets + # check required settings for persistent wallets if settings["wallet.type"] in ["indy", "askar", "askar-anoncreds"]: # requires name, key if not args.wallet_name or not args.wallet_key: raise ArgsParseError( "Parameters --wallet-name and --wallet-key must be provided " - "for indy wallets" + "for persistent wallets" ) # postgres storage requires additional configuration if (