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

because of prior anticipation, support requires only doc and style tw… #457

Merged
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
2 changes: 1 addition & 1 deletion aries_cloudagent/protocols/present_proof/v1_0/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
12 changes: 8 additions & 4 deletions aries_cloudagent/protocols/present_proof/v1_0/util/predicate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down