Skip to content

Commit 2b3b63f

Browse files
committed
Refactor: add abstract method sign_raw in class Account
1 parent fe84521 commit 2b3b63f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/aleph/sdk/client/vmclient.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
from jwcrypto import jwk
99
from jwcrypto.jwa import JWA
1010

11-
from aleph.sdk.chains.ethereum import ETHAccount
11+
from aleph.sdk.types import Account
1212
from aleph.sdk.utils import to_0x_hex
1313

1414
logger = logging.getLogger(__name__)
1515

1616

1717
class VmClient:
18-
def __init__(self, account: ETHAccount, domain: str = ""):
19-
self.account: ETHAccount = account
18+
def __init__(self, account: Account, domain: str = ""):
19+
self.account: Account = account
2020
self.ephemeral_key: jwk.JWK = jwk.JWK.generate(kty="EC", crv="P-256")
2121
self.domain: str = domain
2222
self.pubkey_payload = self._generate_pubkey_payload()

src/aleph/sdk/types.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ class Account(Protocol):
2020
@abstractmethod
2121
async def sign_message(self, message: Dict) -> Dict: ...
2222

23+
@abstractmethod
24+
async def sign_raw(self, buffer: bytes) -> bytes: ...
2325
@abstractmethod
2426
def get_address(self) -> str: ...
2527

0 commit comments

Comments
 (0)