diff --git a/src/commands/mod.rs b/src/commands/mod.rs index 0365cc4..decbdeb 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -14,11 +14,6 @@ mod yubihsm; #[cfg(feature = "yubihsm")] pub use self::yubihsm::YubihsmCommand; -#[cfg(feature = "ledgertm")] -mod ledgertm; -#[cfg(feature = "ledgertm")] -pub use self::ledgertm::LedgertmCommand; - pub use self::{ help::HelpCommand, keygen::KeygenCommand, start::StartCommand, version::VersionCommand, }; @@ -42,10 +37,6 @@ pub enum KmsCommand { #[cfg(feature = "yubihsm")] #[options(help = "subcommands for YubiHSM2")] Yubihsm(YubihsmCommand), - - #[cfg(feature = "ledgertm")] - #[options(help = "subcommands for Ledger Tendermint app")] - Ledgertm(LedgertmCommand), } // TODO: refactor abscissa internally so this is all part of the proc macro @@ -89,8 +80,6 @@ impl Callable for KmsCommand { KmsCommand::Version(version) => version.call(), #[cfg(feature = "yubihsm")] KmsCommand::Yubihsm(yubihsm) => yubihsm.call(), - #[cfg(feature = "ledgertm")] - KmsCommand::Ledgertm(ledgertm) => ledgertm.call(), } } } diff --git a/src/keyring/ed25519/ledgertm.rs b/src/keyring/ed25519/ledgertm.rs index 47bec07..0475edb 100644 --- a/src/keyring/ed25519/ledgertm.rs +++ b/src/keyring/ed25519/ledgertm.rs @@ -5,7 +5,7 @@ use signatory_ledger_tm::{self, Ed25519LedgerTmAppSigner}; use crate::{ config::provider::ledgertm::LedgerTendermintConfig, - error::KmsError, + error::{KmsError, KmsErrorKind::*}, keyring::{ed25519::Signer, KeyRing}, }; @@ -13,7 +13,10 @@ pub const LEDGER_TM_PROVIDER_LABEL: &str = "ledgertm"; pub const LEDGER_TM_ID: &str = "ledgertm"; /// Create Ledger Tendermint signer object from the given configuration -pub fn init(keyring: &mut KeyRing, ledgertm_configs: &[LedgerTendermintConfig]) -> Result<(), KmsError> { +pub fn init( + keyring: &mut KeyRing, + ledgertm_configs: &[LedgerTendermintConfig], +) -> Result<(), KmsError> { if ledgertm_configs.is_empty() { return Ok(()); } @@ -22,7 +25,7 @@ pub fn init(keyring: &mut KeyRing, ledgertm_configs: &[LedgerTendermintConfig]) fail!( ConfigError, "expected one [providers.ledgertm] in config, found: {}", - config.len() + ledgertm_configs.len() ); } let provider = Box::new(Ed25519LedgerTmAppSigner::connect()?); diff --git a/src/lib.rs b/src/lib.rs index 77f6ece..93f96e1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -44,8 +44,6 @@ mod client; mod commands; mod config; mod keyring; -#[cfg(feature = "ledgertm")] -mod ledgertm; mod rpc; mod session; mod unix_connection;