Add interop-spec genesis procedure

This commit is contained in:
Paul Hauner
2019-08-30 15:33:34 +10:00
parent e154b30232
commit 6234adc0d6
7 changed files with 181 additions and 17 deletions

View File

@@ -1,5 +1,6 @@
use super::{SecretKey, BLS_PUBLIC_KEY_BYTE_SIZE};
use milagro_bls::G1Point;
use milagro_bls::PublicKey as RawPublicKey;
use serde::de::{Deserialize, Deserializer};
use serde::ser::{Serialize, Serializer};
use serde_hex::{encode as hex_encode, HexVisitor};
@@ -24,6 +25,13 @@ impl FakePublicKey {
Self::zero()
}
pub fn from_raw(raw: RawPublicKey) -> Self {
Self {
bytes: raw.clone().as_bytes(),
point: G1Point::new(),
}
}
/// Creates a new all-zero's public key
pub fn zero() -> Self {
Self {