diff --git a/Cargo.lock b/Cargo.lock index 813d2d42c..160413f7c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5004,7 +5004,6 @@ dependencies = [ "env_logger", "futures", "hex", - "hidapi", "home", "httpmock", "ledger-transport", diff --git a/cmd/crates/stellar-ledger/Cargo.toml b/cmd/crates/stellar-ledger/Cargo.toml index 3761d36e8..1cda34add 100644 --- a/cmd/crates/stellar-ledger/Cargo.toml +++ b/cmd/crates/stellar-ledger/Cargo.toml @@ -44,7 +44,6 @@ features = ["curr", "std", "serde"] [dev-dependencies] env_logger = "0.11.3" futures = "0.3.30" -hidapi = { version = "1.4.1", features = ["linux-static-hidraw"], default-features = false } log = "0.4.21" once_cell = "1.19.0" pretty_assertions = "1.2.1" diff --git a/cmd/crates/stellar-ledger/src/lib.rs b/cmd/crates/stellar-ledger/src/lib.rs index 9b4bfdb2f..e5bde33dd 100644 --- a/cmd/crates/stellar-ledger/src/lib.rs +++ b/cmd/crates/stellar-ledger/src/lib.rs @@ -1,8 +1,7 @@ use futures::executor::block_on; -use hidapi::HidApi; use ledger_transport::{APDUCommand, Exchange}; use ledger_transport_hid::{ - hidapi::{self, HidError}, + hidapi::{self, HidApi, HidError}, LedgerHIDError, TransportNativeHID, }; use sha2::{Digest, Sha256}; @@ -134,7 +133,7 @@ where let hd_path = bip_path_from_index(index)?; Self::get_public_key_with_display_flag(self, hd_path, false).await } - /// Synchronous version of get_public_key + /// Synchronous version of `get_public_key` /// # Errors /// pub fn get_public_key_sync( @@ -346,7 +345,7 @@ impl Stellar for LedgerSigner { txn: [u8; 32], source_account: &stellar_strkey::Strkey, ) -> Result { - let signature = block_on(self.sign_transaction_hash(self.hd_path.clone(), txn.to_vec())) //TODO: refactor sign_transaction_hash + let signature = block_on(self.sign_transaction_hash(self.hd_path.clone(), &txn)) //TODO: refactor sign_transaction_hash .map_err(|e| { tracing::error!("Error signing transaction hash with Ledger device: {e}"); Error::MissingSignerForAddress {