mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-20 21:34:46 +00:00
Clippy 1.49.0 updates and dht persistence test fix (#2156)
## Issue Addressed `test_dht_persistence` failing ## Proposed Changes Bind `NetworkService::start` to an underscore prefixed variable rather than `_`. `_` was causing it to be dropped immediately This was failing 5/100 times before this update, but I haven't been able to get it to fail after updating it Co-authored-by: realbigsean <seananderson33@gmail.com>
This commit is contained in:
@@ -35,6 +35,11 @@ pub const MOD_R_L: usize = 48;
|
||||
#[zeroize(drop)]
|
||||
pub struct DerivedKey(ZeroizeHash);
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum Error {
|
||||
EmptySeed,
|
||||
}
|
||||
|
||||
impl DerivedKey {
|
||||
/// Instantiates `Self` from some secret seed bytes.
|
||||
///
|
||||
@@ -42,10 +47,10 @@ impl DerivedKey {
|
||||
///
|
||||
/// ## Errors
|
||||
///
|
||||
/// Returns `Err(())` if `seed.is_empty()`, otherwise always returns `Ok(self)`.
|
||||
pub fn from_seed(seed: &[u8]) -> Result<Self, ()> {
|
||||
/// Returns `Err(Error::EmptySeed)` if `seed.is_empty()`, otherwise always returns `Ok(self)`.
|
||||
pub fn from_seed(seed: &[u8]) -> Result<Self, Error> {
|
||||
if seed.is_empty() {
|
||||
Err(())
|
||||
Err(Error::EmptySeed)
|
||||
} else {
|
||||
Ok(Self(derive_master_sk(seed)))
|
||||
}
|
||||
|
||||
@@ -8,4 +8,5 @@ mod secret_bytes;
|
||||
|
||||
pub use bls::ZeroizeHash;
|
||||
pub use derived_key::DerivedKey;
|
||||
pub use derived_key::Error as DerivedKeyError;
|
||||
pub use plain_text::PlainText;
|
||||
|
||||
Reference in New Issue
Block a user