Skip to content

Commit

Permalink
fix: format DerivationPath w/ prefix m/ when using as hwilib
Browse files Browse the repository at this point in the history
function argument
  • Loading branch information
oleonardolima committed Jun 4, 2024
1 parent 7afc15a commit ede9ea7
Showing 1 changed file with 7 additions and 4 deletions.
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);
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

0 comments on commit ede9ea7

Please sign in to comment.