From 3aa284b576a80c44258a2a9890ff67e6fb4ea150 Mon Sep 17 00:00:00 2001 From: benk10 Date: Tue, 29 Apr 2025 15:01:06 +0300 Subject: [PATCH] Fix bitcoin new version derivations (#87) --- src-tauri/src/hwi/interface.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src-tauri/src/hwi/interface.rs b/src-tauri/src/hwi/interface.rs index 59b2121..e84667b 100644 --- a/src-tauri/src/hwi/interface.rs +++ b/src-tauri/src/hwi/interface.rs @@ -145,7 +145,8 @@ impl HWIClient { path: &DerivationPath, expert: bool, ) -> Result { - let output = self.implementation.get_xpub(&path.to_string(), expert)?; + let prefixed_path = format!("m/{}", path); + let output = self.implementation.get_xpub(&prefixed_path, expert)?; deserialize_obj!(&output) } @@ -155,9 +156,8 @@ impl HWIClient { message: &str, path: &DerivationPath, ) -> Result { - let output = self - .implementation - .sign_message(message, &path.to_string())?; + let prefixed_path = format!("m/{}", path); + let output = self.implementation.sign_message(message, &prefixed_path)?; deserialize_obj!(&output) } @@ -183,7 +183,7 @@ impl HWIClient { start: u32, end: u32, ) -> Result, Error> { - let path_str = path.map(|p| p.to_string()); + let path_str = path.map(|p| format!("m/{}/*", p)); let output = self.implementation.get_keypool( keypool, internal, @@ -222,9 +222,10 @@ impl HWIClient { path: &DerivationPath, address_type: HWIAddressType, ) -> Result { + let prefixed_path = format!("m/{}", path); let output = self .implementation - .display_address_with_path(&path.to_string(), address_type)?; + .display_address_with_path(&prefixed_path, address_type)?; deserialize_obj!(&output) }