From 2b3b63f6bbd02d5f286838510a39df6984883020 Mon Sep 17 00:00:00 2001 From: 1yam Date: Wed, 19 Jun 2024 12:23:59 +0200 Subject: [PATCH] Refactor: add abstract method sign_raw in class Account --- src/aleph/sdk/client/vmclient.py | 6 +++--- src/aleph/sdk/types.py | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/aleph/sdk/client/vmclient.py b/src/aleph/sdk/client/vmclient.py index 4cac3069..1cf66639 100644 --- a/src/aleph/sdk/client/vmclient.py +++ b/src/aleph/sdk/client/vmclient.py @@ -8,15 +8,15 @@ from jwcrypto import jwk from jwcrypto.jwa import JWA -from aleph.sdk.chains.ethereum import ETHAccount +from aleph.sdk.types import Account from aleph.sdk.utils import to_0x_hex logger = logging.getLogger(__name__) class VmClient: - def __init__(self, account: ETHAccount, domain: str = ""): - self.account: ETHAccount = account + def __init__(self, account: Account, domain: str = ""): + self.account: Account = account self.ephemeral_key: jwk.JWK = jwk.JWK.generate(kty="EC", crv="P-256") self.domain: str = domain self.pubkey_payload = self._generate_pubkey_payload() diff --git a/src/aleph/sdk/types.py b/src/aleph/sdk/types.py index 8d17f4d4..d344123d 100644 --- a/src/aleph/sdk/types.py +++ b/src/aleph/sdk/types.py @@ -20,6 +20,8 @@ class Account(Protocol): @abstractmethod async def sign_message(self, message: Dict) -> Dict: ... + @abstractmethod + async def sign_raw(self, buffer: bytes) -> bytes: ... @abstractmethod def get_address(self) -> str: ...