Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve consistency for bip32::ChildNumber
There seemed to be some confusion as to whether the internal represenation of a ChildNumber is supposed to be the index (0..2^31-1 for _both_ Normal and Hardened) or the actual number (0..2^31-1 for Normal and 2^31..2^32-1 for Hardened). This commits fixes this confusion. - Make clear that the internal representation is the index rather than the actual number - Make the internal representation non-public - Provide methods for creating valid ChildNumbers - Change relevant callers and tests to conform to this new ChildNumber My rationale for using index rather than the actual number as internal representation is that the difference between the two enum variants already encode wether a ChildNumber is a normal one or a hardened one, so the only bit of extra information left to be encoded is its index.
- Loading branch information
Showing
1 changed file
with
76 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters