Skip to content

Commit

Permalink
✅ Fix test and valid pattern
Browse files Browse the repository at this point in the history
... I think

Signed-off-by: ff137 <[email protected]>
  • Loading branch information
ff137 committed Feb 13, 2025
1 parent ae57fbf commit ea139ce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions acapy_agent/messaging/valid.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,8 @@ class AnoncredsCredDefId(Regexp):

EXAMPLE = "did:(method):3:CL:20:tag"
PATTERN = (
r"^did:(?P<method>[a-zA-Z0-9]+):3:CL:(?P<schema_id>\d+):(?P<tag>[a-zA-Z0-9_-]+)$"
r"^did:(?P<method>[a-zA-Z0-9]+):(?P<did>[a-zA-Z0-9]+):3:"
r"CL:(?P<schema_id>\d+):(?P<tag>[a-zA-Z0-9_-]+)$"
)

def __init__(self):
Expand Down Expand Up @@ -534,8 +535,8 @@ class AnoncredsSchemaId(Regexp):

EXAMPLE = "did:(method):2:schema_name:1.0"
PATTERN = (
r"^did:(?P<method>[a-zA-Z0-9]+):2:(?P<schema_name>[a-zA-Z0-9_-]+):"
r"(?P<version>[0-9.]+)$"
r"^did:(?P<method>[a-zA-Z0-9]+):(?P<did>[a-zA-Z0-9]+):2:"
r"(?P<schema_name>[a-zA-Z0-9_-]+):(?P<version>[0-9.]+)$"
)

def __init__(self):
Expand Down Expand Up @@ -572,8 +573,9 @@ class AnoncredsRevRegId(Regexp):

EXAMPLE = "did:(method):4:did:<method>:3:CL:20:tag:CL_ACCUM:0"
PATTERN = (
r"^did:(?P<method1>[a-zA-Z0-9]+):4:did:(?P<method2>[a-zA-Z0-9]+):3:CL:"
r"(?P<schema_id>\d+):(?P<tag>[a-zA-Z0-9_-]+):CL_ACCUM:(.+)$"
r"^did:(?P<method1>[a-zA-Z0-9]+):(?P<did1>[a-zA-Z0-9]+):4:"
r"did:(?P<method2>[a-zA-Z0-9]+):(?P<did2>[a-zA-Z0-9]+):3:"
r"CL:(?P<schema_id>\d+):(?P<tag>[a-zA-Z0-9_-]+):CL_ACCUM:(.+)$"
)

def __init__(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
from ..handler import LOGGER as ANONCREDS_LOGGER
from ..handler import AnonCredsCredFormatHandler

TEST_DID = "LjgpST2rjsoxYegQDRm7EL"
TEST_DID = "did:sov:LjgpST2rjsoxYegQDRm7EL"
SCHEMA_NAME = "bc-reg"
SCHEMA_TXN = 12
SCHEMA_ID = f"{TEST_DID}:2:{SCHEMA_NAME}:1.0"
Expand Down

0 comments on commit ea139ce

Please sign in to comment.