mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-09 11:25:55 +00:00
Add additional fake_crypto objects
This commit is contained in:
28
eth2/utils/bls/src/fake_aggregate_public_key.rs
Normal file
28
eth2/utils/bls/src/fake_aggregate_public_key.rs
Normal file
@@ -0,0 +1,28 @@
|
||||
use super::{PublicKey, BLS_PUBLIC_KEY_BYTE_SIZE};
|
||||
use bls_aggregates::AggregatePublicKey as RawAggregatePublicKey;
|
||||
|
||||
/// A BLS aggregate public key.
|
||||
///
|
||||
/// This struct is a wrapper upon a base type and provides helper functions (e.g., SSZ
|
||||
/// serialization).
|
||||
#[derive(Debug, Clone, Default)]
|
||||
pub struct FakeAggregatePublicKey {
|
||||
bytes: Vec<u8>,
|
||||
}
|
||||
|
||||
impl FakeAggregatePublicKey {
|
||||
pub fn new() -> Self {
|
||||
Self::zero()
|
||||
}
|
||||
|
||||
/// Creates a new all-zero's aggregate public key
|
||||
pub fn zero() -> Self {
|
||||
Self {
|
||||
bytes: vec![0; BLS_PUBLIC_KEY_BYTE_SIZE],
|
||||
}
|
||||
}
|
||||
|
||||
pub fn add(&mut self, _public_key: &PublicKey) {
|
||||
// No nothing.
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user