Skip to content

Commit

Permalink
Refactor: add abstract method sign_raw in class Account
Browse files Browse the repository at this point in the history
  • Loading branch information
1yam committed Jun 19, 2024
1 parent 5873264 commit f067b7f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/aleph/sdk/client/vmclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions src/aleph/sdk/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...

Expand Down

0 comments on commit f067b7f

Please sign in to comment.