1111from ..protocols .coordinate_mediation .v1_0 .models .mediation_record import (
1212 MediationRecord ,
1313)
14- from ..protocols .coordinate_mediation .v1_0 .route_manager import RouteManager
14+ from ..protocols .coordinate_mediation .v1_0 .normalization import normalize_from_did_key
15+ from ..protocols .coordinate_mediation .v1_0 .route_manager import (
16+ CoordinateMediationV1RouteManager ,
17+ RouteManager ,
18+ )
1519from ..protocols .routing .v1_0 .manager import RoutingManager
1620from ..protocols .routing .v1_0 .models .route_record import RouteRecord
1721from ..storage .error import StorageNotFoundError
@@ -106,6 +110,10 @@ async def routing_info(
106110
107111 return routing_keys , my_endpoint
108112
113+
114+ class BaseWalletRouteManager (CoordinateMediationV1RouteManager ):
115+ """Route manager for operations specific to the base wallet."""
116+
109117 async def connection_from_recipient_key (
110118 self , profile : Profile , recipient_key : str
111119 ) -> ConnRecord :
@@ -117,9 +125,13 @@ async def connection_from_recipient_key(
117125 for sub wallets, we check the sub wallet's connections before the base
118126 wallet.
119127 """
120- manager = self .root_profile .inject (BaseMultitenantManager )
128+ LOGGER .debug ("Retrieving connection for recipient key for multitenant wallet" )
129+ manager = profile .inject (BaseMultitenantManager )
121130 profile_to_search = (
122- await manager .get_profile_for_key (profile .context , recipient_key ) or profile
131+ await manager .get_profile_for_key (
132+ profile .context , normalize_from_did_key (recipient_key )
133+ )
134+ or profile
123135 )
124136
125137 return await super ().connection_from_recipient_key (
0 commit comments