Skip to content

Commit

Permalink
use transactions and add state checks in issue-credential 1.0 protocol
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Whitehead <[email protected]>
  • Loading branch information
andrewwhitehead committed Feb 8, 2022
1 parent 9867e35 commit 41fb940
Show file tree
Hide file tree
Showing 6 changed files with 278 additions and 120 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async def handle(self, context: RequestContext, responder: BaseResponder):
)

# Automatically move to next state if flag is set
if context.settings.get("debug.auto_store_credential"):
if cred_ex_record and context.settings.get("debug.auto_store_credential"):
try:
cred_ex_record = await credential_manager.store_credential(
cred_ex_record
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ async def handle(self, context: RequestContext, responder: BaseResponder):
)

# If auto respond is turned on, automatically reply with credential request
if context.settings.get("debug.auto_respond_credential_offer"):
if cred_ex_record and context.settings.get(
"debug.auto_respond_credential_offer"
):
credential_request_message = None
try:
(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ async def handle(self, context: RequestContext, responder: BaseResponder):
)

# If auto_issue is enabled, respond immediately
if cred_ex_record.auto_issue:
if cred_ex_record and cred_ex_record.auto_issue:
if (
cred_ex_record.credential_proposal_dict
and cred_ex_record.credential_proposal_dict.credential_proposal
Expand Down
Loading

0 comments on commit 41fb940

Please sign in to comment.