forked from icon-project/IBC-Integration
-
Notifications
You must be signed in to change notification settings - Fork 0
/
storage_keys.rs
65 lines (62 loc) · 2.39 KB
/
storage_keys.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
use super::*;
#[cw_serde]
/// This is defining an enumeration called `StorageKey` with 24 possible values. Each value represents a
/// key that can be used to access a specific piece of data in a storage system. The `as_str` method is
/// also defined to convert each value to its corresponding string representation. This code is likely
/// part of a larger system that uses a key-value store to persist data.
pub enum StorageKey {
ClientRegistry,
ClientTypes,
ClientImplementations,
NextSequenceSend,
NextSequenceReceive,
NextSequenceAcknowledgement,
NextClientSequence,
NextConnectionSequence,
NextChannelSequence,
Connections,
ClientConnection,
Channels,
Router,
PortToModule,
Commitments,
BlockTime,
BlockHeight,
Capabilities,
PacketReceipts,
Owner,
LastProcessedOn,
CallbackData,
SentPackets,
WriteAcks,
}
impl StorageKey {
pub fn as_str(&self) -> &'static str {
match self {
StorageKey::ClientRegistry => "client_registry",
StorageKey::ClientTypes => "client_types",
StorageKey::ClientImplementations => "client_implementations",
StorageKey::NextSequenceSend => "next_sequence_send",
StorageKey::NextSequenceReceive => "next_sequence_recv",
StorageKey::NextSequenceAcknowledgement => "next_sequence_ack",
StorageKey::NextClientSequence => "next_client_sequence",
StorageKey::NextConnectionSequence => "next_connection_sequence",
StorageKey::NextChannelSequence => "next_channel_Sequence",
StorageKey::Connections => "connections",
StorageKey::ClientConnection => "client_connections",
StorageKey::Channels => "channels",
StorageKey::Router => "router",
StorageKey::PortToModule => "port_to_module",
StorageKey::Commitments => "commitments",
StorageKey::BlockTime => "block_time",
StorageKey::BlockHeight => "block_height",
StorageKey::Capabilities => "capabilities",
StorageKey::PacketReceipts => "packet_receipts",
StorageKey::Owner => "owner",
StorageKey::LastProcessedOn => "last_processed_on",
StorageKey::CallbackData => "callback_data",
StorageKey::SentPackets => "sent_packets",
StorageKey::WriteAcks => "write_acks",
}
}
}