mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-22 22:34:45 +00:00
Clippy clean (#536)
* Change into_iter to iter * Fix clippy 'easy' warnings * Clippy eth2/utils * Add struct NetworkInfo * Clippy for types, utils, and beacon_node/store/src/iters.rs * Cargo fmt * Change foo to my_foo * Remove complex signature * suppress clippy warning for unit_value in benches * Use enumerate instead of iterating over range * Allow trivially_copy_pass_by_ref in serde_utils
This commit is contained in:
@@ -58,10 +58,12 @@ pub fn be_private_key(validator_index: usize) -> [u8; PRIVATE_KEY_BYTES] {
|
||||
|
||||
/// Return a public and private keypair for a given `validator_index`.
|
||||
pub fn keypair(validator_index: usize) -> Keypair {
|
||||
let sk = SecretKey::from_bytes(&be_private_key(validator_index)).expect(&format!(
|
||||
"Should build valid private key for validator index {}",
|
||||
validator_index
|
||||
));
|
||||
let sk = SecretKey::from_bytes(&be_private_key(validator_index)).unwrap_or_else(|_| {
|
||||
panic!(
|
||||
"Should build valid private key for validator index {}",
|
||||
validator_index
|
||||
)
|
||||
});
|
||||
|
||||
Keypair {
|
||||
pk: PublicKey::from_secret_key(&sk),
|
||||
|
||||
Reference in New Issue
Block a user