ibc_client_cw/types/helper.rs
1use ibc_client_wasm_types::{SUBJECT_PREFIX, SUBSTITUTE_PREFIX};
2
3/// The MigrationPrefix enumerates the prefix type used during migration mode.
4///
5/// The migration mode is activated when there is an incoming
6/// [`MigrateClientStoreMsg`](crate::types::msgs::MigrateClientStoreMsg)
7/// message. It specifies the prefix key for either the
8/// subject or substitute store, or none if the migration is not active.
9#[derive(Clone, Debug)]
10pub enum MigrationPrefix {
11 Subject,
12 Substitute,
13 None,
14}
15
16impl MigrationPrefix {
17 pub fn key(&self) -> &[u8] {
18 match self {
19 Self::Subject => SUBJECT_PREFIX,
20 Self::Substitute => SUBSTITUTE_PREFIX,
21 Self::None => b"",
22 }
23 }
24}
25
26/// Travel is an enum to represent the direction of travel in the context of
27/// height.
28#[derive(Clone, Debug)]
29pub enum HeightTravel {
30 Next,
31 Prev,
32}