fuel_core/database/database_description/
off_chain.rs

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