Merge branch 'master' into v0.6.1

This commit is contained in:
Paul Hauner
2019-06-02 13:49:24 +10:00
67 changed files with 1663 additions and 1634 deletions

View File

@@ -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");