Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDWallet.from_index missing return statement #93

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions hdwallet/hdwallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ def from_path(self, path: Union[str, Derivation]) -> "HDWallet":
self._path += str("/" + index)
return self

def from_index(self, index: int, hardened: bool = False) -> "HDWallet":
def from_index(self, index: int, hardened: bool = False) -> Optional["HDWallet"]:
"""
Derivation from Index.

Expand All @@ -464,7 +464,7 @@ def from_index(self, index: int, hardened: bool = False) -> "HDWallet":
:param hardened: Hardened address, default to ``False``.
:type hardened: bool

:returns: HDWallet -- Hierarchical Deterministic Wallet instance.
:returns: Optional[HDWallet] -- Hierarchical Deterministic Wallet instance.

>>> from hdwallet import HDWallet
>>> from hdwallet.symbols import BTC
Expand All @@ -483,7 +483,7 @@ def from_index(self, index: int, hardened: bool = False) -> "HDWallet":

if hardened:
self._path += ("/%d'" % index)
self._derive_key_by_index(index + BIP32KEY_HARDEN)
return self._derive_key_by_index(index + BIP32KEY_HARDEN)
else:
self._path += ("/%d" % index)
return self._derive_key_by_index(index)
Expand Down