1#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct Request {
5 #[prost(
7 oneof = "request::Value",
8 tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15"
9 )]
10 pub value: ::core::option::Option<request::Value>,
11}
12pub mod request {
14 #[allow(clippy::derive_partial_eq_without_eq)]
16 #[derive(Clone, PartialEq, ::prost::Oneof)]
17 pub enum Value {
18 #[prost(message, tag = "1")]
19 Echo(super::RequestEcho),
20 #[prost(message, tag = "2")]
21 Flush(super::RequestFlush),
22 #[prost(message, tag = "3")]
23 Info(super::RequestInfo),
24 #[prost(message, tag = "4")]
25 SetOption(super::RequestSetOption),
26 #[prost(message, tag = "5")]
27 InitChain(super::RequestInitChain),
28 #[prost(message, tag = "6")]
29 Query(super::RequestQuery),
30 #[prost(message, tag = "7")]
31 BeginBlock(super::RequestBeginBlock),
32 #[prost(message, tag = "8")]
33 CheckTx(super::RequestCheckTx),
34 #[prost(message, tag = "9")]
35 DeliverTx(super::RequestDeliverTx),
36 #[prost(message, tag = "10")]
37 EndBlock(super::RequestEndBlock),
38 #[prost(message, tag = "11")]
39 Commit(super::RequestCommit),
40 #[prost(message, tag = "12")]
41 ListSnapshots(super::RequestListSnapshots),
42 #[prost(message, tag = "13")]
43 OfferSnapshot(super::RequestOfferSnapshot),
44 #[prost(message, tag = "14")]
45 LoadSnapshotChunk(super::RequestLoadSnapshotChunk),
46 #[prost(message, tag = "15")]
47 ApplySnapshotChunk(super::RequestApplySnapshotChunk),
48 }
49}
50#[allow(clippy::derive_partial_eq_without_eq)]
52#[derive(Clone, PartialEq, ::prost::Message)]
53pub struct RequestEcho {
54 #[prost(string, tag = "1")]
55 pub message: ::prost::alloc::string::String,
56}
57#[allow(clippy::derive_partial_eq_without_eq)]
59#[derive(Clone, PartialEq, ::prost::Message)]
60pub struct RequestFlush {}
61#[allow(clippy::derive_partial_eq_without_eq)]
63#[derive(Clone, PartialEq, ::prost::Message)]
64pub struct RequestInfo {
65 #[prost(string, tag = "1")]
66 pub version: ::prost::alloc::string::String,
67 #[prost(uint64, tag = "2")]
68 pub block_version: u64,
69 #[prost(uint64, tag = "3")]
70 pub p2p_version: u64,
71}
72#[allow(clippy::derive_partial_eq_without_eq)]
74#[derive(Clone, PartialEq, ::prost::Message)]
75pub struct RequestSetOption {
76 #[prost(string, tag = "1")]
77 pub key: ::prost::alloc::string::String,
78 #[prost(string, tag = "2")]
79 pub value: ::prost::alloc::string::String,
80}
81#[allow(clippy::derive_partial_eq_without_eq)]
83#[derive(Clone, PartialEq, ::prost::Message)]
84pub struct RequestInitChain {
85 #[prost(message, optional, tag = "1")]
86 pub time: ::core::option::Option<crate::google::protobuf::Timestamp>,
87 #[prost(string, tag = "2")]
88 pub chain_id: ::prost::alloc::string::String,
89 #[prost(message, optional, tag = "3")]
90 pub consensus_params: ::core::option::Option<ConsensusParams>,
91 #[prost(message, repeated, tag = "4")]
92 pub validators: ::prost::alloc::vec::Vec<ValidatorUpdate>,
93 #[prost(bytes = "bytes", tag = "5")]
94 pub app_state_bytes: ::prost::bytes::Bytes,
95 #[prost(int64, tag = "6")]
96 pub initial_height: i64,
97}
98#[allow(clippy::derive_partial_eq_without_eq)]
100#[derive(Clone, PartialEq, ::prost::Message)]
101pub struct RequestQuery {
102 #[prost(bytes = "bytes", tag = "1")]
103 pub data: ::prost::bytes::Bytes,
104 #[prost(string, tag = "2")]
105 pub path: ::prost::alloc::string::String,
106 #[prost(int64, tag = "3")]
107 pub height: i64,
108 #[prost(bool, tag = "4")]
109 pub prove: bool,
110}
111#[allow(clippy::derive_partial_eq_without_eq)]
113#[derive(Clone, PartialEq, ::prost::Message)]
114pub struct RequestBeginBlock {
115 #[prost(bytes = "bytes", tag = "1")]
116 pub hash: ::prost::bytes::Bytes,
117 #[prost(message, optional, tag = "2")]
118 pub header: ::core::option::Option<super::super::types::v1beta1::Header>,
119 #[prost(message, optional, tag = "3")]
120 pub last_commit_info: ::core::option::Option<LastCommitInfo>,
121 #[prost(message, repeated, tag = "4")]
122 pub byzantine_validators: ::prost::alloc::vec::Vec<Evidence>,
123}
124#[allow(clippy::derive_partial_eq_without_eq)]
126#[derive(Clone, PartialEq, ::prost::Message)]
127pub struct RequestCheckTx {
128 #[prost(bytes = "bytes", tag = "1")]
129 pub tx: ::prost::bytes::Bytes,
130 #[prost(enumeration = "CheckTxType", tag = "2")]
131 pub r#type: i32,
132}
133#[allow(clippy::derive_partial_eq_without_eq)]
135#[derive(Clone, PartialEq, ::prost::Message)]
136pub struct RequestDeliverTx {
137 #[prost(bytes = "bytes", tag = "1")]
138 pub tx: ::prost::bytes::Bytes,
139}
140#[allow(clippy::derive_partial_eq_without_eq)]
142#[derive(Clone, PartialEq, ::prost::Message)]
143pub struct RequestEndBlock {
144 #[prost(int64, tag = "1")]
145 pub height: i64,
146}
147#[allow(clippy::derive_partial_eq_without_eq)]
149#[derive(Clone, PartialEq, ::prost::Message)]
150pub struct RequestCommit {}
151#[allow(clippy::derive_partial_eq_without_eq)]
153#[derive(Clone, PartialEq, ::prost::Message)]
154pub struct RequestListSnapshots {}
155#[allow(clippy::derive_partial_eq_without_eq)]
157#[derive(Clone, PartialEq, ::prost::Message)]
158pub struct RequestOfferSnapshot {
159 #[prost(message, optional, tag = "1")]
161 pub snapshot: ::core::option::Option<Snapshot>,
162 #[prost(bytes = "bytes", tag = "2")]
164 pub app_hash: ::prost::bytes::Bytes,
165}
166#[allow(clippy::derive_partial_eq_without_eq)]
168#[derive(Clone, PartialEq, ::prost::Message)]
169pub struct RequestLoadSnapshotChunk {
170 #[prost(uint64, tag = "1")]
171 pub height: u64,
172 #[prost(uint32, tag = "2")]
173 pub format: u32,
174 #[prost(uint32, tag = "3")]
175 pub chunk: u32,
176}
177#[allow(clippy::derive_partial_eq_without_eq)]
179#[derive(Clone, PartialEq, ::prost::Message)]
180pub struct RequestApplySnapshotChunk {
181 #[prost(uint32, tag = "1")]
182 pub index: u32,
183 #[prost(bytes = "bytes", tag = "2")]
184 pub chunk: ::prost::bytes::Bytes,
185 #[prost(string, tag = "3")]
186 pub sender: ::prost::alloc::string::String,
187}
188#[allow(clippy::derive_partial_eq_without_eq)]
190#[derive(Clone, PartialEq, ::prost::Message)]
191pub struct Response {
192 #[prost(
194 oneof = "response::Value",
195 tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16"
196 )]
197 pub value: ::core::option::Option<response::Value>,
198}
199pub mod response {
201 #[allow(clippy::derive_partial_eq_without_eq)]
203 #[derive(Clone, PartialEq, ::prost::Oneof)]
204 pub enum Value {
205 #[prost(message, tag = "1")]
206 Exception(super::ResponseException),
207 #[prost(message, tag = "2")]
208 Echo(super::ResponseEcho),
209 #[prost(message, tag = "3")]
210 Flush(super::ResponseFlush),
211 #[prost(message, tag = "4")]
212 Info(super::ResponseInfo),
213 #[prost(message, tag = "5")]
214 SetOption(super::ResponseSetOption),
215 #[prost(message, tag = "6")]
216 InitChain(super::ResponseInitChain),
217 #[prost(message, tag = "7")]
218 Query(super::ResponseQuery),
219 #[prost(message, tag = "8")]
220 BeginBlock(super::ResponseBeginBlock),
221 #[prost(message, tag = "9")]
222 CheckTx(super::ResponseCheckTx),
223 #[prost(message, tag = "10")]
224 DeliverTx(super::ResponseDeliverTx),
225 #[prost(message, tag = "11")]
226 EndBlock(super::ResponseEndBlock),
227 #[prost(message, tag = "12")]
228 Commit(super::ResponseCommit),
229 #[prost(message, tag = "13")]
230 ListSnapshots(super::ResponseListSnapshots),
231 #[prost(message, tag = "14")]
232 OfferSnapshot(super::ResponseOfferSnapshot),
233 #[prost(message, tag = "15")]
234 LoadSnapshotChunk(super::ResponseLoadSnapshotChunk),
235 #[prost(message, tag = "16")]
236 ApplySnapshotChunk(super::ResponseApplySnapshotChunk),
237 }
238}
239#[allow(clippy::derive_partial_eq_without_eq)]
241#[derive(Clone, PartialEq, ::prost::Message)]
242pub struct ResponseException {
243 #[prost(string, tag = "1")]
244 pub error: ::prost::alloc::string::String,
245}
246#[allow(clippy::derive_partial_eq_without_eq)]
248#[derive(Clone, PartialEq, ::prost::Message)]
249pub struct ResponseEcho {
250 #[prost(string, tag = "1")]
251 pub message: ::prost::alloc::string::String,
252}
253#[allow(clippy::derive_partial_eq_without_eq)]
255#[derive(Clone, PartialEq, ::prost::Message)]
256pub struct ResponseFlush {}
257#[derive(::serde::Deserialize, ::serde::Serialize)]
259#[allow(clippy::derive_partial_eq_without_eq)]
260#[derive(Clone, PartialEq, ::prost::Message)]
261pub struct ResponseInfo {
262 #[prost(string, tag = "1")]
263 #[serde(default)]
264 pub data: ::prost::alloc::string::String,
265 #[prost(string, tag = "2")]
266 #[serde(default)]
267 pub version: ::prost::alloc::string::String,
268 #[prost(uint64, tag = "3")]
269 #[serde(with = "crate::serializers::from_str", default)]
270 pub app_version: u64,
271 #[prost(int64, tag = "4")]
272 #[serde(with = "crate::serializers::from_str", default)]
273 pub last_block_height: i64,
274 #[prost(bytes = "bytes", tag = "5")]
275 #[serde(default)]
276 #[serde(skip_serializing_if = "bytes::Bytes::is_empty")]
277 pub last_block_app_hash: ::prost::bytes::Bytes,
278}
279#[allow(clippy::derive_partial_eq_without_eq)]
281#[derive(Clone, PartialEq, ::prost::Message)]
282pub struct ResponseSetOption {
283 #[prost(uint32, tag = "1")]
284 pub code: u32,
285 #[prost(string, tag = "3")]
287 pub log: ::prost::alloc::string::String,
288 #[prost(string, tag = "4")]
289 pub info: ::prost::alloc::string::String,
290}
291#[allow(clippy::derive_partial_eq_without_eq)]
294#[derive(Clone, PartialEq, ::prost::Message)]
295pub struct ResponseInitChain {
296 #[prost(message, optional, tag = "1")]
297 pub consensus_params: ::core::option::Option<ConsensusParams>,
298 #[prost(message, repeated, tag = "2")]
299 pub validators: ::prost::alloc::vec::Vec<ValidatorUpdate>,
300 #[prost(bytes = "bytes", tag = "3")]
301 pub app_hash: ::prost::bytes::Bytes,
302}
303#[allow(clippy::derive_partial_eq_without_eq)]
305#[derive(Clone, PartialEq, ::prost::Message)]
306pub struct ResponseQuery {
307 #[prost(uint32, tag = "1")]
308 pub code: u32,
309 #[prost(string, tag = "3")]
313 pub log: ::prost::alloc::string::String,
314 #[prost(string, tag = "4")]
316 pub info: ::prost::alloc::string::String,
317 #[prost(int64, tag = "5")]
318 pub index: i64,
319 #[prost(bytes = "bytes", tag = "6")]
320 pub key: ::prost::bytes::Bytes,
321 #[prost(bytes = "bytes", tag = "7")]
322 pub value: ::prost::bytes::Bytes,
323 #[prost(message, optional, tag = "8")]
324 pub proof_ops: ::core::option::Option<super::super::crypto::v1::ProofOps>,
325 #[prost(int64, tag = "9")]
326 pub height: i64,
327 #[prost(string, tag = "10")]
328 pub codespace: ::prost::alloc::string::String,
329}
330#[allow(clippy::derive_partial_eq_without_eq)]
332#[derive(Clone, PartialEq, ::prost::Message)]
333pub struct ResponseBeginBlock {
334 #[prost(message, repeated, tag = "1")]
335 pub events: ::prost::alloc::vec::Vec<Event>,
336}
337#[allow(clippy::derive_partial_eq_without_eq)]
340#[derive(Clone, PartialEq, ::prost::Message)]
341pub struct ResponseCheckTx {
342 #[prost(uint32, tag = "1")]
343 pub code: u32,
344 #[prost(bytes = "bytes", tag = "2")]
345 pub data: ::prost::bytes::Bytes,
346 #[prost(string, tag = "3")]
348 pub log: ::prost::alloc::string::String,
349 #[prost(string, tag = "4")]
351 pub info: ::prost::alloc::string::String,
352 #[prost(int64, tag = "5")]
353 pub gas_wanted: i64,
354 #[prost(int64, tag = "6")]
355 pub gas_used: i64,
356 #[prost(message, repeated, tag = "7")]
357 pub events: ::prost::alloc::vec::Vec<Event>,
358 #[prost(string, tag = "8")]
359 pub codespace: ::prost::alloc::string::String,
360 #[prost(string, tag = "9")]
361 pub sender: ::prost::alloc::string::String,
362 #[prost(int64, tag = "10")]
363 pub priority: i64,
364 #[prost(string, tag = "11")]
367 pub mempool_error: ::prost::alloc::string::String,
368}
369#[allow(clippy::derive_partial_eq_without_eq)]
372#[derive(Clone, PartialEq, ::prost::Message)]
373pub struct ResponseDeliverTx {
374 #[prost(uint32, tag = "1")]
375 pub code: u32,
376 #[prost(bytes = "bytes", tag = "2")]
377 pub data: ::prost::bytes::Bytes,
378 #[prost(string, tag = "3")]
380 pub log: ::prost::alloc::string::String,
381 #[prost(string, tag = "4")]
383 pub info: ::prost::alloc::string::String,
384 #[prost(int64, tag = "5")]
385 pub gas_wanted: i64,
386 #[prost(int64, tag = "6")]
387 pub gas_used: i64,
388 #[prost(message, repeated, tag = "7")]
390 pub events: ::prost::alloc::vec::Vec<Event>,
391 #[prost(string, tag = "8")]
392 pub codespace: ::prost::alloc::string::String,
393}
394#[allow(clippy::derive_partial_eq_without_eq)]
396#[derive(Clone, PartialEq, ::prost::Message)]
397pub struct ResponseEndBlock {
398 #[prost(message, repeated, tag = "1")]
399 pub validator_updates: ::prost::alloc::vec::Vec<ValidatorUpdate>,
400 #[prost(message, optional, tag = "2")]
401 pub consensus_param_updates: ::core::option::Option<ConsensusParams>,
402 #[prost(message, repeated, tag = "3")]
403 pub events: ::prost::alloc::vec::Vec<Event>,
404}
405#[allow(clippy::derive_partial_eq_without_eq)]
407#[derive(Clone, PartialEq, ::prost::Message)]
408pub struct ResponseCommit {
409 #[prost(bytes = "bytes", tag = "2")]
411 pub data: ::prost::bytes::Bytes,
412 #[prost(int64, tag = "3")]
413 pub retain_height: i64,
414}
415#[allow(clippy::derive_partial_eq_without_eq)]
417#[derive(Clone, PartialEq, ::prost::Message)]
418pub struct ResponseListSnapshots {
419 #[prost(message, repeated, tag = "1")]
420 pub snapshots: ::prost::alloc::vec::Vec<Snapshot>,
421}
422#[allow(clippy::derive_partial_eq_without_eq)]
425#[derive(Clone, PartialEq, ::prost::Message)]
426pub struct ResponseOfferSnapshot {
427 #[prost(enumeration = "response_offer_snapshot::Result", tag = "1")]
428 pub result: i32,
429}
430pub mod response_offer_snapshot {
432 #[derive(
434 Clone,
435 Copy,
436 Debug,
437 PartialEq,
438 Eq,
439 Hash,
440 PartialOrd,
441 Ord,
442 ::prost::Enumeration
443 )]
444 #[repr(i32)]
445 pub enum Result {
446 Unknown = 0,
448 Accept = 1,
450 Abort = 2,
452 Reject = 3,
454 RejectFormat = 4,
456 RejectSender = 5,
458 }
459 impl Result {
460 pub fn as_str_name(&self) -> &'static str {
465 match self {
466 Result::Unknown => "UNKNOWN",
467 Result::Accept => "ACCEPT",
468 Result::Abort => "ABORT",
469 Result::Reject => "REJECT",
470 Result::RejectFormat => "REJECT_FORMAT",
471 Result::RejectSender => "REJECT_SENDER",
472 }
473 }
474 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
476 match value {
477 "UNKNOWN" => Some(Self::Unknown),
478 "ACCEPT" => Some(Self::Accept),
479 "ABORT" => Some(Self::Abort),
480 "REJECT" => Some(Self::Reject),
481 "REJECT_FORMAT" => Some(Self::RejectFormat),
482 "REJECT_SENDER" => Some(Self::RejectSender),
483 _ => None,
484 }
485 }
486 }
487}
488#[allow(clippy::derive_partial_eq_without_eq)]
490#[derive(Clone, PartialEq, ::prost::Message)]
491pub struct ResponseLoadSnapshotChunk {
492 #[prost(bytes = "bytes", tag = "1")]
493 pub chunk: ::prost::bytes::Bytes,
494}
495#[allow(clippy::derive_partial_eq_without_eq)]
497#[derive(Clone, PartialEq, ::prost::Message)]
498pub struct ResponseApplySnapshotChunk {
499 #[prost(enumeration = "response_apply_snapshot_chunk::Result", tag = "1")]
500 pub result: i32,
501 #[prost(uint32, repeated, tag = "2")]
503 pub refetch_chunks: ::prost::alloc::vec::Vec<u32>,
504 #[prost(string, repeated, tag = "3")]
506 pub reject_senders: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
507}
508pub mod response_apply_snapshot_chunk {
510 #[derive(
512 Clone,
513 Copy,
514 Debug,
515 PartialEq,
516 Eq,
517 Hash,
518 PartialOrd,
519 Ord,
520 ::prost::Enumeration
521 )]
522 #[repr(i32)]
523 pub enum Result {
524 Unknown = 0,
526 Accept = 1,
528 Abort = 2,
530 Retry = 3,
532 RetrySnapshot = 4,
534 RejectSnapshot = 5,
536 }
537 impl Result {
538 pub fn as_str_name(&self) -> &'static str {
543 match self {
544 Result::Unknown => "UNKNOWN",
545 Result::Accept => "ACCEPT",
546 Result::Abort => "ABORT",
547 Result::Retry => "RETRY",
548 Result::RetrySnapshot => "RETRY_SNAPSHOT",
549 Result::RejectSnapshot => "REJECT_SNAPSHOT",
550 }
551 }
552 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
554 match value {
555 "UNKNOWN" => Some(Self::Unknown),
556 "ACCEPT" => Some(Self::Accept),
557 "ABORT" => Some(Self::Abort),
558 "RETRY" => Some(Self::Retry),
559 "RETRY_SNAPSHOT" => Some(Self::RetrySnapshot),
560 "REJECT_SNAPSHOT" => Some(Self::RejectSnapshot),
561 _ => None,
562 }
563 }
564 }
565}
566#[allow(clippy::derive_partial_eq_without_eq)]
569#[derive(Clone, PartialEq, ::prost::Message)]
570pub struct ConsensusParams {
571 #[prost(message, optional, tag = "1")]
572 pub block: ::core::option::Option<BlockParams>,
573 #[prost(message, optional, tag = "2")]
574 pub evidence: ::core::option::Option<super::super::types::v1beta1::EvidenceParams>,
575 #[prost(message, optional, tag = "3")]
576 pub validator: ::core::option::Option<super::super::types::v1beta1::ValidatorParams>,
577 #[prost(message, optional, tag = "4")]
578 pub version: ::core::option::Option<super::super::types::v1beta1::VersionParams>,
579}
580#[allow(clippy::derive_partial_eq_without_eq)]
582#[derive(Clone, PartialEq, ::prost::Message)]
583pub struct BlockParams {
584 #[prost(int64, tag = "1")]
586 pub max_bytes: i64,
587 #[prost(int64, tag = "2")]
589 pub max_gas: i64,
590}
591#[allow(clippy::derive_partial_eq_without_eq)]
593#[derive(Clone, PartialEq, ::prost::Message)]
594pub struct LastCommitInfo {
595 #[prost(int32, tag = "1")]
596 pub round: i32,
597 #[prost(message, repeated, tag = "2")]
598 pub votes: ::prost::alloc::vec::Vec<VoteInfo>,
599}
600#[allow(clippy::derive_partial_eq_without_eq)]
604#[derive(Clone, PartialEq, ::prost::Message)]
605pub struct Event {
606 #[prost(string, tag = "1")]
607 pub r#type: ::prost::alloc::string::String,
608 #[prost(message, repeated, tag = "2")]
609 pub attributes: ::prost::alloc::vec::Vec<EventAttribute>,
610}
611#[allow(clippy::derive_partial_eq_without_eq)]
613#[derive(Clone, PartialEq, ::prost::Message)]
614pub struct EventAttribute {
615 #[prost(bytes = "bytes", tag = "1")]
616 pub key: ::prost::bytes::Bytes,
617 #[prost(bytes = "bytes", tag = "2")]
618 pub value: ::prost::bytes::Bytes,
619 #[prost(bool, tag = "3")]
621 pub index: bool,
622}
623#[allow(clippy::derive_partial_eq_without_eq)]
627#[derive(Clone, PartialEq, ::prost::Message)]
628pub struct TxResult {
629 #[prost(int64, tag = "1")]
630 pub height: i64,
631 #[prost(uint32, tag = "2")]
632 pub index: u32,
633 #[prost(bytes = "bytes", tag = "3")]
634 pub tx: ::prost::bytes::Bytes,
635 #[prost(message, optional, tag = "4")]
636 pub result: ::core::option::Option<ResponseDeliverTx>,
637}
638#[allow(clippy::derive_partial_eq_without_eq)]
640#[derive(Clone, PartialEq, ::prost::Message)]
641pub struct Validator {
642 #[prost(bytes = "bytes", tag = "1")]
644 pub address: ::prost::bytes::Bytes,
645 #[prost(int64, tag = "3")]
649 pub power: i64,
650}
651#[allow(clippy::derive_partial_eq_without_eq)]
653#[derive(Clone, PartialEq, ::prost::Message)]
654pub struct ValidatorUpdate {
655 #[prost(message, optional, tag = "1")]
656 pub pub_key: ::core::option::Option<super::super::crypto::v1::PublicKey>,
657 #[prost(int64, tag = "2")]
658 pub power: i64,
659}
660#[allow(clippy::derive_partial_eq_without_eq)]
662#[derive(Clone, PartialEq, ::prost::Message)]
663pub struct VoteInfo {
664 #[prost(message, optional, tag = "1")]
665 pub validator: ::core::option::Option<Validator>,
666 #[prost(bool, tag = "2")]
667 pub signed_last_block: bool,
668}
669#[allow(clippy::derive_partial_eq_without_eq)]
671#[derive(Clone, PartialEq, ::prost::Message)]
672pub struct Evidence {
673 #[prost(enumeration = "EvidenceType", tag = "1")]
674 pub r#type: i32,
675 #[prost(message, optional, tag = "2")]
677 pub validator: ::core::option::Option<Validator>,
678 #[prost(int64, tag = "3")]
680 pub height: i64,
681 #[prost(message, optional, tag = "4")]
683 pub time: ::core::option::Option<crate::google::protobuf::Timestamp>,
684 #[prost(int64, tag = "5")]
688 pub total_voting_power: i64,
689}
690#[allow(clippy::derive_partial_eq_without_eq)]
692#[derive(Clone, PartialEq, ::prost::Message)]
693pub struct Snapshot {
694 #[prost(uint64, tag = "1")]
696 pub height: u64,
697 #[prost(uint32, tag = "2")]
699 pub format: u32,
700 #[prost(uint32, tag = "3")]
702 pub chunks: u32,
703 #[prost(bytes = "bytes", tag = "4")]
705 pub hash: ::prost::bytes::Bytes,
706 #[prost(bytes = "bytes", tag = "5")]
708 pub metadata: ::prost::bytes::Bytes,
709}
710#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
712#[repr(i32)]
713pub enum CheckTxType {
714 New = 0,
716 Recheck = 1,
718}
719impl CheckTxType {
720 pub fn as_str_name(&self) -> &'static str {
725 match self {
726 CheckTxType::New => "NEW",
727 CheckTxType::Recheck => "RECHECK",
728 }
729 }
730 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
732 match value {
733 "NEW" => Some(Self::New),
734 "RECHECK" => Some(Self::Recheck),
735 _ => None,
736 }
737 }
738}
739#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
741#[repr(i32)]
742pub enum EvidenceType {
743 Unknown = 0,
745 DuplicateVote = 1,
747 LightClientAttack = 2,
749}
750impl EvidenceType {
751 pub fn as_str_name(&self) -> &'static str {
756 match self {
757 EvidenceType::Unknown => "UNKNOWN",
758 EvidenceType::DuplicateVote => "DUPLICATE_VOTE",
759 EvidenceType::LightClientAttack => "LIGHT_CLIENT_ATTACK",
760 }
761 }
762 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
764 match value {
765 "UNKNOWN" => Some(Self::Unknown),
766 "DUPLICATE_VOTE" => Some(Self::DuplicateVote),
767 "LIGHT_CLIENT_ATTACK" => Some(Self::LightClientAttack),
768 _ => None,
769 }
770 }
771}
772#[cfg(feature = "grpc-server")]
774pub mod abci_application_server {
775 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
776 use tonic::codegen::*;
777 #[async_trait]
779 pub trait AbciApplication: Send + Sync + 'static {
780 async fn echo(
782 &self,
783 request: tonic::Request<super::RequestEcho>,
784 ) -> std::result::Result<tonic::Response<super::ResponseEcho>, tonic::Status>;
785 async fn flush(
787 &self,
788 request: tonic::Request<super::RequestFlush>,
789 ) -> std::result::Result<tonic::Response<super::ResponseFlush>, tonic::Status>;
790 async fn info(
792 &self,
793 request: tonic::Request<super::RequestInfo>,
794 ) -> std::result::Result<tonic::Response<super::ResponseInfo>, tonic::Status>;
795 async fn set_option(
797 &self,
798 request: tonic::Request<super::RequestSetOption>,
799 ) -> std::result::Result<
800 tonic::Response<super::ResponseSetOption>,
801 tonic::Status,
802 >;
803 async fn deliver_tx(
805 &self,
806 request: tonic::Request<super::RequestDeliverTx>,
807 ) -> std::result::Result<
808 tonic::Response<super::ResponseDeliverTx>,
809 tonic::Status,
810 >;
811 async fn check_tx(
813 &self,
814 request: tonic::Request<super::RequestCheckTx>,
815 ) -> std::result::Result<tonic::Response<super::ResponseCheckTx>, tonic::Status>;
816 async fn query(
818 &self,
819 request: tonic::Request<super::RequestQuery>,
820 ) -> std::result::Result<tonic::Response<super::ResponseQuery>, tonic::Status>;
821 async fn commit(
823 &self,
824 request: tonic::Request<super::RequestCommit>,
825 ) -> std::result::Result<tonic::Response<super::ResponseCommit>, tonic::Status>;
826 async fn init_chain(
828 &self,
829 request: tonic::Request<super::RequestInitChain>,
830 ) -> std::result::Result<
831 tonic::Response<super::ResponseInitChain>,
832 tonic::Status,
833 >;
834 async fn begin_block(
836 &self,
837 request: tonic::Request<super::RequestBeginBlock>,
838 ) -> std::result::Result<
839 tonic::Response<super::ResponseBeginBlock>,
840 tonic::Status,
841 >;
842 async fn end_block(
844 &self,
845 request: tonic::Request<super::RequestEndBlock>,
846 ) -> std::result::Result<
847 tonic::Response<super::ResponseEndBlock>,
848 tonic::Status,
849 >;
850 async fn list_snapshots(
852 &self,
853 request: tonic::Request<super::RequestListSnapshots>,
854 ) -> std::result::Result<
855 tonic::Response<super::ResponseListSnapshots>,
856 tonic::Status,
857 >;
858 async fn offer_snapshot(
860 &self,
861 request: tonic::Request<super::RequestOfferSnapshot>,
862 ) -> std::result::Result<
863 tonic::Response<super::ResponseOfferSnapshot>,
864 tonic::Status,
865 >;
866 async fn load_snapshot_chunk(
868 &self,
869 request: tonic::Request<super::RequestLoadSnapshotChunk>,
870 ) -> std::result::Result<
871 tonic::Response<super::ResponseLoadSnapshotChunk>,
872 tonic::Status,
873 >;
874 async fn apply_snapshot_chunk(
876 &self,
877 request: tonic::Request<super::RequestApplySnapshotChunk>,
878 ) -> std::result::Result<
879 tonic::Response<super::ResponseApplySnapshotChunk>,
880 tonic::Status,
881 >;
882 }
883 #[derive(Debug)]
885 pub struct AbciApplicationServer<T: AbciApplication> {
886 inner: _Inner<T>,
887 accept_compression_encodings: EnabledCompressionEncodings,
888 send_compression_encodings: EnabledCompressionEncodings,
889 max_decoding_message_size: Option<usize>,
890 max_encoding_message_size: Option<usize>,
891 }
892 struct _Inner<T>(Arc<T>);
893 impl<T: AbciApplication> AbciApplicationServer<T> {
894 pub fn new(inner: T) -> Self {
895 Self::from_arc(Arc::new(inner))
896 }
897 pub fn from_arc(inner: Arc<T>) -> Self {
898 let inner = _Inner(inner);
899 Self {
900 inner,
901 accept_compression_encodings: Default::default(),
902 send_compression_encodings: Default::default(),
903 max_decoding_message_size: None,
904 max_encoding_message_size: None,
905 }
906 }
907 pub fn with_interceptor<F>(
908 inner: T,
909 interceptor: F,
910 ) -> InterceptedService<Self, F>
911 where
912 F: tonic::service::Interceptor,
913 {
914 InterceptedService::new(Self::new(inner), interceptor)
915 }
916 #[must_use]
918 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
919 self.accept_compression_encodings.enable(encoding);
920 self
921 }
922 #[must_use]
924 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
925 self.send_compression_encodings.enable(encoding);
926 self
927 }
928 #[must_use]
932 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
933 self.max_decoding_message_size = Some(limit);
934 self
935 }
936 #[must_use]
940 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
941 self.max_encoding_message_size = Some(limit);
942 self
943 }
944 }
945 impl<T, B> tonic::codegen::Service<http::Request<B>> for AbciApplicationServer<T>
946 where
947 T: AbciApplication,
948 B: Body + Send + 'static,
949 B::Error: Into<StdError> + Send + 'static,
950 {
951 type Response = http::Response<tonic::body::BoxBody>;
952 type Error = std::convert::Infallible;
953 type Future = BoxFuture<Self::Response, Self::Error>;
954 fn poll_ready(
955 &mut self,
956 _cx: &mut Context<'_>,
957 ) -> Poll<std::result::Result<(), Self::Error>> {
958 Poll::Ready(Ok(()))
959 }
960 fn call(&mut self, req: http::Request<B>) -> Self::Future {
961 let inner = self.inner.clone();
962 match req.uri().path() {
963 "/cometbft.abci.v1beta1.ABCIApplication/Echo" => {
964 #[allow(non_camel_case_types)]
965 struct EchoSvc<T: AbciApplication>(pub Arc<T>);
966 impl<
967 T: AbciApplication,
968 > tonic::server::UnaryService<super::RequestEcho> for EchoSvc<T> {
969 type Response = super::ResponseEcho;
970 type Future = BoxFuture<
971 tonic::Response<Self::Response>,
972 tonic::Status,
973 >;
974 fn call(
975 &mut self,
976 request: tonic::Request<super::RequestEcho>,
977 ) -> Self::Future {
978 let inner = Arc::clone(&self.0);
979 let fut = async move {
980 <T as AbciApplication>::echo(&inner, request).await
981 };
982 Box::pin(fut)
983 }
984 }
985 let accept_compression_encodings = self.accept_compression_encodings;
986 let send_compression_encodings = self.send_compression_encodings;
987 let max_decoding_message_size = self.max_decoding_message_size;
988 let max_encoding_message_size = self.max_encoding_message_size;
989 let inner = self.inner.clone();
990 let fut = async move {
991 let inner = inner.0;
992 let method = EchoSvc(inner);
993 let codec = tonic::codec::ProstCodec::default();
994 let mut grpc = tonic::server::Grpc::new(codec)
995 .apply_compression_config(
996 accept_compression_encodings,
997 send_compression_encodings,
998 )
999 .apply_max_message_size_config(
1000 max_decoding_message_size,
1001 max_encoding_message_size,
1002 );
1003 let res = grpc.unary(method, req).await;
1004 Ok(res)
1005 };
1006 Box::pin(fut)
1007 }
1008 "/cometbft.abci.v1beta1.ABCIApplication/Flush" => {
1009 #[allow(non_camel_case_types)]
1010 struct FlushSvc<T: AbciApplication>(pub Arc<T>);
1011 impl<
1012 T: AbciApplication,
1013 > tonic::server::UnaryService<super::RequestFlush> for FlushSvc<T> {
1014 type Response = super::ResponseFlush;
1015 type Future = BoxFuture<
1016 tonic::Response<Self::Response>,
1017 tonic::Status,
1018 >;
1019 fn call(
1020 &mut self,
1021 request: tonic::Request<super::RequestFlush>,
1022 ) -> Self::Future {
1023 let inner = Arc::clone(&self.0);
1024 let fut = async move {
1025 <T as AbciApplication>::flush(&inner, request).await
1026 };
1027 Box::pin(fut)
1028 }
1029 }
1030 let accept_compression_encodings = self.accept_compression_encodings;
1031 let send_compression_encodings = self.send_compression_encodings;
1032 let max_decoding_message_size = self.max_decoding_message_size;
1033 let max_encoding_message_size = self.max_encoding_message_size;
1034 let inner = self.inner.clone();
1035 let fut = async move {
1036 let inner = inner.0;
1037 let method = FlushSvc(inner);
1038 let codec = tonic::codec::ProstCodec::default();
1039 let mut grpc = tonic::server::Grpc::new(codec)
1040 .apply_compression_config(
1041 accept_compression_encodings,
1042 send_compression_encodings,
1043 )
1044 .apply_max_message_size_config(
1045 max_decoding_message_size,
1046 max_encoding_message_size,
1047 );
1048 let res = grpc.unary(method, req).await;
1049 Ok(res)
1050 };
1051 Box::pin(fut)
1052 }
1053 "/cometbft.abci.v1beta1.ABCIApplication/Info" => {
1054 #[allow(non_camel_case_types)]
1055 struct InfoSvc<T: AbciApplication>(pub Arc<T>);
1056 impl<
1057 T: AbciApplication,
1058 > tonic::server::UnaryService<super::RequestInfo> for InfoSvc<T> {
1059 type Response = super::ResponseInfo;
1060 type Future = BoxFuture<
1061 tonic::Response<Self::Response>,
1062 tonic::Status,
1063 >;
1064 fn call(
1065 &mut self,
1066 request: tonic::Request<super::RequestInfo>,
1067 ) -> Self::Future {
1068 let inner = Arc::clone(&self.0);
1069 let fut = async move {
1070 <T as AbciApplication>::info(&inner, request).await
1071 };
1072 Box::pin(fut)
1073 }
1074 }
1075 let accept_compression_encodings = self.accept_compression_encodings;
1076 let send_compression_encodings = self.send_compression_encodings;
1077 let max_decoding_message_size = self.max_decoding_message_size;
1078 let max_encoding_message_size = self.max_encoding_message_size;
1079 let inner = self.inner.clone();
1080 let fut = async move {
1081 let inner = inner.0;
1082 let method = InfoSvc(inner);
1083 let codec = tonic::codec::ProstCodec::default();
1084 let mut grpc = tonic::server::Grpc::new(codec)
1085 .apply_compression_config(
1086 accept_compression_encodings,
1087 send_compression_encodings,
1088 )
1089 .apply_max_message_size_config(
1090 max_decoding_message_size,
1091 max_encoding_message_size,
1092 );
1093 let res = grpc.unary(method, req).await;
1094 Ok(res)
1095 };
1096 Box::pin(fut)
1097 }
1098 "/cometbft.abci.v1beta1.ABCIApplication/SetOption" => {
1099 #[allow(non_camel_case_types)]
1100 struct SetOptionSvc<T: AbciApplication>(pub Arc<T>);
1101 impl<
1102 T: AbciApplication,
1103 > tonic::server::UnaryService<super::RequestSetOption>
1104 for SetOptionSvc<T> {
1105 type Response = super::ResponseSetOption;
1106 type Future = BoxFuture<
1107 tonic::Response<Self::Response>,
1108 tonic::Status,
1109 >;
1110 fn call(
1111 &mut self,
1112 request: tonic::Request<super::RequestSetOption>,
1113 ) -> Self::Future {
1114 let inner = Arc::clone(&self.0);
1115 let fut = async move {
1116 <T as AbciApplication>::set_option(&inner, request).await
1117 };
1118 Box::pin(fut)
1119 }
1120 }
1121 let accept_compression_encodings = self.accept_compression_encodings;
1122 let send_compression_encodings = self.send_compression_encodings;
1123 let max_decoding_message_size = self.max_decoding_message_size;
1124 let max_encoding_message_size = self.max_encoding_message_size;
1125 let inner = self.inner.clone();
1126 let fut = async move {
1127 let inner = inner.0;
1128 let method = SetOptionSvc(inner);
1129 let codec = tonic::codec::ProstCodec::default();
1130 let mut grpc = tonic::server::Grpc::new(codec)
1131 .apply_compression_config(
1132 accept_compression_encodings,
1133 send_compression_encodings,
1134 )
1135 .apply_max_message_size_config(
1136 max_decoding_message_size,
1137 max_encoding_message_size,
1138 );
1139 let res = grpc.unary(method, req).await;
1140 Ok(res)
1141 };
1142 Box::pin(fut)
1143 }
1144 "/cometbft.abci.v1beta1.ABCIApplication/DeliverTx" => {
1145 #[allow(non_camel_case_types)]
1146 struct DeliverTxSvc<T: AbciApplication>(pub Arc<T>);
1147 impl<
1148 T: AbciApplication,
1149 > tonic::server::UnaryService<super::RequestDeliverTx>
1150 for DeliverTxSvc<T> {
1151 type Response = super::ResponseDeliverTx;
1152 type Future = BoxFuture<
1153 tonic::Response<Self::Response>,
1154 tonic::Status,
1155 >;
1156 fn call(
1157 &mut self,
1158 request: tonic::Request<super::RequestDeliverTx>,
1159 ) -> Self::Future {
1160 let inner = Arc::clone(&self.0);
1161 let fut = async move {
1162 <T as AbciApplication>::deliver_tx(&inner, request).await
1163 };
1164 Box::pin(fut)
1165 }
1166 }
1167 let accept_compression_encodings = self.accept_compression_encodings;
1168 let send_compression_encodings = self.send_compression_encodings;
1169 let max_decoding_message_size = self.max_decoding_message_size;
1170 let max_encoding_message_size = self.max_encoding_message_size;
1171 let inner = self.inner.clone();
1172 let fut = async move {
1173 let inner = inner.0;
1174 let method = DeliverTxSvc(inner);
1175 let codec = tonic::codec::ProstCodec::default();
1176 let mut grpc = tonic::server::Grpc::new(codec)
1177 .apply_compression_config(
1178 accept_compression_encodings,
1179 send_compression_encodings,
1180 )
1181 .apply_max_message_size_config(
1182 max_decoding_message_size,
1183 max_encoding_message_size,
1184 );
1185 let res = grpc.unary(method, req).await;
1186 Ok(res)
1187 };
1188 Box::pin(fut)
1189 }
1190 "/cometbft.abci.v1beta1.ABCIApplication/CheckTx" => {
1191 #[allow(non_camel_case_types)]
1192 struct CheckTxSvc<T: AbciApplication>(pub Arc<T>);
1193 impl<
1194 T: AbciApplication,
1195 > tonic::server::UnaryService<super::RequestCheckTx>
1196 for CheckTxSvc<T> {
1197 type Response = super::ResponseCheckTx;
1198 type Future = BoxFuture<
1199 tonic::Response<Self::Response>,
1200 tonic::Status,
1201 >;
1202 fn call(
1203 &mut self,
1204 request: tonic::Request<super::RequestCheckTx>,
1205 ) -> Self::Future {
1206 let inner = Arc::clone(&self.0);
1207 let fut = async move {
1208 <T as AbciApplication>::check_tx(&inner, request).await
1209 };
1210 Box::pin(fut)
1211 }
1212 }
1213 let accept_compression_encodings = self.accept_compression_encodings;
1214 let send_compression_encodings = self.send_compression_encodings;
1215 let max_decoding_message_size = self.max_decoding_message_size;
1216 let max_encoding_message_size = self.max_encoding_message_size;
1217 let inner = self.inner.clone();
1218 let fut = async move {
1219 let inner = inner.0;
1220 let method = CheckTxSvc(inner);
1221 let codec = tonic::codec::ProstCodec::default();
1222 let mut grpc = tonic::server::Grpc::new(codec)
1223 .apply_compression_config(
1224 accept_compression_encodings,
1225 send_compression_encodings,
1226 )
1227 .apply_max_message_size_config(
1228 max_decoding_message_size,
1229 max_encoding_message_size,
1230 );
1231 let res = grpc.unary(method, req).await;
1232 Ok(res)
1233 };
1234 Box::pin(fut)
1235 }
1236 "/cometbft.abci.v1beta1.ABCIApplication/Query" => {
1237 #[allow(non_camel_case_types)]
1238 struct QuerySvc<T: AbciApplication>(pub Arc<T>);
1239 impl<
1240 T: AbciApplication,
1241 > tonic::server::UnaryService<super::RequestQuery> for QuerySvc<T> {
1242 type Response = super::ResponseQuery;
1243 type Future = BoxFuture<
1244 tonic::Response<Self::Response>,
1245 tonic::Status,
1246 >;
1247 fn call(
1248 &mut self,
1249 request: tonic::Request<super::RequestQuery>,
1250 ) -> Self::Future {
1251 let inner = Arc::clone(&self.0);
1252 let fut = async move {
1253 <T as AbciApplication>::query(&inner, request).await
1254 };
1255 Box::pin(fut)
1256 }
1257 }
1258 let accept_compression_encodings = self.accept_compression_encodings;
1259 let send_compression_encodings = self.send_compression_encodings;
1260 let max_decoding_message_size = self.max_decoding_message_size;
1261 let max_encoding_message_size = self.max_encoding_message_size;
1262 let inner = self.inner.clone();
1263 let fut = async move {
1264 let inner = inner.0;
1265 let method = QuerySvc(inner);
1266 let codec = tonic::codec::ProstCodec::default();
1267 let mut grpc = tonic::server::Grpc::new(codec)
1268 .apply_compression_config(
1269 accept_compression_encodings,
1270 send_compression_encodings,
1271 )
1272 .apply_max_message_size_config(
1273 max_decoding_message_size,
1274 max_encoding_message_size,
1275 );
1276 let res = grpc.unary(method, req).await;
1277 Ok(res)
1278 };
1279 Box::pin(fut)
1280 }
1281 "/cometbft.abci.v1beta1.ABCIApplication/Commit" => {
1282 #[allow(non_camel_case_types)]
1283 struct CommitSvc<T: AbciApplication>(pub Arc<T>);
1284 impl<
1285 T: AbciApplication,
1286 > tonic::server::UnaryService<super::RequestCommit>
1287 for CommitSvc<T> {
1288 type Response = super::ResponseCommit;
1289 type Future = BoxFuture<
1290 tonic::Response<Self::Response>,
1291 tonic::Status,
1292 >;
1293 fn call(
1294 &mut self,
1295 request: tonic::Request<super::RequestCommit>,
1296 ) -> Self::Future {
1297 let inner = Arc::clone(&self.0);
1298 let fut = async move {
1299 <T as AbciApplication>::commit(&inner, request).await
1300 };
1301 Box::pin(fut)
1302 }
1303 }
1304 let accept_compression_encodings = self.accept_compression_encodings;
1305 let send_compression_encodings = self.send_compression_encodings;
1306 let max_decoding_message_size = self.max_decoding_message_size;
1307 let max_encoding_message_size = self.max_encoding_message_size;
1308 let inner = self.inner.clone();
1309 let fut = async move {
1310 let inner = inner.0;
1311 let method = CommitSvc(inner);
1312 let codec = tonic::codec::ProstCodec::default();
1313 let mut grpc = tonic::server::Grpc::new(codec)
1314 .apply_compression_config(
1315 accept_compression_encodings,
1316 send_compression_encodings,
1317 )
1318 .apply_max_message_size_config(
1319 max_decoding_message_size,
1320 max_encoding_message_size,
1321 );
1322 let res = grpc.unary(method, req).await;
1323 Ok(res)
1324 };
1325 Box::pin(fut)
1326 }
1327 "/cometbft.abci.v1beta1.ABCIApplication/InitChain" => {
1328 #[allow(non_camel_case_types)]
1329 struct InitChainSvc<T: AbciApplication>(pub Arc<T>);
1330 impl<
1331 T: AbciApplication,
1332 > tonic::server::UnaryService<super::RequestInitChain>
1333 for InitChainSvc<T> {
1334 type Response = super::ResponseInitChain;
1335 type Future = BoxFuture<
1336 tonic::Response<Self::Response>,
1337 tonic::Status,
1338 >;
1339 fn call(
1340 &mut self,
1341 request: tonic::Request<super::RequestInitChain>,
1342 ) -> Self::Future {
1343 let inner = Arc::clone(&self.0);
1344 let fut = async move {
1345 <T as AbciApplication>::init_chain(&inner, request).await
1346 };
1347 Box::pin(fut)
1348 }
1349 }
1350 let accept_compression_encodings = self.accept_compression_encodings;
1351 let send_compression_encodings = self.send_compression_encodings;
1352 let max_decoding_message_size = self.max_decoding_message_size;
1353 let max_encoding_message_size = self.max_encoding_message_size;
1354 let inner = self.inner.clone();
1355 let fut = async move {
1356 let inner = inner.0;
1357 let method = InitChainSvc(inner);
1358 let codec = tonic::codec::ProstCodec::default();
1359 let mut grpc = tonic::server::Grpc::new(codec)
1360 .apply_compression_config(
1361 accept_compression_encodings,
1362 send_compression_encodings,
1363 )
1364 .apply_max_message_size_config(
1365 max_decoding_message_size,
1366 max_encoding_message_size,
1367 );
1368 let res = grpc.unary(method, req).await;
1369 Ok(res)
1370 };
1371 Box::pin(fut)
1372 }
1373 "/cometbft.abci.v1beta1.ABCIApplication/BeginBlock" => {
1374 #[allow(non_camel_case_types)]
1375 struct BeginBlockSvc<T: AbciApplication>(pub Arc<T>);
1376 impl<
1377 T: AbciApplication,
1378 > tonic::server::UnaryService<super::RequestBeginBlock>
1379 for BeginBlockSvc<T> {
1380 type Response = super::ResponseBeginBlock;
1381 type Future = BoxFuture<
1382 tonic::Response<Self::Response>,
1383 tonic::Status,
1384 >;
1385 fn call(
1386 &mut self,
1387 request: tonic::Request<super::RequestBeginBlock>,
1388 ) -> Self::Future {
1389 let inner = Arc::clone(&self.0);
1390 let fut = async move {
1391 <T as AbciApplication>::begin_block(&inner, request).await
1392 };
1393 Box::pin(fut)
1394 }
1395 }
1396 let accept_compression_encodings = self.accept_compression_encodings;
1397 let send_compression_encodings = self.send_compression_encodings;
1398 let max_decoding_message_size = self.max_decoding_message_size;
1399 let max_encoding_message_size = self.max_encoding_message_size;
1400 let inner = self.inner.clone();
1401 let fut = async move {
1402 let inner = inner.0;
1403 let method = BeginBlockSvc(inner);
1404 let codec = tonic::codec::ProstCodec::default();
1405 let mut grpc = tonic::server::Grpc::new(codec)
1406 .apply_compression_config(
1407 accept_compression_encodings,
1408 send_compression_encodings,
1409 )
1410 .apply_max_message_size_config(
1411 max_decoding_message_size,
1412 max_encoding_message_size,
1413 );
1414 let res = grpc.unary(method, req).await;
1415 Ok(res)
1416 };
1417 Box::pin(fut)
1418 }
1419 "/cometbft.abci.v1beta1.ABCIApplication/EndBlock" => {
1420 #[allow(non_camel_case_types)]
1421 struct EndBlockSvc<T: AbciApplication>(pub Arc<T>);
1422 impl<
1423 T: AbciApplication,
1424 > tonic::server::UnaryService<super::RequestEndBlock>
1425 for EndBlockSvc<T> {
1426 type Response = super::ResponseEndBlock;
1427 type Future = BoxFuture<
1428 tonic::Response<Self::Response>,
1429 tonic::Status,
1430 >;
1431 fn call(
1432 &mut self,
1433 request: tonic::Request<super::RequestEndBlock>,
1434 ) -> Self::Future {
1435 let inner = Arc::clone(&self.0);
1436 let fut = async move {
1437 <T as AbciApplication>::end_block(&inner, request).await
1438 };
1439 Box::pin(fut)
1440 }
1441 }
1442 let accept_compression_encodings = self.accept_compression_encodings;
1443 let send_compression_encodings = self.send_compression_encodings;
1444 let max_decoding_message_size = self.max_decoding_message_size;
1445 let max_encoding_message_size = self.max_encoding_message_size;
1446 let inner = self.inner.clone();
1447 let fut = async move {
1448 let inner = inner.0;
1449 let method = EndBlockSvc(inner);
1450 let codec = tonic::codec::ProstCodec::default();
1451 let mut grpc = tonic::server::Grpc::new(codec)
1452 .apply_compression_config(
1453 accept_compression_encodings,
1454 send_compression_encodings,
1455 )
1456 .apply_max_message_size_config(
1457 max_decoding_message_size,
1458 max_encoding_message_size,
1459 );
1460 let res = grpc.unary(method, req).await;
1461 Ok(res)
1462 };
1463 Box::pin(fut)
1464 }
1465 "/cometbft.abci.v1beta1.ABCIApplication/ListSnapshots" => {
1466 #[allow(non_camel_case_types)]
1467 struct ListSnapshotsSvc<T: AbciApplication>(pub Arc<T>);
1468 impl<
1469 T: AbciApplication,
1470 > tonic::server::UnaryService<super::RequestListSnapshots>
1471 for ListSnapshotsSvc<T> {
1472 type Response = super::ResponseListSnapshots;
1473 type Future = BoxFuture<
1474 tonic::Response<Self::Response>,
1475 tonic::Status,
1476 >;
1477 fn call(
1478 &mut self,
1479 request: tonic::Request<super::RequestListSnapshots>,
1480 ) -> Self::Future {
1481 let inner = Arc::clone(&self.0);
1482 let fut = async move {
1483 <T as AbciApplication>::list_snapshots(&inner, request)
1484 .await
1485 };
1486 Box::pin(fut)
1487 }
1488 }
1489 let accept_compression_encodings = self.accept_compression_encodings;
1490 let send_compression_encodings = self.send_compression_encodings;
1491 let max_decoding_message_size = self.max_decoding_message_size;
1492 let max_encoding_message_size = self.max_encoding_message_size;
1493 let inner = self.inner.clone();
1494 let fut = async move {
1495 let inner = inner.0;
1496 let method = ListSnapshotsSvc(inner);
1497 let codec = tonic::codec::ProstCodec::default();
1498 let mut grpc = tonic::server::Grpc::new(codec)
1499 .apply_compression_config(
1500 accept_compression_encodings,
1501 send_compression_encodings,
1502 )
1503 .apply_max_message_size_config(
1504 max_decoding_message_size,
1505 max_encoding_message_size,
1506 );
1507 let res = grpc.unary(method, req).await;
1508 Ok(res)
1509 };
1510 Box::pin(fut)
1511 }
1512 "/cometbft.abci.v1beta1.ABCIApplication/OfferSnapshot" => {
1513 #[allow(non_camel_case_types)]
1514 struct OfferSnapshotSvc<T: AbciApplication>(pub Arc<T>);
1515 impl<
1516 T: AbciApplication,
1517 > tonic::server::UnaryService<super::RequestOfferSnapshot>
1518 for OfferSnapshotSvc<T> {
1519 type Response = super::ResponseOfferSnapshot;
1520 type Future = BoxFuture<
1521 tonic::Response<Self::Response>,
1522 tonic::Status,
1523 >;
1524 fn call(
1525 &mut self,
1526 request: tonic::Request<super::RequestOfferSnapshot>,
1527 ) -> Self::Future {
1528 let inner = Arc::clone(&self.0);
1529 let fut = async move {
1530 <T as AbciApplication>::offer_snapshot(&inner, request)
1531 .await
1532 };
1533 Box::pin(fut)
1534 }
1535 }
1536 let accept_compression_encodings = self.accept_compression_encodings;
1537 let send_compression_encodings = self.send_compression_encodings;
1538 let max_decoding_message_size = self.max_decoding_message_size;
1539 let max_encoding_message_size = self.max_encoding_message_size;
1540 let inner = self.inner.clone();
1541 let fut = async move {
1542 let inner = inner.0;
1543 let method = OfferSnapshotSvc(inner);
1544 let codec = tonic::codec::ProstCodec::default();
1545 let mut grpc = tonic::server::Grpc::new(codec)
1546 .apply_compression_config(
1547 accept_compression_encodings,
1548 send_compression_encodings,
1549 )
1550 .apply_max_message_size_config(
1551 max_decoding_message_size,
1552 max_encoding_message_size,
1553 );
1554 let res = grpc.unary(method, req).await;
1555 Ok(res)
1556 };
1557 Box::pin(fut)
1558 }
1559 "/cometbft.abci.v1beta1.ABCIApplication/LoadSnapshotChunk" => {
1560 #[allow(non_camel_case_types)]
1561 struct LoadSnapshotChunkSvc<T: AbciApplication>(pub Arc<T>);
1562 impl<
1563 T: AbciApplication,
1564 > tonic::server::UnaryService<super::RequestLoadSnapshotChunk>
1565 for LoadSnapshotChunkSvc<T> {
1566 type Response = super::ResponseLoadSnapshotChunk;
1567 type Future = BoxFuture<
1568 tonic::Response<Self::Response>,
1569 tonic::Status,
1570 >;
1571 fn call(
1572 &mut self,
1573 request: tonic::Request<super::RequestLoadSnapshotChunk>,
1574 ) -> Self::Future {
1575 let inner = Arc::clone(&self.0);
1576 let fut = async move {
1577 <T as AbciApplication>::load_snapshot_chunk(&inner, request)
1578 .await
1579 };
1580 Box::pin(fut)
1581 }
1582 }
1583 let accept_compression_encodings = self.accept_compression_encodings;
1584 let send_compression_encodings = self.send_compression_encodings;
1585 let max_decoding_message_size = self.max_decoding_message_size;
1586 let max_encoding_message_size = self.max_encoding_message_size;
1587 let inner = self.inner.clone();
1588 let fut = async move {
1589 let inner = inner.0;
1590 let method = LoadSnapshotChunkSvc(inner);
1591 let codec = tonic::codec::ProstCodec::default();
1592 let mut grpc = tonic::server::Grpc::new(codec)
1593 .apply_compression_config(
1594 accept_compression_encodings,
1595 send_compression_encodings,
1596 )
1597 .apply_max_message_size_config(
1598 max_decoding_message_size,
1599 max_encoding_message_size,
1600 );
1601 let res = grpc.unary(method, req).await;
1602 Ok(res)
1603 };
1604 Box::pin(fut)
1605 }
1606 "/cometbft.abci.v1beta1.ABCIApplication/ApplySnapshotChunk" => {
1607 #[allow(non_camel_case_types)]
1608 struct ApplySnapshotChunkSvc<T: AbciApplication>(pub Arc<T>);
1609 impl<
1610 T: AbciApplication,
1611 > tonic::server::UnaryService<super::RequestApplySnapshotChunk>
1612 for ApplySnapshotChunkSvc<T> {
1613 type Response = super::ResponseApplySnapshotChunk;
1614 type Future = BoxFuture<
1615 tonic::Response<Self::Response>,
1616 tonic::Status,
1617 >;
1618 fn call(
1619 &mut self,
1620 request: tonic::Request<super::RequestApplySnapshotChunk>,
1621 ) -> Self::Future {
1622 let inner = Arc::clone(&self.0);
1623 let fut = async move {
1624 <T as AbciApplication>::apply_snapshot_chunk(
1625 &inner,
1626 request,
1627 )
1628 .await
1629 };
1630 Box::pin(fut)
1631 }
1632 }
1633 let accept_compression_encodings = self.accept_compression_encodings;
1634 let send_compression_encodings = self.send_compression_encodings;
1635 let max_decoding_message_size = self.max_decoding_message_size;
1636 let max_encoding_message_size = self.max_encoding_message_size;
1637 let inner = self.inner.clone();
1638 let fut = async move {
1639 let inner = inner.0;
1640 let method = ApplySnapshotChunkSvc(inner);
1641 let codec = tonic::codec::ProstCodec::default();
1642 let mut grpc = tonic::server::Grpc::new(codec)
1643 .apply_compression_config(
1644 accept_compression_encodings,
1645 send_compression_encodings,
1646 )
1647 .apply_max_message_size_config(
1648 max_decoding_message_size,
1649 max_encoding_message_size,
1650 );
1651 let res = grpc.unary(method, req).await;
1652 Ok(res)
1653 };
1654 Box::pin(fut)
1655 }
1656 _ => {
1657 Box::pin(async move {
1658 Ok(
1659 http::Response::builder()
1660 .status(200)
1661 .header("grpc-status", "12")
1662 .header("content-type", "application/grpc")
1663 .body(empty_body())
1664 .unwrap(),
1665 )
1666 })
1667 }
1668 }
1669 }
1670 }
1671 impl<T: AbciApplication> Clone for AbciApplicationServer<T> {
1672 fn clone(&self) -> Self {
1673 let inner = self.inner.clone();
1674 Self {
1675 inner,
1676 accept_compression_encodings: self.accept_compression_encodings,
1677 send_compression_encodings: self.send_compression_encodings,
1678 max_decoding_message_size: self.max_decoding_message_size,
1679 max_encoding_message_size: self.max_encoding_message_size,
1680 }
1681 }
1682 }
1683 impl<T: AbciApplication> Clone for _Inner<T> {
1684 fn clone(&self) -> Self {
1685 Self(Arc::clone(&self.0))
1686 }
1687 }
1688 impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
1689 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1690 write!(f, "{:?}", self.0)
1691 }
1692 }
1693 impl<T: AbciApplication> tonic::server::NamedService for AbciApplicationServer<T> {
1694 const NAME: &'static str = "cometbft.abci.v1beta1.ABCIApplication";
1695 }
1696}