diff --git a/aries_cloudagent/protocols/present_proof/v1_0/messages/inner/presentation_preview.py b/aries_cloudagent/protocols/present_proof/v1_0/messages/inner/presentation_preview.py index 4f253e7c84..02379243ce 100644 --- a/aries_cloudagent/protocols/present_proof/v1_0/messages/inner/presentation_preview.py +++ b/aries_cloudagent/protocols/present_proof/v1_0/messages/inner/presentation_preview.py @@ -71,7 +71,7 @@ class Meta: **INDY_CRED_DEF_ID, ) predicate = fields.Str( - description="Predicate (currently, indy supports >=)", + description="Predicate type ('<', '<=', '>=', or '>')", required=True, **INDY_PREDICATE, ) diff --git a/aries_cloudagent/protocols/present_proof/v1_0/routes.py b/aries_cloudagent/protocols/present_proof/v1_0/routes.py index ede5bd57ca..c9be2a5274 100644 --- a/aries_cloudagent/protocols/present_proof/v1_0/routes.py +++ b/aries_cloudagent/protocols/present_proof/v1_0/routes.py @@ -131,7 +131,7 @@ class IndyProofReqPredSpecSchema(Schema): name = fields.String(example="index", description="Attribute name", required=True) p_type = fields.String( - description="Predicate type (indy currently supports only '>=')", + description="Predicate type ('<', '<=', '>=', or '>')", required=True, **INDY_PREDICATE ) diff --git a/aries_cloudagent/protocols/present_proof/v1_0/util/predicate.py b/aries_cloudagent/protocols/present_proof/v1_0/util/predicate.py index 7af9bfd3e8..0fc02197ca 100644 --- a/aries_cloudagent/protocols/present_proof/v1_0/util/predicate.py +++ b/aries_cloudagent/protocols/present_proof/v1_0/util/predicate.py @@ -16,25 +16,29 @@ class Predicate(Enum): '$lt', '<', lambda x, y: Predicate.to_int(x) < Predicate.to_int(y), - lambda x, y: Predicate.to_int(x) >= Predicate.to_int(y)) + lambda x, y: Predicate.to_int(x) >= Predicate.to_int(y) + ) LE = Relation( 'LE', '$lte', '<=', lambda x, y: Predicate.to_int(x) <= Predicate.to_int(y), - lambda x, y: Predicate.to_int(x) > Predicate.to_int(y)) + lambda x, y: Predicate.to_int(x) > Predicate.to_int(y) + ) GE = Relation( 'GE', '$gte', '>=', lambda x, y: Predicate.to_int(x) >= Predicate.to_int(y), - lambda x, y: Predicate.to_int(x) < Predicate.to_int(y)) + lambda x, y: Predicate.to_int(x) < Predicate.to_int(y) + ) GT = Relation( 'GT', '$gt', '>', lambda x, y: Predicate.to_int(x) > Predicate.to_int(y), - lambda x, y: Predicate.to_int(x) <= Predicate.to_int(y)) + lambda x, y: Predicate.to_int(x) <= Predicate.to_int(y) + ) @staticmethod def get(relation: str) -> 'Predicate':