Merge changes from master into spec update

This commit is contained in:
Kirk Baird
2019-01-21 10:03:30 +11:00
8 changed files with 326 additions and 83 deletions

View File

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