mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-19 21:04:41 +00:00
Fix master failing test (#915)
* Use a valid secret key in ssz test * Correct test_random secret key tests
This commit is contained in:
@@ -2,17 +2,7 @@ use super::*;
|
||||
use bls::SecretKey;
|
||||
|
||||
impl TestRandom for SecretKey {
|
||||
fn random_for_test(rng: &mut impl RngCore) -> Self {
|
||||
let mut key_bytes = vec![0; 48];
|
||||
rng.fill_bytes(&mut key_bytes);
|
||||
/*
|
||||
* An `unreachable!` is used here as there's no reason why you cannot construct a key from a
|
||||
* fixed-length byte slice. Also, this should only be used during testing so a panic is
|
||||
* acceptable.
|
||||
*/
|
||||
match SecretKey::from_bytes(&key_bytes) {
|
||||
Ok(key) => key,
|
||||
Err(_) => unreachable!(),
|
||||
}
|
||||
fn random_for_test(_rng: &mut impl RngCore) -> Self {
|
||||
SecretKey::random()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user