Skip to main content

haqq_grpc/gen/
tendermint.types.rs

1// @generated
2#[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/// BlockIdFlag indicates which BlockID the signature is for
36#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
37#[repr(i32)]
38pub enum BlockIdFlag {
39    /// indicates an error condition
40    Unknown = 0,
41    /// the vote was not received
42    Absent = 1,
43    /// voted for the block that received the majority
44    Commit = 2,
45    /// voted for nil
46    Nil = 3,
47}
48impl BlockIdFlag {
49    /// String value of the enum field names used in the ProtoBuf definition.
50    ///
51    /// The values are not transformed in any way and thus are considered stable
52    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
53    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    /// Creates an enum from field names used in the ProtoBuf definition.
62    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/// PartsetHeader
73#[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/// BlockID
94#[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// --------------------------------
104
105/// Header defines the structure of a block header.
106#[derive(::derive_builder::Builder)]
107#[allow(clippy::derive_partial_eq_without_eq)]
108#[derive(Clone, PartialEq, ::prost::Message)]
109pub struct Header {
110    /// basic block info
111    #[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    /// prev block info
120    #[prost(message, optional, tag="5")]
121    pub last_block_id: ::core::option::Option<BlockId>,
122    /// hashes of block data
123    ///
124    /// commit from validators from the last block
125    #[prost(bytes="bytes", tag="6")]
126    pub last_commit_hash: ::prost::bytes::Bytes,
127    /// transactions
128    #[prost(bytes="bytes", tag="7")]
129    pub data_hash: ::prost::bytes::Bytes,
130    /// hashes from the app output from the prev block
131    ///
132    /// validators for the current block
133    #[prost(bytes="bytes", tag="8")]
134    pub validators_hash: ::prost::bytes::Bytes,
135    /// validators for the next block
136    #[prost(bytes="bytes", tag="9")]
137    pub next_validators_hash: ::prost::bytes::Bytes,
138    /// consensus params for current block
139    #[prost(bytes="bytes", tag="10")]
140    pub consensus_hash: ::prost::bytes::Bytes,
141    /// state after txs from the previous block
142    #[prost(bytes="bytes", tag="11")]
143    pub app_hash: ::prost::bytes::Bytes,
144    /// root hash of all results from the txs from the previous block
145    #[prost(bytes="bytes", tag="12")]
146    pub last_results_hash: ::prost::bytes::Bytes,
147    /// consensus info
148    ///
149    /// evidence included in the block
150    #[prost(bytes="bytes", tag="13")]
151    pub evidence_hash: ::prost::bytes::Bytes,
152    /// original proposer of the block
153    #[prost(bytes="bytes", tag="14")]
154    pub proposer_address: ::prost::bytes::Bytes,
155}
156/// Data contains the set of transactions included in the block
157#[derive(::derive_builder::Builder)]
158#[allow(clippy::derive_partial_eq_without_eq)]
159#[derive(Clone, PartialEq, ::prost::Message)]
160pub struct Data {
161    /// Txs that will be applied by state @ block.Height+1.
162    /// NOTE: not all txs here are valid.  We're just agreeing on the order first.
163    /// This means that block.AppHash does not include these txs.
164    #[prost(bytes="bytes", repeated, tag="1")]
165    pub txs: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
166}
167/// Vote represents a prevote or precommit vote from validators for
168/// consensus.
169#[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    /// zero if vote is nil.
180    #[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    /// Vote signature by the validator if they participated in consensus for the
189    /// associated block.
190    #[prost(bytes="bytes", tag="8")]
191    pub signature: ::prost::bytes::Bytes,
192    /// Vote extension provided by the application. Only valid for precommit
193    /// messages.
194    #[prost(bytes="bytes", tag="9")]
195    pub extension: ::prost::bytes::Bytes,
196    /// Vote extension signature by the validator if they participated in
197    /// consensus for the associated block.
198    /// Only valid for precommit messages.
199    #[prost(bytes="bytes", tag="10")]
200    pub extension_signature: ::prost::bytes::Bytes,
201}
202/// Commit contains the evidence that a block was committed by a set of validators.
203#[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/// CommitSig is a part of the Vote included in a Commit.
217#[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/// ExtendedCommitSig retains all the same fields as CommitSig but adds vote
244/// extension-related fields. We use two signatures to ensure backwards compatibility.
245/// That is the digest of the original signature is still the same in prior versions
246#[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    /// Vote extension data
259    #[prost(bytes="bytes", tag="5")]
260    pub extension: ::prost::bytes::Bytes,
261    /// Vote extension signature
262    #[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/// TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree.
316#[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/// SignedMsgType is a type of signed message in the consensus.
328#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
329#[repr(i32)]
330pub enum SignedMsgType {
331    Unknown = 0,
332    /// Votes
333    Prevote = 1,
334    Precommit = 2,
335    /// Proposals
336    Proposal = 32,
337}
338impl SignedMsgType {
339    /// String value of the enum field names used in the ProtoBuf definition.
340    ///
341    /// The values are not transformed in any way and thus are considered stable
342    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
343    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    /// Creates an enum from field names used in the ProtoBuf definition.
352    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/// ConsensusParams contains consensus critical parameters that determine the
363/// validity of blocks.
364#[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/// BlockParams contains limits on the block size.
378#[derive(::derive_builder::Builder)]
379#[allow(clippy::derive_partial_eq_without_eq)]
380#[derive(Clone, PartialEq, ::prost::Message)]
381pub struct BlockParams {
382    /// Max block size, in bytes.
383    /// Note: must be greater than 0
384    #[prost(int64, tag="1")]
385    pub max_bytes: i64,
386    /// Max gas per block.
387    /// Note: must be greater or equal to -1
388    #[prost(int64, tag="2")]
389    pub max_gas: i64,
390}
391/// EvidenceParams determine how we handle evidence of malfeasance.
392#[derive(::derive_builder::Builder)]
393#[allow(clippy::derive_partial_eq_without_eq)]
394#[derive(Clone, PartialEq, ::prost::Message)]
395pub struct EvidenceParams {
396    /// Max age of evidence, in blocks.
397    ///
398    /// The basic formula for calculating this is: MaxAgeDuration / {average block
399    /// time}.
400    #[prost(int64, tag="1")]
401    pub max_age_num_blocks: i64,
402    /// Max age of evidence, in time.
403    ///
404    /// It should correspond with an app's "unbonding period" or other similar
405    /// mechanism for handling [Nothing-At-Stake
406    /// attacks](<https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed>).
407    #[prost(message, optional, tag="2")]
408    pub max_age_duration: ::core::option::Option<::pbjson_types::Duration>,
409    /// This sets the maximum size of total evidence in bytes that can be committed in a single block.
410    /// and should fall comfortably under the max block bytes.
411    /// Default is 1048576 or 1MB
412    #[prost(int64, tag="3")]
413    pub max_bytes: i64,
414}
415/// ValidatorParams restrict the public key types validators can use.
416/// NOTE: uses ABCI pubkey naming, not Amino names.
417#[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/// VersionParams contains the ABCI application version.
425#[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/// HashedParams is a subset of ConsensusParams.
433///
434/// It is hashed into the Header.ConsensusHash.
435#[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}
451/// Nested message and enum types in `Evidence`.
452pub 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/// DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes.
463#[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/// LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client.
479#[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// @@protoc_insertion_point(module)