From db1c97635b70c6a9942e95dea490310d3a7227e4 Mon Sep 17 00:00:00 2001 From: Elizabeth Engelman <4752801+elizabethengelman@users.noreply.github.com> Date: Wed, 20 Mar 2024 13:06:42 -0400 Subject: [PATCH] Clean up: remove unused tests, etc --- cmd/crates/stellar-ledger/src/app.rs | 3 +-- cmd/crates/stellar-ledger/src/lib.rs | 33 +--------------------------- 2 files changed, 2 insertions(+), 34 deletions(-) diff --git a/cmd/crates/stellar-ledger/src/app.rs b/cmd/crates/stellar-ledger/src/app.rs index f6f0a705c..cd33fcf23 100644 --- a/cmd/crates/stellar-ledger/src/app.rs +++ b/cmd/crates/stellar-ledger/src/app.rs @@ -30,7 +30,7 @@ pub enum LedgerError { pub fn get_public_key(index: u32) -> Result { let hd_path = bip_path_from_index(index); - get_public_key_with_display_flag(hd_path, true) + get_public_key_with_display_flag(hd_path, false) } fn bip_path_from_index(index: u32) -> slip10::BIP32Path { @@ -90,7 +90,6 @@ pub fn get_public_key_with_display_flag( response.retcode(), ); // Ok means we successfully connected with the Ledger but it doesn't mean our request succeeded. We still need to check the response.retcode - if response.retcode() == RETURN_CODE_OK { return Ok( stellar_strkey::ed25519::PublicKey::from_payload(&response.data()).unwrap(), diff --git a/cmd/crates/stellar-ledger/src/lib.rs b/cmd/crates/stellar-ledger/src/lib.rs index 4c372605d..85bb50157 100644 --- a/cmd/crates/stellar-ledger/src/lib.rs +++ b/cmd/crates/stellar-ledger/src/lib.rs @@ -36,42 +36,11 @@ mod test { &HIDAPI } - #[test] - #[serial] - fn list_all_devices() { - init_logging(); - let api = hidapi(); - - for device_info in api.device_list() { - println!( - "{:#?} - {:#x}/{:#x}/{:#x}/{:#x} {:#} {:#}", - device_info.path(), - device_info.vendor_id(), - device_info.product_id(), - device_info.usage_page(), - device_info.interface_number(), - device_info.manufacturer_string().unwrap_or_default(), - device_info.product_string().unwrap_or_default() - ); - } - } - - #[test] - #[serial] - fn ledger_device_path() { - init_logging(); - let api = hidapi(); - - let mut ledgers = TransportNativeHID::list_ledgers(&api); - - let a_ledger = ledgers.next().expect("could not find any ledger device"); - println!("{:?}", a_ledger.path()); - } - #[test] #[serial] fn test_get_public_key() { let public_key = get_public_key(0); println!("{public_key:?}"); + assert!(public_key.is_ok()); } }