message: update the LeaderId type
diff: -use crate::key::{PrivateKey, PublicKey};
  +use crate::key::{deserialize_public_key, serialize_public_key};
  use crate::stake::StakePoolId;
  use chain_core::property;
  -use chain_crypto::algorithms::vrf::vrf::{ProvenOutputSeed, SecretKey};
  +use chain_crypto::algorithms::vrf::vrf::{self, ProvenOutputSeed};
  +use chain_crypto::{Ed25519, FakeMMM, PublicKey, SecretKey};
  pub mod bft;
  pub mod genesis;
  #[derive(Debug, Clone, PartialEq, Eq, Hash)]
  -pub struct LeaderId(pub PublicKey);
  +pub struct LeaderId(pub PublicKey<Ed25519>);
  pub enum Leader {
  - BftLeader(PrivateKey),
  - GenesisPraos(SecretKey, PrivateKey, ProvenOutputSeed),
  + BftLeader(SecretKey<Ed25519>),
  + GenesisPraos(SecretKey<FakeMMM>, vrf::SecretKey, ProvenOutputSeed),
  }
  impl chain_core::property::LeaderId for LeaderId {}
  @@ -22,13 +23,8 @@ impl From<StakePoolId> for LeaderId {
  }
  }
  -impl From<&PrivateKey> for LeaderId {
  - fn from(key: &PrivateKey) -> Self {
  - LeaderId(key.public())
  - }
  -}
  -impl From<PublicKey> for LeaderId {
  - fn from(key: PublicKey) -> Self {
  +impl From<PublicKey<Ed25519>> for LeaderId {
  + fn from(key: PublicKey<Ed25519>) -> Self {
  LeaderId(key)
  }
  }
  @@ -36,14 +32,14 @@ impl From<PublicKey> for LeaderId {
  impl property::Serialize for LeaderId {
  type Error = std::io::Error;
  fn serialize<W: std::io::Write>(&self, writer: W) -> Result<(), Self::Error> {
  - self.0.serialize(writer)
  + serialize_public_key(&self.0, writer)
  }
  }
  impl property::Deserialize for LeaderId {
  type Error = std::io::Error;
  fn deserialize<R: std::io::BufRead>(reader: R) -> Result<Self, Self::Error> {
  - Ok(LeaderId(PublicKey::deserialize(reader)?))
  + deserialize_public_key(reader).map(LeaderId)
  }
  }
  @@ -54,7 +50,14 @@ mod test {
  impl Arbitrary for LeaderId {
  fn arbitrary<G: Gen>(g: &mut G) -> Self {
  - LeaderId(Arbitrary::arbitrary(g))
  + use rand_chacha::ChaChaRng;
  + use rand_core::SeedableRng;
  + let mut seed = [0; 32];
  + for byte in seed.iter_mut() {
  + *byte = Arbitrary::arbitrary(g);
  + }
  + let mut rng = ChaChaRng::from_seed(seed);
  + LeaderId(SecretKey::generate(&mut rng).to_public())
  }
  }
  }
  