use super::{agreement::SectionSigned, prefix_map::PrefixMap, signed::Signed};
use crate::SectionAuthorityProvider;
use serde::{Deserialize, Serialize};
use std::borrow::Borrow;
use xor_name::Prefix;
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct Network {
pub sections: PrefixMap<OtherSection>,
}
#[derive(Clone, Eq, PartialEq, Hash, Debug, Serialize, Deserialize)]
pub struct OtherSection {
pub section_auth: SectionSigned<SectionAuthorityProvider>,
pub key_signed: Option<Signed>,
}
impl Borrow<Prefix> for OtherSection {
fn borrow(&self) -> &Prefix {
&self.section_auth.value.prefix
}
}