use super::*;
impl<N: Network, B: BlockStorage<N>, P: ProgramStorage<N>> Ledger<N, B, P> {
pub const fn latest_state_root(&self) -> &Field<N> {
self.block_tree.root()
}
pub fn latest_block(&self) -> Result<Block<N>> {
self.get_block(self.current_height)
}
pub const fn latest_hash(&self) -> N::BlockHash {
self.current_hash
}
pub const fn latest_height(&self) -> u32 {
self.current_height
}
pub const fn latest_round(&self) -> u64 {
self.current_round
}
pub fn latest_coinbase_target(&self) -> Result<u64> {
Ok(self.get_header(self.current_height)?.coinbase_target())
}
pub fn latest_proof_target(&self) -> Result<u64> {
Ok(self.get_header(self.current_height)?.proof_target())
}
pub fn latest_timestamp(&self) -> Result<i64> {
Ok(self.get_header(self.current_height)?.timestamp())
}
pub fn latest_transactions(&self) -> Result<Transactions<N>> {
self.get_transactions(self.current_height)
}
}