use super::*; pub(crate) trait Entry: Sized { type Value; fn load(value: Self::Value) -> Self; fn store(self) -> Self::Value; } pub(super) type BlockHashValue = [u8; 32]; impl Entry for BlockHash { type Value = BlockHashValue; fn load(value: Self::Value) -> Self { BlockHash::from_raw_hash(Hash::from_byte_array(value)) } fn store(self) -> Self::Value { *self.as_ref() } } #[derive(Debug, PartialEq, Copy, Clone)] pub(crate) struct RuneEntry { pub(crate) burned: u128, pub(crate) divisibility: u8, pub(crate) end: Option, pub(crate) etching: Txid, pub(crate) limit: Option, pub(crate) number: u64, pub(crate) rune: Rune, pub(crate) supply: u128, pub(crate) symbol: Option, pub(crate) timestamp: u32, } pub(super) type RuneEntryValue = ( u128, // burned u8, // divisibility Option, // end (u128, u128), // etching Option, // limit u64, // number u128, // rune u128, // supply Option, // symbol