Add bip32::parse_derivation_path#185
Add bip32::parse_derivation_path#185stevenroose wants to merge 3 commits intorust-bitcoin:masterfrom
Conversation
|
Concept ACK. Fuzz testing is failing in the CI build. I'm not sure what to do about that. |
|
Hmm, it fails to build a fuzzing dep. I have no idea about the fuzzing setup in rust-bitcoin, bth. |
97f62bd to
b9700de
Compare
|
You're suggesting that should be supported? Or add tests to catch that they
are not supported?
…On Thu, Nov 15, 2018, 21:17 Gregory Sanders ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/util/bip32.rs
<#185 (comment)>
:
> use super::{ChildNumber, ExtendedPrivKey, ExtendedPubKey};
use super::ChildNumber::{Hardened, Normal};
use super::Error;
+ #[test]
+ fn test_parse_derivation_path() {
+ assert_eq!(parse_derivation_path("42"), Err(Error::InvalidDerivationPathFormat));
+ assert_eq!(parse_derivation_path("n/0'/0"), Err(Error::InvalidDerivationPathFormat));
+ assert_eq!(parse_derivation_path("m/0h/0x"), Err(Error::InvalidChildNumberFormat));
+
suggestion: add test for something like m//3/0' with double-slashes as
well has capital H for harden
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#185 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA0F3G5BRYwjBqKKDJVwH6LznskTuT3Xks5uvdoGgaJpZM4YKKuR>
.
|
|
Tests.
…On Thu, Nov 15, 2018, 5:45 PM Steven Roose ***@***.*** wrote:
You're suggesting that should be supported? Or add tests to catch that they
are not supported?
On Thu, Nov 15, 2018, 21:17 Gregory Sanders ***@***.***>
wrote:
> ***@***.**** commented on this pull request.
> ------------------------------
>
> In src/util/bip32.rs
> <
#185 (comment)
>
> :
>
> > use super::{ChildNumber, ExtendedPrivKey, ExtendedPubKey};
> use super::ChildNumber::{Hardened, Normal};
> use super::Error;
>
> + #[test]
> + fn test_parse_derivation_path() {
> + assert_eq!(parse_derivation_path("42"),
Err(Error::InvalidDerivationPathFormat));
> + assert_eq!(parse_derivation_path("n/0'/0"),
Err(Error::InvalidDerivationPathFormat));
> + assert_eq!(parse_derivation_path("m/0h/0x"),
Err(Error::InvalidChildNumberFormat));
> +
>
> suggestion: add test for something like m//3/0' with double-slashes as
> well has capital H for harden
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <
#185 (review)
>,
> or mute the thread
> <
https://github.com/notifications/unsubscribe-auth/AA0F3G5BRYwjBqKKDJVwH6LznskTuT3Xks5uvdoGgaJpZM4YKKuR
>
> .
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#185 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFgC0xmKPu5nWu-fcIGmuFEpV1o4nQ6Jks5uve5vgaJpZM4YKKuR>
.
|
b9700de to
9cae500
Compare
9cae500 to
4b13153
Compare
06e3c83 to
5b14f57
Compare
5b14f57 to
02c06bb
Compare
This public method parses a formatted derivation path into a `Vec<ChildNumber>`.
|
Fuzz found something. Should I keep those: https://travis-ci.org/rust-bitcoin/rust-bitcoin/jobs/463440802 |
02c06bb to
4981e08
Compare
I think that's just a bug in a serde implementation we use because of 1.14 :/ it happens from time to time (iirc it's because of a stack overflow that can be triggered, this seems consistent with the large output that was produced and the deep stack trace). I'd just run the test again, but maybe @apoelstra can confirm or correct this (I know I read this somewhere, but I don't remember where). |
|
I don't think it's serde, I think it's just Yet Another In any case, it's unrelated to this PR. |
fce8421 to
73baeca
Compare
|
Ready to be merged! |
dongcarl
left a comment
There was a problem hiding this comment.
LGTM, in the future we should make this more generic by parsing to an Iterator over Result<ChildNumber, Error>.
|
I'd be more in favor of having a new type `struct
DerivationPath(Vec<ChildNumber>)` in this case, to be honest.
…On Sat, Jan 19, 2019, 23:12 Carl Dong ***@***.*** wrote:
***@***.**** approved this pull request.
LGTM, in the future we should make this more generic by parsing to an
Iterator over Result<ChildNumber, Error>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#185 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA0F3MQeNTXcqx06DgqT5R0WQEdXVgAZks5vE6ZZgaJpZM4YKKuR>
.
|
|
Would there be more interest in a |
Yes, let's do that! I remember needing it for PSBT at some point. |
|
@stevenroose Any progress on this? |
|
Ah didn't see your previous comment. I can do this whenever I'm back from
PTO. Don't have decent internet here but can try :) I want to get this in
too, I have a copy of that code in hal and reserves.
…On Mon, Feb 4, 2019, 16:41 Carl Dong ***@***.*** wrote:
@stevenroose <https://github.com/stevenroose> Any progress on this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#185 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA0F3BZ8212dJHqXK_PFsJo-mrm8UdIlks5vKFS1gaJpZM4YKKuR>
.
|
|
Superseded by #233, which is now merged. |
…ions 8806879 Migrate CI to github actions (Tibo-lg) Pull request description: Closes rust-bitcoin#185 I'm not a github action expert so there might be more concise ways of expressing things, but at least it works. ACKs for top commit: notmandatory: ACK 8806879 Tree-SHA512: 0c347867a66d1a19fad182ebb3961819a34190573dfec4c1425c1f295bc1a32a7f0adb8da31a9e0b004144b8f17efea36c0d81244e09b743af36df6705039f3a
Test Display/Debug for SortedMultiVec
…itcoin#185) PR rust-bitcoin#180 used `MultiPeerNetworkManager`, this was renamed in rust-bitcoin#183 which was merged before rust-bitcoin#180 but after its CI run.
…-bitcoin#197) * feat(spv): flush headers on shutdown * move fn lower in the impl * refactor: `MultiPeerNetworkManager` -> `PeerNetworkManager` (rust-bitcoin#184) * refactor: `MultiPeerNetworkManager` -> `PeerNetworkManager` * Fix formatting and apply review * feat: Update ffi headers (rust-bitcoin#183) * feat(spv): broadcast transaction (rust-bitcoin#180) * fix: Fix `PeerNetworkManager` cast in `broadcast_transaction` (rust-bitcoin#185) PR rust-bitcoin#180 used `MultiPeerNetworkManager`, this was renamed in rust-bitcoin#183 which was merged before rust-bitcoin#180 but after its CI run. * fix: Use non-blocking `TcpStream` in `dash-spv::network::TcpConnection` (rust-bitcoin#188) * refactor: Improve SPV shutdown handling with `CancellationToken` (rust-bitcoin#187) * refactor: `TcpConnection` -> `Peer` and `ConnectionPool` -> `PeerPool` (rust-bitcoin#190) * fix: Locking issue after rust-bitcoin#190 (rust-bitcoin#191) rust-bitcoin#190 removed the read timeouts of the `Peer::receive_message` which currently leads to a lockup of the peer because the write lock is held while waiting for the message. Needs some more refactoring but this works for now. * fix: More follow-up to rust-bitcoin#190 (rust-bitcoin#193) The sleep timeout branch introduced in rust-bitcoin#191 returns an `Err(NetworkError::Timeout)` which leads to a misbehavior update below in the `msg_result` match and eventually in a peer ban. This shouldn't happen because the `sleep` timing out only means that there is no data available right now. Instead, it now returns `Ok(None)` which will just keep things going. * flush after mn list sync too * move flush to after header sync instead of mnlist * fix --------- Co-authored-by: Kevin Rombach <35775977+xdustinface@users.noreply.github.com>
Utility method to parse a
m/0'/0'/0-like path.Harden characters
'andhare supported.