Skip to content

Commit

Permalink
Merge remote-tracking branch 'AhaLabs/feat/ledger-signing' into feat/…
Browse files Browse the repository at this point in the history
…sign_with_ledger
  • Loading branch information
willemneal committed May 7, 2024
2 parents c22eb60 + a5eca37 commit 17080a5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion cmd/crates/stellar-ledger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 3 additions & 4 deletions cmd/crates/stellar-ledger/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -346,7 +345,7 @@ impl<T: Exchange> Stellar for LedgerSigner<T> {
txn: [u8; 32],
source_account: &stellar_strkey::Strkey,
) -> Result<DecoratedSignature, Error> {
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 {
Expand Down

0 comments on commit 17080a5

Please sign in to comment.