Skip to content
Snippets Groups Projects
Commit 31767968 authored by Nicolas80's avatar Nicolas80
Browse files

* Small clippy cleanup

parent 13307c1a
No related branches found
No related tags found
1 merge request!44feat: Can choose between ed25519 ans sr25519
...@@ -572,7 +572,6 @@ pub async fn handle_command(data: Data, command: Subcommand) -> Result<(), GcliE ...@@ -572,7 +572,6 @@ pub async fn handle_command(data: Data, command: Subcommand) -> Result<(), GcliE
.borrow() .borrow()
.account .account
.crypto_scheme .crypto_scheme
.clone()
.ok_or(GcliError::Logic( .ok_or(GcliError::Logic(
"Base account without crypto_scheme".to_string(), "Base account without crypto_scheme".to_string(),
))? ))?
......
...@@ -148,18 +148,14 @@ pub fn get_keypair( ...@@ -148,18 +148,14 @@ pub fn get_keypair(
crypto_scheme: CryptoScheme, crypto_scheme: CryptoScheme,
) -> Result<KeyPair, GcliError> { ) -> Result<KeyPair, GcliError> {
match (secret_format, secret) { match (secret_format, secret) {
(SecretFormat::Predefined, Some(deriv)) => { (SecretFormat::Predefined, Some(deriv)) => match crypto_scheme {
match crypto_scheme {
CryptoScheme::Ed25519 => { CryptoScheme::Ed25519 => {
pair_from_ed25519_str(&predefined_suri(deriv)).map(|v| v.into()) pair_from_ed25519_str(&predefined_suri(deriv)).map(|v| v.into())
} }
_ => pair_from_predefined(deriv).map(|v| v.into()), _ => pair_from_predefined(deriv).map(|v| v.into()),
} },
}
(secret_format, None) => Ok(prompt_secret(secret_format, Some(crypto_scheme))), (secret_format, None) => Ok(prompt_secret(secret_format, Some(crypto_scheme))),
(_, Some(secret)) => { (_, Some(secret)) => pair_from_secret_with_scheme(secret_format, secret, crypto_scheme),
pair_from_secret_with_scheme(secret_format, secret, crypto_scheme)
}
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment