1#[derive(::derive_builder::Builder)]
3#[allow(clippy::derive_partial_eq_without_eq)]
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct ValidatorSet {
6 #[prost(message, repeated, tag="1")]
7 pub validators: ::prost::alloc::vec::Vec<Validator>,
8 #[prost(message, optional, tag="2")]
9 pub proposer: ::core::option::Option<Validator>,
10 #[prost(int64, tag="3")]
11 pub total_voting_power: i64,
12}
13#[derive(::derive_builder::Builder)]
14#[allow(clippy::derive_partial_eq_without_eq)]
15#[derive(Clone, PartialEq, ::prost::Message)]
16pub struct Validator {
17 #[prost(bytes="bytes", tag="1")]
18 pub address: ::prost::bytes::Bytes,
19 #[prost(message, optional, tag="2")]
20 pub pub_key: ::core::option::Option<super::crypto::PublicKey>,
21 #[prost(int64, tag="3")]
22 pub voting_power: i64,
23 #[prost(int64, tag="4")]
24 pub proposer_priority: i64,
25}
26#[derive(::derive_builder::Builder)]
27#[allow(clippy::derive_partial_eq_without_eq)]
28#[derive(Clone, PartialEq, ::prost::Message)]
29pub struct SimpleValidator {
30 #[prost(message, optional, tag="1")]
31 pub pub_key: ::core::option::Option<super::crypto::PublicKey>,
32 #[prost(int64, tag="2")]
33 pub voting_power: i64,
34}
35#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
37#[repr(i32)]
38pub enum BlockIdFlag {
39 Unknown = 0,
41 Absent = 1,
43 Commit = 2,
45 Nil = 3,
47}
48impl BlockIdFlag {
49 pub fn as_str_name(&self) -> &'static str {
54 match self {
55 BlockIdFlag::Unknown => "BLOCK_ID_FLAG_UNKNOWN",
56 BlockIdFlag::Absent => "BLOCK_ID_FLAG_ABSENT",
57 BlockIdFlag::Commit => "BLOCK_ID_FLAG_COMMIT",
58 BlockIdFlag::Nil => "BLOCK_ID_FLAG_NIL",
59 }
60 }
61 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
63 match value {
64 "BLOCK_ID_FLAG_UNKNOWN" => Some(Self::Unknown),
65 "BLOCK_ID_FLAG_ABSENT" => Some(Self::Absent),
66 "BLOCK_ID_FLAG_COMMIT" => Some(Self::Commit),
67 "BLOCK_ID_FLAG_NIL" => Some(Self::Nil),
68 _ => None,
69 }
70 }
71}
72#[derive(::derive_builder::Builder)]
74#[allow(clippy::derive_partial_eq_without_eq)]
75#[derive(Clone, PartialEq, ::prost::Message)]
76pub struct PartSetHeader {
77 #[prost(uint32, tag="1")]
78 pub total: u32,
79 #[prost(bytes="bytes", tag="2")]
80 pub hash: ::prost::bytes::Bytes,
81}
82#[derive(::derive_builder::Builder)]
83#[allow(clippy::derive_partial_eq_without_eq)]
84#[derive(Clone, PartialEq, ::prost::Message)]
85pub struct Part {
86 #[prost(uint32, tag="1")]
87 pub index: u32,
88 #[prost(bytes="bytes", tag="2")]
89 pub bytes: ::prost::bytes::Bytes,
90 #[prost(message, optional, tag="3")]
91 pub proof: ::core::option::Option<super::crypto::Proof>,
92}
93#[derive(::derive_builder::Builder)]
95#[allow(clippy::derive_partial_eq_without_eq)]
96#[derive(Clone, PartialEq, ::prost::Message)]
97pub struct BlockId {
98 #[prost(bytes="bytes", tag="1")]
99 pub hash: ::prost::bytes::Bytes,
100 #[prost(message, optional, tag="2")]
101 pub part_set_header: ::core::option::Option<PartSetHeader>,
102}
103#[derive(::derive_builder::Builder)]
107#[allow(clippy::derive_partial_eq_without_eq)]
108#[derive(Clone, PartialEq, ::prost::Message)]
109pub struct Header {
110 #[prost(message, optional, tag="1")]
112 pub version: ::core::option::Option<super::version::Consensus>,
113 #[prost(string, tag="2")]
114 pub chain_id: ::prost::alloc::string::String,
115 #[prost(int64, tag="3")]
116 pub height: i64,
117 #[prost(message, optional, tag="4")]
118 pub time: ::core::option::Option<::pbjson_types::Timestamp>,
119 #[prost(message, optional, tag="5")]
121 pub last_block_id: ::core::option::Option<BlockId>,
122 #[prost(bytes="bytes", tag="6")]
126 pub last_commit_hash: ::prost::bytes::Bytes,
127 #[prost(bytes="bytes", tag="7")]
129 pub data_hash: ::prost::bytes::Bytes,
130 #[prost(bytes="bytes", tag="8")]
134 pub validators_hash: ::prost::bytes::Bytes,
135 #[prost(bytes="bytes", tag="9")]
137 pub next_validators_hash: ::prost::bytes::Bytes,
138 #[prost(bytes="bytes", tag="10")]
140 pub consensus_hash: ::prost::bytes::Bytes,
141 #[prost(bytes="bytes", tag="11")]
143 pub app_hash: ::prost::bytes::Bytes,
144 #[prost(bytes="bytes", tag="12")]
146 pub last_results_hash: ::prost::bytes::Bytes,
147 #[prost(bytes="bytes", tag="13")]
151 pub evidence_hash: ::prost::bytes::Bytes,
152 #[prost(bytes="bytes", tag="14")]
154 pub proposer_address: ::prost::bytes::Bytes,
155}
156#[derive(::derive_builder::Builder)]
158#[allow(clippy::derive_partial_eq_without_eq)]
159#[derive(Clone, PartialEq, ::prost::Message)]
160pub struct Data {
161 #[prost(bytes="bytes", repeated, tag="1")]
165 pub txs: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
166}
167#[derive(::derive_builder::Builder)]
170#[allow(clippy::derive_partial_eq_without_eq)]
171#[derive(Clone, PartialEq, ::prost::Message)]
172pub struct Vote {
173 #[prost(enumeration="SignedMsgType", tag="1")]
174 pub r#type: i32,
175 #[prost(int64, tag="2")]
176 pub height: i64,
177 #[prost(int32, tag="3")]
178 pub round: i32,
179 #[prost(message, optional, tag="4")]
181 pub block_id: ::core::option::Option<BlockId>,
182 #[prost(message, optional, tag="5")]
183 pub timestamp: ::core::option::Option<::pbjson_types::Timestamp>,
184 #[prost(bytes="bytes", tag="6")]
185 pub validator_address: ::prost::bytes::Bytes,
186 #[prost(int32, tag="7")]
187 pub validator_index: i32,
188 #[prost(bytes="bytes", tag="8")]
191 pub signature: ::prost::bytes::Bytes,
192 #[prost(bytes="bytes", tag="9")]
195 pub extension: ::prost::bytes::Bytes,
196 #[prost(bytes="bytes", tag="10")]
200 pub extension_signature: ::prost::bytes::Bytes,
201}
202#[derive(::derive_builder::Builder)]
204#[allow(clippy::derive_partial_eq_without_eq)]
205#[derive(Clone, PartialEq, ::prost::Message)]
206pub struct Commit {
207 #[prost(int64, tag="1")]
208 pub height: i64,
209 #[prost(int32, tag="2")]
210 pub round: i32,
211 #[prost(message, optional, tag="3")]
212 pub block_id: ::core::option::Option<BlockId>,
213 #[prost(message, repeated, tag="4")]
214 pub signatures: ::prost::alloc::vec::Vec<CommitSig>,
215}
216#[derive(::derive_builder::Builder)]
218#[allow(clippy::derive_partial_eq_without_eq)]
219#[derive(Clone, PartialEq, ::prost::Message)]
220pub struct CommitSig {
221 #[prost(enumeration="BlockIdFlag", tag="1")]
222 pub block_id_flag: i32,
223 #[prost(bytes="bytes", tag="2")]
224 pub validator_address: ::prost::bytes::Bytes,
225 #[prost(message, optional, tag="3")]
226 pub timestamp: ::core::option::Option<::pbjson_types::Timestamp>,
227 #[prost(bytes="bytes", tag="4")]
228 pub signature: ::prost::bytes::Bytes,
229}
230#[derive(::derive_builder::Builder)]
231#[allow(clippy::derive_partial_eq_without_eq)]
232#[derive(Clone, PartialEq, ::prost::Message)]
233pub struct ExtendedCommit {
234 #[prost(int64, tag="1")]
235 pub height: i64,
236 #[prost(int32, tag="2")]
237 pub round: i32,
238 #[prost(message, optional, tag="3")]
239 pub block_id: ::core::option::Option<BlockId>,
240 #[prost(message, repeated, tag="4")]
241 pub extended_signatures: ::prost::alloc::vec::Vec<ExtendedCommitSig>,
242}
243#[derive(::derive_builder::Builder)]
247#[allow(clippy::derive_partial_eq_without_eq)]
248#[derive(Clone, PartialEq, ::prost::Message)]
249pub struct ExtendedCommitSig {
250 #[prost(enumeration="BlockIdFlag", tag="1")]
251 pub block_id_flag: i32,
252 #[prost(bytes="bytes", tag="2")]
253 pub validator_address: ::prost::bytes::Bytes,
254 #[prost(message, optional, tag="3")]
255 pub timestamp: ::core::option::Option<::pbjson_types::Timestamp>,
256 #[prost(bytes="bytes", tag="4")]
257 pub signature: ::prost::bytes::Bytes,
258 #[prost(bytes="bytes", tag="5")]
260 pub extension: ::prost::bytes::Bytes,
261 #[prost(bytes="bytes", tag="6")]
263 pub extension_signature: ::prost::bytes::Bytes,
264}
265#[derive(::derive_builder::Builder)]
266#[allow(clippy::derive_partial_eq_without_eq)]
267#[derive(Clone, PartialEq, ::prost::Message)]
268pub struct Proposal {
269 #[prost(enumeration="SignedMsgType", tag="1")]
270 pub r#type: i32,
271 #[prost(int64, tag="2")]
272 pub height: i64,
273 #[prost(int32, tag="3")]
274 pub round: i32,
275 #[prost(int32, tag="4")]
276 pub pol_round: i32,
277 #[prost(message, optional, tag="5")]
278 pub block_id: ::core::option::Option<BlockId>,
279 #[prost(message, optional, tag="6")]
280 pub timestamp: ::core::option::Option<::pbjson_types::Timestamp>,
281 #[prost(bytes="bytes", tag="7")]
282 pub signature: ::prost::bytes::Bytes,
283}
284#[derive(::derive_builder::Builder)]
285#[allow(clippy::derive_partial_eq_without_eq)]
286#[derive(Clone, PartialEq, ::prost::Message)]
287pub struct SignedHeader {
288 #[prost(message, optional, tag="1")]
289 pub header: ::core::option::Option<Header>,
290 #[prost(message, optional, tag="2")]
291 pub commit: ::core::option::Option<Commit>,
292}
293#[derive(::derive_builder::Builder)]
294#[allow(clippy::derive_partial_eq_without_eq)]
295#[derive(Clone, PartialEq, ::prost::Message)]
296pub struct LightBlock {
297 #[prost(message, optional, tag="1")]
298 pub signed_header: ::core::option::Option<SignedHeader>,
299 #[prost(message, optional, tag="2")]
300 pub validator_set: ::core::option::Option<ValidatorSet>,
301}
302#[derive(::derive_builder::Builder)]
303#[allow(clippy::derive_partial_eq_without_eq)]
304#[derive(Clone, PartialEq, ::prost::Message)]
305pub struct BlockMeta {
306 #[prost(message, optional, tag="1")]
307 pub block_id: ::core::option::Option<BlockId>,
308 #[prost(int64, tag="2")]
309 pub block_size: i64,
310 #[prost(message, optional, tag="3")]
311 pub header: ::core::option::Option<Header>,
312 #[prost(int64, tag="4")]
313 pub num_txs: i64,
314}
315#[derive(::derive_builder::Builder)]
317#[allow(clippy::derive_partial_eq_without_eq)]
318#[derive(Clone, PartialEq, ::prost::Message)]
319pub struct TxProof {
320 #[prost(bytes="bytes", tag="1")]
321 pub root_hash: ::prost::bytes::Bytes,
322 #[prost(bytes="bytes", tag="2")]
323 pub data: ::prost::bytes::Bytes,
324 #[prost(message, optional, tag="3")]
325 pub proof: ::core::option::Option<super::crypto::Proof>,
326}
327#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
329#[repr(i32)]
330pub enum SignedMsgType {
331 Unknown = 0,
332 Prevote = 1,
334 Precommit = 2,
335 Proposal = 32,
337}
338impl SignedMsgType {
339 pub fn as_str_name(&self) -> &'static str {
344 match self {
345 SignedMsgType::Unknown => "SIGNED_MSG_TYPE_UNKNOWN",
346 SignedMsgType::Prevote => "SIGNED_MSG_TYPE_PREVOTE",
347 SignedMsgType::Precommit => "SIGNED_MSG_TYPE_PRECOMMIT",
348 SignedMsgType::Proposal => "SIGNED_MSG_TYPE_PROPOSAL",
349 }
350 }
351 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
353 match value {
354 "SIGNED_MSG_TYPE_UNKNOWN" => Some(Self::Unknown),
355 "SIGNED_MSG_TYPE_PREVOTE" => Some(Self::Prevote),
356 "SIGNED_MSG_TYPE_PRECOMMIT" => Some(Self::Precommit),
357 "SIGNED_MSG_TYPE_PROPOSAL" => Some(Self::Proposal),
358 _ => None,
359 }
360 }
361}
362#[derive(::derive_builder::Builder)]
365#[allow(clippy::derive_partial_eq_without_eq)]
366#[derive(Clone, PartialEq, ::prost::Message)]
367pub struct ConsensusParams {
368 #[prost(message, optional, tag="1")]
369 pub block: ::core::option::Option<BlockParams>,
370 #[prost(message, optional, tag="2")]
371 pub evidence: ::core::option::Option<EvidenceParams>,
372 #[prost(message, optional, tag="3")]
373 pub validator: ::core::option::Option<ValidatorParams>,
374 #[prost(message, optional, tag="4")]
375 pub version: ::core::option::Option<VersionParams>,
376}
377#[derive(::derive_builder::Builder)]
379#[allow(clippy::derive_partial_eq_without_eq)]
380#[derive(Clone, PartialEq, ::prost::Message)]
381pub struct BlockParams {
382 #[prost(int64, tag="1")]
385 pub max_bytes: i64,
386 #[prost(int64, tag="2")]
389 pub max_gas: i64,
390}
391#[derive(::derive_builder::Builder)]
393#[allow(clippy::derive_partial_eq_without_eq)]
394#[derive(Clone, PartialEq, ::prost::Message)]
395pub struct EvidenceParams {
396 #[prost(int64, tag="1")]
401 pub max_age_num_blocks: i64,
402 #[prost(message, optional, tag="2")]
408 pub max_age_duration: ::core::option::Option<::pbjson_types::Duration>,
409 #[prost(int64, tag="3")]
413 pub max_bytes: i64,
414}
415#[derive(::derive_builder::Builder)]
418#[allow(clippy::derive_partial_eq_without_eq)]
419#[derive(Clone, PartialEq, ::prost::Message)]
420pub struct ValidatorParams {
421 #[prost(string, repeated, tag="1")]
422 pub pub_key_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
423}
424#[derive(::derive_builder::Builder)]
426#[allow(clippy::derive_partial_eq_without_eq)]
427#[derive(Clone, PartialEq, ::prost::Message)]
428pub struct VersionParams {
429 #[prost(uint64, tag="1")]
430 pub app: u64,
431}
432#[derive(::derive_builder::Builder)]
436#[allow(clippy::derive_partial_eq_without_eq)]
437#[derive(Clone, PartialEq, ::prost::Message)]
438pub struct HashedParams {
439 #[prost(int64, tag="1")]
440 pub block_max_bytes: i64,
441 #[prost(int64, tag="2")]
442 pub block_max_gas: i64,
443}
444#[derive(::derive_builder::Builder)]
445#[allow(clippy::derive_partial_eq_without_eq)]
446#[derive(Clone, PartialEq, ::prost::Message)]
447pub struct Evidence {
448 #[prost(oneof="evidence::Sum", tags="1, 2")]
449 pub sum: ::core::option::Option<evidence::Sum>,
450}
451pub mod evidence {
453 #[allow(clippy::derive_partial_eq_without_eq)]
454#[derive(Clone, PartialEq, ::prost::Oneof)]
455 pub enum Sum {
456 #[prost(message, tag="1")]
457 DuplicateVoteEvidence(super::DuplicateVoteEvidence),
458 #[prost(message, tag="2")]
459 LightClientAttackEvidence(super::LightClientAttackEvidence),
460 }
461}
462#[derive(::derive_builder::Builder)]
464#[allow(clippy::derive_partial_eq_without_eq)]
465#[derive(Clone, PartialEq, ::prost::Message)]
466pub struct DuplicateVoteEvidence {
467 #[prost(message, optional, tag="1")]
468 pub vote_a: ::core::option::Option<Vote>,
469 #[prost(message, optional, tag="2")]
470 pub vote_b: ::core::option::Option<Vote>,
471 #[prost(int64, tag="3")]
472 pub total_voting_power: i64,
473 #[prost(int64, tag="4")]
474 pub validator_power: i64,
475 #[prost(message, optional, tag="5")]
476 pub timestamp: ::core::option::Option<::pbjson_types::Timestamp>,
477}
478#[derive(::derive_builder::Builder)]
480#[allow(clippy::derive_partial_eq_without_eq)]
481#[derive(Clone, PartialEq, ::prost::Message)]
482pub struct LightClientAttackEvidence {
483 #[prost(message, optional, tag="1")]
484 pub conflicting_block: ::core::option::Option<LightBlock>,
485 #[prost(int64, tag="2")]
486 pub common_height: i64,
487 #[prost(message, repeated, tag="3")]
488 pub byzantine_validators: ::prost::alloc::vec::Vec<Validator>,
489 #[prost(int64, tag="4")]
490 pub total_voting_power: i64,
491 #[prost(message, optional, tag="5")]
492 pub timestamp: ::core::option::Option<::pbjson_types::Timestamp>,
493}
494#[derive(::derive_builder::Builder)]
495#[allow(clippy::derive_partial_eq_without_eq)]
496#[derive(Clone, PartialEq, ::prost::Message)]
497pub struct EvidenceList {
498 #[prost(message, repeated, tag="1")]
499 pub evidence: ::prost::alloc::vec::Vec<Evidence>,
500}
501#[derive(::derive_builder::Builder)]
502#[allow(clippy::derive_partial_eq_without_eq)]
503#[derive(Clone, PartialEq, ::prost::Message)]
504pub struct Block {
505 #[prost(message, optional, tag="1")]
506 pub header: ::core::option::Option<Header>,
507 #[prost(message, optional, tag="2")]
508 pub data: ::core::option::Option<Data>,
509 #[prost(message, optional, tag="3")]
510 pub evidence: ::core::option::Option<EvidenceList>,
511 #[prost(message, optional, tag="4")]
512 pub last_commit: ::core::option::Option<Commit>,
513}
514include!("tendermint.types.serde.rs");
515