use super::Block;
use crate::block::BlockHeader;
use scsys::{Id, Timestamp};
impl Block {
pub const fn new(header: BlockHeader) -> Self {
Self { header }
}
pub fn from_id(id: Id) -> Self {
Self {
header: BlockHeader::from_id(id),
}
}
pub const fn header(&self) -> &BlockHeader {
&self.header
}
pub const fn header_mut(&mut self) -> &mut BlockHeader {
&mut self.header
}
pub const fn id(&self) -> Id {
self.header().id()
}
pub const fn timestamp(&self) -> Timestamp {
self.header().timestamp()
}
}