Skip to content

Commit

Permalink
remove redundant code + black fmt changes
Browse files Browse the repository at this point in the history
Signed-off-by: Shaanjot Gill <[email protected]>
  • Loading branch information
shaangill025 committed Sep 13, 2023
1 parent 2019ea5 commit 1634cfc
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ class Meta:

connection_id = fields.Str(required=False)
message_id = fields.Str(required=False)
sent_time = fields.Str(required=False,
sent_time = fields.Str(
required=False,
validate=INDY_ISO8601_DATETIME_VALIDATE,
example=INDY_ISO8601_DATETIME_EXAMPLE
example=INDY_ISO8601_DATETIME_EXAMPLE,
)
locale = fields.Str(required=False)
content = fields.Str(required=False)
21 changes: 0 additions & 21 deletions plugins/traction_innkeeper/traction_innkeeper/__init__.py
Original file line number Diff line number Diff line change
@@ -1,21 +0,0 @@
from aries_cloudagent.messaging.valid import (
INDY_SCHEMA_ID_VALIDATE,
INDY_SCHEMA_ID_EXAMPLE,
INDY_REV_REG_SIZE_VALIDATE,
INDY_REV_REG_SIZE_EXAMPLE,
INDY_CRED_DEF_ID_VALIDATE,
INDY_CRED_DEF_ID_EXAMPLE,
)

INDY_SCHEMA_ID = {
"validate": INDY_SCHEMA_ID_VALIDATE,
"example": INDY_SCHEMA_ID_EXAMPLE,
}
INDY_REV_REG_SIZE = {
"validate": INDY_REV_REG_SIZE_VALIDATE,
"example": INDY_REV_REG_SIZE_EXAMPLE,
}
INDY_CRED_DEF_ID = {
"validate": INDY_CRED_DEF_ID_VALIDATE,
"example": INDY_CRED_DEF_ID_EXAMPLE,
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,10 @@
INDY_REV_REG_SIZE_VALIDATE,
INDY_REV_REG_SIZE_EXAMPLE,
INDY_CRED_DEF_ID_VALIDATE,
INDY_CRED_DEF_ID_EXAMPLE
INDY_CRED_DEF_ID_EXAMPLE,
)
from marshmallow import EXCLUDE, fields

try:
from aries_cloudagent.messaging.valid import (
INDY_SCHEMA_ID,
INDY_REV_REG_SIZE,
INDY_CRED_DEF_ID,
)
except ImportError:
from ... import (
INDY_SCHEMA_ID,
INDY_REV_REG_SIZE,
INDY_CRED_DEF_ID,
)


class CredDefStorageRecord(BaseRecord):
"""Traction CredDef Storage Record."""
Expand Down Expand Up @@ -82,12 +69,12 @@ class Meta:
required=True,
description="Cred Def identifier",
validate=INDY_CRED_DEF_ID_VALIDATE,
example=INDY_CRED_DEF_ID_EXAMPLE
example=INDY_CRED_DEF_ID_EXAMPLE,
)
schema_id = fields.Str(
description="Schema identifier",
validate=INDY_SCHEMA_ID_VALIDATE,
example=INDY_SCHEMA_ID_EXAMPLE
example=INDY_SCHEMA_ID_EXAMPLE,
)
support_revocation = fields.Boolean(
required=False, description="Revocation supported flag"
Expand Down
18 changes: 4 additions & 14 deletions plugins/traction_innkeeper/traction_innkeeper/v1_0/oca/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,10 @@
INDY_SCHEMA_ID_EXAMPLE,
INDY_CRED_DEF_ID_VALIDATE,
INDY_CRED_DEF_ID_EXAMPLE,
UUIDFour
UUIDFour,
)
from marshmallow import EXCLUDE, fields

try:
from aries_cloudagent.messaging.valid import (
INDY_SCHEMA_ID,
INDY_CRED_DEF_ID,
UUIDFour,
)
except ImportError:
from ... import INDY_SCHEMA_ID, INDY_CRED_DEF_ID
from aries_cloudagent.messaging.valid import UUIDFour


class OcaRecord(BaseRecord):
"""Traction OCA Record."""
Expand Down Expand Up @@ -88,13 +78,13 @@ class Meta:
required=False,
description="Schema identifier",
validate=INDY_SCHEMA_ID_VALIDATE,
example=INDY_SCHEMA_ID_EXAMPLE
example=INDY_SCHEMA_ID_EXAMPLE,
)
cred_def_id = fields.Str(
required=False,
required=False,
description="Cred Def identifier",
validate=INDY_CRED_DEF_ID_VALIDATE,
example=INDY_CRED_DEF_ID_EXAMPLE
example=INDY_CRED_DEF_ID_EXAMPLE,
)
url = fields.Str(required=False, description="(Public) Url for OCA Bundle")
bundle = fields.Dict(
Expand Down
16 changes: 3 additions & 13 deletions plugins/traction_innkeeper/traction_innkeeper/v1_0/oca/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,11 @@
INDY_SCHEMA_ID_VALIDATE,
INDY_CRED_DEF_ID_EXAMPLE,
INDY_CRED_DEF_ID_VALIDATE,
UUIDFour
UUIDFour,
)
from aries_cloudagent.storage.error import StorageNotFoundError, StorageError
from marshmallow import fields, ValidationError

try:
from aries_cloudagent.messaging.valid import (
INDY_SCHEMA_ID,
INDY_CRED_DEF_ID,
UUIDFour,
)
except ImportError:
from ... import INDY_SCHEMA_ID, INDY_CRED_DEF_ID
from aries_cloudagent.messaging.valid import UUIDFour

from . import OcaService
from .models import OcaRecordSchema
from .oca_service import PublicDIDRequiredError, PublicDIDMismatchError
Expand Down Expand Up @@ -86,13 +76,13 @@ class AddOcaRecordRequestSchema(OpenAPISchema):
required=False,
description="Schema identifier",
validate=INDY_SCHEMA_ID_VALIDATE,
example=INDY_SCHEMA_ID_EXAMPLE
example=INDY_SCHEMA_ID_EXAMPLE,
)
cred_def_id = fields.Str(
required=False,
description="Cred Def identifier",
validate=INDY_CRED_DEF_ID_VALIDATE,
example=INDY_CRED_DEF_ID_EXAMPLE
example=INDY_CRED_DEF_ID_EXAMPLE,
)
url = fields.Str(required=False, description="(Public) Url for OCA Bundle")
bundle = fields.Dict(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
)
from marshmallow import EXCLUDE, fields

try:
from aries_cloudagent.messaging.valid import INDY_SCHEMA_ID
except ImportError:
from ... import INDY_SCHEMA_ID


class SchemaStorageRecord(BaseRecord):
"""Traction Schema Storage Record."""
Expand Down

0 comments on commit 1634cfc

Please sign in to comment.