juno_rust_proto/prost/ibc-go/
ibc.lightclients.solomachine.v1.rs

1/// ClientState defines a solo machine client that tracks the current consensus
2/// state and if the client is frozen.
3#[allow(clippy::derive_partial_eq_without_eq)]
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct ClientState {
6    /// latest sequence of the client state
7    #[prost(uint64, tag = "1")]
8    pub sequence: u64,
9    /// frozen sequence of the solo machine
10    #[prost(uint64, tag = "2")]
11    pub frozen_sequence: u64,
12    #[prost(message, optional, tag = "3")]
13    pub consensus_state: ::core::option::Option<ConsensusState>,
14    /// when set to true, will allow governance to update a solo machine client.
15    /// The client will be unfrozen if it is frozen.
16    #[prost(bool, tag = "4")]
17    pub allow_update_after_proposal: bool,
18}
19/// ConsensusState defines a solo machine consensus state. The sequence of a
20/// consensus state is contained in the "height" key used in storing the
21/// consensus state.
22#[allow(clippy::derive_partial_eq_without_eq)]
23#[derive(Clone, PartialEq, ::prost::Message)]
24pub struct ConsensusState {
25    /// public key of the solo machine
26    #[prost(message, optional, tag = "1")]
27    pub public_key: ::core::option::Option<::prost_types::Any>,
28    /// diversifier allows the same public key to be re-used across different solo
29    /// machine clients (potentially on different chains) without being considered
30    /// misbehaviour.
31    #[prost(string, tag = "2")]
32    pub diversifier: ::prost::alloc::string::String,
33    #[prost(uint64, tag = "3")]
34    pub timestamp: u64,
35}
36/// Header defines a solo machine consensus header
37#[allow(clippy::derive_partial_eq_without_eq)]
38#[derive(Clone, PartialEq, ::prost::Message)]
39pub struct Header {
40    /// sequence to update solo machine public key at
41    #[prost(uint64, tag = "1")]
42    pub sequence: u64,
43    #[prost(uint64, tag = "2")]
44    pub timestamp: u64,
45    #[prost(bytes = "vec", tag = "3")]
46    pub signature: ::prost::alloc::vec::Vec<u8>,
47    #[prost(message, optional, tag = "4")]
48    pub new_public_key: ::core::option::Option<::prost_types::Any>,
49    #[prost(string, tag = "5")]
50    pub new_diversifier: ::prost::alloc::string::String,
51}
52/// Misbehaviour defines misbehaviour for a solo machine which consists
53/// of a sequence and two signatures over different messages at that sequence.
54#[allow(clippy::derive_partial_eq_without_eq)]
55#[derive(Clone, PartialEq, ::prost::Message)]
56pub struct Misbehaviour {
57    #[prost(string, tag = "1")]
58    pub client_id: ::prost::alloc::string::String,
59    #[prost(uint64, tag = "2")]
60    pub sequence: u64,
61    #[prost(message, optional, tag = "3")]
62    pub signature_one: ::core::option::Option<SignatureAndData>,
63    #[prost(message, optional, tag = "4")]
64    pub signature_two: ::core::option::Option<SignatureAndData>,
65}
66/// SignatureAndData contains a signature and the data signed over to create that
67/// signature.
68#[allow(clippy::derive_partial_eq_without_eq)]
69#[derive(Clone, PartialEq, ::prost::Message)]
70pub struct SignatureAndData {
71    #[prost(bytes = "vec", tag = "1")]
72    pub signature: ::prost::alloc::vec::Vec<u8>,
73    #[prost(enumeration = "DataType", tag = "2")]
74    pub data_type: i32,
75    #[prost(bytes = "vec", tag = "3")]
76    pub data: ::prost::alloc::vec::Vec<u8>,
77    #[prost(uint64, tag = "4")]
78    pub timestamp: u64,
79}
80/// TimestampedSignatureData contains the signature data and the timestamp of the
81/// signature.
82#[allow(clippy::derive_partial_eq_without_eq)]
83#[derive(Clone, PartialEq, ::prost::Message)]
84pub struct TimestampedSignatureData {
85    #[prost(bytes = "vec", tag = "1")]
86    pub signature_data: ::prost::alloc::vec::Vec<u8>,
87    #[prost(uint64, tag = "2")]
88    pub timestamp: u64,
89}
90/// SignBytes defines the signed bytes used for signature verification.
91#[allow(clippy::derive_partial_eq_without_eq)]
92#[derive(Clone, PartialEq, ::prost::Message)]
93pub struct SignBytes {
94    #[prost(uint64, tag = "1")]
95    pub sequence: u64,
96    #[prost(uint64, tag = "2")]
97    pub timestamp: u64,
98    #[prost(string, tag = "3")]
99    pub diversifier: ::prost::alloc::string::String,
100    /// type of the data used
101    #[prost(enumeration = "DataType", tag = "4")]
102    pub data_type: i32,
103    /// marshaled data
104    #[prost(bytes = "vec", tag = "5")]
105    pub data: ::prost::alloc::vec::Vec<u8>,
106}
107/// HeaderData returns the SignBytes data for update verification.
108#[allow(clippy::derive_partial_eq_without_eq)]
109#[derive(Clone, PartialEq, ::prost::Message)]
110pub struct HeaderData {
111    /// header public key
112    #[prost(message, optional, tag = "1")]
113    pub new_pub_key: ::core::option::Option<::prost_types::Any>,
114    /// header diversifier
115    #[prost(string, tag = "2")]
116    pub new_diversifier: ::prost::alloc::string::String,
117}
118/// ClientStateData returns the SignBytes data for client state verification.
119#[allow(clippy::derive_partial_eq_without_eq)]
120#[derive(Clone, PartialEq, ::prost::Message)]
121pub struct ClientStateData {
122    #[prost(bytes = "vec", tag = "1")]
123    pub path: ::prost::alloc::vec::Vec<u8>,
124    #[prost(message, optional, tag = "2")]
125    pub client_state: ::core::option::Option<::prost_types::Any>,
126}
127/// ConsensusStateData returns the SignBytes data for consensus state
128/// verification.
129#[allow(clippy::derive_partial_eq_without_eq)]
130#[derive(Clone, PartialEq, ::prost::Message)]
131pub struct ConsensusStateData {
132    #[prost(bytes = "vec", tag = "1")]
133    pub path: ::prost::alloc::vec::Vec<u8>,
134    #[prost(message, optional, tag = "2")]
135    pub consensus_state: ::core::option::Option<::prost_types::Any>,
136}
137/// ConnectionStateData returns the SignBytes data for connection state
138/// verification.
139#[allow(clippy::derive_partial_eq_without_eq)]
140#[derive(Clone, PartialEq, ::prost::Message)]
141pub struct ConnectionStateData {
142    #[prost(bytes = "vec", tag = "1")]
143    pub path: ::prost::alloc::vec::Vec<u8>,
144    #[prost(message, optional, tag = "2")]
145    pub connection:
146        ::core::option::Option<super::super::super::core::connection::v1::ConnectionEnd>,
147}
148/// ChannelStateData returns the SignBytes data for channel state
149/// verification.
150#[allow(clippy::derive_partial_eq_without_eq)]
151#[derive(Clone, PartialEq, ::prost::Message)]
152pub struct ChannelStateData {
153    #[prost(bytes = "vec", tag = "1")]
154    pub path: ::prost::alloc::vec::Vec<u8>,
155    #[prost(message, optional, tag = "2")]
156    pub channel: ::core::option::Option<super::super::super::core::channel::v1::Channel>,
157}
158/// PacketCommitmentData returns the SignBytes data for packet commitment
159/// verification.
160#[allow(clippy::derive_partial_eq_without_eq)]
161#[derive(Clone, PartialEq, ::prost::Message)]
162pub struct PacketCommitmentData {
163    #[prost(bytes = "vec", tag = "1")]
164    pub path: ::prost::alloc::vec::Vec<u8>,
165    #[prost(bytes = "vec", tag = "2")]
166    pub commitment: ::prost::alloc::vec::Vec<u8>,
167}
168/// PacketAcknowledgementData returns the SignBytes data for acknowledgement
169/// verification.
170#[allow(clippy::derive_partial_eq_without_eq)]
171#[derive(Clone, PartialEq, ::prost::Message)]
172pub struct PacketAcknowledgementData {
173    #[prost(bytes = "vec", tag = "1")]
174    pub path: ::prost::alloc::vec::Vec<u8>,
175    #[prost(bytes = "vec", tag = "2")]
176    pub acknowledgement: ::prost::alloc::vec::Vec<u8>,
177}
178/// PacketReceiptAbsenceData returns the SignBytes data for
179/// packet receipt absence verification.
180#[allow(clippy::derive_partial_eq_without_eq)]
181#[derive(Clone, PartialEq, ::prost::Message)]
182pub struct PacketReceiptAbsenceData {
183    #[prost(bytes = "vec", tag = "1")]
184    pub path: ::prost::alloc::vec::Vec<u8>,
185}
186/// NextSequenceRecvData returns the SignBytes data for verification of the next
187/// sequence to be received.
188#[allow(clippy::derive_partial_eq_without_eq)]
189#[derive(Clone, PartialEq, ::prost::Message)]
190pub struct NextSequenceRecvData {
191    #[prost(bytes = "vec", tag = "1")]
192    pub path: ::prost::alloc::vec::Vec<u8>,
193    #[prost(uint64, tag = "2")]
194    pub next_seq_recv: u64,
195}
196/// DataType defines the type of solo machine proof being created. This is done
197/// to preserve uniqueness of different data sign byte encodings.
198#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
199#[repr(i32)]
200pub enum DataType {
201    /// Default State
202    UninitializedUnspecified = 0,
203    /// Data type for client state verification
204    ClientState = 1,
205    /// Data type for consensus state verification
206    ConsensusState = 2,
207    /// Data type for connection state verification
208    ConnectionState = 3,
209    /// Data type for channel state verification
210    ChannelState = 4,
211    /// Data type for packet commitment verification
212    PacketCommitment = 5,
213    /// Data type for packet acknowledgement verification
214    PacketAcknowledgement = 6,
215    /// Data type for packet receipt absence verification
216    PacketReceiptAbsence = 7,
217    /// Data type for next sequence recv verification
218    NextSequenceRecv = 8,
219    /// Data type for header verification
220    Header = 9,
221}
222impl DataType {
223    /// String value of the enum field names used in the ProtoBuf definition.
224    ///
225    /// The values are not transformed in any way and thus are considered stable
226    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
227    pub fn as_str_name(&self) -> &'static str {
228        match self {
229            DataType::UninitializedUnspecified => "DATA_TYPE_UNINITIALIZED_UNSPECIFIED",
230            DataType::ClientState => "DATA_TYPE_CLIENT_STATE",
231            DataType::ConsensusState => "DATA_TYPE_CONSENSUS_STATE",
232            DataType::ConnectionState => "DATA_TYPE_CONNECTION_STATE",
233            DataType::ChannelState => "DATA_TYPE_CHANNEL_STATE",
234            DataType::PacketCommitment => "DATA_TYPE_PACKET_COMMITMENT",
235            DataType::PacketAcknowledgement => "DATA_TYPE_PACKET_ACKNOWLEDGEMENT",
236            DataType::PacketReceiptAbsence => "DATA_TYPE_PACKET_RECEIPT_ABSENCE",
237            DataType::NextSequenceRecv => "DATA_TYPE_NEXT_SEQUENCE_RECV",
238            DataType::Header => "DATA_TYPE_HEADER",
239        }
240    }
241    /// Creates an enum from field names used in the ProtoBuf definition.
242    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
243        match value {
244            "DATA_TYPE_UNINITIALIZED_UNSPECIFIED" => Some(Self::UninitializedUnspecified),
245            "DATA_TYPE_CLIENT_STATE" => Some(Self::ClientState),
246            "DATA_TYPE_CONSENSUS_STATE" => Some(Self::ConsensusState),
247            "DATA_TYPE_CONNECTION_STATE" => Some(Self::ConnectionState),
248            "DATA_TYPE_CHANNEL_STATE" => Some(Self::ChannelState),
249            "DATA_TYPE_PACKET_COMMITMENT" => Some(Self::PacketCommitment),
250            "DATA_TYPE_PACKET_ACKNOWLEDGEMENT" => Some(Self::PacketAcknowledgement),
251            "DATA_TYPE_PACKET_RECEIPT_ABSENCE" => Some(Self::PacketReceiptAbsence),
252            "DATA_TYPE_NEXT_SEQUENCE_RECV" => Some(Self::NextSequenceRecv),
253            "DATA_TYPE_HEADER" => Some(Self::Header),
254            _ => None,
255        }
256    }
257}