nibiru_std/proto/buf/
tendermint.types.rs

1// @generated
2#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct ValidatorSet {
5    #[prost(message, repeated, tag="1")]
6    pub validators: ::prost::alloc::vec::Vec<Validator>,
7    #[prost(message, optional, tag="2")]
8    pub proposer: ::core::option::Option<Validator>,
9    #[prost(int64, tag="3")]
10    pub total_voting_power: i64,
11}
12#[allow(clippy::derive_partial_eq_without_eq)]
13#[derive(Clone, PartialEq, ::prost::Message)]
14pub struct Validator {
15    #[prost(bytes="bytes", tag="1")]
16    pub address: ::prost::bytes::Bytes,
17    #[prost(message, optional, tag="2")]
18    pub pub_key: ::core::option::Option<super::crypto::PublicKey>,
19    #[prost(int64, tag="3")]
20    pub voting_power: i64,
21    #[prost(int64, tag="4")]
22    pub proposer_priority: i64,
23}
24#[allow(clippy::derive_partial_eq_without_eq)]
25#[derive(Clone, PartialEq, ::prost::Message)]
26pub struct SimpleValidator {
27    #[prost(message, optional, tag="1")]
28    pub pub_key: ::core::option::Option<super::crypto::PublicKey>,
29    #[prost(int64, tag="2")]
30    pub voting_power: i64,
31}
32/// PartsetHeader
33#[allow(clippy::derive_partial_eq_without_eq)]
34#[derive(Clone, PartialEq, ::prost::Message)]
35pub struct PartSetHeader {
36    #[prost(uint32, tag="1")]
37    pub total: u32,
38    #[prost(bytes="bytes", tag="2")]
39    pub hash: ::prost::bytes::Bytes,
40}
41#[allow(clippy::derive_partial_eq_without_eq)]
42#[derive(Clone, PartialEq, ::prost::Message)]
43pub struct Part {
44    #[prost(uint32, tag="1")]
45    pub index: u32,
46    #[prost(bytes="bytes", tag="2")]
47    pub bytes: ::prost::bytes::Bytes,
48    #[prost(message, optional, tag="3")]
49    pub proof: ::core::option::Option<super::crypto::Proof>,
50}
51/// BlockID
52#[allow(clippy::derive_partial_eq_without_eq)]
53#[derive(Clone, PartialEq, ::prost::Message)]
54pub struct BlockId {
55    #[prost(bytes="bytes", tag="1")]
56    pub hash: ::prost::bytes::Bytes,
57    #[prost(message, optional, tag="2")]
58    pub part_set_header: ::core::option::Option<PartSetHeader>,
59}
60// --------------------------------
61
62/// Header defines the structure of a block header.
63#[allow(clippy::derive_partial_eq_without_eq)]
64#[derive(Clone, PartialEq, ::prost::Message)]
65pub struct Header {
66    /// basic block info
67    #[prost(message, optional, tag="1")]
68    pub version: ::core::option::Option<super::version::Consensus>,
69    #[prost(string, tag="2")]
70    pub chain_id: ::prost::alloc::string::String,
71    #[prost(int64, tag="3")]
72    pub height: i64,
73    #[prost(message, optional, tag="4")]
74    pub time: ::core::option::Option<::prost_types::Timestamp>,
75    /// prev block info
76    #[prost(message, optional, tag="5")]
77    pub last_block_id: ::core::option::Option<BlockId>,
78    /// hashes of block data
79    ///
80    /// commit from validators from the last block
81    #[prost(bytes="bytes", tag="6")]
82    pub last_commit_hash: ::prost::bytes::Bytes,
83    /// transactions
84    #[prost(bytes="bytes", tag="7")]
85    pub data_hash: ::prost::bytes::Bytes,
86    /// hashes from the app output from the prev block
87    ///
88    /// validators for the current block
89    #[prost(bytes="bytes", tag="8")]
90    pub validators_hash: ::prost::bytes::Bytes,
91    /// validators for the next block
92    #[prost(bytes="bytes", tag="9")]
93    pub next_validators_hash: ::prost::bytes::Bytes,
94    /// consensus params for current block
95    #[prost(bytes="bytes", tag="10")]
96    pub consensus_hash: ::prost::bytes::Bytes,
97    /// state after txs from the previous block
98    #[prost(bytes="bytes", tag="11")]
99    pub app_hash: ::prost::bytes::Bytes,
100    /// root hash of all results from the txs from the previous block
101    #[prost(bytes="bytes", tag="12")]
102    pub last_results_hash: ::prost::bytes::Bytes,
103    /// consensus info
104    ///
105    /// evidence included in the block
106    #[prost(bytes="bytes", tag="13")]
107    pub evidence_hash: ::prost::bytes::Bytes,
108    /// original proposer of the block
109    #[prost(bytes="bytes", tag="14")]
110    pub proposer_address: ::prost::bytes::Bytes,
111}
112/// Data contains the set of transactions included in the block
113#[allow(clippy::derive_partial_eq_without_eq)]
114#[derive(Clone, PartialEq, ::prost::Message)]
115pub struct Data {
116    /// Txs that will be applied by state @ block.Height+1.
117    /// NOTE: not all txs here are valid.  We're just agreeing on the order first.
118    /// This means that block.AppHash does not include these txs.
119    #[prost(bytes="bytes", repeated, tag="1")]
120    pub txs: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
121}
122/// Vote represents a prevote, precommit, or commit vote from validators for
123/// consensus.
124#[allow(clippy::derive_partial_eq_without_eq)]
125#[derive(Clone, PartialEq, ::prost::Message)]
126pub struct Vote {
127    #[prost(enumeration="SignedMsgType", tag="1")]
128    pub r#type: i32,
129    #[prost(int64, tag="2")]
130    pub height: i64,
131    #[prost(int32, tag="3")]
132    pub round: i32,
133    /// zero if vote is nil.
134    #[prost(message, optional, tag="4")]
135    pub block_id: ::core::option::Option<BlockId>,
136    #[prost(message, optional, tag="5")]
137    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
138    #[prost(bytes="bytes", tag="6")]
139    pub validator_address: ::prost::bytes::Bytes,
140    #[prost(int32, tag="7")]
141    pub validator_index: i32,
142    #[prost(bytes="bytes", tag="8")]
143    pub signature: ::prost::bytes::Bytes,
144}
145/// Commit contains the evidence that a block was committed by a set of validators.
146#[allow(clippy::derive_partial_eq_without_eq)]
147#[derive(Clone, PartialEq, ::prost::Message)]
148pub struct Commit {
149    #[prost(int64, tag="1")]
150    pub height: i64,
151    #[prost(int32, tag="2")]
152    pub round: i32,
153    #[prost(message, optional, tag="3")]
154    pub block_id: ::core::option::Option<BlockId>,
155    #[prost(message, repeated, tag="4")]
156    pub signatures: ::prost::alloc::vec::Vec<CommitSig>,
157}
158/// CommitSig is a part of the Vote included in a Commit.
159#[allow(clippy::derive_partial_eq_without_eq)]
160#[derive(Clone, PartialEq, ::prost::Message)]
161pub struct CommitSig {
162    #[prost(enumeration="BlockIdFlag", tag="1")]
163    pub block_id_flag: i32,
164    #[prost(bytes="bytes", tag="2")]
165    pub validator_address: ::prost::bytes::Bytes,
166    #[prost(message, optional, tag="3")]
167    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
168    #[prost(bytes="bytes", tag="4")]
169    pub signature: ::prost::bytes::Bytes,
170}
171#[allow(clippy::derive_partial_eq_without_eq)]
172#[derive(Clone, PartialEq, ::prost::Message)]
173pub struct Proposal {
174    #[prost(enumeration="SignedMsgType", tag="1")]
175    pub r#type: i32,
176    #[prost(int64, tag="2")]
177    pub height: i64,
178    #[prost(int32, tag="3")]
179    pub round: i32,
180    #[prost(int32, tag="4")]
181    pub pol_round: i32,
182    #[prost(message, optional, tag="5")]
183    pub block_id: ::core::option::Option<BlockId>,
184    #[prost(message, optional, tag="6")]
185    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
186    #[prost(bytes="bytes", tag="7")]
187    pub signature: ::prost::bytes::Bytes,
188}
189#[allow(clippy::derive_partial_eq_without_eq)]
190#[derive(Clone, PartialEq, ::prost::Message)]
191pub struct SignedHeader {
192    #[prost(message, optional, tag="1")]
193    pub header: ::core::option::Option<Header>,
194    #[prost(message, optional, tag="2")]
195    pub commit: ::core::option::Option<Commit>,
196}
197#[allow(clippy::derive_partial_eq_without_eq)]
198#[derive(Clone, PartialEq, ::prost::Message)]
199pub struct LightBlock {
200    #[prost(message, optional, tag="1")]
201    pub signed_header: ::core::option::Option<SignedHeader>,
202    #[prost(message, optional, tag="2")]
203    pub validator_set: ::core::option::Option<ValidatorSet>,
204}
205#[allow(clippy::derive_partial_eq_without_eq)]
206#[derive(Clone, PartialEq, ::prost::Message)]
207pub struct BlockMeta {
208    #[prost(message, optional, tag="1")]
209    pub block_id: ::core::option::Option<BlockId>,
210    #[prost(int64, tag="2")]
211    pub block_size: i64,
212    #[prost(message, optional, tag="3")]
213    pub header: ::core::option::Option<Header>,
214    #[prost(int64, tag="4")]
215    pub num_txs: i64,
216}
217/// TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree.
218#[allow(clippy::derive_partial_eq_without_eq)]
219#[derive(Clone, PartialEq, ::prost::Message)]
220pub struct TxProof {
221    #[prost(bytes="bytes", tag="1")]
222    pub root_hash: ::prost::bytes::Bytes,
223    #[prost(bytes="bytes", tag="2")]
224    pub data: ::prost::bytes::Bytes,
225    #[prost(message, optional, tag="3")]
226    pub proof: ::core::option::Option<super::crypto::Proof>,
227}
228/// BlockIdFlag indicates which BlcokID the signature is for
229#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
230#[repr(i32)]
231pub enum BlockIdFlag {
232    Unknown = 0,
233    Absent = 1,
234    Commit = 2,
235    Nil = 3,
236}
237impl BlockIdFlag {
238    /// String value of the enum field names used in the ProtoBuf definition.
239    ///
240    /// The values are not transformed in any way and thus are considered stable
241    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
242    pub fn as_str_name(&self) -> &'static str {
243        match self {
244            BlockIdFlag::Unknown => "BLOCK_ID_FLAG_UNKNOWN",
245            BlockIdFlag::Absent => "BLOCK_ID_FLAG_ABSENT",
246            BlockIdFlag::Commit => "BLOCK_ID_FLAG_COMMIT",
247            BlockIdFlag::Nil => "BLOCK_ID_FLAG_NIL",
248        }
249    }
250    /// Creates an enum from field names used in the ProtoBuf definition.
251    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
252        match value {
253            "BLOCK_ID_FLAG_UNKNOWN" => Some(Self::Unknown),
254            "BLOCK_ID_FLAG_ABSENT" => Some(Self::Absent),
255            "BLOCK_ID_FLAG_COMMIT" => Some(Self::Commit),
256            "BLOCK_ID_FLAG_NIL" => Some(Self::Nil),
257            _ => None,
258        }
259    }
260}
261/// SignedMsgType is a type of signed message in the consensus.
262#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
263#[repr(i32)]
264pub enum SignedMsgType {
265    Unknown = 0,
266    /// Votes
267    Prevote = 1,
268    Precommit = 2,
269    /// Proposals
270    Proposal = 32,
271}
272impl SignedMsgType {
273    /// String value of the enum field names used in the ProtoBuf definition.
274    ///
275    /// The values are not transformed in any way and thus are considered stable
276    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
277    pub fn as_str_name(&self) -> &'static str {
278        match self {
279            SignedMsgType::Unknown => "SIGNED_MSG_TYPE_UNKNOWN",
280            SignedMsgType::Prevote => "SIGNED_MSG_TYPE_PREVOTE",
281            SignedMsgType::Precommit => "SIGNED_MSG_TYPE_PRECOMMIT",
282            SignedMsgType::Proposal => "SIGNED_MSG_TYPE_PROPOSAL",
283        }
284    }
285    /// Creates an enum from field names used in the ProtoBuf definition.
286    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
287        match value {
288            "SIGNED_MSG_TYPE_UNKNOWN" => Some(Self::Unknown),
289            "SIGNED_MSG_TYPE_PREVOTE" => Some(Self::Prevote),
290            "SIGNED_MSG_TYPE_PRECOMMIT" => Some(Self::Precommit),
291            "SIGNED_MSG_TYPE_PROPOSAL" => Some(Self::Proposal),
292            _ => None,
293        }
294    }
295}
296/// ConsensusParams contains consensus critical parameters that determine the
297/// validity of blocks.
298#[allow(clippy::derive_partial_eq_without_eq)]
299#[derive(Clone, PartialEq, ::prost::Message)]
300pub struct ConsensusParams {
301    #[prost(message, optional, tag="1")]
302    pub block: ::core::option::Option<BlockParams>,
303    #[prost(message, optional, tag="2")]
304    pub evidence: ::core::option::Option<EvidenceParams>,
305    #[prost(message, optional, tag="3")]
306    pub validator: ::core::option::Option<ValidatorParams>,
307    #[prost(message, optional, tag="4")]
308    pub version: ::core::option::Option<VersionParams>,
309}
310/// BlockParams contains limits on the block size.
311#[allow(clippy::derive_partial_eq_without_eq)]
312#[derive(Clone, PartialEq, ::prost::Message)]
313pub struct BlockParams {
314    /// Max block size, in bytes.
315    /// Note: must be greater than 0
316    #[prost(int64, tag="1")]
317    pub max_bytes: i64,
318    /// Max gas per block.
319    /// Note: must be greater or equal to -1
320    #[prost(int64, tag="2")]
321    pub max_gas: i64,
322}
323/// EvidenceParams determine how we handle evidence of malfeasance.
324#[allow(clippy::derive_partial_eq_without_eq)]
325#[derive(Clone, PartialEq, ::prost::Message)]
326pub struct EvidenceParams {
327    /// Max age of evidence, in blocks.
328    ///
329    /// The basic formula for calculating this is: MaxAgeDuration / {average block
330    /// time}.
331    #[prost(int64, tag="1")]
332    pub max_age_num_blocks: i64,
333    /// Max age of evidence, in time.
334    ///
335    /// It should correspond with an app's "unbonding period" or other similar
336    /// mechanism for handling [Nothing-At-Stake
337    /// attacks](<https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed>).
338    #[prost(message, optional, tag="2")]
339    pub max_age_duration: ::core::option::Option<::prost_types::Duration>,
340    /// This sets the maximum size of total evidence in bytes that can be committed in a single block.
341    /// and should fall comfortably under the max block bytes.
342    /// Default is 1048576 or 1MB
343    #[prost(int64, tag="3")]
344    pub max_bytes: i64,
345}
346/// ValidatorParams restrict the public key types validators can use.
347/// NOTE: uses ABCI pubkey naming, not Amino names.
348#[allow(clippy::derive_partial_eq_without_eq)]
349#[derive(Clone, PartialEq, ::prost::Message)]
350pub struct ValidatorParams {
351    #[prost(string, repeated, tag="1")]
352    pub pub_key_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
353}
354/// VersionParams contains the ABCI application version.
355#[allow(clippy::derive_partial_eq_without_eq)]
356#[derive(Clone, PartialEq, ::prost::Message)]
357pub struct VersionParams {
358    #[prost(uint64, tag="1")]
359    pub app: u64,
360}
361/// HashedParams is a subset of ConsensusParams.
362///
363/// It is hashed into the Header.ConsensusHash.
364#[allow(clippy::derive_partial_eq_without_eq)]
365#[derive(Clone, PartialEq, ::prost::Message)]
366pub struct HashedParams {
367    #[prost(int64, tag="1")]
368    pub block_max_bytes: i64,
369    #[prost(int64, tag="2")]
370    pub block_max_gas: i64,
371}
372#[allow(clippy::derive_partial_eq_without_eq)]
373#[derive(Clone, PartialEq, ::prost::Message)]
374pub struct Evidence {
375    #[prost(oneof="evidence::Sum", tags="1, 2")]
376    pub sum: ::core::option::Option<evidence::Sum>,
377}
378/// Nested message and enum types in `Evidence`.
379pub mod evidence {
380    #[allow(clippy::derive_partial_eq_without_eq)]
381#[derive(Clone, PartialEq, ::prost::Oneof)]
382    pub enum Sum {
383        #[prost(message, tag="1")]
384        DuplicateVoteEvidence(super::DuplicateVoteEvidence),
385        #[prost(message, tag="2")]
386        LightClientAttackEvidence(super::LightClientAttackEvidence),
387    }
388}
389/// DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes.
390#[allow(clippy::derive_partial_eq_without_eq)]
391#[derive(Clone, PartialEq, ::prost::Message)]
392pub struct DuplicateVoteEvidence {
393    #[prost(message, optional, tag="1")]
394    pub vote_a: ::core::option::Option<Vote>,
395    #[prost(message, optional, tag="2")]
396    pub vote_b: ::core::option::Option<Vote>,
397    #[prost(int64, tag="3")]
398    pub total_voting_power: i64,
399    #[prost(int64, tag="4")]
400    pub validator_power: i64,
401    #[prost(message, optional, tag="5")]
402    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
403}
404/// LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client.
405#[allow(clippy::derive_partial_eq_without_eq)]
406#[derive(Clone, PartialEq, ::prost::Message)]
407pub struct LightClientAttackEvidence {
408    #[prost(message, optional, tag="1")]
409    pub conflicting_block: ::core::option::Option<LightBlock>,
410    #[prost(int64, tag="2")]
411    pub common_height: i64,
412    #[prost(message, repeated, tag="3")]
413    pub byzantine_validators: ::prost::alloc::vec::Vec<Validator>,
414    #[prost(int64, tag="4")]
415    pub total_voting_power: i64,
416    #[prost(message, optional, tag="5")]
417    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
418}
419#[allow(clippy::derive_partial_eq_without_eq)]
420#[derive(Clone, PartialEq, ::prost::Message)]
421pub struct EvidenceList {
422    #[prost(message, repeated, tag="1")]
423    pub evidence: ::prost::alloc::vec::Vec<Evidence>,
424}
425#[allow(clippy::derive_partial_eq_without_eq)]
426#[derive(Clone, PartialEq, ::prost::Message)]
427pub struct Block {
428    #[prost(message, optional, tag="1")]
429    pub header: ::core::option::Option<Header>,
430    #[prost(message, optional, tag="2")]
431    pub data: ::core::option::Option<Data>,
432    #[prost(message, optional, tag="3")]
433    pub evidence: ::core::option::Option<EvidenceList>,
434    #[prost(message, optional, tag="4")]
435    pub last_commit: ::core::option::Option<Commit>,
436}
437// @@protoc_insertion_point(module)