openwallet-foundation / bifold-wallet

Aries Mobile Agent React Native - Part of the Aries Bifold effort to provide SSI capabilities in a production ready app.
Apache License 2.0
151 stars 148 forks source link

[BUG] Predicate on int with a length over 11 digits un-processable #787

Open PatStLouis opened 1 year ago

PatStLouis commented 1 year ago

When submitting a predicate towards an int attribute value over 10 digits long, the wallet can't generate a presentation and get stuck on the presentation request screen.

To reproduce use the traction webapp and the following values:

--- # Schema
schema_name: int_test
schema_version: 0.1
attributes: ["int_lenght_10", "int_lenght_11"]
--- # Credential Definition
tag: int_test
--- # Credential Issuance
values: 
 int_lenght_10: 11111111111
 int_lenght_11: 111111111111
--- # Presentation requests
# The first is against a length 10 value (wallet generates presentation), second against a length 11 value (wallet gets stuck)
{
  "nonce": "121212121212",
  "name": "proof-request",
  "version": "1.0",
  "requested_attributes": {},
  "requested_predicates": {
      "long_predicate": {
        "name": "int_lenght_10",
        "p_type": ">=",
        "p_value": 1111111111,
        "restrictions": [{"schema_name": "int_test"}]
      }
    },
  "non_revoked": {}
}
{
  "nonce": "121212121212",
  "name": "proof-request",
  "version": "1.0",
  "requested_attributes": {},
  "requested_predicates": {
      "long_predicate": {
        "name": "int_lenght_11",
        "p_type": ">=",
        "p_value": 11111111111,
        "restrictions": [{"schema_name": "int_test"}]
      }
    },
  "non_revoked": {}
}
cvarjao commented 1 month ago

@PatStLouis , is this still an issue? have you tested against vanilla Credo?