elys_std/types/tendermint/
types.rs

1use elys_std_deriv::CosmwasmExt;
2/// ConsensusParams contains consensus critical parameters that determine the
3/// validity of blocks.
4#[allow(clippy::derive_partial_eq_without_eq)]
5#[derive(
6    Clone,
7    PartialEq,
8    Eq,
9    ::prost::Message,
10    ::serde::Serialize,
11    ::serde::Deserialize,
12    ::schemars::JsonSchema,
13    CosmwasmExt,
14)]
15#[proto_message(type_url = "/tendermint.types.ConsensusParams")]
16pub struct ConsensusParams {
17    #[prost(message, optional, tag = "1")]
18    pub block: ::core::option::Option<BlockParams>,
19    #[prost(message, optional, tag = "2")]
20    pub evidence: ::core::option::Option<EvidenceParams>,
21    #[prost(message, optional, tag = "3")]
22    pub validator: ::core::option::Option<ValidatorParams>,
23    #[prost(message, optional, tag = "4")]
24    pub version: ::core::option::Option<VersionParams>,
25    #[prost(message, optional, tag = "5")]
26    pub abci: ::core::option::Option<AbciParams>,
27}
28/// BlockParams contains limits on the block size.
29#[allow(clippy::derive_partial_eq_without_eq)]
30#[derive(
31    Clone,
32    PartialEq,
33    Eq,
34    ::prost::Message,
35    ::serde::Serialize,
36    ::serde::Deserialize,
37    ::schemars::JsonSchema,
38    CosmwasmExt,
39)]
40#[proto_message(type_url = "/tendermint.types.BlockParams")]
41pub struct BlockParams {
42    /// Max block size, in bytes.
43    /// Note: must be greater than 0
44    #[prost(int64, tag = "1")]
45    #[serde(
46        serialize_with = "crate::serde::as_str::serialize",
47        deserialize_with = "crate::serde::as_str::deserialize"
48    )]
49    pub max_bytes: i64,
50    /// Max gas per block.
51    /// Note: must be greater or equal to -1
52    #[prost(int64, tag = "2")]
53    #[serde(
54        serialize_with = "crate::serde::as_str::serialize",
55        deserialize_with = "crate::serde::as_str::deserialize"
56    )]
57    pub max_gas: i64,
58}
59/// EvidenceParams determine how we handle evidence of malfeasance.
60#[allow(clippy::derive_partial_eq_without_eq)]
61#[derive(
62    Clone,
63    PartialEq,
64    Eq,
65    ::prost::Message,
66    ::serde::Serialize,
67    ::serde::Deserialize,
68    ::schemars::JsonSchema,
69    CosmwasmExt,
70)]
71#[proto_message(type_url = "/tendermint.types.EvidenceParams")]
72pub struct EvidenceParams {
73    /// Max age of evidence, in blocks.
74    ///
75    /// The basic formula for calculating this is: MaxAgeDuration / {average block
76    /// time}.
77    #[prost(int64, tag = "1")]
78    #[serde(
79        serialize_with = "crate::serde::as_str::serialize",
80        deserialize_with = "crate::serde::as_str::deserialize"
81    )]
82    pub max_age_num_blocks: i64,
83    /// Max age of evidence, in time.
84    ///
85    /// It should correspond with an app's "unbonding period" or other similar
86    /// mechanism for handling [Nothing-At-Stake
87    /// attacks](<https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed>).
88    #[prost(message, optional, tag = "2")]
89    pub max_age_duration: ::core::option::Option<crate::shim::Duration>,
90    /// This sets the maximum size of total evidence in bytes that can be committed in a single block.
91    /// and should fall comfortably under the max block bytes.
92    /// Default is 1048576 or 1MB
93    #[prost(int64, tag = "3")]
94    #[serde(
95        serialize_with = "crate::serde::as_str::serialize",
96        deserialize_with = "crate::serde::as_str::deserialize"
97    )]
98    pub max_bytes: i64,
99}
100/// ValidatorParams restrict the public key types validators can use.
101/// NOTE: uses ABCI pubkey naming, not Amino names.
102#[allow(clippy::derive_partial_eq_without_eq)]
103#[derive(
104    Clone,
105    PartialEq,
106    Eq,
107    ::prost::Message,
108    ::serde::Serialize,
109    ::serde::Deserialize,
110    ::schemars::JsonSchema,
111    CosmwasmExt,
112)]
113#[proto_message(type_url = "/tendermint.types.ValidatorParams")]
114pub struct ValidatorParams {
115    #[prost(string, repeated, tag = "1")]
116    pub pub_key_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
117}
118/// VersionParams contains the ABCI application version.
119#[allow(clippy::derive_partial_eq_without_eq)]
120#[derive(
121    Clone,
122    PartialEq,
123    Eq,
124    ::prost::Message,
125    ::serde::Serialize,
126    ::serde::Deserialize,
127    ::schemars::JsonSchema,
128    CosmwasmExt,
129)]
130#[proto_message(type_url = "/tendermint.types.VersionParams")]
131pub struct VersionParams {
132    #[prost(uint64, tag = "1")]
133    #[serde(
134        serialize_with = "crate::serde::as_str::serialize",
135        deserialize_with = "crate::serde::as_str::deserialize"
136    )]
137    pub app: u64,
138}
139/// HashedParams is a subset of ConsensusParams.
140///
141/// It is hashed into the Header.ConsensusHash.
142#[allow(clippy::derive_partial_eq_without_eq)]
143#[derive(
144    Clone,
145    PartialEq,
146    Eq,
147    ::prost::Message,
148    ::serde::Serialize,
149    ::serde::Deserialize,
150    ::schemars::JsonSchema,
151    CosmwasmExt,
152)]
153#[proto_message(type_url = "/tendermint.types.HashedParams")]
154pub struct HashedParams {
155    #[prost(int64, tag = "1")]
156    #[serde(
157        serialize_with = "crate::serde::as_str::serialize",
158        deserialize_with = "crate::serde::as_str::deserialize"
159    )]
160    pub block_max_bytes: i64,
161    #[prost(int64, tag = "2")]
162    #[serde(
163        serialize_with = "crate::serde::as_str::serialize",
164        deserialize_with = "crate::serde::as_str::deserialize"
165    )]
166    pub block_max_gas: i64,
167}
168/// ABCIParams configure functionality specific to the Application Blockchain Interface.
169#[allow(clippy::derive_partial_eq_without_eq)]
170#[derive(
171    Clone,
172    PartialEq,
173    Eq,
174    ::prost::Message,
175    ::serde::Serialize,
176    ::serde::Deserialize,
177    ::schemars::JsonSchema,
178    CosmwasmExt,
179)]
180#[proto_message(type_url = "/tendermint.types.ABCIParams")]
181pub struct AbciParams {
182    /// vote_extensions_enable_height configures the first height during which
183    /// vote extensions will be enabled. During this specified height, and for all
184    /// subsequent heights, precommit messages that do not contain valid extension data
185    /// will be considered invalid. Prior to this height, vote extensions will not
186    /// be used or accepted by validators on the network.
187    ///
188    /// Once enabled, vote extensions will be created by the application in ExtendVote,
189    /// passed to the application for validation in VerifyVoteExtension and given
190    /// to the application to use when proposing a block during PrepareProposal.
191    #[prost(int64, tag = "1")]
192    #[serde(
193        serialize_with = "crate::serde::as_str::serialize",
194        deserialize_with = "crate::serde::as_str::deserialize"
195    )]
196    pub vote_extensions_enable_height: i64,
197}
198#[allow(clippy::derive_partial_eq_without_eq)]
199#[derive(
200    Clone,
201    PartialEq,
202    Eq,
203    ::prost::Message,
204    ::serde::Serialize,
205    ::serde::Deserialize,
206    ::schemars::JsonSchema,
207    CosmwasmExt,
208)]
209#[proto_message(type_url = "/tendermint.types.ValidatorSet")]
210pub struct ValidatorSet {
211    #[prost(message, repeated, tag = "1")]
212    pub validators: ::prost::alloc::vec::Vec<Validator>,
213    #[prost(message, optional, tag = "2")]
214    pub proposer: ::core::option::Option<Validator>,
215    #[prost(int64, tag = "3")]
216    #[serde(
217        serialize_with = "crate::serde::as_str::serialize",
218        deserialize_with = "crate::serde::as_str::deserialize"
219    )]
220    pub total_voting_power: i64,
221}
222#[allow(clippy::derive_partial_eq_without_eq)]
223#[derive(
224    Clone,
225    PartialEq,
226    Eq,
227    ::prost::Message,
228    ::serde::Serialize,
229    ::serde::Deserialize,
230    ::schemars::JsonSchema,
231    CosmwasmExt,
232)]
233#[proto_message(type_url = "/tendermint.types.Validator")]
234pub struct Validator {
235    #[prost(bytes = "vec", tag = "1")]
236    #[serde(
237        serialize_with = "crate::serde::as_base64_encoded_string::serialize",
238        deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
239    )]
240    pub address: ::prost::alloc::vec::Vec<u8>,
241    #[prost(message, optional, tag = "2")]
242    pub pub_key: ::core::option::Option<super::crypto::PublicKey>,
243    #[prost(int64, tag = "3")]
244    #[serde(
245        serialize_with = "crate::serde::as_str::serialize",
246        deserialize_with = "crate::serde::as_str::deserialize"
247    )]
248    pub voting_power: i64,
249    #[prost(int64, tag = "4")]
250    #[serde(
251        serialize_with = "crate::serde::as_str::serialize",
252        deserialize_with = "crate::serde::as_str::deserialize"
253    )]
254    pub proposer_priority: i64,
255}
256#[allow(clippy::derive_partial_eq_without_eq)]
257#[derive(
258    Clone,
259    PartialEq,
260    Eq,
261    ::prost::Message,
262    ::serde::Serialize,
263    ::serde::Deserialize,
264    ::schemars::JsonSchema,
265    CosmwasmExt,
266)]
267#[proto_message(type_url = "/tendermint.types.SimpleValidator")]
268pub struct SimpleValidator {
269    #[prost(message, optional, tag = "1")]
270    pub pub_key: ::core::option::Option<super::crypto::PublicKey>,
271    #[prost(int64, tag = "2")]
272    #[serde(
273        serialize_with = "crate::serde::as_str::serialize",
274        deserialize_with = "crate::serde::as_str::deserialize"
275    )]
276    pub voting_power: i64,
277}
278/// BlockIdFlag indicates which BlockID the signature is for
279#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
280#[repr(i32)]
281#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)]
282pub enum BlockIdFlag {
283    /// indicates an error condition
284    Unknown = 0,
285    /// the vote was not received
286    Absent = 1,
287    /// voted for the block that received the majority
288    Commit = 2,
289    /// voted for nil
290    Nil = 3,
291}
292impl BlockIdFlag {
293    /// String value of the enum field names used in the ProtoBuf definition.
294    ///
295    /// The values are not transformed in any way and thus are considered stable
296    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
297    pub fn as_str_name(&self) -> &'static str {
298        match self {
299            BlockIdFlag::Unknown => "BLOCK_ID_FLAG_UNKNOWN",
300            BlockIdFlag::Absent => "BLOCK_ID_FLAG_ABSENT",
301            BlockIdFlag::Commit => "BLOCK_ID_FLAG_COMMIT",
302            BlockIdFlag::Nil => "BLOCK_ID_FLAG_NIL",
303        }
304    }
305    /// Creates an enum from field names used in the ProtoBuf definition.
306    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
307        match value {
308            "BLOCK_ID_FLAG_UNKNOWN" => Some(Self::Unknown),
309            "BLOCK_ID_FLAG_ABSENT" => Some(Self::Absent),
310            "BLOCK_ID_FLAG_COMMIT" => Some(Self::Commit),
311            "BLOCK_ID_FLAG_NIL" => Some(Self::Nil),
312            _ => None,
313        }
314    }
315}
316/// PartsetHeader
317#[allow(clippy::derive_partial_eq_without_eq)]
318#[derive(
319    Clone,
320    PartialEq,
321    Eq,
322    ::prost::Message,
323    ::serde::Serialize,
324    ::serde::Deserialize,
325    ::schemars::JsonSchema,
326    CosmwasmExt,
327)]
328#[proto_message(type_url = "/tendermint.types.PartSetHeader")]
329pub struct PartSetHeader {
330    #[prost(uint32, tag = "1")]
331    #[serde(
332        serialize_with = "crate::serde::as_str::serialize",
333        deserialize_with = "crate::serde::as_str::deserialize"
334    )]
335    pub total: u32,
336    #[prost(bytes = "vec", tag = "2")]
337    #[serde(
338        serialize_with = "crate::serde::as_base64_encoded_string::serialize",
339        deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
340    )]
341    pub hash: ::prost::alloc::vec::Vec<u8>,
342}
343#[allow(clippy::derive_partial_eq_without_eq)]
344#[derive(
345    Clone,
346    PartialEq,
347    Eq,
348    ::prost::Message,
349    ::serde::Serialize,
350    ::serde::Deserialize,
351    ::schemars::JsonSchema,
352    CosmwasmExt,
353)]
354#[proto_message(type_url = "/tendermint.types.Part")]
355pub struct Part {
356    #[prost(uint32, tag = "1")]
357    #[serde(
358        serialize_with = "crate::serde::as_str::serialize",
359        deserialize_with = "crate::serde::as_str::deserialize"
360    )]
361    pub index: u32,
362    #[prost(bytes = "vec", tag = "2")]
363    #[serde(
364        serialize_with = "crate::serde::as_base64_encoded_string::serialize",
365        deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
366    )]
367    pub bytes: ::prost::alloc::vec::Vec<u8>,
368    #[prost(message, optional, tag = "3")]
369    pub proof: ::core::option::Option<super::crypto::Proof>,
370}
371/// BlockID
372#[allow(clippy::derive_partial_eq_without_eq)]
373#[derive(
374    Clone,
375    PartialEq,
376    Eq,
377    ::prost::Message,
378    ::serde::Serialize,
379    ::serde::Deserialize,
380    ::schemars::JsonSchema,
381    CosmwasmExt,
382)]
383#[proto_message(type_url = "/tendermint.types.BlockID")]
384pub struct BlockId {
385    #[prost(bytes = "vec", tag = "1")]
386    #[serde(
387        serialize_with = "crate::serde::as_base64_encoded_string::serialize",
388        deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
389    )]
390    pub hash: ::prost::alloc::vec::Vec<u8>,
391    #[prost(message, optional, tag = "2")]
392    pub part_set_header: ::core::option::Option<PartSetHeader>,
393}
394/// Header defines the structure of a block header.
395#[allow(clippy::derive_partial_eq_without_eq)]
396#[derive(
397    Clone,
398    PartialEq,
399    Eq,
400    ::prost::Message,
401    ::serde::Serialize,
402    ::serde::Deserialize,
403    ::schemars::JsonSchema,
404    CosmwasmExt,
405)]
406#[proto_message(type_url = "/tendermint.types.Header")]
407pub struct Header {
408    /// basic block info
409    #[prost(message, optional, tag = "1")]
410    pub version: ::core::option::Option<super::version::Consensus>,
411    #[prost(string, tag = "2")]
412    #[serde(alias = "chainID")]
413    pub chain_id: ::prost::alloc::string::String,
414    #[prost(int64, tag = "3")]
415    #[serde(
416        serialize_with = "crate::serde::as_str::serialize",
417        deserialize_with = "crate::serde::as_str::deserialize"
418    )]
419    pub height: i64,
420    #[prost(message, optional, tag = "4")]
421    pub time: ::core::option::Option<crate::shim::Timestamp>,
422    /// prev block info
423    #[prost(message, optional, tag = "5")]
424    #[serde(alias = "last_blockID")]
425    pub last_block_id: ::core::option::Option<BlockId>,
426    /// hashes of block data
427    ///
428    /// commit from validators from the last block
429    #[prost(bytes = "vec", tag = "6")]
430    #[serde(
431        serialize_with = "crate::serde::as_base64_encoded_string::serialize",
432        deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
433    )]
434    pub last_commit_hash: ::prost::alloc::vec::Vec<u8>,
435    /// transactions
436    #[prost(bytes = "vec", tag = "7")]
437    #[serde(
438        serialize_with = "crate::serde::as_base64_encoded_string::serialize",
439        deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
440    )]
441    pub data_hash: ::prost::alloc::vec::Vec<u8>,
442    /// hashes from the app output from the prev block
443    ///
444    /// validators for the current block
445    #[prost(bytes = "vec", tag = "8")]
446    #[serde(
447        serialize_with = "crate::serde::as_base64_encoded_string::serialize",
448        deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
449    )]
450    pub validators_hash: ::prost::alloc::vec::Vec<u8>,
451    /// validators for the next block
452    #[prost(bytes = "vec", tag = "9")]
453    #[serde(
454        serialize_with = "crate::serde::as_base64_encoded_string::serialize",
455        deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
456    )]
457    pub next_validators_hash: ::prost::alloc::vec::Vec<u8>,
458    /// consensus params for current block
459    #[prost(bytes = "vec", tag = "10")]
460    #[serde(
461        serialize_with = "crate::serde::as_base64_encoded_string::serialize",
462        deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
463    )]
464    pub consensus_hash: ::prost::alloc::vec::Vec<u8>,
465    /// state after txs from the previous block
466    #[prost(bytes = "vec", tag = "11")]
467    #[serde(
468        serialize_with = "crate::serde::as_base64_encoded_string::serialize",
469        deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
470    )]
471    pub app_hash: ::prost::alloc::vec::Vec<u8>,
472    /// root hash of all results from the txs from the previous block
473    #[prost(bytes = "vec", tag = "12")]
474    #[serde(
475        serialize_with = "crate::serde::as_base64_encoded_string::serialize",
476        deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
477    )]
478    pub last_results_hash: ::prost::alloc::vec::Vec<u8>,
479    /// consensus info
480    ///
481    /// evidence included in the block
482    #[prost(bytes = "vec", tag = "13")]
483    #[serde(
484        serialize_with = "crate::serde::as_base64_encoded_string::serialize",
485        deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
486    )]
487    pub evidence_hash: ::prost::alloc::vec::Vec<u8>,
488    /// original proposer of the block
489    #[prost(bytes = "vec", tag = "14")]
490    #[serde(
491        serialize_with = "crate::serde::as_base64_encoded_string::serialize",
492        deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
493    )]
494    pub proposer_address: ::prost::alloc::vec::Vec<u8>,
495}
496/// Data contains the set of transactions included in the block
497#[allow(clippy::derive_partial_eq_without_eq)]
498#[derive(
499    Clone,
500    PartialEq,
501    Eq,
502    ::prost::Message,
503    ::serde::Serialize,
504    ::serde::Deserialize,
505    ::schemars::JsonSchema,
506    CosmwasmExt,
507)]
508#[proto_message(type_url = "/tendermint.types.Data")]
509pub struct Data {
510    /// Txs that will be applied by state @ block.Height+1.
511    /// NOTE: not all txs here are valid.  We're just agreeing on the order first.
512    /// This means that block.AppHash does not include these txs.
513    #[prost(bytes = "vec", repeated, tag = "1")]
514    pub txs: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
515}
516/// Vote represents a prevote or precommit vote from validators for
517/// consensus.
518#[allow(clippy::derive_partial_eq_without_eq)]
519#[derive(
520    Clone,
521    PartialEq,
522    Eq,
523    ::prost::Message,
524    ::serde::Serialize,
525    ::serde::Deserialize,
526    ::schemars::JsonSchema,
527    CosmwasmExt,
528)]
529#[proto_message(type_url = "/tendermint.types.Vote")]
530pub struct Vote {
531    #[prost(enumeration = "SignedMsgType", tag = "1")]
532    #[serde(
533        serialize_with = "crate::serde::as_str::serialize",
534        deserialize_with = "crate::serde::as_str::deserialize"
535    )]
536    pub r#type: i32,
537    #[prost(int64, tag = "2")]
538    #[serde(
539        serialize_with = "crate::serde::as_str::serialize",
540        deserialize_with = "crate::serde::as_str::deserialize"
541    )]
542    pub height: i64,
543    #[prost(int32, tag = "3")]
544    #[serde(
545        serialize_with = "crate::serde::as_str::serialize",
546        deserialize_with = "crate::serde::as_str::deserialize"
547    )]
548    pub round: i32,
549    /// zero if vote is nil.
550    #[prost(message, optional, tag = "4")]
551    #[serde(alias = "blockID")]
552    pub block_id: ::core::option::Option<BlockId>,
553    #[prost(message, optional, tag = "5")]
554    pub timestamp: ::core::option::Option<crate::shim::Timestamp>,
555    #[prost(bytes = "vec", tag = "6")]
556    #[serde(
557        serialize_with = "crate::serde::as_base64_encoded_string::serialize",
558        deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
559    )]
560    pub validator_address: ::prost::alloc::vec::Vec<u8>,
561    #[prost(int32, tag = "7")]
562    #[serde(
563        serialize_with = "crate::serde::as_str::serialize",
564        deserialize_with = "crate::serde::as_str::deserialize"
565    )]
566    pub validator_index: i32,
567    /// Vote signature by the validator if they participated in consensus for the
568    /// associated block.
569    #[prost(bytes = "vec", tag = "8")]
570    #[serde(
571        serialize_with = "crate::serde::as_base64_encoded_string::serialize",
572        deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
573    )]
574    pub signature: ::prost::alloc::vec::Vec<u8>,
575    /// Vote extension provided by the application. Only valid for precommit
576    /// messages.
577    #[prost(bytes = "vec", tag = "9")]
578    #[serde(
579        serialize_with = "crate::serde::as_base64_encoded_string::serialize",
580        deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
581    )]
582    pub extension: ::prost::alloc::vec::Vec<u8>,
583    /// Vote extension signature by the validator if they participated in
584    /// consensus for the associated block.
585    /// Only valid for precommit messages.
586    #[prost(bytes = "vec", tag = "10")]
587    #[serde(
588        serialize_with = "crate::serde::as_base64_encoded_string::serialize",
589        deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
590    )]
591    pub extension_signature: ::prost::alloc::vec::Vec<u8>,
592}
593/// Commit contains the evidence that a block was committed by a set of validators.
594#[allow(clippy::derive_partial_eq_without_eq)]
595#[derive(
596    Clone,
597    PartialEq,
598    Eq,
599    ::prost::Message,
600    ::serde::Serialize,
601    ::serde::Deserialize,
602    ::schemars::JsonSchema,
603    CosmwasmExt,
604)]
605#[proto_message(type_url = "/tendermint.types.Commit")]
606pub struct Commit {
607    #[prost(int64, tag = "1")]
608    #[serde(
609        serialize_with = "crate::serde::as_str::serialize",
610        deserialize_with = "crate::serde::as_str::deserialize"
611    )]
612    pub height: i64,
613    #[prost(int32, tag = "2")]
614    #[serde(
615        serialize_with = "crate::serde::as_str::serialize",
616        deserialize_with = "crate::serde::as_str::deserialize"
617    )]
618    pub round: i32,
619    #[prost(message, optional, tag = "3")]
620    #[serde(alias = "blockID")]
621    pub block_id: ::core::option::Option<BlockId>,
622    #[prost(message, repeated, tag = "4")]
623    pub signatures: ::prost::alloc::vec::Vec<CommitSig>,
624}
625/// CommitSig is a part of the Vote included in a Commit.
626#[allow(clippy::derive_partial_eq_without_eq)]
627#[derive(
628    Clone,
629    PartialEq,
630    Eq,
631    ::prost::Message,
632    ::serde::Serialize,
633    ::serde::Deserialize,
634    ::schemars::JsonSchema,
635    CosmwasmExt,
636)]
637#[proto_message(type_url = "/tendermint.types.CommitSig")]
638pub struct CommitSig {
639    #[prost(enumeration = "BlockIdFlag", tag = "1")]
640    #[serde(alias = "blockID_flag")]
641    #[serde(
642        serialize_with = "crate::serde::as_str::serialize",
643        deserialize_with = "crate::serde::as_str::deserialize"
644    )]
645    pub block_id_flag: i32,
646    #[prost(bytes = "vec", tag = "2")]
647    #[serde(
648        serialize_with = "crate::serde::as_base64_encoded_string::serialize",
649        deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
650    )]
651    pub validator_address: ::prost::alloc::vec::Vec<u8>,
652    #[prost(message, optional, tag = "3")]
653    pub timestamp: ::core::option::Option<crate::shim::Timestamp>,
654    #[prost(bytes = "vec", tag = "4")]
655    #[serde(
656        serialize_with = "crate::serde::as_base64_encoded_string::serialize",
657        deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
658    )]
659    pub signature: ::prost::alloc::vec::Vec<u8>,
660}
661#[allow(clippy::derive_partial_eq_without_eq)]
662#[derive(
663    Clone,
664    PartialEq,
665    Eq,
666    ::prost::Message,
667    ::serde::Serialize,
668    ::serde::Deserialize,
669    ::schemars::JsonSchema,
670    CosmwasmExt,
671)]
672#[proto_message(type_url = "/tendermint.types.ExtendedCommit")]
673pub struct ExtendedCommit {
674    #[prost(int64, tag = "1")]
675    #[serde(
676        serialize_with = "crate::serde::as_str::serialize",
677        deserialize_with = "crate::serde::as_str::deserialize"
678    )]
679    pub height: i64,
680    #[prost(int32, tag = "2")]
681    #[serde(
682        serialize_with = "crate::serde::as_str::serialize",
683        deserialize_with = "crate::serde::as_str::deserialize"
684    )]
685    pub round: i32,
686    #[prost(message, optional, tag = "3")]
687    #[serde(alias = "blockID")]
688    pub block_id: ::core::option::Option<BlockId>,
689    #[prost(message, repeated, tag = "4")]
690    pub extended_signatures: ::prost::alloc::vec::Vec<ExtendedCommitSig>,
691}
692/// ExtendedCommitSig retains all the same fields as CommitSig but adds vote
693/// extension-related fields. We use two signatures to ensure backwards compatibility.
694/// That is the digest of the original signature is still the same in prior versions
695#[allow(clippy::derive_partial_eq_without_eq)]
696#[derive(
697    Clone,
698    PartialEq,
699    Eq,
700    ::prost::Message,
701    ::serde::Serialize,
702    ::serde::Deserialize,
703    ::schemars::JsonSchema,
704    CosmwasmExt,
705)]
706#[proto_message(type_url = "/tendermint.types.ExtendedCommitSig")]
707pub struct ExtendedCommitSig {
708    #[prost(enumeration = "BlockIdFlag", tag = "1")]
709    #[serde(alias = "blockID_flag")]
710    #[serde(
711        serialize_with = "crate::serde::as_str::serialize",
712        deserialize_with = "crate::serde::as_str::deserialize"
713    )]
714    pub block_id_flag: i32,
715    #[prost(bytes = "vec", tag = "2")]
716    #[serde(
717        serialize_with = "crate::serde::as_base64_encoded_string::serialize",
718        deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
719    )]
720    pub validator_address: ::prost::alloc::vec::Vec<u8>,
721    #[prost(message, optional, tag = "3")]
722    pub timestamp: ::core::option::Option<crate::shim::Timestamp>,
723    #[prost(bytes = "vec", tag = "4")]
724    #[serde(
725        serialize_with = "crate::serde::as_base64_encoded_string::serialize",
726        deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
727    )]
728    pub signature: ::prost::alloc::vec::Vec<u8>,
729    /// Vote extension data
730    #[prost(bytes = "vec", tag = "5")]
731    #[serde(
732        serialize_with = "crate::serde::as_base64_encoded_string::serialize",
733        deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
734    )]
735    pub extension: ::prost::alloc::vec::Vec<u8>,
736    /// Vote extension signature
737    #[prost(bytes = "vec", tag = "6")]
738    #[serde(
739        serialize_with = "crate::serde::as_base64_encoded_string::serialize",
740        deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
741    )]
742    pub extension_signature: ::prost::alloc::vec::Vec<u8>,
743}
744#[allow(clippy::derive_partial_eq_without_eq)]
745#[derive(
746    Clone,
747    PartialEq,
748    Eq,
749    ::prost::Message,
750    ::serde::Serialize,
751    ::serde::Deserialize,
752    ::schemars::JsonSchema,
753    CosmwasmExt,
754)]
755#[proto_message(type_url = "/tendermint.types.Proposal")]
756pub struct Proposal {
757    #[prost(enumeration = "SignedMsgType", tag = "1")]
758    #[serde(
759        serialize_with = "crate::serde::as_str::serialize",
760        deserialize_with = "crate::serde::as_str::deserialize"
761    )]
762    pub r#type: i32,
763    #[prost(int64, tag = "2")]
764    #[serde(
765        serialize_with = "crate::serde::as_str::serialize",
766        deserialize_with = "crate::serde::as_str::deserialize"
767    )]
768    pub height: i64,
769    #[prost(int32, tag = "3")]
770    #[serde(
771        serialize_with = "crate::serde::as_str::serialize",
772        deserialize_with = "crate::serde::as_str::deserialize"
773    )]
774    pub round: i32,
775    #[prost(int32, tag = "4")]
776    #[serde(
777        serialize_with = "crate::serde::as_str::serialize",
778        deserialize_with = "crate::serde::as_str::deserialize"
779    )]
780    pub pol_round: i32,
781    #[prost(message, optional, tag = "5")]
782    #[serde(alias = "blockID")]
783    pub block_id: ::core::option::Option<BlockId>,
784    #[prost(message, optional, tag = "6")]
785    pub timestamp: ::core::option::Option<crate::shim::Timestamp>,
786    #[prost(bytes = "vec", tag = "7")]
787    #[serde(
788        serialize_with = "crate::serde::as_base64_encoded_string::serialize",
789        deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
790    )]
791    pub signature: ::prost::alloc::vec::Vec<u8>,
792}
793#[allow(clippy::derive_partial_eq_without_eq)]
794#[derive(
795    Clone,
796    PartialEq,
797    Eq,
798    ::prost::Message,
799    ::serde::Serialize,
800    ::serde::Deserialize,
801    ::schemars::JsonSchema,
802    CosmwasmExt,
803)]
804#[proto_message(type_url = "/tendermint.types.SignedHeader")]
805pub struct SignedHeader {
806    #[prost(message, optional, tag = "1")]
807    pub header: ::core::option::Option<Header>,
808    #[prost(message, optional, tag = "2")]
809    pub commit: ::core::option::Option<Commit>,
810}
811#[allow(clippy::derive_partial_eq_without_eq)]
812#[derive(
813    Clone,
814    PartialEq,
815    Eq,
816    ::prost::Message,
817    ::serde::Serialize,
818    ::serde::Deserialize,
819    ::schemars::JsonSchema,
820    CosmwasmExt,
821)]
822#[proto_message(type_url = "/tendermint.types.LightBlock")]
823pub struct LightBlock {
824    #[prost(message, optional, tag = "1")]
825    pub signed_header: ::core::option::Option<SignedHeader>,
826    #[prost(message, optional, tag = "2")]
827    pub validator_set: ::core::option::Option<ValidatorSet>,
828}
829#[allow(clippy::derive_partial_eq_without_eq)]
830#[derive(
831    Clone,
832    PartialEq,
833    Eq,
834    ::prost::Message,
835    ::serde::Serialize,
836    ::serde::Deserialize,
837    ::schemars::JsonSchema,
838    CosmwasmExt,
839)]
840#[proto_message(type_url = "/tendermint.types.BlockMeta")]
841pub struct BlockMeta {
842    #[prost(message, optional, tag = "1")]
843    #[serde(alias = "blockID")]
844    pub block_id: ::core::option::Option<BlockId>,
845    #[prost(int64, tag = "2")]
846    #[serde(
847        serialize_with = "crate::serde::as_str::serialize",
848        deserialize_with = "crate::serde::as_str::deserialize"
849    )]
850    pub block_size: i64,
851    #[prost(message, optional, tag = "3")]
852    pub header: ::core::option::Option<Header>,
853    #[prost(int64, tag = "4")]
854    #[serde(
855        serialize_with = "crate::serde::as_str::serialize",
856        deserialize_with = "crate::serde::as_str::deserialize"
857    )]
858    pub num_txs: i64,
859}
860/// TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree.
861#[allow(clippy::derive_partial_eq_without_eq)]
862#[derive(
863    Clone,
864    PartialEq,
865    Eq,
866    ::prost::Message,
867    ::serde::Serialize,
868    ::serde::Deserialize,
869    ::schemars::JsonSchema,
870    CosmwasmExt,
871)]
872#[proto_message(type_url = "/tendermint.types.TxProof")]
873pub struct TxProof {
874    #[prost(bytes = "vec", tag = "1")]
875    #[serde(
876        serialize_with = "crate::serde::as_base64_encoded_string::serialize",
877        deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
878    )]
879    pub root_hash: ::prost::alloc::vec::Vec<u8>,
880    #[prost(bytes = "vec", tag = "2")]
881    #[serde(
882        serialize_with = "crate::serde::as_base64_encoded_string::serialize",
883        deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
884    )]
885    pub data: ::prost::alloc::vec::Vec<u8>,
886    #[prost(message, optional, tag = "3")]
887    pub proof: ::core::option::Option<super::crypto::Proof>,
888}
889/// SignedMsgType is a type of signed message in the consensus.
890#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
891#[repr(i32)]
892#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)]
893pub enum SignedMsgType {
894    Unknown = 0,
895    /// Votes
896    Prevote = 1,
897    Precommit = 2,
898    /// Proposals
899    Proposal = 32,
900}
901impl SignedMsgType {
902    /// String value of the enum field names used in the ProtoBuf definition.
903    ///
904    /// The values are not transformed in any way and thus are considered stable
905    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
906    pub fn as_str_name(&self) -> &'static str {
907        match self {
908            SignedMsgType::Unknown => "SIGNED_MSG_TYPE_UNKNOWN",
909            SignedMsgType::Prevote => "SIGNED_MSG_TYPE_PREVOTE",
910            SignedMsgType::Precommit => "SIGNED_MSG_TYPE_PRECOMMIT",
911            SignedMsgType::Proposal => "SIGNED_MSG_TYPE_PROPOSAL",
912        }
913    }
914    /// Creates an enum from field names used in the ProtoBuf definition.
915    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
916        match value {
917            "SIGNED_MSG_TYPE_UNKNOWN" => Some(Self::Unknown),
918            "SIGNED_MSG_TYPE_PREVOTE" => Some(Self::Prevote),
919            "SIGNED_MSG_TYPE_PRECOMMIT" => Some(Self::Precommit),
920            "SIGNED_MSG_TYPE_PROPOSAL" => Some(Self::Proposal),
921            _ => None,
922        }
923    }
924}
925#[allow(clippy::derive_partial_eq_without_eq)]
926#[derive(
927    Clone,
928    PartialEq,
929    Eq,
930    ::prost::Message,
931    ::serde::Serialize,
932    ::serde::Deserialize,
933    ::schemars::JsonSchema,
934    CosmwasmExt,
935)]
936#[proto_message(type_url = "/tendermint.types.Evidence")]
937pub struct Evidence {
938    #[prost(oneof = "evidence::Sum", tags = "1, 2")]
939    pub sum: ::core::option::Option<evidence::Sum>,
940}
941/// Nested message and enum types in `Evidence`.
942pub mod evidence {
943    use elys_std_deriv::CosmwasmExt;
944    #[allow(clippy::derive_partial_eq_without_eq)]
945    #[derive(
946        Clone,
947        PartialEq,
948        Eq,
949        ::prost::Oneof,
950        ::serde::Serialize,
951        ::serde::Deserialize,
952        ::schemars::JsonSchema,
953    )]
954    pub enum Sum {
955        #[prost(message, tag = "1")]
956        DuplicateVoteEvidence(super::DuplicateVoteEvidence),
957        #[prost(message, tag = "2")]
958        LightClientAttackEvidence(super::LightClientAttackEvidence),
959    }
960}
961/// DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes.
962#[allow(clippy::derive_partial_eq_without_eq)]
963#[derive(
964    Clone,
965    PartialEq,
966    Eq,
967    ::prost::Message,
968    ::serde::Serialize,
969    ::serde::Deserialize,
970    ::schemars::JsonSchema,
971    CosmwasmExt,
972)]
973#[proto_message(type_url = "/tendermint.types.DuplicateVoteEvidence")]
974pub struct DuplicateVoteEvidence {
975    #[prost(message, optional, tag = "1")]
976    pub vote_a: ::core::option::Option<Vote>,
977    #[prost(message, optional, tag = "2")]
978    pub vote_b: ::core::option::Option<Vote>,
979    #[prost(int64, tag = "3")]
980    #[serde(
981        serialize_with = "crate::serde::as_str::serialize",
982        deserialize_with = "crate::serde::as_str::deserialize"
983    )]
984    pub total_voting_power: i64,
985    #[prost(int64, tag = "4")]
986    #[serde(
987        serialize_with = "crate::serde::as_str::serialize",
988        deserialize_with = "crate::serde::as_str::deserialize"
989    )]
990    pub validator_power: i64,
991    #[prost(message, optional, tag = "5")]
992    pub timestamp: ::core::option::Option<crate::shim::Timestamp>,
993}
994/// LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client.
995#[allow(clippy::derive_partial_eq_without_eq)]
996#[derive(
997    Clone,
998    PartialEq,
999    Eq,
1000    ::prost::Message,
1001    ::serde::Serialize,
1002    ::serde::Deserialize,
1003    ::schemars::JsonSchema,
1004    CosmwasmExt,
1005)]
1006#[proto_message(type_url = "/tendermint.types.LightClientAttackEvidence")]
1007pub struct LightClientAttackEvidence {
1008    #[prost(message, optional, tag = "1")]
1009    pub conflicting_block: ::core::option::Option<LightBlock>,
1010    #[prost(int64, tag = "2")]
1011    #[serde(
1012        serialize_with = "crate::serde::as_str::serialize",
1013        deserialize_with = "crate::serde::as_str::deserialize"
1014    )]
1015    pub common_height: i64,
1016    #[prost(message, repeated, tag = "3")]
1017    pub byzantine_validators: ::prost::alloc::vec::Vec<Validator>,
1018    #[prost(int64, tag = "4")]
1019    #[serde(
1020        serialize_with = "crate::serde::as_str::serialize",
1021        deserialize_with = "crate::serde::as_str::deserialize"
1022    )]
1023    pub total_voting_power: i64,
1024    #[prost(message, optional, tag = "5")]
1025    pub timestamp: ::core::option::Option<crate::shim::Timestamp>,
1026}
1027#[allow(clippy::derive_partial_eq_without_eq)]
1028#[derive(
1029    Clone,
1030    PartialEq,
1031    Eq,
1032    ::prost::Message,
1033    ::serde::Serialize,
1034    ::serde::Deserialize,
1035    ::schemars::JsonSchema,
1036    CosmwasmExt,
1037)]
1038#[proto_message(type_url = "/tendermint.types.EvidenceList")]
1039pub struct EvidenceList {
1040    #[prost(message, repeated, tag = "1")]
1041    pub evidence: ::prost::alloc::vec::Vec<Evidence>,
1042}
1043#[allow(clippy::derive_partial_eq_without_eq)]
1044#[derive(
1045    Clone,
1046    PartialEq,
1047    Eq,
1048    ::prost::Message,
1049    ::serde::Serialize,
1050    ::serde::Deserialize,
1051    ::schemars::JsonSchema,
1052    CosmwasmExt,
1053)]
1054#[proto_message(type_url = "/tendermint.types.Block")]
1055pub struct Block {
1056    #[prost(message, optional, tag = "1")]
1057    pub header: ::core::option::Option<Header>,
1058    #[prost(message, optional, tag = "2")]
1059    pub data: ::core::option::Option<Data>,
1060    #[prost(message, optional, tag = "3")]
1061    pub evidence: ::core::option::Option<EvidenceList>,
1062    #[prost(message, optional, tag = "4")]
1063    pub last_commit: ::core::option::Option<Commit>,
1064}