1#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct GetTxRequest {
5 #[prost(bytes = "vec", tag = "1")]
7 pub hash: ::prost::alloc::vec::Vec<u8>,
8 #[prost(bool, tag = "2")]
10 pub prove: bool,
11}
12impl ::prost::Name for GetTxRequest {
13 const NAME: &'static str = "GetTxRequest";
14 const PACKAGE: &'static str = "penumbra.util.tendermint_proxy.v1";
15 fn full_name() -> ::prost::alloc::string::String {
16 "penumbra.util.tendermint_proxy.v1.GetTxRequest".into()
17 }
18 fn type_url() -> ::prost::alloc::string::String {
19 "/penumbra.util.tendermint_proxy.v1.GetTxRequest".into()
20 }
21}
22#[derive(Clone, PartialEq, ::prost::Message)]
24pub struct GetTxResponse {
25 #[prost(bytes = "vec", tag = "1")]
27 pub hash: ::prost::alloc::vec::Vec<u8>,
28 #[prost(uint64, tag = "2")]
29 pub height: u64,
30 #[prost(uint64, tag = "3")]
31 pub index: u64,
32 #[prost(message, optional, tag = "4")]
33 pub tx_result: ::core::option::Option<TxResult>,
34 #[prost(bytes = "vec", tag = "5")]
35 pub tx: ::prost::alloc::vec::Vec<u8>,
36}
37impl ::prost::Name for GetTxResponse {
38 const NAME: &'static str = "GetTxResponse";
39 const PACKAGE: &'static str = "penumbra.util.tendermint_proxy.v1";
40 fn full_name() -> ::prost::alloc::string::String {
41 "penumbra.util.tendermint_proxy.v1.GetTxResponse".into()
42 }
43 fn type_url() -> ::prost::alloc::string::String {
44 "/penumbra.util.tendermint_proxy.v1.GetTxResponse".into()
45 }
46}
47#[derive(Clone, PartialEq, ::prost::Message)]
48pub struct TxResult {
49 #[prost(string, tag = "1")]
50 pub log: ::prost::alloc::string::String,
51 #[prost(uint64, tag = "2")]
52 pub gas_wanted: u64,
53 #[prost(uint64, tag = "3")]
54 pub gas_used: u64,
55 #[prost(message, repeated, tag = "4")]
56 pub tags: ::prost::alloc::vec::Vec<Tag>,
57}
58impl ::prost::Name for TxResult {
59 const NAME: &'static str = "TxResult";
60 const PACKAGE: &'static str = "penumbra.util.tendermint_proxy.v1";
61 fn full_name() -> ::prost::alloc::string::String {
62 "penumbra.util.tendermint_proxy.v1.TxResult".into()
63 }
64 fn type_url() -> ::prost::alloc::string::String {
65 "/penumbra.util.tendermint_proxy.v1.TxResult".into()
66 }
67}
68#[derive(Clone, PartialEq, ::prost::Message)]
69pub struct Tag {
70 #[prost(bytes = "vec", tag = "1")]
71 pub key: ::prost::alloc::vec::Vec<u8>,
72 #[prost(bytes = "vec", tag = "2")]
73 pub value: ::prost::alloc::vec::Vec<u8>,
74 #[prost(bool, tag = "3")]
75 pub index: bool,
76}
77impl ::prost::Name for Tag {
78 const NAME: &'static str = "Tag";
79 const PACKAGE: &'static str = "penumbra.util.tendermint_proxy.v1";
80 fn full_name() -> ::prost::alloc::string::String {
81 "penumbra.util.tendermint_proxy.v1.Tag".into()
82 }
83 fn type_url() -> ::prost::alloc::string::String {
84 "/penumbra.util.tendermint_proxy.v1.Tag".into()
85 }
86}
87#[derive(Clone, PartialEq, ::prost::Message)]
89pub struct BroadcastTxAsyncRequest {
90 #[prost(bytes = "vec", tag = "1")]
91 pub params: ::prost::alloc::vec::Vec<u8>,
92 #[prost(uint64, tag = "2")]
93 pub req_id: u64,
94}
95impl ::prost::Name for BroadcastTxAsyncRequest {
96 const NAME: &'static str = "BroadcastTxAsyncRequest";
97 const PACKAGE: &'static str = "penumbra.util.tendermint_proxy.v1";
98 fn full_name() -> ::prost::alloc::string::String {
99 "penumbra.util.tendermint_proxy.v1.BroadcastTxAsyncRequest".into()
100 }
101 fn type_url() -> ::prost::alloc::string::String {
102 "/penumbra.util.tendermint_proxy.v1.BroadcastTxAsyncRequest".into()
103 }
104}
105#[derive(Clone, PartialEq, ::prost::Message)]
107pub struct BroadcastTxAsyncResponse {
108 #[prost(uint64, tag = "1")]
109 pub code: u64,
110 #[prost(bytes = "vec", tag = "2")]
111 pub data: ::prost::alloc::vec::Vec<u8>,
112 #[prost(string, tag = "3")]
113 pub log: ::prost::alloc::string::String,
114 #[prost(bytes = "vec", tag = "4")]
115 pub hash: ::prost::alloc::vec::Vec<u8>,
116}
117impl ::prost::Name for BroadcastTxAsyncResponse {
118 const NAME: &'static str = "BroadcastTxAsyncResponse";
119 const PACKAGE: &'static str = "penumbra.util.tendermint_proxy.v1";
120 fn full_name() -> ::prost::alloc::string::String {
121 "penumbra.util.tendermint_proxy.v1.BroadcastTxAsyncResponse".into()
122 }
123 fn type_url() -> ::prost::alloc::string::String {
124 "/penumbra.util.tendermint_proxy.v1.BroadcastTxAsyncResponse".into()
125 }
126}
127#[derive(Clone, PartialEq, ::prost::Message)]
129pub struct BroadcastTxSyncRequest {
130 #[prost(bytes = "vec", tag = "1")]
131 pub params: ::prost::alloc::vec::Vec<u8>,
132 #[prost(uint64, tag = "2")]
133 pub req_id: u64,
134}
135impl ::prost::Name for BroadcastTxSyncRequest {
136 const NAME: &'static str = "BroadcastTxSyncRequest";
137 const PACKAGE: &'static str = "penumbra.util.tendermint_proxy.v1";
138 fn full_name() -> ::prost::alloc::string::String {
139 "penumbra.util.tendermint_proxy.v1.BroadcastTxSyncRequest".into()
140 }
141 fn type_url() -> ::prost::alloc::string::String {
142 "/penumbra.util.tendermint_proxy.v1.BroadcastTxSyncRequest".into()
143 }
144}
145#[derive(Clone, PartialEq, ::prost::Message)]
147pub struct BroadcastTxSyncResponse {
148 #[prost(uint64, tag = "1")]
149 pub code: u64,
150 #[prost(bytes = "vec", tag = "2")]
151 pub data: ::prost::alloc::vec::Vec<u8>,
152 #[prost(string, tag = "3")]
153 pub log: ::prost::alloc::string::String,
154 #[prost(bytes = "vec", tag = "4")]
155 pub hash: ::prost::alloc::vec::Vec<u8>,
156}
157impl ::prost::Name for BroadcastTxSyncResponse {
158 const NAME: &'static str = "BroadcastTxSyncResponse";
159 const PACKAGE: &'static str = "penumbra.util.tendermint_proxy.v1";
160 fn full_name() -> ::prost::alloc::string::String {
161 "penumbra.util.tendermint_proxy.v1.BroadcastTxSyncResponse".into()
162 }
163 fn type_url() -> ::prost::alloc::string::String {
164 "/penumbra.util.tendermint_proxy.v1.BroadcastTxSyncResponse".into()
165 }
166}
167#[derive(Clone, Copy, PartialEq, ::prost::Message)]
169pub struct GetStatusRequest {}
170impl ::prost::Name for GetStatusRequest {
171 const NAME: &'static str = "GetStatusRequest";
172 const PACKAGE: &'static str = "penumbra.util.tendermint_proxy.v1";
173 fn full_name() -> ::prost::alloc::string::String {
174 "penumbra.util.tendermint_proxy.v1.GetStatusRequest".into()
175 }
176 fn type_url() -> ::prost::alloc::string::String {
177 "/penumbra.util.tendermint_proxy.v1.GetStatusRequest".into()
178 }
179}
180#[derive(Clone, PartialEq, ::prost::Message)]
182pub struct GetStatusResponse {
183 #[prost(message, optional, tag = "1")]
184 pub node_info: ::core::option::Option<
185 super::super::super::super::tendermint::p2p::DefaultNodeInfo,
186 >,
187 #[prost(message, optional, tag = "2")]
188 pub sync_info: ::core::option::Option<SyncInfo>,
189 #[prost(message, optional, tag = "3")]
190 pub validator_info: ::core::option::Option<
191 super::super::super::super::tendermint::types::Validator,
192 >,
193}
194impl ::prost::Name for GetStatusResponse {
195 const NAME: &'static str = "GetStatusResponse";
196 const PACKAGE: &'static str = "penumbra.util.tendermint_proxy.v1";
197 fn full_name() -> ::prost::alloc::string::String {
198 "penumbra.util.tendermint_proxy.v1.GetStatusResponse".into()
199 }
200 fn type_url() -> ::prost::alloc::string::String {
201 "/penumbra.util.tendermint_proxy.v1.GetStatusResponse".into()
202 }
203}
204#[derive(Clone, PartialEq, ::prost::Message)]
205pub struct SyncInfo {
206 #[prost(bytes = "vec", tag = "1")]
207 pub latest_block_hash: ::prost::alloc::vec::Vec<u8>,
208 #[prost(bytes = "vec", tag = "2")]
209 pub latest_app_hash: ::prost::alloc::vec::Vec<u8>,
210 #[prost(uint64, tag = "3")]
211 pub latest_block_height: u64,
212 #[prost(message, optional, tag = "4")]
213 pub latest_block_time: ::core::option::Option<::pbjson_types::Timestamp>,
214 #[prost(bool, tag = "9")]
221 pub catching_up: bool,
222}
223impl ::prost::Name for SyncInfo {
224 const NAME: &'static str = "SyncInfo";
225 const PACKAGE: &'static str = "penumbra.util.tendermint_proxy.v1";
226 fn full_name() -> ::prost::alloc::string::String {
227 "penumbra.util.tendermint_proxy.v1.SyncInfo".into()
228 }
229 fn type_url() -> ::prost::alloc::string::String {
230 "/penumbra.util.tendermint_proxy.v1.SyncInfo".into()
231 }
232}
233#[derive(Clone, PartialEq, ::prost::Message)]
235pub struct AbciQueryRequest {
236 #[prost(bytes = "vec", tag = "1")]
237 pub data: ::prost::alloc::vec::Vec<u8>,
238 #[prost(string, tag = "2")]
239 pub path: ::prost::alloc::string::String,
240 #[prost(int64, tag = "3")]
241 pub height: i64,
242 #[prost(bool, tag = "4")]
243 pub prove: bool,
244}
245impl ::prost::Name for AbciQueryRequest {
246 const NAME: &'static str = "ABCIQueryRequest";
247 const PACKAGE: &'static str = "penumbra.util.tendermint_proxy.v1";
248 fn full_name() -> ::prost::alloc::string::String {
249 "penumbra.util.tendermint_proxy.v1.ABCIQueryRequest".into()
250 }
251 fn type_url() -> ::prost::alloc::string::String {
252 "/penumbra.util.tendermint_proxy.v1.ABCIQueryRequest".into()
253 }
254}
255#[derive(Clone, PartialEq, ::prost::Message)]
260pub struct AbciQueryResponse {
261 #[prost(uint32, tag = "1")]
262 pub code: u32,
263 #[prost(string, tag = "3")]
265 pub log: ::prost::alloc::string::String,
266 #[prost(string, tag = "4")]
268 pub info: ::prost::alloc::string::String,
269 #[prost(int64, tag = "5")]
270 pub index: i64,
271 #[prost(bytes = "vec", tag = "6")]
272 pub key: ::prost::alloc::vec::Vec<u8>,
273 #[prost(bytes = "vec", tag = "7")]
274 pub value: ::prost::alloc::vec::Vec<u8>,
275 #[prost(message, optional, tag = "8")]
276 pub proof_ops: ::core::option::Option<
277 super::super::super::super::tendermint::crypto::ProofOps,
278 >,
279 #[prost(int64, tag = "9")]
280 pub height: i64,
281 #[prost(string, tag = "10")]
282 pub codespace: ::prost::alloc::string::String,
283}
284impl ::prost::Name for AbciQueryResponse {
285 const NAME: &'static str = "ABCIQueryResponse";
286 const PACKAGE: &'static str = "penumbra.util.tendermint_proxy.v1";
287 fn full_name() -> ::prost::alloc::string::String {
288 "penumbra.util.tendermint_proxy.v1.ABCIQueryResponse".into()
289 }
290 fn type_url() -> ::prost::alloc::string::String {
291 "/penumbra.util.tendermint_proxy.v1.ABCIQueryResponse".into()
292 }
293}
294#[derive(Clone, Copy, PartialEq, ::prost::Message)]
296pub struct GetBlockByHeightRequest {
297 #[prost(int64, tag = "1")]
298 pub height: i64,
299}
300impl ::prost::Name for GetBlockByHeightRequest {
301 const NAME: &'static str = "GetBlockByHeightRequest";
302 const PACKAGE: &'static str = "penumbra.util.tendermint_proxy.v1";
303 fn full_name() -> ::prost::alloc::string::String {
304 "penumbra.util.tendermint_proxy.v1.GetBlockByHeightRequest".into()
305 }
306 fn type_url() -> ::prost::alloc::string::String {
307 "/penumbra.util.tendermint_proxy.v1.GetBlockByHeightRequest".into()
308 }
309}
310#[derive(Clone, PartialEq, ::prost::Message)]
312pub struct GetBlockByHeightResponse {
313 #[prost(message, optional, tag = "1")]
314 pub block_id: ::core::option::Option<
315 super::super::super::super::tendermint::types::BlockId,
316 >,
317 #[prost(message, optional, tag = "2")]
318 pub block: ::core::option::Option<
319 super::super::super::super::tendermint::types::Block,
320 >,
321}
322impl ::prost::Name for GetBlockByHeightResponse {
323 const NAME: &'static str = "GetBlockByHeightResponse";
324 const PACKAGE: &'static str = "penumbra.util.tendermint_proxy.v1";
325 fn full_name() -> ::prost::alloc::string::String {
326 "penumbra.util.tendermint_proxy.v1.GetBlockByHeightResponse".into()
327 }
328 fn type_url() -> ::prost::alloc::string::String {
329 "/penumbra.util.tendermint_proxy.v1.GetBlockByHeightResponse".into()
330 }
331}
332#[cfg(feature = "rpc")]
334pub mod tendermint_proxy_service_client {
335 #![allow(
336 unused_variables,
337 dead_code,
338 missing_docs,
339 clippy::wildcard_imports,
340 clippy::let_unit_value,
341 )]
342 use tonic::codegen::*;
343 use tonic::codegen::http::Uri;
344 #[derive(Debug, Clone)]
346 pub struct TendermintProxyServiceClient<T> {
347 inner: tonic::client::Grpc<T>,
348 }
349 impl TendermintProxyServiceClient<tonic::transport::Channel> {
350 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
352 where
353 D: TryInto<tonic::transport::Endpoint>,
354 D::Error: Into<StdError>,
355 {
356 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
357 Ok(Self::new(conn))
358 }
359 }
360 impl<T> TendermintProxyServiceClient<T>
361 where
362 T: tonic::client::GrpcService<tonic::body::BoxBody>,
363 T::Error: Into<StdError>,
364 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
365 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
366 {
367 pub fn new(inner: T) -> Self {
368 let inner = tonic::client::Grpc::new(inner);
369 Self { inner }
370 }
371 pub fn with_origin(inner: T, origin: Uri) -> Self {
372 let inner = tonic::client::Grpc::with_origin(inner, origin);
373 Self { inner }
374 }
375 pub fn with_interceptor<F>(
376 inner: T,
377 interceptor: F,
378 ) -> TendermintProxyServiceClient<InterceptedService<T, F>>
379 where
380 F: tonic::service::Interceptor,
381 T::ResponseBody: Default,
382 T: tonic::codegen::Service<
383 http::Request<tonic::body::BoxBody>,
384 Response = http::Response<
385 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
386 >,
387 >,
388 <T as tonic::codegen::Service<
389 http::Request<tonic::body::BoxBody>,
390 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
391 {
392 TendermintProxyServiceClient::new(
393 InterceptedService::new(inner, interceptor),
394 )
395 }
396 #[must_use]
401 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
402 self.inner = self.inner.send_compressed(encoding);
403 self
404 }
405 #[must_use]
407 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
408 self.inner = self.inner.accept_compressed(encoding);
409 self
410 }
411 #[must_use]
415 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
416 self.inner = self.inner.max_decoding_message_size(limit);
417 self
418 }
419 #[must_use]
423 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
424 self.inner = self.inner.max_encoding_message_size(limit);
425 self
426 }
427 pub async fn get_status(
429 &mut self,
430 request: impl tonic::IntoRequest<super::GetStatusRequest>,
431 ) -> std::result::Result<
432 tonic::Response<super::GetStatusResponse>,
433 tonic::Status,
434 > {
435 self.inner
436 .ready()
437 .await
438 .map_err(|e| {
439 tonic::Status::unknown(
440 format!("Service was not ready: {}", e.into()),
441 )
442 })?;
443 let codec = tonic::codec::ProstCodec::default();
444 let path = http::uri::PathAndQuery::from_static(
445 "/penumbra.util.tendermint_proxy.v1.TendermintProxyService/GetStatus",
446 );
447 let mut req = request.into_request();
448 req.extensions_mut()
449 .insert(
450 GrpcMethod::new(
451 "penumbra.util.tendermint_proxy.v1.TendermintProxyService",
452 "GetStatus",
453 ),
454 );
455 self.inner.unary(req, path, codec).await
456 }
457 pub async fn broadcast_tx_async(
459 &mut self,
460 request: impl tonic::IntoRequest<super::BroadcastTxAsyncRequest>,
461 ) -> std::result::Result<
462 tonic::Response<super::BroadcastTxAsyncResponse>,
463 tonic::Status,
464 > {
465 self.inner
466 .ready()
467 .await
468 .map_err(|e| {
469 tonic::Status::unknown(
470 format!("Service was not ready: {}", e.into()),
471 )
472 })?;
473 let codec = tonic::codec::ProstCodec::default();
474 let path = http::uri::PathAndQuery::from_static(
475 "/penumbra.util.tendermint_proxy.v1.TendermintProxyService/BroadcastTxAsync",
476 );
477 let mut req = request.into_request();
478 req.extensions_mut()
479 .insert(
480 GrpcMethod::new(
481 "penumbra.util.tendermint_proxy.v1.TendermintProxyService",
482 "BroadcastTxAsync",
483 ),
484 );
485 self.inner.unary(req, path, codec).await
486 }
487 pub async fn broadcast_tx_sync(
489 &mut self,
490 request: impl tonic::IntoRequest<super::BroadcastTxSyncRequest>,
491 ) -> std::result::Result<
492 tonic::Response<super::BroadcastTxSyncResponse>,
493 tonic::Status,
494 > {
495 self.inner
496 .ready()
497 .await
498 .map_err(|e| {
499 tonic::Status::unknown(
500 format!("Service was not ready: {}", e.into()),
501 )
502 })?;
503 let codec = tonic::codec::ProstCodec::default();
504 let path = http::uri::PathAndQuery::from_static(
505 "/penumbra.util.tendermint_proxy.v1.TendermintProxyService/BroadcastTxSync",
506 );
507 let mut req = request.into_request();
508 req.extensions_mut()
509 .insert(
510 GrpcMethod::new(
511 "penumbra.util.tendermint_proxy.v1.TendermintProxyService",
512 "BroadcastTxSync",
513 ),
514 );
515 self.inner.unary(req, path, codec).await
516 }
517 pub async fn get_tx(
519 &mut self,
520 request: impl tonic::IntoRequest<super::GetTxRequest>,
521 ) -> std::result::Result<tonic::Response<super::GetTxResponse>, tonic::Status> {
522 self.inner
523 .ready()
524 .await
525 .map_err(|e| {
526 tonic::Status::unknown(
527 format!("Service was not ready: {}", e.into()),
528 )
529 })?;
530 let codec = tonic::codec::ProstCodec::default();
531 let path = http::uri::PathAndQuery::from_static(
532 "/penumbra.util.tendermint_proxy.v1.TendermintProxyService/GetTx",
533 );
534 let mut req = request.into_request();
535 req.extensions_mut()
536 .insert(
537 GrpcMethod::new(
538 "penumbra.util.tendermint_proxy.v1.TendermintProxyService",
539 "GetTx",
540 ),
541 );
542 self.inner.unary(req, path, codec).await
543 }
544 pub async fn abci_query(
548 &mut self,
549 request: impl tonic::IntoRequest<super::AbciQueryRequest>,
550 ) -> std::result::Result<
551 tonic::Response<super::AbciQueryResponse>,
552 tonic::Status,
553 > {
554 self.inner
555 .ready()
556 .await
557 .map_err(|e| {
558 tonic::Status::unknown(
559 format!("Service was not ready: {}", e.into()),
560 )
561 })?;
562 let codec = tonic::codec::ProstCodec::default();
563 let path = http::uri::PathAndQuery::from_static(
564 "/penumbra.util.tendermint_proxy.v1.TendermintProxyService/ABCIQuery",
565 );
566 let mut req = request.into_request();
567 req.extensions_mut()
568 .insert(
569 GrpcMethod::new(
570 "penumbra.util.tendermint_proxy.v1.TendermintProxyService",
571 "ABCIQuery",
572 ),
573 );
574 self.inner.unary(req, path, codec).await
575 }
576 pub async fn get_block_by_height(
578 &mut self,
579 request: impl tonic::IntoRequest<super::GetBlockByHeightRequest>,
580 ) -> std::result::Result<
581 tonic::Response<super::GetBlockByHeightResponse>,
582 tonic::Status,
583 > {
584 self.inner
585 .ready()
586 .await
587 .map_err(|e| {
588 tonic::Status::unknown(
589 format!("Service was not ready: {}", e.into()),
590 )
591 })?;
592 let codec = tonic::codec::ProstCodec::default();
593 let path = http::uri::PathAndQuery::from_static(
594 "/penumbra.util.tendermint_proxy.v1.TendermintProxyService/GetBlockByHeight",
595 );
596 let mut req = request.into_request();
597 req.extensions_mut()
598 .insert(
599 GrpcMethod::new(
600 "penumbra.util.tendermint_proxy.v1.TendermintProxyService",
601 "GetBlockByHeight",
602 ),
603 );
604 self.inner.unary(req, path, codec).await
605 }
606 }
607}
608#[cfg(feature = "rpc")]
610pub mod tendermint_proxy_service_server {
611 #![allow(
612 unused_variables,
613 dead_code,
614 missing_docs,
615 clippy::wildcard_imports,
616 clippy::let_unit_value,
617 )]
618 use tonic::codegen::*;
619 #[async_trait]
621 pub trait TendermintProxyService: std::marker::Send + std::marker::Sync + 'static {
622 async fn get_status(
624 &self,
625 request: tonic::Request<super::GetStatusRequest>,
626 ) -> std::result::Result<
627 tonic::Response<super::GetStatusResponse>,
628 tonic::Status,
629 >;
630 async fn broadcast_tx_async(
632 &self,
633 request: tonic::Request<super::BroadcastTxAsyncRequest>,
634 ) -> std::result::Result<
635 tonic::Response<super::BroadcastTxAsyncResponse>,
636 tonic::Status,
637 >;
638 async fn broadcast_tx_sync(
640 &self,
641 request: tonic::Request<super::BroadcastTxSyncRequest>,
642 ) -> std::result::Result<
643 tonic::Response<super::BroadcastTxSyncResponse>,
644 tonic::Status,
645 >;
646 async fn get_tx(
648 &self,
649 request: tonic::Request<super::GetTxRequest>,
650 ) -> std::result::Result<tonic::Response<super::GetTxResponse>, tonic::Status>;
651 async fn abci_query(
655 &self,
656 request: tonic::Request<super::AbciQueryRequest>,
657 ) -> std::result::Result<
658 tonic::Response<super::AbciQueryResponse>,
659 tonic::Status,
660 >;
661 async fn get_block_by_height(
663 &self,
664 request: tonic::Request<super::GetBlockByHeightRequest>,
665 ) -> std::result::Result<
666 tonic::Response<super::GetBlockByHeightResponse>,
667 tonic::Status,
668 >;
669 }
670 #[derive(Debug)]
672 pub struct TendermintProxyServiceServer<T> {
673 inner: Arc<T>,
674 accept_compression_encodings: EnabledCompressionEncodings,
675 send_compression_encodings: EnabledCompressionEncodings,
676 max_decoding_message_size: Option<usize>,
677 max_encoding_message_size: Option<usize>,
678 }
679 impl<T> TendermintProxyServiceServer<T> {
680 pub fn new(inner: T) -> Self {
681 Self::from_arc(Arc::new(inner))
682 }
683 pub fn from_arc(inner: Arc<T>) -> Self {
684 Self {
685 inner,
686 accept_compression_encodings: Default::default(),
687 send_compression_encodings: Default::default(),
688 max_decoding_message_size: None,
689 max_encoding_message_size: None,
690 }
691 }
692 pub fn with_interceptor<F>(
693 inner: T,
694 interceptor: F,
695 ) -> InterceptedService<Self, F>
696 where
697 F: tonic::service::Interceptor,
698 {
699 InterceptedService::new(Self::new(inner), interceptor)
700 }
701 #[must_use]
703 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
704 self.accept_compression_encodings.enable(encoding);
705 self
706 }
707 #[must_use]
709 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
710 self.send_compression_encodings.enable(encoding);
711 self
712 }
713 #[must_use]
717 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
718 self.max_decoding_message_size = Some(limit);
719 self
720 }
721 #[must_use]
725 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
726 self.max_encoding_message_size = Some(limit);
727 self
728 }
729 }
730 impl<T, B> tonic::codegen::Service<http::Request<B>>
731 for TendermintProxyServiceServer<T>
732 where
733 T: TendermintProxyService,
734 B: Body + std::marker::Send + 'static,
735 B::Error: Into<StdError> + std::marker::Send + 'static,
736 {
737 type Response = http::Response<tonic::body::BoxBody>;
738 type Error = std::convert::Infallible;
739 type Future = BoxFuture<Self::Response, Self::Error>;
740 fn poll_ready(
741 &mut self,
742 _cx: &mut Context<'_>,
743 ) -> Poll<std::result::Result<(), Self::Error>> {
744 Poll::Ready(Ok(()))
745 }
746 fn call(&mut self, req: http::Request<B>) -> Self::Future {
747 match req.uri().path() {
748 "/penumbra.util.tendermint_proxy.v1.TendermintProxyService/GetStatus" => {
749 #[allow(non_camel_case_types)]
750 struct GetStatusSvc<T: TendermintProxyService>(pub Arc<T>);
751 impl<
752 T: TendermintProxyService,
753 > tonic::server::UnaryService<super::GetStatusRequest>
754 for GetStatusSvc<T> {
755 type Response = super::GetStatusResponse;
756 type Future = BoxFuture<
757 tonic::Response<Self::Response>,
758 tonic::Status,
759 >;
760 fn call(
761 &mut self,
762 request: tonic::Request<super::GetStatusRequest>,
763 ) -> Self::Future {
764 let inner = Arc::clone(&self.0);
765 let fut = async move {
766 <T as TendermintProxyService>::get_status(&inner, request)
767 .await
768 };
769 Box::pin(fut)
770 }
771 }
772 let accept_compression_encodings = self.accept_compression_encodings;
773 let send_compression_encodings = self.send_compression_encodings;
774 let max_decoding_message_size = self.max_decoding_message_size;
775 let max_encoding_message_size = self.max_encoding_message_size;
776 let inner = self.inner.clone();
777 let fut = async move {
778 let method = GetStatusSvc(inner);
779 let codec = tonic::codec::ProstCodec::default();
780 let mut grpc = tonic::server::Grpc::new(codec)
781 .apply_compression_config(
782 accept_compression_encodings,
783 send_compression_encodings,
784 )
785 .apply_max_message_size_config(
786 max_decoding_message_size,
787 max_encoding_message_size,
788 );
789 let res = grpc.unary(method, req).await;
790 Ok(res)
791 };
792 Box::pin(fut)
793 }
794 "/penumbra.util.tendermint_proxy.v1.TendermintProxyService/BroadcastTxAsync" => {
795 #[allow(non_camel_case_types)]
796 struct BroadcastTxAsyncSvc<T: TendermintProxyService>(pub Arc<T>);
797 impl<
798 T: TendermintProxyService,
799 > tonic::server::UnaryService<super::BroadcastTxAsyncRequest>
800 for BroadcastTxAsyncSvc<T> {
801 type Response = super::BroadcastTxAsyncResponse;
802 type Future = BoxFuture<
803 tonic::Response<Self::Response>,
804 tonic::Status,
805 >;
806 fn call(
807 &mut self,
808 request: tonic::Request<super::BroadcastTxAsyncRequest>,
809 ) -> Self::Future {
810 let inner = Arc::clone(&self.0);
811 let fut = async move {
812 <T as TendermintProxyService>::broadcast_tx_async(
813 &inner,
814 request,
815 )
816 .await
817 };
818 Box::pin(fut)
819 }
820 }
821 let accept_compression_encodings = self.accept_compression_encodings;
822 let send_compression_encodings = self.send_compression_encodings;
823 let max_decoding_message_size = self.max_decoding_message_size;
824 let max_encoding_message_size = self.max_encoding_message_size;
825 let inner = self.inner.clone();
826 let fut = async move {
827 let method = BroadcastTxAsyncSvc(inner);
828 let codec = tonic::codec::ProstCodec::default();
829 let mut grpc = tonic::server::Grpc::new(codec)
830 .apply_compression_config(
831 accept_compression_encodings,
832 send_compression_encodings,
833 )
834 .apply_max_message_size_config(
835 max_decoding_message_size,
836 max_encoding_message_size,
837 );
838 let res = grpc.unary(method, req).await;
839 Ok(res)
840 };
841 Box::pin(fut)
842 }
843 "/penumbra.util.tendermint_proxy.v1.TendermintProxyService/BroadcastTxSync" => {
844 #[allow(non_camel_case_types)]
845 struct BroadcastTxSyncSvc<T: TendermintProxyService>(pub Arc<T>);
846 impl<
847 T: TendermintProxyService,
848 > tonic::server::UnaryService<super::BroadcastTxSyncRequest>
849 for BroadcastTxSyncSvc<T> {
850 type Response = super::BroadcastTxSyncResponse;
851 type Future = BoxFuture<
852 tonic::Response<Self::Response>,
853 tonic::Status,
854 >;
855 fn call(
856 &mut self,
857 request: tonic::Request<super::BroadcastTxSyncRequest>,
858 ) -> Self::Future {
859 let inner = Arc::clone(&self.0);
860 let fut = async move {
861 <T as TendermintProxyService>::broadcast_tx_sync(
862 &inner,
863 request,
864 )
865 .await
866 };
867 Box::pin(fut)
868 }
869 }
870 let accept_compression_encodings = self.accept_compression_encodings;
871 let send_compression_encodings = self.send_compression_encodings;
872 let max_decoding_message_size = self.max_decoding_message_size;
873 let max_encoding_message_size = self.max_encoding_message_size;
874 let inner = self.inner.clone();
875 let fut = async move {
876 let method = BroadcastTxSyncSvc(inner);
877 let codec = tonic::codec::ProstCodec::default();
878 let mut grpc = tonic::server::Grpc::new(codec)
879 .apply_compression_config(
880 accept_compression_encodings,
881 send_compression_encodings,
882 )
883 .apply_max_message_size_config(
884 max_decoding_message_size,
885 max_encoding_message_size,
886 );
887 let res = grpc.unary(method, req).await;
888 Ok(res)
889 };
890 Box::pin(fut)
891 }
892 "/penumbra.util.tendermint_proxy.v1.TendermintProxyService/GetTx" => {
893 #[allow(non_camel_case_types)]
894 struct GetTxSvc<T: TendermintProxyService>(pub Arc<T>);
895 impl<
896 T: TendermintProxyService,
897 > tonic::server::UnaryService<super::GetTxRequest> for GetTxSvc<T> {
898 type Response = super::GetTxResponse;
899 type Future = BoxFuture<
900 tonic::Response<Self::Response>,
901 tonic::Status,
902 >;
903 fn call(
904 &mut self,
905 request: tonic::Request<super::GetTxRequest>,
906 ) -> Self::Future {
907 let inner = Arc::clone(&self.0);
908 let fut = async move {
909 <T as TendermintProxyService>::get_tx(&inner, request).await
910 };
911 Box::pin(fut)
912 }
913 }
914 let accept_compression_encodings = self.accept_compression_encodings;
915 let send_compression_encodings = self.send_compression_encodings;
916 let max_decoding_message_size = self.max_decoding_message_size;
917 let max_encoding_message_size = self.max_encoding_message_size;
918 let inner = self.inner.clone();
919 let fut = async move {
920 let method = GetTxSvc(inner);
921 let codec = tonic::codec::ProstCodec::default();
922 let mut grpc = tonic::server::Grpc::new(codec)
923 .apply_compression_config(
924 accept_compression_encodings,
925 send_compression_encodings,
926 )
927 .apply_max_message_size_config(
928 max_decoding_message_size,
929 max_encoding_message_size,
930 );
931 let res = grpc.unary(method, req).await;
932 Ok(res)
933 };
934 Box::pin(fut)
935 }
936 "/penumbra.util.tendermint_proxy.v1.TendermintProxyService/ABCIQuery" => {
937 #[allow(non_camel_case_types)]
938 struct ABCIQuerySvc<T: TendermintProxyService>(pub Arc<T>);
939 impl<
940 T: TendermintProxyService,
941 > tonic::server::UnaryService<super::AbciQueryRequest>
942 for ABCIQuerySvc<T> {
943 type Response = super::AbciQueryResponse;
944 type Future = BoxFuture<
945 tonic::Response<Self::Response>,
946 tonic::Status,
947 >;
948 fn call(
949 &mut self,
950 request: tonic::Request<super::AbciQueryRequest>,
951 ) -> Self::Future {
952 let inner = Arc::clone(&self.0);
953 let fut = async move {
954 <T as TendermintProxyService>::abci_query(&inner, request)
955 .await
956 };
957 Box::pin(fut)
958 }
959 }
960 let accept_compression_encodings = self.accept_compression_encodings;
961 let send_compression_encodings = self.send_compression_encodings;
962 let max_decoding_message_size = self.max_decoding_message_size;
963 let max_encoding_message_size = self.max_encoding_message_size;
964 let inner = self.inner.clone();
965 let fut = async move {
966 let method = ABCIQuerySvc(inner);
967 let codec = tonic::codec::ProstCodec::default();
968 let mut grpc = tonic::server::Grpc::new(codec)
969 .apply_compression_config(
970 accept_compression_encodings,
971 send_compression_encodings,
972 )
973 .apply_max_message_size_config(
974 max_decoding_message_size,
975 max_encoding_message_size,
976 );
977 let res = grpc.unary(method, req).await;
978 Ok(res)
979 };
980 Box::pin(fut)
981 }
982 "/penumbra.util.tendermint_proxy.v1.TendermintProxyService/GetBlockByHeight" => {
983 #[allow(non_camel_case_types)]
984 struct GetBlockByHeightSvc<T: TendermintProxyService>(pub Arc<T>);
985 impl<
986 T: TendermintProxyService,
987 > tonic::server::UnaryService<super::GetBlockByHeightRequest>
988 for GetBlockByHeightSvc<T> {
989 type Response = super::GetBlockByHeightResponse;
990 type Future = BoxFuture<
991 tonic::Response<Self::Response>,
992 tonic::Status,
993 >;
994 fn call(
995 &mut self,
996 request: tonic::Request<super::GetBlockByHeightRequest>,
997 ) -> Self::Future {
998 let inner = Arc::clone(&self.0);
999 let fut = async move {
1000 <T as TendermintProxyService>::get_block_by_height(
1001 &inner,
1002 request,
1003 )
1004 .await
1005 };
1006 Box::pin(fut)
1007 }
1008 }
1009 let accept_compression_encodings = self.accept_compression_encodings;
1010 let send_compression_encodings = self.send_compression_encodings;
1011 let max_decoding_message_size = self.max_decoding_message_size;
1012 let max_encoding_message_size = self.max_encoding_message_size;
1013 let inner = self.inner.clone();
1014 let fut = async move {
1015 let method = GetBlockByHeightSvc(inner);
1016 let codec = tonic::codec::ProstCodec::default();
1017 let mut grpc = tonic::server::Grpc::new(codec)
1018 .apply_compression_config(
1019 accept_compression_encodings,
1020 send_compression_encodings,
1021 )
1022 .apply_max_message_size_config(
1023 max_decoding_message_size,
1024 max_encoding_message_size,
1025 );
1026 let res = grpc.unary(method, req).await;
1027 Ok(res)
1028 };
1029 Box::pin(fut)
1030 }
1031 _ => {
1032 Box::pin(async move {
1033 let mut response = http::Response::new(empty_body());
1034 let headers = response.headers_mut();
1035 headers
1036 .insert(
1037 tonic::Status::GRPC_STATUS,
1038 (tonic::Code::Unimplemented as i32).into(),
1039 );
1040 headers
1041 .insert(
1042 http::header::CONTENT_TYPE,
1043 tonic::metadata::GRPC_CONTENT_TYPE,
1044 );
1045 Ok(response)
1046 })
1047 }
1048 }
1049 }
1050 }
1051 impl<T> Clone for TendermintProxyServiceServer<T> {
1052 fn clone(&self) -> Self {
1053 let inner = self.inner.clone();
1054 Self {
1055 inner,
1056 accept_compression_encodings: self.accept_compression_encodings,
1057 send_compression_encodings: self.send_compression_encodings,
1058 max_decoding_message_size: self.max_decoding_message_size,
1059 max_encoding_message_size: self.max_encoding_message_size,
1060 }
1061 }
1062 }
1063 pub const SERVICE_NAME: &str = "penumbra.util.tendermint_proxy.v1.TendermintProxyService";
1065 impl<T> tonic::server::NamedService for TendermintProxyServiceServer<T> {
1066 const NAME: &'static str = SERVICE_NAME;
1067 }
1068}