Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Commit

Permalink
add clearer text
Browse files Browse the repository at this point in the history
  • Loading branch information
Neotamandua committed Oct 5, 2023
1 parent 79069dd commit 5c66daf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/bin/interactive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ fn menu_op(
.add(CMI::History, "Transaction History")
.add(CMI::Transfer, "Transfer Dusk")
.add(CMI::Stake, "Stake Dusk")
.add(CMI::StakeAllow, "Stake Allow")
.add(CMI::StakeAllow, "Allow staking key")
.add(CMI::StakeInfo, "Check existing stake")
.add(CMI::Unstake, "Unstake Dusk")
.add(CMI::Withdraw, "Withdraw staking reward")
Expand Down
11 changes: 9 additions & 2 deletions src/bin/io/prompt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,18 @@ fn check_valid_denom(value: f64, balance: Dusk) -> Result<(), String> {
}

fn check_valid_pkey(key: &str) -> Result<(), String> {
let key_length = bs58::decode(key).into_vec().unwrap_or(vec![]).len();
let key_length = match bs58::decode(key).into_vec() {
Ok(v) => v.len(),
Err(_) => {
return Err(
"Please introduce a valid provisioner key (Base58)".to_string()
)
}
};
if key_length == PROVISIONER_KEY_LENGTH {
Ok(())
} else {
Err("Please introduce a valid provisioner key".to_string())
Err(format!("Invalid provisioner key length. Key should be {} bytes long but was {} bytes long", PROVISIONER_KEY_LENGTH, key_length))
}
}

Expand Down

0 comments on commit 5c66daf

Please sign in to comment.