#![allow(clippy::module_inception)]
pub mod consensus;
pub mod doms;
pub mod fabric;
pub mod genesis;
pub use amadeus_utils::constants::{
DST, DST_ANR, DST_ANR_CHALLENGE, DST_ATT, DST_ENTRY, DST_MOTION, DST_NODE, DST_POP, DST_TX, DST_VRF,
};
use crate::utils::misc::TermExt;
use crate::utils::rocksdb::RocksDb;
use amadeus_utils::constants::CF_SYSCONF;
use eetf::Term;
pub fn chain_epoch(db: &RocksDb) -> u32 {
chain_height(db) / 100_000
}
pub fn chain_height(db: &RocksDb) -> u32 {
match db.get(CF_SYSCONF, b"temporal_height") {
Ok(Some(bytes)) => {
match Term::decode(&bytes[..]) {
Ok(term) => TermExt::get_integer(&term).unwrap_or(0) as u32,
Err(_) => 0, }
}
_ => 0, }
}