Skip to content

Commit

Permalink
mnemonic length message updated
Browse files Browse the repository at this point in the history
  • Loading branch information
surinder83singh committed Oct 27, 2023
1 parent dea5aad commit 56df23e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cli/src/wizards/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ pub(crate) async fn import_with_mnemonic(ctx: &Arc<KaspaCli>, account_kind: Acco
tprintln!(ctx);
let mnemonic = ask(&term).await?;
tprintln!(ctx);

let length = mnemonic.len();
match account_kind {
AccountKind::Legacy if mnemonic.len() != 12 => Err(Error::Custom("wrong mnemonic length".to_owned())),
AccountKind::Bip32 if mnemonic.len() != 24 => Err(Error::Custom("wrong mnemonic length".to_owned())),
AccountKind::Legacy if length != 12 => Err(Error::Custom(format!("wrong mnemonic length ({length})"))),
AccountKind::Bip32 if length != 24 => Err(Error::Custom(format!("wrong mnemonic length ({length})"))),

AccountKind::Legacy | AccountKind::Bip32 | AccountKind::MultiSig => Ok(()),
_ => Err(Error::Custom("unsupported account kind".to_owned())),
Expand Down

0 comments on commit 56df23e

Please sign in to comment.