Skip to content

bip32: Add DerivationPath type#233

Merged
dongcarl merged 4 commits intorust-bitcoin:masterfrom
stevenroose:derivation-path
Feb 15, 2019
Merged

bip32: Add DerivationPath type#233
dongcarl merged 4 commits intorust-bitcoin:masterfrom
stevenroose:derivation-path

Conversation

@stevenroose
Copy link
Copy Markdown
Collaborator

Replaces #185.

@dongcarl
Copy link
Copy Markdown
Member

@stevenroose Could you force push again? I think Travis is buggy.

@dongcarl
Copy link
Copy Markdown
Member

Possible followup PR: Implement FromIterator and ToIterator, make the wrapped Vec not public.

@sgeisler
Copy link
Copy Markdown
Contributor

sgeisler commented Feb 11, 2019

Possible followup PR: Implement FromIterator and ToIterator, make the wrapped Vec not public.

Here it might even make sense to implement the different index/range traits, so you could select sub-paths:

let first_key = DerivationPath::from_str("m/84'/0'/0'/0/0")?;
let next_key = first_key[..4].child(first_key[4] + 1);

@stevenroose stevenroose force-pushed the derivation-path branch 2 times, most recently from 94d33c4 to 15ab50c Compare February 12, 2019 12:38
They can produce an error if the index is out of range.
Implements Display and FromStr for easy usage with serialized types.
- From<&[ChildNumber]> (cloning)
- AsRef<[ChildNumber]>
- std::iter::FromIterator<ChildNumber>
- std::iter::IntoIterator<ChildNumber>
- std::ops::Index (returning &[ChildNumber])

Also add two methods:
- child(&self, ChildNumber) -> DerivationPath
- into_child(self, ChildNumber) -> DerivationPath
Copy link
Copy Markdown
Contributor

@sgeisler sgeisler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed all comments, LGTM.

Copy link
Copy Markdown
Member

@dongcarl dongcarl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dongcarl dongcarl merged commit d5331e5 into rust-bitcoin:master Feb 15, 2019
yancyribbens pushed a commit to yancyribbens/rust-bitcoin that referenced this pull request Mar 23, 2024
Explicitly error on non-standard sighash types
PastaPastaPasta pushed a commit to PastaPastaPasta/rust-dashcore that referenced this pull request Feb 2, 2026
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.

3 participants