Skip to content

Commit 3224f08

Browse files
committed
daemon: update rust-miniscript to 0.9
This also updates the multipaths descriptor patch to the review PR rust-bitcoin/rust-miniscript#470 (rebased on 0.9)
1 parent 8c206b0 commit 3224f08

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ jsonrpc_server = []
2525

2626
[dependencies]
2727
# For managing transactions (it re-exports the bitcoin crate)
28-
# TODO: don't use my fork for a real release..
29-
miniscript = { git = "https://github.com/darosior/rust-miniscript", branch = "multipath_descriptors_on_8.0", features = ["serde"] }
28+
miniscript = { version = "9.0", features = ["serde"] }
3029

3130
# Don't reinvent the wheel
3231
dirs = "3.0"
@@ -57,3 +56,6 @@ libc = "0.2"
5756

5857
# Used for PSBTs
5958
base64 = "0.13"
59+
60+
[patch.crates-io]
61+
miniscript = { git = "https://github.com/darosior/rust-miniscript", branch = "multipath_descriptors_on_9.0" }

src/descriptors.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,13 @@ fn is_valid_desc_key(key: &descriptor::DescriptorPublicKey) -> bool {
190190
false
191191
}
192192
descriptor::DescriptorPublicKey::MultiXPub(ref xpub) => {
193+
let der_paths = xpub.derivation_paths.paths();
193194
// Rust-miniscript enforces BIP389 which states that all paths must have the same len.
194-
let len = xpub.derivation_paths.get(0).expect("Cannot be empty").len();
195+
let len = der_paths.get(0).expect("Cannot be empty").len();
195196
xpub.wildcard == descriptor::Wildcard::Unhardened
196-
&& xpub.derivation_paths.len() == 2
197-
&& xpub.derivation_paths[0][len - 1] == 0.into()
198-
&& xpub.derivation_paths[1][len - 1] == 1.into()
197+
&& der_paths.len() == 2
198+
&& der_paths[0][len - 1] == 0.into()
199+
&& der_paths[1][len - 1] == 1.into()
199200
}
200201
}
201202
}

0 commit comments

Comments
 (0)