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

Adjust verifier revocation states #455

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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