Some Cli polish (#8966)

automerge
This commit is contained in:
Tyera Eulberg
2020-03-19 13:03:36 -06:00
committed by GitHub
parent b84468ecd3
commit 6b9a0935c1
3 changed files with 10 additions and 9 deletions

View File

@ -2191,17 +2191,9 @@ where
)) = err.kind() )) = err.kind()
{ {
if let Some(specific_error) = E::decode_custom_error_to_enum(*code) { if let Some(specific_error) = E::decode_custom_error_to_enum(*code) {
error!("{}::{:?}", E::type_of(), specific_error);
eprintln!(
"Program Error ({}::{:?}): {}",
E::type_of(),
specific_error,
specific_error
);
return Err(specific_error.into()); return Err(specific_error.into());
} }
} }
error!("{:?}", err);
Err(err.into()) Err(err.into())
} }
Ok(sig) => Ok(sig), Ok(sig) => Ok(sig),

View File

@ -236,7 +236,8 @@ impl LedgerWallet {
self.write(command, p1, p2, data)?; self.write(command, p1, p2, data)?;
if p1 == P1_CONFIRM && is_last_part(p2) { if p1 == P1_CONFIRM && is_last_part(p2) {
println!( println!(
"Waiting for approval from remote wallet {}", "Waiting for your approval on {} {}",
self.name(),
self.pretty_path self.pretty_path
); );
let result = self.read()?; let result = self.read()?;
@ -261,6 +262,10 @@ impl LedgerWallet {
} }
impl RemoteWallet for LedgerWallet { impl RemoteWallet for LedgerWallet {
fn name(&self) -> &str {
"Ledger hardware wallet"
}
fn read_device( fn read_device(
&self, &self,
dev_info: &hidapi::DeviceInfo, dev_info: &hidapi::DeviceInfo,

View File

@ -173,6 +173,10 @@ impl RemoteWalletManager {
/// `RemoteWallet` trait /// `RemoteWallet` trait
pub trait RemoteWallet { pub trait RemoteWallet {
fn name(&self) -> &str {
"remote wallet"
}
/// Parse device info and get device base pubkey /// Parse device info and get device base pubkey
fn read_device( fn read_device(
&self, &self,