diff --git a/aries_cloudagent/multitenant/route_manager.py b/aries_cloudagent/multitenant/route_manager.py index d430aa0c51..954b3c98f9 100644 --- a/aries_cloudagent/multitenant/route_manager.py +++ b/aries_cloudagent/multitenant/route_manager.py @@ -81,8 +81,17 @@ async def _route_for_key( keylist_updates = await mediation_mgr.remove_key( replace_key, keylist_updates ) - - responder = self.root_profile.inject(BaseResponder) + # in order to locate the correct verkey for message packing we need + # to use the correct profile. + # if we are using default/base mediation then we need + # the root_profile to create the responder. + # if sub-wallets are configuring their own mediation, then + # we need the sub-wallet (profile) to create the responder. + responder = ( + self.root_profile.inject(BaseResponder) + if base_mediation_record + else profile.inject(BaseResponder) + ) await responder.send( keylist_updates, connection_id=mediation_record.connection_id )