Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): upgrade rust-bitcoin to 0.32.0 #99

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hwi"
version = "0.8.0"
version = "0.9.0"
authors = ["Daniela Brozzoni <[email protected]>"]
edition = "2018"
license = "MIT"
Expand All @@ -11,12 +11,12 @@ readme = "README.md"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
bitcoin = { version = "0.31.0", features = ["serde", "base64"] }
bitcoin = { version = "0.32", features = ["serde", "base64"] }
serde = { version = "^1.0", features = ["derive"] }
serde_json = { version = "^1.0" }
pyo3 = { version = "0.21.2", features = ["auto-initialize"] }

miniscript = { version = "11.0", features = ["serde"], optional = true }
miniscript = { version = "12.0", features = ["serde"], optional = true }

[dev-dependencies]
serial_test = "0.6.0"
Expand Down
11 changes: 7 additions & 4 deletions src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,9 @@ impl HWIClient {
path: &DerivationPath,
expert: bool,
) -> Result<HWIExtendedPubKey, Error> {
let prefixed_path = format!("m/{}", path);
Copy link
Contributor

Choose a reason for hiding this comment

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

Drats, that turned out ugly didn't it. Maybe we should have a function that explicitly does this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, a specific function for that would help.

Copy link

@Kixunil Kixunil Jun 8, 2024

Choose a reason for hiding this comment

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

Including m/ is actually incorrect/misunderstanding of the BIP. Why did you keep the incorrect behavior?

Copy link
Member

Choose a reason for hiding this comment

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

Hey @Kixunil , which BIP in particular do you mean?

Anyway this PR isn't meant to change how this lib works, only to bump the version of rust-bitcoin. If there's something we need to fix we can do it in another PR.

Copy link

Choose a reason for hiding this comment

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

32, see this issue: rust-bitcoin/rust-bitcoin#2451

However, I've just noticed this is still debated: rust-bitcoin/rust-bitcoin#2671

Copy link
Contributor Author

@oleonardolima oleonardolima Jun 10, 2024

Choose a reason for hiding this comment

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

Including m/ is actually incorrect/misunderstanding of the BIP. Why did you keep the incorrect behavior?

Hey @Kixunil , which BIP in particular do you mean?

Anyway this PR isn't meant to change how this lib works, only to bump the version of rust-bitcoin. If there's something we need to fix we can do it in another PR.

Yes, I kept it because it would require changes on the upstream hwilib, ACK's, and so on, as Steve mentioned not the scope of this PR.

Thanks, I'll keep an eye on the issue discussion, and update it in another PR if appropriate.

Python::with_gil(|py| {
let func_args = (&self.hw_client, path.to_string(), expert);
let func_args = (&self.hw_client, prefixed_path, expert);
let output = self
.hwilib
.commands
Expand All @@ -242,8 +243,9 @@ impl HWIClient {
message: &str,
path: &DerivationPath,
) -> Result<HWISignature, Error> {
let prefixed_path = format!("m/{}", path);
Python::with_gil(|py| {
let func_args = (&self.hw_client, message, path.to_string());
let func_args = (&self.hw_client, message, prefixed_path);
let output = self
.hwilib
.commands
Expand Down Expand Up @@ -279,7 +281,7 @@ impl HWIClient {
Python::with_gil(|py| {
let mut p_str = py.None();
if let Some(p) = path {
p_str = format!("{}/*", p).into_py(py);
p_str = format!("m/{}/*", p).into_py(py);
}
let func_args = (
&self.hw_client,
Expand Down Expand Up @@ -345,8 +347,9 @@ impl HWIClient {
address_type: HWIAddressType,
) -> Result<HWIAddress, Error> {
Python::with_gil(|py| {
let prefixed_path = format!("m/{}", path);
let descriptor = py.None();
let func_args = (&self.hw_client, path.to_string(), descriptor, address_type);
let func_args = (&self.hw_client, prefixed_path, descriptor, address_type);
let output = self
.hwilib
.commands
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ mod tests {

let previous_txin = TxIn {
previous_output: bitcoin::OutPoint {
txid: previous_tx.txid(),
txid: previous_tx.compute_txid(),
vout: Default::default(),
},
..Default::default()
Expand Down
Loading