Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent dummy profiles on start up #3449

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion acapy_agent/utils/profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from ..askar.profile_anon import AskarAnoncredsProfile
from ..core.profile import Profile
from ..multitenant.manager import MultitenantManager
from ..multitenant.single_wallet_askar_manager import SingleWalletAskarMultitenantManager
from ..storage.base import BaseStorageSearch
from ..wallet.models.wallet_record import WalletRecord

Expand Down Expand Up @@ -41,6 +42,13 @@ async def get_subwallet_profiles_from_storage(root_profile: Profile) -> list[Pro
search_session = base_storage_search.search_records(
type_filter=WalletRecord.RECORD_TYPE, page_size=10
)
if (
root_profile.context.settings.get("multitenant.wallet_type")
== "single-wallet-askar"
):
manager = SingleWalletAskarMultitenantManager(root_profile)
else:
manager = MultitenantManager(root_profile)
while search_session._done is False:
wallet_storage_records = await search_session.fetch()
for wallet_storage_record in wallet_storage_records:
Expand All @@ -49,7 +57,7 @@ async def get_subwallet_profiles_from_storage(root_profile: Profile) -> list[Pro
json.loads(wallet_storage_record.value),
)
subwallet_profiles.append(
await MultitenantManager(root_profile).get_wallet_profile(
await manager.get_wallet_profile(
base_context=root_profile.context,
wallet_record=wallet_record,
)
Expand Down
Loading