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

HDWallet.from_index missing return statement #93

wants to merge 1 commit into from

Conversation

kyurais
Copy link

@kyurais kyurais commented Nov 28, 2023

The Issue:

Deriving from index returns None if hardened is set to True in all cases

>>> from hdwallet import HDWallet
>>> from hdwallet.symbols import BTC
>>> hdwallet = HDWallet(symbol=BTC)
>>> hdwallet.from_xprivate_key(xprivate_key="xprv9s21ZrQH143K3xPGUzpogJeKtRdjHkK6muBJo8v7rEVRzT83xJgNcLpMoJXUf9wJFKfuHR4SGvfgdShh4t9VmjjrE9usBunK3LfNna31LGF")
>>> child_node = hdwallet.from_index(index=44, hardened=True)
>>> child_node is None
True

Expected Behavior:

>>> child_node = hdwallet.from_index(index=44, hardened=True)
<hdwallet.hdwallet.HDWallet object at 0x000001E8BFB98D60>
>>> isinstance(child_node, HDWallet)
True

Added return statement to HDWallet.from_index hardened key derivation.
Change return type to Optional to mirror the return type of called method HDWallet._derive_key_by_index

Do let me know if the pull request is not formulated correctly.

Change return type to Optional to mirror the return type of called  method
@kyurais kyurais closed this Nov 28, 2023
@kyurais
Copy link
Author

kyurais commented Nov 28, 2023

Duplicate #85

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant