From a9f21762eab746bf2ed44178456f5e0efc9f6896 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 19 Mar 2024 12:52:36 +0100 Subject: [PATCH] fixes 2 --- cli/src/cli.rs | 4 ++-- cli/src/helper.rs | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cli/src/cli.rs b/cli/src/cli.rs index 2f23c830ee..9bbbefc44c 100644 --- a/cli/src/cli.rs +++ b/cli/src/cli.rs @@ -68,7 +68,7 @@ pub struct InitParameters { #[arg(short, long, value_name = "URL", env = "NODE_URL", default_value = DEFAULT_NODE_URL)] pub node_url: String, /// Set the BIP path. If not provided a bip path has to be provided interactively on first launch. - /// The expected format is: `///`. + /// The expected format is: `///`. #[arg(short, long, value_parser = parse_bip_path)] pub bip_path: Option, /// Set the Bech32-encoded wallet address. @@ -412,7 +412,7 @@ pub async fn init_command( let mut alias = init_params.alias; if alias.is_none() { - if get_decision("Do you want to set an alias of the new wallet?")? { + if get_decision("Do you want to set an alias for the new wallet?")? { alias.replace(get_alias("Set wallet alias").await?); } } diff --git a/cli/src/helper.rs b/cli/src/helper.rs index fc81b50be3..1e66d4664a 100644 --- a/cli/src/helper.rs +++ b/cli/src/helper.rs @@ -55,7 +55,7 @@ pub async fn get_alias(prompt: &str) -> Result { loop { let input = Input::::new().with_prompt(prompt).interact_text()?; if input.is_empty() || !input.is_ascii() { - println_log_error!("Invalid input, please choose a non-empty alias consisting of ASCII characters."); + println_log_error!("Invalid input, please enter a valid alias (non-empty, ASCII)."); } else { return Ok(input); } @@ -66,7 +66,7 @@ pub async fn get_address(prompt: &str) -> Result { loop { let input = Input::::new().with_prompt(prompt).interact_text()?; if input.is_empty() || !input.is_ascii() { - println_log_error!("Invalid input, please choose a non-empty address consisting of ASCII characters."); + println_log_error!("Invalid input, please enter a valid Bech32 address."); } else { return Ok(Bech32Address::from_str(&input)?); } @@ -77,9 +77,11 @@ pub async fn get_bip_path(prompt: &str) -> Result { loop { let input = Input::::new().with_prompt(prompt).interact_text()?; if input.is_empty() || !input.is_ascii() { - println_log_error!("Invalid input, please choose a non-empty address consisting of ASCII characters."); + println_log_error!( + "Invalid input, please enter a valid bip path (///." + ); } else { - return Ok(parse_bip_path(&input).expect("todo")); + return Ok(parse_bip_path(&input)?); } } }