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

Remove caching #238

Merged
merged 6 commits into from
Oct 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
339 changes: 17 additions & 322 deletions aries_cloudagent/messaging/credentials/manager.py

Large diffs are not rendered by default.

22 changes: 10 additions & 12 deletions aries_cloudagent/messaging/credentials/routes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Connection handling admin routes."""

import asyncio
import json
from json.decoder import JSONDecodeError

Expand Down Expand Up @@ -346,13 +345,14 @@ async def credential_exchange_send(request: web.BaseRequest):
if not connection_record.is_ready:
raise web.HTTPForbidden()

credential_exchange_record = await credential_manager.prepare_send(
credential_definition_id, connection_id, credential_values
)
asyncio.ensure_future(
credential_manager.perform_send(credential_exchange_record, outbound_handler)
(
credential_exchange_record,
credential_offer_message,
) = await credential_manager.create_offer(
credential_definition_id, connection_id, True, credential_values
)

await outbound_handler(credential_offer_message, connection_id=connection_id)
return web.json_response(credential_exchange_record.serialize())


Expand Down Expand Up @@ -391,16 +391,14 @@ async def credential_exchange_send_offer(request: web.BaseRequest):
if not connection_record.is_ready:
raise web.HTTPForbidden()

credential_exchange_record = await credential_manager.create_offer(
credential_definition_id, connection_id
)

(
credential_exchange_record,
credential_offer_message,
) = await credential_manager.offer_credential(credential_exchange_record)
await outbound_handler(credential_offer_message, connection_id=connection_id)
) = await credential_manager.create_offer(
credential_definition_id, connection_id
)

await outbound_handler(credential_offer_message, connection_id=connection_id)
return web.json_response(credential_exchange_record.serialize())


Expand Down