persistence_std/types/tendermint/
types.rs

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