mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-14 18:32:42 +00:00
Adds a std::default::Default implementation for ValidatorRecord
Updates the test generation so that it uses sane values for some marker values like `FAR_FUTURE_SLOT`
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
use super::SecretKey;
|
||||
use bls_aggregates::PublicKey as RawPublicKey;
|
||||
use ssz::{decode_ssz_list, Decodable, DecodeError, Encodable, SszStream};
|
||||
use std::default;
|
||||
|
||||
/// A single BLS signature.
|
||||
///
|
||||
@@ -20,6 +21,13 @@ impl PublicKey {
|
||||
}
|
||||
}
|
||||
|
||||
impl default::Default for PublicKey {
|
||||
fn default() -> Self {
|
||||
let secret_key = SecretKey::random();
|
||||
PublicKey::from_secret_key(&secret_key)
|
||||
}
|
||||
}
|
||||
|
||||
impl Encodable for PublicKey {
|
||||
fn ssz_append(&self, s: &mut SszStream) {
|
||||
s.append_vec(&self.0.as_bytes());
|
||||
|
||||
Reference in New Issue
Block a user