This repository has been archived by the owner on Jun 6, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
keytree: add serialization for xpub, xprv #228
keytree: add serialization for xpub, xprv #228
Changes from 9 commits
3dd745f
1fe8e45
abec3ff
8a4232c
4619c81
0b9b1fc
6088364
187c956
5733f32
47f5c31
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's
hex
crate withhex::encode
method so we can write a more readable test (and then copy this over to the spec as Test Vectors):There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hex
is only needed indev-dependencies
in Cargo.toml. So you'd include it only under themod test { }
, not in the top of lib.rs.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tried this out, and it's neat, but I'm not sure it actually produces a more readable test, especially since all the other tests in this package (for creating xprvs and xpubs) use non-hex encoded byte arrays. When I switched over to a hex string, I could no longer eyeball that these were the same.
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think all have to be hex, across the board. But if it's a PITA to update, we can do that in a separate PR later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we'd definitely want that to post the test vectors in the spec in hex. But before that we need to implement derivation for both xpub and xprv.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do it all in another PR, then. (It's fine to do, I should just change them all together.)