Skip to content

Commit

Permalink
feat: parametrize DIDCommMessaging interface
Browse files Browse the repository at this point in the history
Makes type hinting a bit nicer

Signed-off-by: Daniel Bluhm <[email protected]>
  • Loading branch information
dbluhm committed Nov 13, 2023
1 parent c194733 commit 37c9c34
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions didcomm_messaging/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""DIDComm Messaging."""
from dataclasses import dataclass
import json
from typing import Optional
from typing import Generic, Optional

from pydid.service import DIDCommV2Service

from didcomm_messaging.crypto import CryptoService, SecretsManager
from didcomm_messaging.crypto import CryptoService, SecretsManager, P, S
from didcomm_messaging.packaging import PackagingService
from didcomm_messaging.resolver import DIDResolver
from didcomm_messaging.routing import RoutingService
Expand All @@ -30,15 +30,15 @@ class UnpackResult:
sender_kid: Optional[str] = None


class DIDCommMessaging:
class DIDCommMessaging(Generic[P, S]):
"""Main entrypoint for DIDComm Messaging."""

def __init__(
self,
crypto: CryptoService,
secrets: SecretsManager,
crypto: CryptoService[P, S],
secrets: SecretsManager[S],
resolver: DIDResolver,
packaging: PackagingService,
packaging: PackagingService[P, S],
routing: RoutingService,
):
"""Initialize the DIDComm Messaging service."""
Expand Down

0 comments on commit 37c9c34

Please sign in to comment.