Skip to content

Commit

Permalink
Merge branch 'main' into mhh-base-client
Browse files Browse the repository at this point in the history
  • Loading branch information
MHHukiewitz committed Aug 30, 2023
2 parents 711f4c1 + 16e3769 commit 66f456f
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/aleph/sdk/wallets/ledger/ethereum.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,24 @@ def from_address(
a known wallet address.
"""
device = device or init_dongle()
account = find_account(address=address, dongle=device, count=5)
return LedgerETHAccount(
account=account,
device=device,
account: Optional[LedgerAccount] = find_account(
address=address, dongle=device, count=5
)
return (
LedgerETHAccount(
account=account,
device=device,
)
if account
else None
)

@staticmethod
def from_path(path: str, device: Optional[Dongle] = None) -> LedgerETHAccount:
"""Initialize an aleph.im account from a LedgerHQ device from
a known wallet account path."""
device = device or init_dongle()
account = get_account_by_path(path_string=path, dongle=device)
account: LedgerAccount = get_account_by_path(path_string=path, dongle=device)
return LedgerETHAccount(
account=account,
device=device,
Expand Down

0 comments on commit 66f456f

Please sign in to comment.