Skip to content

Conversation

@lukavada
Copy link

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
@lukavada lukavada closed this Nov 28, 2023
@lukavada
Copy link
Author

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.

1 participant