Skip to content

Commit

Permalink
Merge pull request #455 from andrewwhitehead/fix/rev-state-ts
Browse files Browse the repository at this point in the history
Adjust verifier revocation states
  • Loading branch information
swcurran committed Apr 9, 2020
2 parents 2f6e50b + 75ce55d commit 0c7663a
Showing 1 changed file with 15 additions and 18 deletions.
33 changes: 15 additions & 18 deletions aries_cloudagent/protocols/present_proof/v1_0/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ async def create_bound_request(
name=name,
version=version,
nonce=nonce,
ledger=await self.context.inject(BaseLedger)
ledger=await self.context.inject(BaseLedger),
)
presentation_request_message = PresentationRequest(
comment=comment,
Expand Down Expand Up @@ -323,10 +323,7 @@ async def create_presentation(
# of the presentation request or attributes
current_timestamp = int(time.time())

non_revoc_interval = {
"from": 0,
"to": current_timestamp
}
non_revoc_interval = {"from": 0, "to": current_timestamp}
non_revoc_interval.update(
presentation_exchange_record.presentation_request.get("non_revoked", {})
)
Expand Down Expand Up @@ -544,20 +541,20 @@ async def verify_presentation(
] = await ledger.get_revoc_reg_def(identifier["rev_reg_id"])

if identifier.get("timestamp"):
(
found_rev_reg_entry,
found_timestamp,
) = await ledger.get_revoc_reg_entry(
identifier["rev_reg_id"], identifier["timestamp"]
)

if identifier["rev_reg_id"] not in rev_reg_entries:
rev_reg_entries[identifier["rev_reg_id"]] = {
found_timestamp: found_rev_reg_entry
}
else:
rev_reg_entries.setdefault(identifier["rev_reg_id"], {})

if (
identifier["timestamp"]
not in rev_reg_entries[identifier["rev_reg_id"]]
):
(
found_rev_reg_entry,
_found_timestamp,
) = await ledger.get_revoc_reg_entry(
identifier["rev_reg_id"], identifier["timestamp"]
)
rev_reg_entries[identifier["rev_reg_id"]][
found_timestamp
identifier["timestamp"]
] = found_rev_reg_entry

verifier: BaseVerifier = await self.context.inject(BaseVerifier)
Expand Down

0 comments on commit 0c7663a

Please sign in to comment.