Skip to content

Commit

Permalink
fix missing sign_raw() on LedgerETHAccount
Browse files Browse the repository at this point in the history
  • Loading branch information
MHHukiewitz committed Aug 28, 2023
1 parent fd6b06f commit bd6a170
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/aleph/sdk/wallets/ledger/ethereum.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from ledgereth.messages import sign_message
from ledgereth.objects import LedgerAccount, SignedMessage

from ...chains.common import BaseAccount, get_verification_buffer
from ...chains.common import BaseAccount, bytes_from_hex, get_verification_buffer


class LedgerETHAccount(BaseAccount):
Expand Down Expand Up @@ -74,6 +74,12 @@ async def sign_message(self, message: Dict) -> Dict:
message["signature"] = signature
return message

async def sign_raw(self, buffer: bytes) -> bytes:
"""Sign a raw buffer."""
sig: SignedMessage = sign_message(buffer, dongle=self._device)
signature: HexStr = sig.signature
return bytes_from_hex(signature)

def get_address(self) -> str:
return self._account.address

Expand Down

0 comments on commit bd6a170

Please sign in to comment.