1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::serde::Deserialize, ::serde::Serialize)]
pub struct ValidatorSet {
#[prost(message, repeated, tag="1")]
pub validators: ::std::vec::Vec<Validator>,
#[prost(message, optional, tag="2")]
pub proposer: ::std::option::Option<Validator>,
#[prost(int64, tag="3")]
pub total_voting_power: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::serde::Deserialize, ::serde::Serialize)]
pub struct Validator {
#[prost(bytes, tag="1")]
#[serde(with = "crate::serializers::bytes::hexstring")]
pub address: std::vec::Vec<u8>,
#[prost(message, optional, tag="2")]
pub pub_key: ::std::option::Option<super::crypto::PublicKey>,
#[prost(int64, tag="3")]
#[serde(alias = "power", with = "crate::serializers::from_str")]
pub voting_power: i64,
#[prost(int64, tag="4")]
#[serde(with = "crate::serializers::from_str", default)]
pub proposer_priority: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SimpleValidator {
#[prost(message, optional, tag="1")]
pub pub_key: ::std::option::Option<super::crypto::PublicKey>,
#[prost(int64, tag="2")]
pub voting_power: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::serde::Deserialize, ::serde::Serialize)]
pub struct PartSetHeader {
#[prost(uint32, tag="1")]
#[serde(with = "crate::serializers::part_set_header_total")]
pub total: u32,
#[prost(bytes, tag="2")]
#[serde(with = "crate::serializers::bytes::hexstring")]
pub hash: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Part {
#[prost(uint32, tag="1")]
pub index: u32,
#[prost(bytes, tag="2")]
pub bytes: std::vec::Vec<u8>,
#[prost(message, optional, tag="3")]
pub proof: ::std::option::Option<super::crypto::Proof>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::serde::Deserialize, ::serde::Serialize)]
pub struct BlockId {
#[prost(bytes, tag="1")]
#[serde(with = "crate::serializers::bytes::hexstring")]
pub hash: std::vec::Vec<u8>,
#[prost(message, optional, tag="2")]
#[serde(alias = "parts")]
pub part_set_header: ::std::option::Option<PartSetHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::serde::Deserialize, ::serde::Serialize)]
pub struct Header {
#[prost(message, optional, tag="1")]
pub version: ::std::option::Option<super::version::Consensus>,
#[prost(string, tag="2")]
pub chain_id: std::string::String,
#[prost(int64, tag="3")]
#[serde(with = "crate::serializers::from_str")]
pub height: i64,
#[prost(message, optional, tag="4")]
#[serde(with = "crate::serializers::optional")]
pub time: ::std::option::Option<super::super::google::protobuf::Timestamp>,
#[prost(message, optional, tag="5")]
pub last_block_id: ::std::option::Option<BlockId>,
#[prost(bytes, tag="6")]
#[serde(with = "crate::serializers::bytes::hexstring")]
pub last_commit_hash: std::vec::Vec<u8>,
#[prost(bytes, tag="7")]
#[serde(with = "crate::serializers::bytes::hexstring")]
pub data_hash: std::vec::Vec<u8>,
#[prost(bytes, tag="8")]
#[serde(with = "crate::serializers::bytes::hexstring")]
pub validators_hash: std::vec::Vec<u8>,
#[prost(bytes, tag="9")]
#[serde(with = "crate::serializers::bytes::hexstring")]
pub next_validators_hash: std::vec::Vec<u8>,
#[prost(bytes, tag="10")]
#[serde(with = "crate::serializers::bytes::hexstring")]
pub consensus_hash: std::vec::Vec<u8>,
#[prost(bytes, tag="11")]
#[serde(with = "crate::serializers::bytes::hexstring")]
pub app_hash: std::vec::Vec<u8>,
#[prost(bytes, tag="12")]
#[serde(with = "crate::serializers::bytes::hexstring")]
pub last_results_hash: std::vec::Vec<u8>,
#[prost(bytes, tag="13")]
#[serde(with = "crate::serializers::bytes::hexstring")]
pub evidence_hash: std::vec::Vec<u8>,
#[prost(bytes, tag="14")]
#[serde(with = "crate::serializers::bytes::hexstring")]
pub proposer_address: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::serde::Deserialize, ::serde::Serialize)]
pub struct Data {
#[prost(bytes, repeated, tag="1")]
#[serde(with = "crate::serializers::txs")]
pub txs: ::std::vec::Vec<std::vec::Vec<u8>>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::serde::Deserialize, ::serde::Serialize)]
pub struct Vote {
#[prost(enumeration="SignedMsgType", tag="1")]
pub r#type: i32,
#[prost(int64, tag="2")]
#[serde(with = "crate::serializers::from_str")]
pub height: i64,
#[prost(int32, tag="3")]
#[serde(with = "crate::serializers::from_str")]
pub round: i32,
#[prost(message, optional, tag="4")]
pub block_id: ::std::option::Option<BlockId>,
#[prost(message, optional, tag="5")]
#[serde(with = "crate::serializers::optional")]
pub timestamp: ::std::option::Option<super::super::google::protobuf::Timestamp>,
#[prost(bytes, tag="6")]
#[serde(with = "crate::serializers::bytes::hexstring")]
pub validator_address: std::vec::Vec<u8>,
#[prost(int32, tag="7")]
#[serde(with = "crate::serializers::from_str")]
pub validator_index: i32,
#[prost(bytes, tag="8")]
#[serde(with = "crate::serializers::bytes::base64string")]
pub signature: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::serde::Deserialize, ::serde::Serialize)]
pub struct Commit {
#[prost(int64, tag="1")]
#[serde(with = "crate::serializers::from_str")]
pub height: i64,
#[prost(int32, tag="2")]
pub round: i32,
#[prost(message, optional, tag="3")]
pub block_id: ::std::option::Option<BlockId>,
#[prost(message, repeated, tag="4")]
#[serde(with = "crate::serializers::nullable")]
pub signatures: ::std::vec::Vec<CommitSig>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::serde::Deserialize, ::serde::Serialize)]
pub struct CommitSig {
#[prost(enumeration="BlockIdFlag", tag="1")]
pub block_id_flag: i32,
#[prost(bytes, tag="2")]
#[serde(with = "crate::serializers::bytes::hexstring")]
pub validator_address: std::vec::Vec<u8>,
#[prost(message, optional, tag="3")]
#[serde(with = "crate::serializers::optional")]
pub timestamp: ::std::option::Option<super::super::google::protobuf::Timestamp>,
#[prost(bytes, tag="4")]
#[serde(with = "crate::serializers::bytes::base64string")]
pub signature: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Proposal {
#[prost(enumeration="SignedMsgType", tag="1")]
pub r#type: i32,
#[prost(int64, tag="2")]
pub height: i64,
#[prost(int32, tag="3")]
pub round: i32,
#[prost(int32, tag="4")]
pub pol_round: i32,
#[prost(message, optional, tag="5")]
pub block_id: ::std::option::Option<BlockId>,
#[prost(message, optional, tag="6")]
pub timestamp: ::std::option::Option<super::super::google::protobuf::Timestamp>,
#[prost(bytes, tag="7")]
pub signature: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::serde::Deserialize, ::serde::Serialize)]
pub struct SignedHeader {
#[prost(message, optional, tag="1")]
pub header: ::std::option::Option<Header>,
#[prost(message, optional, tag="2")]
pub commit: ::std::option::Option<Commit>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::serde::Deserialize, ::serde::Serialize)]
pub struct LightBlock {
#[prost(message, optional, tag="1")]
pub signed_header: ::std::option::Option<SignedHeader>,
#[prost(message, optional, tag="2")]
pub validator_set: ::std::option::Option<ValidatorSet>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::serde::Deserialize, ::serde::Serialize)]
pub struct BlockMeta {
#[prost(message, optional, tag="1")]
pub block_id: ::std::option::Option<BlockId>,
#[prost(int64, tag="2")]
#[serde(with = "crate::serializers::from_str")]
pub block_size: i64,
#[prost(message, optional, tag="3")]
pub header: ::std::option::Option<Header>,
#[prost(int64, tag="4")]
#[serde(with = "crate::serializers::from_str")]
pub num_txs: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::serde::Deserialize, ::serde::Serialize)]
pub struct TxProof {
#[prost(bytes, tag="1")]
#[serde(with = "crate::serializers::bytes::hexstring")]
pub root_hash: std::vec::Vec<u8>,
#[prost(bytes, tag="2")]
#[serde(with = "crate::serializers::bytes::base64string")]
pub data: std::vec::Vec<u8>,
#[prost(message, optional, tag="3")]
pub proof: ::std::option::Option<super::crypto::Proof>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
#[derive(::num_derive::FromPrimitive, ::num_derive::ToPrimitive)]
pub enum BlockIdFlag {
Unknown = 0,
Absent = 1,
Commit = 2,
Nil = 3,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SignedMsgType {
Unknown = 0,
Prevote = 1,
Precommit = 2,
Proposal = 32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventDataRoundState {
#[prost(int64, tag="1")]
pub height: i64,
#[prost(int32, tag="2")]
pub round: i32,
#[prost(string, tag="3")]
pub step: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConsensusParams {
#[prost(message, optional, tag="1")]
pub block: ::std::option::Option<BlockParams>,
#[prost(message, optional, tag="2")]
pub evidence: ::std::option::Option<EvidenceParams>,
#[prost(message, optional, tag="3")]
pub validator: ::std::option::Option<ValidatorParams>,
#[prost(message, optional, tag="4")]
pub version: ::std::option::Option<VersionParams>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlockParams {
#[prost(int64, tag="1")]
pub max_bytes: i64,
#[prost(int64, tag="2")]
pub max_gas: i64,
#[prost(int64, tag="3")]
pub time_iota_ms: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::serde::Deserialize, ::serde::Serialize)]
pub struct EvidenceParams {
#[prost(int64, tag="1")]
pub max_age_num_blocks: i64,
#[prost(message, optional, tag="2")]
pub max_age_duration: ::std::option::Option<super::super::google::protobuf::Duration>,
#[prost(int64, tag="3")]
#[serde(with = "crate::serializers::from_str", default)]
pub max_bytes: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorParams {
#[prost(string, repeated, tag="1")]
pub pub_key_types: ::std::vec::Vec<std::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VersionParams {
#[prost(uint64, tag="1")]
pub app_version: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HashedParams {
#[prost(int64, tag="1")]
pub block_max_bytes: i64,
#[prost(int64, tag="2")]
pub block_max_gas: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[serde(from = "crate::serializers::evidence::EvidenceVariant", into = "crate::serializers::evidence::EvidenceVariant")]
pub struct Evidence {
#[prost(oneof="evidence::Sum", tags="1, 2")]
pub sum: ::std::option::Option<evidence::Sum>,
}
pub mod evidence {
#[derive(Clone, PartialEq, ::prost::Oneof)]
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[serde(tag = "type", content = "value")]
#[serde(from = "crate::serializers::evidence::EvidenceVariant", into = "crate::serializers::evidence::EvidenceVariant")]
pub enum Sum {
#[prost(message, tag="1")]
#[serde(rename = "tendermint/DuplicateVoteEvidence")]
DuplicateVoteEvidence(super::DuplicateVoteEvidence),
#[prost(message, tag="2")]
#[serde(rename = "tendermint/LightClientAttackEvidence")]
LightClientAttackEvidence(super::LightClientAttackEvidence),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::serde::Deserialize, ::serde::Serialize)]
pub struct DuplicateVoteEvidence {
#[prost(message, optional, tag="1")]
pub vote_a: ::std::option::Option<Vote>,
#[prost(message, optional, tag="2")]
pub vote_b: ::std::option::Option<Vote>,
#[prost(int64, tag="3")]
pub total_voting_power: i64,
#[prost(int64, tag="4")]
pub validator_power: i64,
#[prost(message, optional, tag="5")]
pub timestamp: ::std::option::Option<super::super::google::protobuf::Timestamp>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::serde::Deserialize, ::serde::Serialize)]
pub struct LightClientAttackEvidence {
#[prost(message, optional, tag="1")]
pub conflicting_block: ::std::option::Option<LightBlock>,
#[prost(int64, tag="2")]
pub common_height: i64,
#[prost(message, repeated, tag="3")]
pub byzantine_validators: ::std::vec::Vec<Validator>,
#[prost(int64, tag="4")]
pub total_voting_power: i64,
#[prost(message, optional, tag="5")]
pub timestamp: ::std::option::Option<super::super::google::protobuf::Timestamp>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::serde::Deserialize, ::serde::Serialize)]
pub struct EvidenceList {
#[prost(message, repeated, tag="1")]
#[serde(with = "crate::serializers::nullable")]
pub evidence: ::std::vec::Vec<Evidence>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::serde::Deserialize, ::serde::Serialize)]
pub struct CanonicalBlockId {
#[prost(bytes, tag="1")]
pub hash: std::vec::Vec<u8>,
#[prost(message, optional, tag="2")]
#[serde(alias = "parts")]
pub part_set_header: ::std::option::Option<CanonicalPartSetHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::serde::Deserialize, ::serde::Serialize)]
pub struct CanonicalPartSetHeader {
#[prost(uint32, tag="1")]
pub total: u32,
#[prost(bytes, tag="2")]
pub hash: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CanonicalProposal {
#[prost(enumeration="SignedMsgType", tag="1")]
pub r#type: i32,
#[prost(sfixed64, tag="2")]
pub height: i64,
#[prost(sfixed64, tag="3")]
pub round: i64,
#[prost(int64, tag="4")]
pub pol_round: i64,
#[prost(message, optional, tag="5")]
pub block_id: ::std::option::Option<CanonicalBlockId>,
#[prost(message, optional, tag="6")]
pub timestamp: ::std::option::Option<super::super::google::protobuf::Timestamp>,
#[prost(string, tag="7")]
pub chain_id: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::serde::Deserialize, ::serde::Serialize)]
pub struct CanonicalVote {
#[prost(enumeration="SignedMsgType", tag="1")]
pub r#type: i32,
#[prost(sfixed64, tag="2")]
pub height: i64,
#[prost(sfixed64, tag="3")]
pub round: i64,
#[prost(message, optional, tag="4")]
pub block_id: ::std::option::Option<CanonicalBlockId>,
#[prost(message, optional, tag="5")]
pub timestamp: ::std::option::Option<super::super::google::protobuf::Timestamp>,
#[prost(string, tag="6")]
pub chain_id: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::serde::Deserialize, ::serde::Serialize)]
pub struct Block {
#[prost(message, optional, tag="1")]
pub header: ::std::option::Option<Header>,
#[prost(message, optional, tag="2")]
pub data: ::std::option::Option<Data>,
#[prost(message, optional, tag="3")]
pub evidence: ::std::option::Option<EvidenceList>,
#[prost(message, optional, tag="4")]
pub last_commit: ::std::option::Option<Commit>,
}