Appease clippy

This commit is contained in:
Paul Hauner
2022-08-17 12:18:50 +10:00
parent 85d0843857
commit ce7f29d0d9

View File

@@ -301,14 +301,14 @@ async fn build_validator_spec_from_cli<'a>(
*/ */
let mut validators = Vec::with_capacity(count as usize); let mut validators = Vec::with_capacity(count as usize);
let mut deposits = disable_deposits.then(|| vec![]); let mut deposits = disable_deposits.then(Vec::new);
for (i, derivation_index) in (first_index..first_index + count).enumerate() { for (i, derivation_index) in (first_index..first_index + count).enumerate() {
// If the voting keystore password was not provided by the user then use a unique random // If the voting keystore password was not provided by the user then use a unique random
// string for each validator. // string for each validator.
let voting_keystore_password = voting_keystore_password let voting_keystore_password = voting_keystore_password
.clone() .clone()
.unwrap_or_else(|| random_password_string()); .unwrap_or_else(random_password_string);
// Set the wallet to the appropriate derivation index. // Set the wallet to the appropriate derivation index.
wallet wallet
@@ -372,7 +372,7 @@ async fn build_validator_spec_from_cli<'a>(
let withdrawal_credentials = if let Some(eth1_withdrawal_address) = let withdrawal_credentials = if let Some(eth1_withdrawal_address) =
eth1_withdrawal_address eth1_withdrawal_address
{ {
WithdrawalCredentials::eth1(eth1_withdrawal_address, &spec) WithdrawalCredentials::eth1(eth1_withdrawal_address, spec)
} else { } else {
// Decrypt the withdrawal keystore so withdrawal credentials can be created. It's // Decrypt the withdrawal keystore so withdrawal credentials can be created. It's
// not strictly necessary to decrypt the keystore since we can read the pubkey // not strictly necessary to decrypt the keystore since we can read the pubkey
@@ -382,7 +382,7 @@ async fn build_validator_spec_from_cli<'a>(
.withdrawal .withdrawal
.decrypt_keypair(withdrawal_keystore_password.as_ref()) .decrypt_keypair(withdrawal_keystore_password.as_ref())
.map_err(|e| format!("Failed to decrypt withdrawal keystore {}: {:?}", i, e))?; .map_err(|e| format!("Failed to decrypt withdrawal keystore {}: {:?}", i, e))?;
WithdrawalCredentials::bls(&withdrawal_keypair.pk, &spec) WithdrawalCredentials::bls(&withdrawal_keypair.pk, spec)
}; };
// Create a JSON structure equivalent to the one generated by // Create a JSON structure equivalent to the one generated by
@@ -391,7 +391,7 @@ async fn build_validator_spec_from_cli<'a>(
&voting_keypair, &voting_keypair,
withdrawal_credentials.into(), withdrawal_credentials.into(),
deposit_gwei, deposit_gwei,
&spec, spec,
)?; )?;
deposits.push(json_deposit); deposits.push(json_deposit);