Skip to content

Commit 6ba9ae2

Browse files
committed
receive pres - update exception raising condition
Signed-off-by: shaangill025 <gill.shaanjots@gmail.com>
1 parent 1d4f98e commit 6ba9ae2

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

  • aries_cloudagent/protocols/present_proof/v2_0/formats/indy

aries_cloudagent/protocols/present_proof/v2_0/formats/indy/handler.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,10 @@ def _check_proof_vs_proposal():
199199
f"attr::{name}::value": proof_value,
200200
}
201201

202-
if not any(r.items() <= criteria.items() for r in req_restrictions):
202+
if (
203+
not any(r.items() <= criteria.items() for r in req_restrictions)
204+
and len(req_restrictions) != 0
205+
):
203206
raise V20PresFormatHandlerError(
204207
f"Presented attribute {reft} does not satisfy proof request "
205208
f"restrictions {req_restrictions}"
@@ -234,7 +237,10 @@ def _check_proof_vs_proposal():
234237
},
235238
}
236239

237-
if not any(r.items() <= criteria.items() for r in req_restrictions):
240+
if (
241+
not any(r.items() <= criteria.items() for r in req_restrictions)
242+
and len(req_restrictions) != 0
243+
):
238244
raise V20PresFormatHandlerError(
239245
f"Presented attr group {reft} does not satisfy proof request "
240246
f"restrictions {req_restrictions}"
@@ -287,7 +293,10 @@ def _check_proof_vs_proposal():
287293
"issuer_did": cred_def_id.split(":")[-5],
288294
}
289295

290-
if not any(r.items() <= criteria.items() for r in req_restrictions):
296+
if (
297+
not any(r.items() <= criteria.items() for r in req_restrictions)
298+
and len(req_restrictions) != 0
299+
):
291300
raise V20PresFormatHandlerError(
292301
f"Presented predicate {reft} does not satisfy proof request "
293302
f"restrictions {req_restrictions}"

0 commit comments

Comments
 (0)