Skip to content

Commit eb8ee9f

Browse files
authored
Prevent dummy profiles on start up (openwallet-foundation#3449)
Signed-off-by: jamshale <[email protected]>
1 parent 8b83b9e commit eb8ee9f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

acapy_agent/utils/profiles.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from ..askar.profile_anon import AskarAnoncredsProfile
99
from ..core.profile import Profile
1010
from ..multitenant.manager import MultitenantManager
11+
from ..multitenant.single_wallet_askar_manager import SingleWalletAskarMultitenantManager
1112
from ..storage.base import BaseStorageSearch
1213
from ..wallet.models.wallet_record import WalletRecord
1314

@@ -41,6 +42,13 @@ async def get_subwallet_profiles_from_storage(root_profile: Profile) -> list[Pro
4142
search_session = base_storage_search.search_records(
4243
type_filter=WalletRecord.RECORD_TYPE, page_size=10
4344
)
45+
if (
46+
root_profile.context.settings.get("multitenant.wallet_type")
47+
== "single-wallet-askar"
48+
):
49+
manager = SingleWalletAskarMultitenantManager(root_profile)
50+
else:
51+
manager = MultitenantManager(root_profile)
4452
while search_session._done is False:
4553
wallet_storage_records = await search_session.fetch()
4654
for wallet_storage_record in wallet_storage_records:
@@ -49,7 +57,7 @@ async def get_subwallet_profiles_from_storage(root_profile: Profile) -> list[Pro
4957
json.loads(wallet_storage_record.value),
5058
)
5159
subwallet_profiles.append(
52-
await MultitenantManager(root_profile).get_wallet_profile(
60+
await manager.get_wallet_profile(
5361
base_context=root_profile.context,
5462
wallet_record=wallet_record,
5563
)

0 commit comments

Comments
 (0)