fuel_core/database/database_description/
on_chain.rs

1use crate::database::database_description::DatabaseDescription;
2use fuel_core_types::fuel_types::BlockHeight;
3
4#[derive(Copy, Clone, Debug)]
5pub struct OnChain;
6
7impl DatabaseDescription for OnChain {
8    type Column = fuel_core_storage::column::Column;
9    type Height = BlockHeight;
10
11    fn version() -> u32 {
12        0
13    }
14
15    fn name() -> String {
16        "on_chain".to_string()
17    }
18
19    fn metadata_column() -> Self::Column {
20        Self::Column::Metadata
21    }
22
23    fn prefix(column: &Self::Column) -> Option<usize> {
24        match column {
25            Self::Column::ContractsAssets | Self::Column::ContractsState => {
26                // prefix is address length
27                Some(32)
28            }
29            _ => None,
30        }
31    }
32}