Skip to content

Commit 5e88904

Browse files
committed
Merge #99: chore(deps): upgrade rust-bitcoin to 0.32.0
be7933a chore: bump version to `0.9.0` (Leonardo Lima) ede9ea7 fix: format `DerivationPath` w/ prefix `m/` when using as hwilib function argument (Leonardo Lima) 7afc15a fix: use `compute_txid()` instead of deprecated `txid()` (Leonardo Lima) c15e1a2 chore: upgrade `miniscript` dependency to `0.12.0` (Leonardo Lima) be5b382 chore: upgrade `bitcoin` dependency to `0.32.0` (Leonardo Lima) Pull request description: <!-- You can erase any parts of this template not applicable to your Pull Request. --> `partially fixes` [#1422](bitcoindevkit/bdk#1422) ### Description It updates the `rust-bitcoin` dependency to `0.32.0`, and the `miniscript` to `0.12.0`. <!-- Describe the purpose of this PR, what's being adding and/or fixed --> ### Notes to the reviewers It's open for any comments. <!-- In this section you can include notes directed to the reviewers, like explaining why some parts of the PR were done in a specific way --> ### Changelog notice - Update the `bitcoin` crate dependency to `0.32.0` - Update the `miniscript` crate dependency to `0.12.0` - Expliciltly format the `DerivationPath` with `m/` prefix before passing it as argument to HWI interface, the `fmt::Display` trait removed the `m/` prefix on `rust-bitcoin` `0.32.0`. <!-- Notice the release manager should include in the release tag message changelog --> <!-- See https://keepachangelog.com/en/1.0.0/ for examples --> ### Checklists #### All Submissions: * [x] I've signed all my commits * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md) * [x] I ran `cargo fmt` and `cargo clippy` before committing ACKs for top commit: notmandatory: ACK be7933a Tree-SHA512: 52bca723ae6e7dd9642c016d7881323be21d03bef05e9f9e21803e7fd5d8924c25d7a9731b4b3c61018648b4666e92ee1ca695ea8df8016f90a9446e8d64cefa
2 parents 308bde4 + be7933a commit 5e88904

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "hwi"
3-
version = "0.8.0"
3+
version = "0.9.0"
44
authors = ["Daniela Brozzoni <danielabrozzoni@protonmail.com>"]
55
edition = "2018"
66
license = "MIT"
@@ -11,12 +11,12 @@ readme = "README.md"
1111
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1212

1313
[dependencies]
14-
bitcoin = { version = "0.31.0", features = ["serde", "base64"] }
14+
bitcoin = { version = "0.32", features = ["serde", "base64"] }
1515
serde = { version = "^1.0", features = ["derive"] }
1616
serde_json = { version = "^1.0" }
1717
pyo3 = { version = "0.21.2", features = ["auto-initialize"] }
1818

19-
miniscript = { version = "11.0", features = ["serde"], optional = true }
19+
miniscript = { version = "12.0", features = ["serde"], optional = true }
2020

2121
[dev-dependencies]
2222
serial_test = "0.6.0"

src/interface.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,9 @@ impl HWIClient {
224224
path: &DerivationPath,
225225
expert: bool,
226226
) -> Result<HWIExtendedPubKey, Error> {
227+
let prefixed_path = format!("m/{}", path);
227228
Python::with_gil(|py| {
228-
let func_args = (&self.hw_client, path.to_string(), expert);
229+
let func_args = (&self.hw_client, prefixed_path, expert);
229230
let output = self
230231
.hwilib
231232
.commands
@@ -242,8 +243,9 @@ impl HWIClient {
242243
message: &str,
243244
path: &DerivationPath,
244245
) -> Result<HWISignature, Error> {
246+
let prefixed_path = format!("m/{}", path);
245247
Python::with_gil(|py| {
246-
let func_args = (&self.hw_client, message, path.to_string());
248+
let func_args = (&self.hw_client, message, prefixed_path);
247249
let output = self
248250
.hwilib
249251
.commands
@@ -279,7 +281,7 @@ impl HWIClient {
279281
Python::with_gil(|py| {
280282
let mut p_str = py.None();
281283
if let Some(p) = path {
282-
p_str = format!("{}/*", p).into_py(py);
284+
p_str = format!("m/{}/*", p).into_py(py);
283285
}
284286
let func_args = (
285287
&self.hw_client,
@@ -345,8 +347,9 @@ impl HWIClient {
345347
address_type: HWIAddressType,
346348
) -> Result<HWIAddress, Error> {
347349
Python::with_gil(|py| {
350+
let prefixed_path = format!("m/{}", path);
348351
let descriptor = py.None();
349-
let func_args = (&self.hw_client, path.to_string(), descriptor, address_type);
352+
let func_args = (&self.hw_client, prefixed_path, descriptor, address_type);
350353
let output = self
351354
.hwilib
352355
.commands

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ mod tests {
225225

226226
let previous_txin = TxIn {
227227
previous_output: bitcoin::OutPoint {
228-
txid: previous_tx.txid(),
228+
txid: previous_tx.compute_txid(),
229229
vout: Default::default(),
230230
},
231231
..Default::default()

0 commit comments

Comments
 (0)