use crate::{
group::{ProposalRef, proposals::Proposal},
tree::UpdatePath,
};
#[derive(Debug, Clone, Copy, PartialEq, Eq, thalassa::TlsplAll)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[repr(u8)]
pub enum ProposalOrRefType {
Reserved = 0x00,
Proposal = 0x01,
Reference = 0x02,
}
#[derive(Debug, Clone, PartialEq, Eq, thalassa::TlsplAll)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[repr(u8)]
#[allow(clippy::large_enum_variant)]
pub enum ProposalOrRef<'a> {
#[tlspl(discriminant = "ProposalOrRefType::Proposal")]
Proposal(Proposal<'a>),
#[tlspl(discriminant = "ProposalOrRefType::Reference")]
Reference(ProposalRef<'a>),
}
#[derive(Debug, Clone, PartialEq, Eq, thalassa::TlsplAll)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Commit<'a> {
pub proposals: Vec<ProposalOrRef<'a>>,
pub path: Option<UpdatePath<'a>>,
}