fuel_core/database/database_description/
relayer.rs1use crate::database::database_description::DatabaseDescription;
2use fuel_core_storage::kv_store::StorageColumn;
3use fuel_core_types::blockchain::primitives::DaBlockHeight;
4
5#[derive(
7 Debug,
8 Copy,
9 Clone,
10 strum_macros::EnumCount,
11 strum_macros::IntoStaticStr,
12 PartialEq,
13 Eq,
14 enum_iterator::Sequence,
15 Hash,
16)]
17pub enum DummyColumn {
18 Metadata,
19}
20
21impl StorageColumn for DummyColumn {
22 fn name(&self) -> String {
23 let str: &str = self.into();
24 str.to_string()
25 }
26
27 fn id(&self) -> u32 {
28 *self as u32
29 }
30}
31
32#[derive(Copy, Clone, Debug)]
33pub struct Relayer;
34
35impl DatabaseDescription for Relayer {
36 #[cfg(feature = "relayer")]
37 type Column = fuel_core_relayer::storage::Column;
38
39 #[cfg(not(feature = "relayer"))]
40 type Column = DummyColumn;
41
42 type Height = DaBlockHeight;
43
44 fn version() -> u32 {
45 0
46 }
47
48 fn name() -> String {
49 "relayer".to_string()
50 }
51
52 fn metadata_column() -> Self::Column {
53 Self::Column::Metadata
54 }
55
56 fn prefix(_: &Self::Column) -> Option<usize> {
57 None
58 }
59}