mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-20 05:14:35 +00:00
Merge branch 'master' into v0.6.1
This commit is contained in:
@@ -14,6 +14,7 @@ use tree_hash::tree_hash_ssz_encoding_as_vector;
|
||||
#[derive(Debug, PartialEq, Clone, Eq)]
|
||||
pub struct FakeSignature {
|
||||
bytes: Vec<u8>,
|
||||
is_empty: bool,
|
||||
}
|
||||
|
||||
impl FakeSignature {
|
||||
@@ -26,6 +27,7 @@ impl FakeSignature {
|
||||
pub fn zero() -> Self {
|
||||
Self {
|
||||
bytes: vec![0; BLS_SIG_BYTE_SIZE],
|
||||
is_empty: true,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,6 +61,7 @@ impl FakeSignature {
|
||||
} else {
|
||||
Ok(Self {
|
||||
bytes: bytes.to_vec(),
|
||||
is_empty: false,
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -71,6 +74,11 @@ impl FakeSignature {
|
||||
pub fn empty_signature() -> Self {
|
||||
FakeSignature::zero()
|
||||
}
|
||||
|
||||
// Check for empty Signature
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.is_empty
|
||||
}
|
||||
}
|
||||
|
||||
impl_ssz!(FakeSignature, BLS_SIG_BYTE_SIZE, "FakeSignature");
|
||||
|
||||
Reference in New Issue
Block a user