Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions catalyst-gateway/bin/src/db/types/slot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ use scylla::_macro_internal::{
SerializeValue, TypeCheckError, WrittenCellProof,
};

use crate::service::common::types::cardano::slot_no::SlotNo;

/// A `Slot` wrapper that can be stored to and load from a database.\
#[allow(clippy::module_name_repetitions)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
Expand Down Expand Up @@ -42,6 +44,12 @@ impl From<DbSlot> for BigInt {
}
}

impl From<SlotNo> for DbSlot {
fn from(value: SlotNo) -> Self {
Self(value.into())
}
}

impl SerializeValue for DbSlot {
fn serialize<'b>(
&self, typ: &ColumnType, writer: CellWriter<'b>,
Expand Down
Loading