mod bytes;
mod serialize;
mod string;
mod to_bits;
use console::{network::prelude::*, types::Field};
#[derive(Clone, PartialEq, Eq)]
pub struct HeaderLeaf<N: Network> {
index: u8,
id: Field<N>,
}
impl<N: Network> HeaderLeaf<N> {
pub const fn new(index: u8, id: Field<N>) -> Self {
Self { index, id }
}
pub const fn index(&self) -> u8 {
self.index
}
pub const fn id(&self) -> Field<N> {
self.id
}
}
#[cfg(test)]
mod test_helpers {
use super::*;
use console::network::Testnet3;
type CurrentNetwork = Testnet3;
pub(super) fn sample_leaf() -> HeaderLeaf<CurrentNetwork> {
let rng = &mut test_crypto_rng();
HeaderLeaf::new(rng.gen(), Uniform::rand(rng))
}
}