cat_gateway/service/common/objects/cardano/
sync_state.rsuse poem_openapi::{types::Example, Object};
use crate::service::{
api::cardano::types::{DateTime, SlotNumber},
common::objects::cardano::hash::Hash,
};
#[derive(Object)]
#[oai(example = true)]
pub(crate) struct SyncState {
#[oai(validator(minimum(value = "0"), maximum(value = "4294967295")))]
pub(crate) slot_number: SlotNumber,
pub(crate) block_hash: Hash,
pub(crate) last_updated: DateTime,
}
impl Example for SyncState {
#[allow(clippy::expect_used)]
fn example() -> Self {
Self {
slot_number: 5,
block_hash: hex::decode(
"0000000000000000000000000000000000000000000000000000000000000000",
)
.expect("Invalid hex")
.into(),
last_updated: chrono::DateTime::default(),
}
}
}