Skip to content

Commit 66f456f

Browse files
committed
Merge branch 'main' into mhh-base-client
2 parents 711f4c1 + 16e3769 commit 66f456f

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/aleph/sdk/wallets/ledger/ethereum.py

+11-5
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,24 @@ def from_address(
3838
a known wallet address.
3939
"""
4040
device = device or init_dongle()
41-
account = find_account(address=address, dongle=device, count=5)
42-
return LedgerETHAccount(
43-
account=account,
44-
device=device,
41+
account: Optional[LedgerAccount] = find_account(
42+
address=address, dongle=device, count=5
43+
)
44+
return (
45+
LedgerETHAccount(
46+
account=account,
47+
device=device,
48+
)
49+
if account
50+
else None
4551
)
4652

4753
@staticmethod
4854
def from_path(path: str, device: Optional[Dongle] = None) -> LedgerETHAccount:
4955
"""Initialize an aleph.im account from a LedgerHQ device from
5056
a known wallet account path."""
5157
device = device or init_dongle()
52-
account = get_account_by_path(path_string=path, dongle=device)
58+
account: LedgerAccount = get_account_by_path(path_string=path, dongle=device)
5359
return LedgerETHAccount(
5460
account=account,
5561
device=device,

0 commit comments

Comments
 (0)