Skip to content

Commit

Permalink
set revocation_id on issued credential exchange
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Whitehead <[email protected]>
  • Loading branch information
andrewwhitehead committed Mar 16, 2022
1 parent 9c65346 commit 043ad3c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions aries_cloudagent/protocols/issue_credential/v1_0/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ async def issue_credential(
schema_id = cred_ex_record.schema_id
rev_reg = None
credential_ser = None
cred_rev_id = None

if cred_ex_record.credential:
LOGGER.warning(
Expand Down Expand Up @@ -661,10 +662,7 @@ async def issue_credential(
)
issuer = self._profile.inject(IndyIssuer)
try:
(
credential_json,
cred_ex_record.revocation_id,
) = await issuer.create_credential(
(credential_json, cred_rev_id) = await issuer.create_credential(
schema,
cred_offer_ser,
cred_req_ser,
Expand All @@ -676,7 +674,7 @@ async def issue_credential(
credential_ser = json.loads(credential_json)

# If the rev reg is now full
if rev_reg and rev_reg.max_creds == int(cred_ex_record.revocation_id):
if rev_reg and rev_reg.max_creds == int(cred_rev_id):
async with self._profile.session() as session:
await active_rev_reg_rec.set_state(
session,
Expand Down Expand Up @@ -728,6 +726,7 @@ async def issue_credential(
)
cred_ex_record.state = V10CredentialExchange.STATE_ISSUED
cred_ex_record.credential = credential_ser
cred_ex_record.revocation_id = cred_rev_id
await cred_ex_record.save(txn, reason="issue credential")
await txn.commit()

Expand Down

0 comments on commit 043ad3c

Please sign in to comment.