ibc_client_cw/types/
helper.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use ibc_client_wasm_types::{SUBJECT_PREFIX, SUBSTITUTE_PREFIX};

/// The MigrationPrefix enumerates the prefix type used during migration mode.
///
/// The migration mode is activated when there is an incoming
/// [`MigrateClientStoreMsg`](crate::types::msgs::MigrateClientStoreMsg)
/// message. It specifies the prefix key for either the
/// subject or substitute store, or none if the migration is not active.
#[derive(Clone, Debug)]
pub enum MigrationPrefix {
    Subject,
    Substitute,
    None,
}

impl MigrationPrefix {
    pub fn key(&self) -> &[u8] {
        match self {
            Self::Subject => SUBJECT_PREFIX,
            Self::Substitute => SUBSTITUTE_PREFIX,
            Self::None => b"",
        }
    }
}

/// Travel is an enum to represent the direction of travel in the context of
/// height.
#[derive(Clone, Debug)]
pub enum HeightTravel {
    Next,
    Prev,
}