1#[allow(clippy::derive_partial_eq_without_eq)]
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct SignRequest {
6 #[prost(bytes = "vec", tag = "1")]
7 pub message: ::prost::alloc::vec::Vec<u8>,
8}
9#[allow(clippy::derive_partial_eq_without_eq)]
11#[derive(Clone, PartialEq, ::prost::Message)]
12pub struct SignResponse {
13 #[prost(bytes = "vec", tag = "1")]
14 pub signature: ::prost::alloc::vec::Vec<u8>,
15}
16#[allow(clippy::derive_partial_eq_without_eq)]
18#[derive(Clone, PartialEq, ::prost::Message)]
19pub struct GetPublicRequest {}
20#[allow(clippy::derive_partial_eq_without_eq)]
22#[derive(Clone, PartialEq, ::prost::Message)]
23pub struct GetPublicResponse {
24 #[prost(bytes = "vec", tag = "1")]
25 pub public_key: ::prost::alloc::vec::Vec<u8>,
26}
27pub mod signer_service_client {
29 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
30 use tonic::codegen::*;
31 use tonic::codegen::http::Uri;
32 #[derive(Debug, Clone)]
34 pub struct SignerServiceClient<T> {
35 inner: tonic::client::Grpc<T>,
36 }
37 impl SignerServiceClient<tonic::transport::Channel> {
38 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
40 where
41 D: TryInto<tonic::transport::Endpoint>,
42 D::Error: Into<StdError>,
43 {
44 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
45 Ok(Self::new(conn))
46 }
47 }
48 impl<T> SignerServiceClient<T>
49 where
50 T: tonic::client::GrpcService<tonic::body::BoxBody>,
51 T::Error: Into<StdError>,
52 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
53 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
54 {
55 pub fn new(inner: T) -> Self {
56 let inner = tonic::client::Grpc::new(inner);
57 Self { inner }
58 }
59 pub fn with_origin(inner: T, origin: Uri) -> Self {
60 let inner = tonic::client::Grpc::with_origin(inner, origin);
61 Self { inner }
62 }
63 pub fn with_interceptor<F>(
64 inner: T,
65 interceptor: F,
66 ) -> SignerServiceClient<InterceptedService<T, F>>
67 where
68 F: tonic::service::Interceptor,
69 T::ResponseBody: Default,
70 T: tonic::codegen::Service<
71 http::Request<tonic::body::BoxBody>,
72 Response = http::Response<
73 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
74 >,
75 >,
76 <T as tonic::codegen::Service<
77 http::Request<tonic::body::BoxBody>,
78 >>::Error: Into<StdError> + Send + Sync,
79 {
80 SignerServiceClient::new(InterceptedService::new(inner, interceptor))
81 }
82 #[must_use]
87 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
88 self.inner = self.inner.send_compressed(encoding);
89 self
90 }
91 #[must_use]
93 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
94 self.inner = self.inner.accept_compressed(encoding);
95 self
96 }
97 #[must_use]
101 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
102 self.inner = self.inner.max_decoding_message_size(limit);
103 self
104 }
105 #[must_use]
109 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
110 self.inner = self.inner.max_encoding_message_size(limit);
111 self
112 }
113 pub async fn sign(
115 &mut self,
116 request: impl tonic::IntoRequest<super::SignRequest>,
117 ) -> std::result::Result<tonic::Response<super::SignResponse>, tonic::Status> {
118 self.inner
119 .ready()
120 .await
121 .map_err(|e| {
122 tonic::Status::new(
123 tonic::Code::Unknown,
124 format!("Service was not ready: {}", e.into()),
125 )
126 })?;
127 let codec = tonic::codec::ProstCodec::default();
128 let path = http::uri::PathAndQuery::from_static(
129 "/evnode.v1.SignerService/Sign",
130 );
131 let mut req = request.into_request();
132 req.extensions_mut()
133 .insert(GrpcMethod::new("evnode.v1.SignerService", "Sign"));
134 self.inner.unary(req, path, codec).await
135 }
136 pub async fn get_public(
138 &mut self,
139 request: impl tonic::IntoRequest<super::GetPublicRequest>,
140 ) -> std::result::Result<
141 tonic::Response<super::GetPublicResponse>,
142 tonic::Status,
143 > {
144 self.inner
145 .ready()
146 .await
147 .map_err(|e| {
148 tonic::Status::new(
149 tonic::Code::Unknown,
150 format!("Service was not ready: {}", e.into()),
151 )
152 })?;
153 let codec = tonic::codec::ProstCodec::default();
154 let path = http::uri::PathAndQuery::from_static(
155 "/evnode.v1.SignerService/GetPublic",
156 );
157 let mut req = request.into_request();
158 req.extensions_mut()
159 .insert(GrpcMethod::new("evnode.v1.SignerService", "GetPublic"));
160 self.inner.unary(req, path, codec).await
161 }
162 }
163}
164pub mod signer_service_server {
166 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
167 use tonic::codegen::*;
168 #[async_trait]
170 pub trait SignerService: Send + Sync + 'static {
171 async fn sign(
173 &self,
174 request: tonic::Request<super::SignRequest>,
175 ) -> std::result::Result<tonic::Response<super::SignResponse>, tonic::Status>;
176 async fn get_public(
178 &self,
179 request: tonic::Request<super::GetPublicRequest>,
180 ) -> std::result::Result<
181 tonic::Response<super::GetPublicResponse>,
182 tonic::Status,
183 >;
184 }
185 #[derive(Debug)]
187 pub struct SignerServiceServer<T: SignerService> {
188 inner: _Inner<T>,
189 accept_compression_encodings: EnabledCompressionEncodings,
190 send_compression_encodings: EnabledCompressionEncodings,
191 max_decoding_message_size: Option<usize>,
192 max_encoding_message_size: Option<usize>,
193 }
194 struct _Inner<T>(Arc<T>);
195 impl<T: SignerService> SignerServiceServer<T> {
196 pub fn new(inner: T) -> Self {
197 Self::from_arc(Arc::new(inner))
198 }
199 pub fn from_arc(inner: Arc<T>) -> Self {
200 let inner = _Inner(inner);
201 Self {
202 inner,
203 accept_compression_encodings: Default::default(),
204 send_compression_encodings: Default::default(),
205 max_decoding_message_size: None,
206 max_encoding_message_size: None,
207 }
208 }
209 pub fn with_interceptor<F>(
210 inner: T,
211 interceptor: F,
212 ) -> InterceptedService<Self, F>
213 where
214 F: tonic::service::Interceptor,
215 {
216 InterceptedService::new(Self::new(inner), interceptor)
217 }
218 #[must_use]
220 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
221 self.accept_compression_encodings.enable(encoding);
222 self
223 }
224 #[must_use]
226 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
227 self.send_compression_encodings.enable(encoding);
228 self
229 }
230 #[must_use]
234 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
235 self.max_decoding_message_size = Some(limit);
236 self
237 }
238 #[must_use]
242 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
243 self.max_encoding_message_size = Some(limit);
244 self
245 }
246 }
247 impl<T, B> tonic::codegen::Service<http::Request<B>> for SignerServiceServer<T>
248 where
249 T: SignerService,
250 B: Body + Send + 'static,
251 B::Error: Into<StdError> + Send + 'static,
252 {
253 type Response = http::Response<tonic::body::BoxBody>;
254 type Error = std::convert::Infallible;
255 type Future = BoxFuture<Self::Response, Self::Error>;
256 fn poll_ready(
257 &mut self,
258 _cx: &mut Context<'_>,
259 ) -> Poll<std::result::Result<(), Self::Error>> {
260 Poll::Ready(Ok(()))
261 }
262 fn call(&mut self, req: http::Request<B>) -> Self::Future {
263 let inner = self.inner.clone();
264 match req.uri().path() {
265 "/evnode.v1.SignerService/Sign" => {
266 #[allow(non_camel_case_types)]
267 struct SignSvc<T: SignerService>(pub Arc<T>);
268 impl<
269 T: SignerService,
270 > tonic::server::UnaryService<super::SignRequest> for SignSvc<T> {
271 type Response = super::SignResponse;
272 type Future = BoxFuture<
273 tonic::Response<Self::Response>,
274 tonic::Status,
275 >;
276 fn call(
277 &mut self,
278 request: tonic::Request<super::SignRequest>,
279 ) -> Self::Future {
280 let inner = Arc::clone(&self.0);
281 let fut = async move {
282 <T as SignerService>::sign(&inner, request).await
283 };
284 Box::pin(fut)
285 }
286 }
287 let accept_compression_encodings = self.accept_compression_encodings;
288 let send_compression_encodings = self.send_compression_encodings;
289 let max_decoding_message_size = self.max_decoding_message_size;
290 let max_encoding_message_size = self.max_encoding_message_size;
291 let inner = self.inner.clone();
292 let fut = async move {
293 let inner = inner.0;
294 let method = SignSvc(inner);
295 let codec = tonic::codec::ProstCodec::default();
296 let mut grpc = tonic::server::Grpc::new(codec)
297 .apply_compression_config(
298 accept_compression_encodings,
299 send_compression_encodings,
300 )
301 .apply_max_message_size_config(
302 max_decoding_message_size,
303 max_encoding_message_size,
304 );
305 let res = grpc.unary(method, req).await;
306 Ok(res)
307 };
308 Box::pin(fut)
309 }
310 "/evnode.v1.SignerService/GetPublic" => {
311 #[allow(non_camel_case_types)]
312 struct GetPublicSvc<T: SignerService>(pub Arc<T>);
313 impl<
314 T: SignerService,
315 > tonic::server::UnaryService<super::GetPublicRequest>
316 for GetPublicSvc<T> {
317 type Response = super::GetPublicResponse;
318 type Future = BoxFuture<
319 tonic::Response<Self::Response>,
320 tonic::Status,
321 >;
322 fn call(
323 &mut self,
324 request: tonic::Request<super::GetPublicRequest>,
325 ) -> Self::Future {
326 let inner = Arc::clone(&self.0);
327 let fut = async move {
328 <T as SignerService>::get_public(&inner, request).await
329 };
330 Box::pin(fut)
331 }
332 }
333 let accept_compression_encodings = self.accept_compression_encodings;
334 let send_compression_encodings = self.send_compression_encodings;
335 let max_decoding_message_size = self.max_decoding_message_size;
336 let max_encoding_message_size = self.max_encoding_message_size;
337 let inner = self.inner.clone();
338 let fut = async move {
339 let inner = inner.0;
340 let method = GetPublicSvc(inner);
341 let codec = tonic::codec::ProstCodec::default();
342 let mut grpc = tonic::server::Grpc::new(codec)
343 .apply_compression_config(
344 accept_compression_encodings,
345 send_compression_encodings,
346 )
347 .apply_max_message_size_config(
348 max_decoding_message_size,
349 max_encoding_message_size,
350 );
351 let res = grpc.unary(method, req).await;
352 Ok(res)
353 };
354 Box::pin(fut)
355 }
356 _ => {
357 Box::pin(async move {
358 Ok(
359 http::Response::builder()
360 .status(200)
361 .header("grpc-status", "12")
362 .header("content-type", "application/grpc")
363 .body(empty_body())
364 .unwrap(),
365 )
366 })
367 }
368 }
369 }
370 }
371 impl<T: SignerService> Clone for SignerServiceServer<T> {
372 fn clone(&self) -> Self {
373 let inner = self.inner.clone();
374 Self {
375 inner,
376 accept_compression_encodings: self.accept_compression_encodings,
377 send_compression_encodings: self.send_compression_encodings,
378 max_decoding_message_size: self.max_decoding_message_size,
379 max_encoding_message_size: self.max_encoding_message_size,
380 }
381 }
382 }
383 impl<T: SignerService> Clone for _Inner<T> {
384 fn clone(&self) -> Self {
385 Self(Arc::clone(&self.0))
386 }
387 }
388 impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
389 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
390 write!(f, "{:?}", self.0)
391 }
392 }
393 impl<T: SignerService> tonic::server::NamedService for SignerServiceServer<T> {
394 const NAME: &'static str = "evnode.v1.SignerService";
395 }
396}
397#[allow(clippy::derive_partial_eq_without_eq)]
402#[derive(Clone, PartialEq, ::prost::Message)]
403pub struct Version {
404 #[prost(uint64, tag = "1")]
405 pub block: u64,
406 #[prost(uint64, tag = "2")]
407 pub app: u64,
408}
409#[allow(clippy::derive_partial_eq_without_eq)]
411#[derive(Clone, PartialEq, ::prost::Message)]
412pub struct Header {
413 #[prost(message, optional, tag = "1")]
415 pub version: ::core::option::Option<Version>,
416 #[prost(uint64, tag = "2")]
418 pub height: u64,
419 #[prost(uint64, tag = "3")]
421 pub time: u64,
422 #[prost(bytes = "vec", tag = "4")]
424 pub last_header_hash: ::prost::alloc::vec::Vec<u8>,
425 #[prost(bytes = "vec", tag = "5")]
427 pub last_commit_hash: ::prost::alloc::vec::Vec<u8>,
428 #[prost(bytes = "vec", tag = "6")]
430 pub data_hash: ::prost::alloc::vec::Vec<u8>,
431 #[prost(bytes = "vec", tag = "7")]
433 pub consensus_hash: ::prost::alloc::vec::Vec<u8>,
434 #[prost(bytes = "vec", tag = "8")]
436 pub app_hash: ::prost::alloc::vec::Vec<u8>,
437 #[prost(bytes = "vec", tag = "9")]
441 pub last_results_hash: ::prost::alloc::vec::Vec<u8>,
442 #[prost(bytes = "vec", tag = "10")]
448 pub proposer_address: ::prost::alloc::vec::Vec<u8>,
449 #[prost(bytes = "vec", tag = "11")]
451 pub validator_hash: ::prost::alloc::vec::Vec<u8>,
452 #[prost(string, tag = "12")]
454 pub chain_id: ::prost::alloc::string::String,
455}
456#[allow(clippy::derive_partial_eq_without_eq)]
458#[derive(Clone, PartialEq, ::prost::Message)]
459pub struct SignedHeader {
460 #[prost(message, optional, tag = "1")]
461 pub header: ::core::option::Option<Header>,
462 #[prost(bytes = "vec", tag = "2")]
463 pub signature: ::prost::alloc::vec::Vec<u8>,
464 #[prost(message, optional, tag = "3")]
465 pub signer: ::core::option::Option<Signer>,
466}
467#[allow(clippy::derive_partial_eq_without_eq)]
469#[derive(Clone, PartialEq, ::prost::Message)]
470pub struct Signer {
471 #[prost(bytes = "vec", tag = "1")]
473 pub address: ::prost::alloc::vec::Vec<u8>,
474 #[prost(bytes = "vec", tag = "2")]
476 pub pub_key: ::prost::alloc::vec::Vec<u8>,
477}
478#[allow(clippy::derive_partial_eq_without_eq)]
480#[derive(Clone, PartialEq, ::prost::Message)]
481pub struct Metadata {
482 #[prost(string, tag = "1")]
484 pub chain_id: ::prost::alloc::string::String,
485 #[prost(uint64, tag = "2")]
487 pub height: u64,
488 #[prost(uint64, tag = "3")]
490 pub time: u64,
491 #[prost(bytes = "vec", tag = "4")]
493 pub last_data_hash: ::prost::alloc::vec::Vec<u8>,
494}
495#[allow(clippy::derive_partial_eq_without_eq)]
497#[derive(Clone, PartialEq, ::prost::Message)]
498pub struct Data {
499 #[prost(message, optional, tag = "1")]
500 pub metadata: ::core::option::Option<Metadata>,
501 #[prost(bytes = "vec", repeated, tag = "2")]
502 pub txs: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
503}
504#[allow(clippy::derive_partial_eq_without_eq)]
506#[derive(Clone, PartialEq, ::prost::Message)]
507pub struct SignedData {
508 #[prost(message, optional, tag = "1")]
509 pub data: ::core::option::Option<Data>,
510 #[prost(bytes = "vec", tag = "2")]
511 pub signature: ::prost::alloc::vec::Vec<u8>,
512 #[prost(message, optional, tag = "3")]
513 pub signer: ::core::option::Option<Signer>,
514}
515#[allow(clippy::derive_partial_eq_without_eq)]
517#[derive(Clone, PartialEq, ::prost::Message)]
518pub struct Vote {
519 #[prost(string, tag = "1")]
521 pub chain_id: ::prost::alloc::string::String,
522 #[prost(uint64, tag = "2")]
524 pub height: u64,
525 #[prost(message, optional, tag = "3")]
527 pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
528 #[prost(bytes = "vec", tag = "4")]
530 pub block_id_hash: ::prost::alloc::vec::Vec<u8>,
531 #[prost(bytes = "vec", tag = "5")]
533 pub validator_address: ::prost::alloc::vec::Vec<u8>,
534}
535#[allow(clippy::derive_partial_eq_without_eq)]
537#[derive(Clone, PartialEq, ::prost::Message)]
538pub struct State {
539 #[prost(message, optional, tag = "1")]
540 pub version: ::core::option::Option<Version>,
541 #[prost(string, tag = "2")]
542 pub chain_id: ::prost::alloc::string::String,
543 #[prost(uint64, tag = "3")]
544 pub initial_height: u64,
545 #[prost(uint64, tag = "4")]
546 pub last_block_height: u64,
547 #[prost(message, optional, tag = "5")]
548 pub last_block_time: ::core::option::Option<::prost_types::Timestamp>,
549 #[prost(uint64, tag = "6")]
550 pub da_height: u64,
551 #[prost(bytes = "vec", tag = "7")]
552 pub last_results_hash: ::prost::alloc::vec::Vec<u8>,
553 #[prost(bytes = "vec", tag = "8")]
554 pub app_hash: ::prost::alloc::vec::Vec<u8>,
555}
556#[allow(clippy::derive_partial_eq_without_eq)]
558#[derive(Clone, PartialEq, ::prost::Message)]
559pub struct GetPeerInfoResponse {
560 #[prost(message, repeated, tag = "1")]
562 pub peers: ::prost::alloc::vec::Vec<PeerInfo>,
563}
564#[allow(clippy::derive_partial_eq_without_eq)]
566#[derive(Clone, PartialEq, ::prost::Message)]
567pub struct GetNetInfoResponse {
568 #[prost(message, optional, tag = "1")]
570 pub net_info: ::core::option::Option<NetInfo>,
571}
572#[allow(clippy::derive_partial_eq_without_eq)]
574#[derive(Clone, PartialEq, ::prost::Message)]
575pub struct PeerInfo {
576 #[prost(string, tag = "1")]
578 pub id: ::prost::alloc::string::String,
579 #[prost(string, tag = "2")]
581 pub address: ::prost::alloc::string::String,
582}
583#[allow(clippy::derive_partial_eq_without_eq)]
585#[derive(Clone, PartialEq, ::prost::Message)]
586pub struct NetInfo {
587 #[prost(string, tag = "1")]
589 pub id: ::prost::alloc::string::String,
590 #[prost(string, repeated, tag = "2")]
592 pub listen_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
593 #[prost(string, repeated, tag = "3")]
595 pub connected_peers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
596}
597pub mod p2p_service_client {
599 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
600 use tonic::codegen::*;
601 use tonic::codegen::http::Uri;
602 #[derive(Debug, Clone)]
604 pub struct P2pServiceClient<T> {
605 inner: tonic::client::Grpc<T>,
606 }
607 impl P2pServiceClient<tonic::transport::Channel> {
608 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
610 where
611 D: TryInto<tonic::transport::Endpoint>,
612 D::Error: Into<StdError>,
613 {
614 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
615 Ok(Self::new(conn))
616 }
617 }
618 impl<T> P2pServiceClient<T>
619 where
620 T: tonic::client::GrpcService<tonic::body::BoxBody>,
621 T::Error: Into<StdError>,
622 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
623 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
624 {
625 pub fn new(inner: T) -> Self {
626 let inner = tonic::client::Grpc::new(inner);
627 Self { inner }
628 }
629 pub fn with_origin(inner: T, origin: Uri) -> Self {
630 let inner = tonic::client::Grpc::with_origin(inner, origin);
631 Self { inner }
632 }
633 pub fn with_interceptor<F>(
634 inner: T,
635 interceptor: F,
636 ) -> P2pServiceClient<InterceptedService<T, F>>
637 where
638 F: tonic::service::Interceptor,
639 T::ResponseBody: Default,
640 T: tonic::codegen::Service<
641 http::Request<tonic::body::BoxBody>,
642 Response = http::Response<
643 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
644 >,
645 >,
646 <T as tonic::codegen::Service<
647 http::Request<tonic::body::BoxBody>,
648 >>::Error: Into<StdError> + Send + Sync,
649 {
650 P2pServiceClient::new(InterceptedService::new(inner, interceptor))
651 }
652 #[must_use]
657 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
658 self.inner = self.inner.send_compressed(encoding);
659 self
660 }
661 #[must_use]
663 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
664 self.inner = self.inner.accept_compressed(encoding);
665 self
666 }
667 #[must_use]
671 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
672 self.inner = self.inner.max_decoding_message_size(limit);
673 self
674 }
675 #[must_use]
679 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
680 self.inner = self.inner.max_encoding_message_size(limit);
681 self
682 }
683 pub async fn get_peer_info(
685 &mut self,
686 request: impl tonic::IntoRequest<()>,
687 ) -> std::result::Result<
688 tonic::Response<super::GetPeerInfoResponse>,
689 tonic::Status,
690 > {
691 self.inner
692 .ready()
693 .await
694 .map_err(|e| {
695 tonic::Status::new(
696 tonic::Code::Unknown,
697 format!("Service was not ready: {}", e.into()),
698 )
699 })?;
700 let codec = tonic::codec::ProstCodec::default();
701 let path = http::uri::PathAndQuery::from_static(
702 "/evnode.v1.P2PService/GetPeerInfo",
703 );
704 let mut req = request.into_request();
705 req.extensions_mut()
706 .insert(GrpcMethod::new("evnode.v1.P2PService", "GetPeerInfo"));
707 self.inner.unary(req, path, codec).await
708 }
709 pub async fn get_net_info(
711 &mut self,
712 request: impl tonic::IntoRequest<()>,
713 ) -> std::result::Result<
714 tonic::Response<super::GetNetInfoResponse>,
715 tonic::Status,
716 > {
717 self.inner
718 .ready()
719 .await
720 .map_err(|e| {
721 tonic::Status::new(
722 tonic::Code::Unknown,
723 format!("Service was not ready: {}", e.into()),
724 )
725 })?;
726 let codec = tonic::codec::ProstCodec::default();
727 let path = http::uri::PathAndQuery::from_static(
728 "/evnode.v1.P2PService/GetNetInfo",
729 );
730 let mut req = request.into_request();
731 req.extensions_mut()
732 .insert(GrpcMethod::new("evnode.v1.P2PService", "GetNetInfo"));
733 self.inner.unary(req, path, codec).await
734 }
735 }
736}
737pub mod p2p_service_server {
739 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
740 use tonic::codegen::*;
741 #[async_trait]
743 pub trait P2pService: Send + Sync + 'static {
744 async fn get_peer_info(
746 &self,
747 request: tonic::Request<()>,
748 ) -> std::result::Result<
749 tonic::Response<super::GetPeerInfoResponse>,
750 tonic::Status,
751 >;
752 async fn get_net_info(
754 &self,
755 request: tonic::Request<()>,
756 ) -> std::result::Result<
757 tonic::Response<super::GetNetInfoResponse>,
758 tonic::Status,
759 >;
760 }
761 #[derive(Debug)]
763 pub struct P2pServiceServer<T: P2pService> {
764 inner: _Inner<T>,
765 accept_compression_encodings: EnabledCompressionEncodings,
766 send_compression_encodings: EnabledCompressionEncodings,
767 max_decoding_message_size: Option<usize>,
768 max_encoding_message_size: Option<usize>,
769 }
770 struct _Inner<T>(Arc<T>);
771 impl<T: P2pService> P2pServiceServer<T> {
772 pub fn new(inner: T) -> Self {
773 Self::from_arc(Arc::new(inner))
774 }
775 pub fn from_arc(inner: Arc<T>) -> Self {
776 let inner = _Inner(inner);
777 Self {
778 inner,
779 accept_compression_encodings: Default::default(),
780 send_compression_encodings: Default::default(),
781 max_decoding_message_size: None,
782 max_encoding_message_size: None,
783 }
784 }
785 pub fn with_interceptor<F>(
786 inner: T,
787 interceptor: F,
788 ) -> InterceptedService<Self, F>
789 where
790 F: tonic::service::Interceptor,
791 {
792 InterceptedService::new(Self::new(inner), interceptor)
793 }
794 #[must_use]
796 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
797 self.accept_compression_encodings.enable(encoding);
798 self
799 }
800 #[must_use]
802 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
803 self.send_compression_encodings.enable(encoding);
804 self
805 }
806 #[must_use]
810 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
811 self.max_decoding_message_size = Some(limit);
812 self
813 }
814 #[must_use]
818 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
819 self.max_encoding_message_size = Some(limit);
820 self
821 }
822 }
823 impl<T, B> tonic::codegen::Service<http::Request<B>> for P2pServiceServer<T>
824 where
825 T: P2pService,
826 B: Body + Send + 'static,
827 B::Error: Into<StdError> + Send + 'static,
828 {
829 type Response = http::Response<tonic::body::BoxBody>;
830 type Error = std::convert::Infallible;
831 type Future = BoxFuture<Self::Response, Self::Error>;
832 fn poll_ready(
833 &mut self,
834 _cx: &mut Context<'_>,
835 ) -> Poll<std::result::Result<(), Self::Error>> {
836 Poll::Ready(Ok(()))
837 }
838 fn call(&mut self, req: http::Request<B>) -> Self::Future {
839 let inner = self.inner.clone();
840 match req.uri().path() {
841 "/evnode.v1.P2PService/GetPeerInfo" => {
842 #[allow(non_camel_case_types)]
843 struct GetPeerInfoSvc<T: P2pService>(pub Arc<T>);
844 impl<T: P2pService> tonic::server::UnaryService<()>
845 for GetPeerInfoSvc<T> {
846 type Response = super::GetPeerInfoResponse;
847 type Future = BoxFuture<
848 tonic::Response<Self::Response>,
849 tonic::Status,
850 >;
851 fn call(&mut self, request: tonic::Request<()>) -> Self::Future {
852 let inner = Arc::clone(&self.0);
853 let fut = async move {
854 <T as P2pService>::get_peer_info(&inner, request).await
855 };
856 Box::pin(fut)
857 }
858 }
859 let accept_compression_encodings = self.accept_compression_encodings;
860 let send_compression_encodings = self.send_compression_encodings;
861 let max_decoding_message_size = self.max_decoding_message_size;
862 let max_encoding_message_size = self.max_encoding_message_size;
863 let inner = self.inner.clone();
864 let fut = async move {
865 let inner = inner.0;
866 let method = GetPeerInfoSvc(inner);
867 let codec = tonic::codec::ProstCodec::default();
868 let mut grpc = tonic::server::Grpc::new(codec)
869 .apply_compression_config(
870 accept_compression_encodings,
871 send_compression_encodings,
872 )
873 .apply_max_message_size_config(
874 max_decoding_message_size,
875 max_encoding_message_size,
876 );
877 let res = grpc.unary(method, req).await;
878 Ok(res)
879 };
880 Box::pin(fut)
881 }
882 "/evnode.v1.P2PService/GetNetInfo" => {
883 #[allow(non_camel_case_types)]
884 struct GetNetInfoSvc<T: P2pService>(pub Arc<T>);
885 impl<T: P2pService> tonic::server::UnaryService<()>
886 for GetNetInfoSvc<T> {
887 type Response = super::GetNetInfoResponse;
888 type Future = BoxFuture<
889 tonic::Response<Self::Response>,
890 tonic::Status,
891 >;
892 fn call(&mut self, request: tonic::Request<()>) -> Self::Future {
893 let inner = Arc::clone(&self.0);
894 let fut = async move {
895 <T as P2pService>::get_net_info(&inner, request).await
896 };
897 Box::pin(fut)
898 }
899 }
900 let accept_compression_encodings = self.accept_compression_encodings;
901 let send_compression_encodings = self.send_compression_encodings;
902 let max_decoding_message_size = self.max_decoding_message_size;
903 let max_encoding_message_size = self.max_encoding_message_size;
904 let inner = self.inner.clone();
905 let fut = async move {
906 let inner = inner.0;
907 let method = GetNetInfoSvc(inner);
908 let codec = tonic::codec::ProstCodec::default();
909 let mut grpc = tonic::server::Grpc::new(codec)
910 .apply_compression_config(
911 accept_compression_encodings,
912 send_compression_encodings,
913 )
914 .apply_max_message_size_config(
915 max_decoding_message_size,
916 max_encoding_message_size,
917 );
918 let res = grpc.unary(method, req).await;
919 Ok(res)
920 };
921 Box::pin(fut)
922 }
923 _ => {
924 Box::pin(async move {
925 Ok(
926 http::Response::builder()
927 .status(200)
928 .header("grpc-status", "12")
929 .header("content-type", "application/grpc")
930 .body(empty_body())
931 .unwrap(),
932 )
933 })
934 }
935 }
936 }
937 }
938 impl<T: P2pService> Clone for P2pServiceServer<T> {
939 fn clone(&self) -> Self {
940 let inner = self.inner.clone();
941 Self {
942 inner,
943 accept_compression_encodings: self.accept_compression_encodings,
944 send_compression_encodings: self.send_compression_encodings,
945 max_decoding_message_size: self.max_decoding_message_size,
946 max_encoding_message_size: self.max_encoding_message_size,
947 }
948 }
949 }
950 impl<T: P2pService> Clone for _Inner<T> {
951 fn clone(&self) -> Self {
952 Self(Arc::clone(&self.0))
953 }
954 }
955 impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
956 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
957 write!(f, "{:?}", self.0)
958 }
959 }
960 impl<T: P2pService> tonic::server::NamedService for P2pServiceServer<T> {
961 const NAME: &'static str = "evnode.v1.P2PService";
962 }
963}
964#[allow(clippy::derive_partial_eq_without_eq)]
966#[derive(Clone, PartialEq, ::prost::Message)]
967pub struct Batch {
968 #[prost(bytes = "vec", repeated, tag = "1")]
969 pub txs: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
970}
971#[allow(clippy::derive_partial_eq_without_eq)]
973#[derive(Clone, PartialEq, ::prost::Message)]
974pub struct GetHealthResponse {
975 #[prost(enumeration = "HealthStatus", tag = "1")]
977 pub status: i32,
978}
979#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
981#[repr(i32)]
982pub enum HealthStatus {
983 Unknown = 0,
985 Pass = 1,
987 Warn = 2,
989 Fail = 3,
991}
992impl HealthStatus {
993 pub fn as_str_name(&self) -> &'static str {
998 match self {
999 HealthStatus::Unknown => "UNKNOWN",
1000 HealthStatus::Pass => "PASS",
1001 HealthStatus::Warn => "WARN",
1002 HealthStatus::Fail => "FAIL",
1003 }
1004 }
1005 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1007 match value {
1008 "UNKNOWN" => Some(Self::Unknown),
1009 "PASS" => Some(Self::Pass),
1010 "WARN" => Some(Self::Warn),
1011 "FAIL" => Some(Self::Fail),
1012 _ => None,
1013 }
1014 }
1015}
1016pub mod health_service_client {
1018 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
1019 use tonic::codegen::*;
1020 use tonic::codegen::http::Uri;
1021 #[derive(Debug, Clone)]
1023 pub struct HealthServiceClient<T> {
1024 inner: tonic::client::Grpc<T>,
1025 }
1026 impl HealthServiceClient<tonic::transport::Channel> {
1027 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1029 where
1030 D: TryInto<tonic::transport::Endpoint>,
1031 D::Error: Into<StdError>,
1032 {
1033 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1034 Ok(Self::new(conn))
1035 }
1036 }
1037 impl<T> HealthServiceClient<T>
1038 where
1039 T: tonic::client::GrpcService<tonic::body::BoxBody>,
1040 T::Error: Into<StdError>,
1041 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
1042 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
1043 {
1044 pub fn new(inner: T) -> Self {
1045 let inner = tonic::client::Grpc::new(inner);
1046 Self { inner }
1047 }
1048 pub fn with_origin(inner: T, origin: Uri) -> Self {
1049 let inner = tonic::client::Grpc::with_origin(inner, origin);
1050 Self { inner }
1051 }
1052 pub fn with_interceptor<F>(
1053 inner: T,
1054 interceptor: F,
1055 ) -> HealthServiceClient<InterceptedService<T, F>>
1056 where
1057 F: tonic::service::Interceptor,
1058 T::ResponseBody: Default,
1059 T: tonic::codegen::Service<
1060 http::Request<tonic::body::BoxBody>,
1061 Response = http::Response<
1062 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
1063 >,
1064 >,
1065 <T as tonic::codegen::Service<
1066 http::Request<tonic::body::BoxBody>,
1067 >>::Error: Into<StdError> + Send + Sync,
1068 {
1069 HealthServiceClient::new(InterceptedService::new(inner, interceptor))
1070 }
1071 #[must_use]
1076 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1077 self.inner = self.inner.send_compressed(encoding);
1078 self
1079 }
1080 #[must_use]
1082 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1083 self.inner = self.inner.accept_compressed(encoding);
1084 self
1085 }
1086 #[must_use]
1090 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1091 self.inner = self.inner.max_decoding_message_size(limit);
1092 self
1093 }
1094 #[must_use]
1098 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1099 self.inner = self.inner.max_encoding_message_size(limit);
1100 self
1101 }
1102 pub async fn livez(
1104 &mut self,
1105 request: impl tonic::IntoRequest<()>,
1106 ) -> std::result::Result<
1107 tonic::Response<super::GetHealthResponse>,
1108 tonic::Status,
1109 > {
1110 self.inner
1111 .ready()
1112 .await
1113 .map_err(|e| {
1114 tonic::Status::new(
1115 tonic::Code::Unknown,
1116 format!("Service was not ready: {}", e.into()),
1117 )
1118 })?;
1119 let codec = tonic::codec::ProstCodec::default();
1120 let path = http::uri::PathAndQuery::from_static(
1121 "/evnode.v1.HealthService/Livez",
1122 );
1123 let mut req = request.into_request();
1124 req.extensions_mut()
1125 .insert(GrpcMethod::new("evnode.v1.HealthService", "Livez"));
1126 self.inner.unary(req, path, codec).await
1127 }
1128 }
1129}
1130pub mod health_service_server {
1132 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
1133 use tonic::codegen::*;
1134 #[async_trait]
1136 pub trait HealthService: Send + Sync + 'static {
1137 async fn livez(
1139 &self,
1140 request: tonic::Request<()>,
1141 ) -> std::result::Result<
1142 tonic::Response<super::GetHealthResponse>,
1143 tonic::Status,
1144 >;
1145 }
1146 #[derive(Debug)]
1148 pub struct HealthServiceServer<T: HealthService> {
1149 inner: _Inner<T>,
1150 accept_compression_encodings: EnabledCompressionEncodings,
1151 send_compression_encodings: EnabledCompressionEncodings,
1152 max_decoding_message_size: Option<usize>,
1153 max_encoding_message_size: Option<usize>,
1154 }
1155 struct _Inner<T>(Arc<T>);
1156 impl<T: HealthService> HealthServiceServer<T> {
1157 pub fn new(inner: T) -> Self {
1158 Self::from_arc(Arc::new(inner))
1159 }
1160 pub fn from_arc(inner: Arc<T>) -> Self {
1161 let inner = _Inner(inner);
1162 Self {
1163 inner,
1164 accept_compression_encodings: Default::default(),
1165 send_compression_encodings: Default::default(),
1166 max_decoding_message_size: None,
1167 max_encoding_message_size: None,
1168 }
1169 }
1170 pub fn with_interceptor<F>(
1171 inner: T,
1172 interceptor: F,
1173 ) -> InterceptedService<Self, F>
1174 where
1175 F: tonic::service::Interceptor,
1176 {
1177 InterceptedService::new(Self::new(inner), interceptor)
1178 }
1179 #[must_use]
1181 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1182 self.accept_compression_encodings.enable(encoding);
1183 self
1184 }
1185 #[must_use]
1187 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1188 self.send_compression_encodings.enable(encoding);
1189 self
1190 }
1191 #[must_use]
1195 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1196 self.max_decoding_message_size = Some(limit);
1197 self
1198 }
1199 #[must_use]
1203 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1204 self.max_encoding_message_size = Some(limit);
1205 self
1206 }
1207 }
1208 impl<T, B> tonic::codegen::Service<http::Request<B>> for HealthServiceServer<T>
1209 where
1210 T: HealthService,
1211 B: Body + Send + 'static,
1212 B::Error: Into<StdError> + Send + 'static,
1213 {
1214 type Response = http::Response<tonic::body::BoxBody>;
1215 type Error = std::convert::Infallible;
1216 type Future = BoxFuture<Self::Response, Self::Error>;
1217 fn poll_ready(
1218 &mut self,
1219 _cx: &mut Context<'_>,
1220 ) -> Poll<std::result::Result<(), Self::Error>> {
1221 Poll::Ready(Ok(()))
1222 }
1223 fn call(&mut self, req: http::Request<B>) -> Self::Future {
1224 let inner = self.inner.clone();
1225 match req.uri().path() {
1226 "/evnode.v1.HealthService/Livez" => {
1227 #[allow(non_camel_case_types)]
1228 struct LivezSvc<T: HealthService>(pub Arc<T>);
1229 impl<T: HealthService> tonic::server::UnaryService<()>
1230 for LivezSvc<T> {
1231 type Response = super::GetHealthResponse;
1232 type Future = BoxFuture<
1233 tonic::Response<Self::Response>,
1234 tonic::Status,
1235 >;
1236 fn call(&mut self, request: tonic::Request<()>) -> Self::Future {
1237 let inner = Arc::clone(&self.0);
1238 let fut = async move {
1239 <T as HealthService>::livez(&inner, request).await
1240 };
1241 Box::pin(fut)
1242 }
1243 }
1244 let accept_compression_encodings = self.accept_compression_encodings;
1245 let send_compression_encodings = self.send_compression_encodings;
1246 let max_decoding_message_size = self.max_decoding_message_size;
1247 let max_encoding_message_size = self.max_encoding_message_size;
1248 let inner = self.inner.clone();
1249 let fut = async move {
1250 let inner = inner.0;
1251 let method = LivezSvc(inner);
1252 let codec = tonic::codec::ProstCodec::default();
1253 let mut grpc = tonic::server::Grpc::new(codec)
1254 .apply_compression_config(
1255 accept_compression_encodings,
1256 send_compression_encodings,
1257 )
1258 .apply_max_message_size_config(
1259 max_decoding_message_size,
1260 max_encoding_message_size,
1261 );
1262 let res = grpc.unary(method, req).await;
1263 Ok(res)
1264 };
1265 Box::pin(fut)
1266 }
1267 _ => {
1268 Box::pin(async move {
1269 Ok(
1270 http::Response::builder()
1271 .status(200)
1272 .header("grpc-status", "12")
1273 .header("content-type", "application/grpc")
1274 .body(empty_body())
1275 .unwrap(),
1276 )
1277 })
1278 }
1279 }
1280 }
1281 }
1282 impl<T: HealthService> Clone for HealthServiceServer<T> {
1283 fn clone(&self) -> Self {
1284 let inner = self.inner.clone();
1285 Self {
1286 inner,
1287 accept_compression_encodings: self.accept_compression_encodings,
1288 send_compression_encodings: self.send_compression_encodings,
1289 max_decoding_message_size: self.max_decoding_message_size,
1290 max_encoding_message_size: self.max_encoding_message_size,
1291 }
1292 }
1293 }
1294 impl<T: HealthService> Clone for _Inner<T> {
1295 fn clone(&self) -> Self {
1296 Self(Arc::clone(&self.0))
1297 }
1298 }
1299 impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
1300 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1301 write!(f, "{:?}", self.0)
1302 }
1303 }
1304 impl<T: HealthService> tonic::server::NamedService for HealthServiceServer<T> {
1305 const NAME: &'static str = "evnode.v1.HealthService";
1306 }
1307}
1308#[allow(clippy::derive_partial_eq_without_eq)]
1310#[derive(Clone, PartialEq, ::prost::Message)]
1311pub struct InitChainRequest {
1312 #[prost(message, optional, tag = "1")]
1314 pub genesis_time: ::core::option::Option<::prost_types::Timestamp>,
1315 #[prost(uint64, tag = "2")]
1317 pub initial_height: u64,
1318 #[prost(string, tag = "3")]
1320 pub chain_id: ::prost::alloc::string::String,
1321}
1322#[allow(clippy::derive_partial_eq_without_eq)]
1324#[derive(Clone, PartialEq, ::prost::Message)]
1325pub struct InitChainResponse {
1326 #[prost(bytes = "vec", tag = "1")]
1328 pub state_root: ::prost::alloc::vec::Vec<u8>,
1329 #[prost(uint64, tag = "2")]
1331 pub max_bytes: u64,
1332}
1333#[allow(clippy::derive_partial_eq_without_eq)]
1337#[derive(Clone, PartialEq, ::prost::Message)]
1338pub struct GetTxsRequest {}
1339#[allow(clippy::derive_partial_eq_without_eq)]
1341#[derive(Clone, PartialEq, ::prost::Message)]
1342pub struct GetTxsResponse {
1343 #[prost(bytes = "vec", repeated, tag = "1")]
1345 pub txs: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
1346}
1347#[allow(clippy::derive_partial_eq_without_eq)]
1349#[derive(Clone, PartialEq, ::prost::Message)]
1350pub struct ExecuteTxsRequest {
1351 #[prost(bytes = "vec", repeated, tag = "1")]
1353 pub txs: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
1354 #[prost(uint64, tag = "2")]
1356 pub block_height: u64,
1357 #[prost(message, optional, tag = "3")]
1359 pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
1360 #[prost(bytes = "vec", tag = "4")]
1362 pub prev_state_root: ::prost::alloc::vec::Vec<u8>,
1363}
1364#[allow(clippy::derive_partial_eq_without_eq)]
1366#[derive(Clone, PartialEq, ::prost::Message)]
1367pub struct ExecuteTxsResponse {
1368 #[prost(bytes = "vec", tag = "1")]
1370 pub updated_state_root: ::prost::alloc::vec::Vec<u8>,
1371 #[prost(uint64, tag = "2")]
1373 pub max_bytes: u64,
1374}
1375#[allow(clippy::derive_partial_eq_without_eq)]
1377#[derive(Clone, PartialEq, ::prost::Message)]
1378pub struct SetFinalRequest {
1379 #[prost(uint64, tag = "1")]
1381 pub block_height: u64,
1382}
1383#[allow(clippy::derive_partial_eq_without_eq)]
1387#[derive(Clone, PartialEq, ::prost::Message)]
1388pub struct SetFinalResponse {}
1389pub mod executor_service_client {
1391 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
1392 use tonic::codegen::*;
1393 use tonic::codegen::http::Uri;
1394 #[derive(Debug, Clone)]
1396 pub struct ExecutorServiceClient<T> {
1397 inner: tonic::client::Grpc<T>,
1398 }
1399 impl ExecutorServiceClient<tonic::transport::Channel> {
1400 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1402 where
1403 D: TryInto<tonic::transport::Endpoint>,
1404 D::Error: Into<StdError>,
1405 {
1406 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1407 Ok(Self::new(conn))
1408 }
1409 }
1410 impl<T> ExecutorServiceClient<T>
1411 where
1412 T: tonic::client::GrpcService<tonic::body::BoxBody>,
1413 T::Error: Into<StdError>,
1414 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
1415 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
1416 {
1417 pub fn new(inner: T) -> Self {
1418 let inner = tonic::client::Grpc::new(inner);
1419 Self { inner }
1420 }
1421 pub fn with_origin(inner: T, origin: Uri) -> Self {
1422 let inner = tonic::client::Grpc::with_origin(inner, origin);
1423 Self { inner }
1424 }
1425 pub fn with_interceptor<F>(
1426 inner: T,
1427 interceptor: F,
1428 ) -> ExecutorServiceClient<InterceptedService<T, F>>
1429 where
1430 F: tonic::service::Interceptor,
1431 T::ResponseBody: Default,
1432 T: tonic::codegen::Service<
1433 http::Request<tonic::body::BoxBody>,
1434 Response = http::Response<
1435 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
1436 >,
1437 >,
1438 <T as tonic::codegen::Service<
1439 http::Request<tonic::body::BoxBody>,
1440 >>::Error: Into<StdError> + Send + Sync,
1441 {
1442 ExecutorServiceClient::new(InterceptedService::new(inner, interceptor))
1443 }
1444 #[must_use]
1449 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1450 self.inner = self.inner.send_compressed(encoding);
1451 self
1452 }
1453 #[must_use]
1455 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1456 self.inner = self.inner.accept_compressed(encoding);
1457 self
1458 }
1459 #[must_use]
1463 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1464 self.inner = self.inner.max_decoding_message_size(limit);
1465 self
1466 }
1467 #[must_use]
1471 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1472 self.inner = self.inner.max_encoding_message_size(limit);
1473 self
1474 }
1475 pub async fn init_chain(
1477 &mut self,
1478 request: impl tonic::IntoRequest<super::InitChainRequest>,
1479 ) -> std::result::Result<
1480 tonic::Response<super::InitChainResponse>,
1481 tonic::Status,
1482 > {
1483 self.inner
1484 .ready()
1485 .await
1486 .map_err(|e| {
1487 tonic::Status::new(
1488 tonic::Code::Unknown,
1489 format!("Service was not ready: {}", e.into()),
1490 )
1491 })?;
1492 let codec = tonic::codec::ProstCodec::default();
1493 let path = http::uri::PathAndQuery::from_static(
1494 "/evnode.v1.ExecutorService/InitChain",
1495 );
1496 let mut req = request.into_request();
1497 req.extensions_mut()
1498 .insert(GrpcMethod::new("evnode.v1.ExecutorService", "InitChain"));
1499 self.inner.unary(req, path, codec).await
1500 }
1501 pub async fn get_txs(
1503 &mut self,
1504 request: impl tonic::IntoRequest<super::GetTxsRequest>,
1505 ) -> std::result::Result<tonic::Response<super::GetTxsResponse>, tonic::Status> {
1506 self.inner
1507 .ready()
1508 .await
1509 .map_err(|e| {
1510 tonic::Status::new(
1511 tonic::Code::Unknown,
1512 format!("Service was not ready: {}", e.into()),
1513 )
1514 })?;
1515 let codec = tonic::codec::ProstCodec::default();
1516 let path = http::uri::PathAndQuery::from_static(
1517 "/evnode.v1.ExecutorService/GetTxs",
1518 );
1519 let mut req = request.into_request();
1520 req.extensions_mut()
1521 .insert(GrpcMethod::new("evnode.v1.ExecutorService", "GetTxs"));
1522 self.inner.unary(req, path, codec).await
1523 }
1524 pub async fn execute_txs(
1526 &mut self,
1527 request: impl tonic::IntoRequest<super::ExecuteTxsRequest>,
1528 ) -> std::result::Result<
1529 tonic::Response<super::ExecuteTxsResponse>,
1530 tonic::Status,
1531 > {
1532 self.inner
1533 .ready()
1534 .await
1535 .map_err(|e| {
1536 tonic::Status::new(
1537 tonic::Code::Unknown,
1538 format!("Service was not ready: {}", e.into()),
1539 )
1540 })?;
1541 let codec = tonic::codec::ProstCodec::default();
1542 let path = http::uri::PathAndQuery::from_static(
1543 "/evnode.v1.ExecutorService/ExecuteTxs",
1544 );
1545 let mut req = request.into_request();
1546 req.extensions_mut()
1547 .insert(GrpcMethod::new("evnode.v1.ExecutorService", "ExecuteTxs"));
1548 self.inner.unary(req, path, codec).await
1549 }
1550 pub async fn set_final(
1552 &mut self,
1553 request: impl tonic::IntoRequest<super::SetFinalRequest>,
1554 ) -> std::result::Result<
1555 tonic::Response<super::SetFinalResponse>,
1556 tonic::Status,
1557 > {
1558 self.inner
1559 .ready()
1560 .await
1561 .map_err(|e| {
1562 tonic::Status::new(
1563 tonic::Code::Unknown,
1564 format!("Service was not ready: {}", e.into()),
1565 )
1566 })?;
1567 let codec = tonic::codec::ProstCodec::default();
1568 let path = http::uri::PathAndQuery::from_static(
1569 "/evnode.v1.ExecutorService/SetFinal",
1570 );
1571 let mut req = request.into_request();
1572 req.extensions_mut()
1573 .insert(GrpcMethod::new("evnode.v1.ExecutorService", "SetFinal"));
1574 self.inner.unary(req, path, codec).await
1575 }
1576 }
1577}
1578pub mod executor_service_server {
1580 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
1581 use tonic::codegen::*;
1582 #[async_trait]
1584 pub trait ExecutorService: Send + Sync + 'static {
1585 async fn init_chain(
1587 &self,
1588 request: tonic::Request<super::InitChainRequest>,
1589 ) -> std::result::Result<
1590 tonic::Response<super::InitChainResponse>,
1591 tonic::Status,
1592 >;
1593 async fn get_txs(
1595 &self,
1596 request: tonic::Request<super::GetTxsRequest>,
1597 ) -> std::result::Result<tonic::Response<super::GetTxsResponse>, tonic::Status>;
1598 async fn execute_txs(
1600 &self,
1601 request: tonic::Request<super::ExecuteTxsRequest>,
1602 ) -> std::result::Result<
1603 tonic::Response<super::ExecuteTxsResponse>,
1604 tonic::Status,
1605 >;
1606 async fn set_final(
1608 &self,
1609 request: tonic::Request<super::SetFinalRequest>,
1610 ) -> std::result::Result<
1611 tonic::Response<super::SetFinalResponse>,
1612 tonic::Status,
1613 >;
1614 }
1615 #[derive(Debug)]
1617 pub struct ExecutorServiceServer<T: ExecutorService> {
1618 inner: _Inner<T>,
1619 accept_compression_encodings: EnabledCompressionEncodings,
1620 send_compression_encodings: EnabledCompressionEncodings,
1621 max_decoding_message_size: Option<usize>,
1622 max_encoding_message_size: Option<usize>,
1623 }
1624 struct _Inner<T>(Arc<T>);
1625 impl<T: ExecutorService> ExecutorServiceServer<T> {
1626 pub fn new(inner: T) -> Self {
1627 Self::from_arc(Arc::new(inner))
1628 }
1629 pub fn from_arc(inner: Arc<T>) -> Self {
1630 let inner = _Inner(inner);
1631 Self {
1632 inner,
1633 accept_compression_encodings: Default::default(),
1634 send_compression_encodings: Default::default(),
1635 max_decoding_message_size: None,
1636 max_encoding_message_size: None,
1637 }
1638 }
1639 pub fn with_interceptor<F>(
1640 inner: T,
1641 interceptor: F,
1642 ) -> InterceptedService<Self, F>
1643 where
1644 F: tonic::service::Interceptor,
1645 {
1646 InterceptedService::new(Self::new(inner), interceptor)
1647 }
1648 #[must_use]
1650 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1651 self.accept_compression_encodings.enable(encoding);
1652 self
1653 }
1654 #[must_use]
1656 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1657 self.send_compression_encodings.enable(encoding);
1658 self
1659 }
1660 #[must_use]
1664 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1665 self.max_decoding_message_size = Some(limit);
1666 self
1667 }
1668 #[must_use]
1672 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1673 self.max_encoding_message_size = Some(limit);
1674 self
1675 }
1676 }
1677 impl<T, B> tonic::codegen::Service<http::Request<B>> for ExecutorServiceServer<T>
1678 where
1679 T: ExecutorService,
1680 B: Body + Send + 'static,
1681 B::Error: Into<StdError> + Send + 'static,
1682 {
1683 type Response = http::Response<tonic::body::BoxBody>;
1684 type Error = std::convert::Infallible;
1685 type Future = BoxFuture<Self::Response, Self::Error>;
1686 fn poll_ready(
1687 &mut self,
1688 _cx: &mut Context<'_>,
1689 ) -> Poll<std::result::Result<(), Self::Error>> {
1690 Poll::Ready(Ok(()))
1691 }
1692 fn call(&mut self, req: http::Request<B>) -> Self::Future {
1693 let inner = self.inner.clone();
1694 match req.uri().path() {
1695 "/evnode.v1.ExecutorService/InitChain" => {
1696 #[allow(non_camel_case_types)]
1697 struct InitChainSvc<T: ExecutorService>(pub Arc<T>);
1698 impl<
1699 T: ExecutorService,
1700 > tonic::server::UnaryService<super::InitChainRequest>
1701 for InitChainSvc<T> {
1702 type Response = super::InitChainResponse;
1703 type Future = BoxFuture<
1704 tonic::Response<Self::Response>,
1705 tonic::Status,
1706 >;
1707 fn call(
1708 &mut self,
1709 request: tonic::Request<super::InitChainRequest>,
1710 ) -> Self::Future {
1711 let inner = Arc::clone(&self.0);
1712 let fut = async move {
1713 <T as ExecutorService>::init_chain(&inner, request).await
1714 };
1715 Box::pin(fut)
1716 }
1717 }
1718 let accept_compression_encodings = self.accept_compression_encodings;
1719 let send_compression_encodings = self.send_compression_encodings;
1720 let max_decoding_message_size = self.max_decoding_message_size;
1721 let max_encoding_message_size = self.max_encoding_message_size;
1722 let inner = self.inner.clone();
1723 let fut = async move {
1724 let inner = inner.0;
1725 let method = InitChainSvc(inner);
1726 let codec = tonic::codec::ProstCodec::default();
1727 let mut grpc = tonic::server::Grpc::new(codec)
1728 .apply_compression_config(
1729 accept_compression_encodings,
1730 send_compression_encodings,
1731 )
1732 .apply_max_message_size_config(
1733 max_decoding_message_size,
1734 max_encoding_message_size,
1735 );
1736 let res = grpc.unary(method, req).await;
1737 Ok(res)
1738 };
1739 Box::pin(fut)
1740 }
1741 "/evnode.v1.ExecutorService/GetTxs" => {
1742 #[allow(non_camel_case_types)]
1743 struct GetTxsSvc<T: ExecutorService>(pub Arc<T>);
1744 impl<
1745 T: ExecutorService,
1746 > tonic::server::UnaryService<super::GetTxsRequest>
1747 for GetTxsSvc<T> {
1748 type Response = super::GetTxsResponse;
1749 type Future = BoxFuture<
1750 tonic::Response<Self::Response>,
1751 tonic::Status,
1752 >;
1753 fn call(
1754 &mut self,
1755 request: tonic::Request<super::GetTxsRequest>,
1756 ) -> Self::Future {
1757 let inner = Arc::clone(&self.0);
1758 let fut = async move {
1759 <T as ExecutorService>::get_txs(&inner, request).await
1760 };
1761 Box::pin(fut)
1762 }
1763 }
1764 let accept_compression_encodings = self.accept_compression_encodings;
1765 let send_compression_encodings = self.send_compression_encodings;
1766 let max_decoding_message_size = self.max_decoding_message_size;
1767 let max_encoding_message_size = self.max_encoding_message_size;
1768 let inner = self.inner.clone();
1769 let fut = async move {
1770 let inner = inner.0;
1771 let method = GetTxsSvc(inner);
1772 let codec = tonic::codec::ProstCodec::default();
1773 let mut grpc = tonic::server::Grpc::new(codec)
1774 .apply_compression_config(
1775 accept_compression_encodings,
1776 send_compression_encodings,
1777 )
1778 .apply_max_message_size_config(
1779 max_decoding_message_size,
1780 max_encoding_message_size,
1781 );
1782 let res = grpc.unary(method, req).await;
1783 Ok(res)
1784 };
1785 Box::pin(fut)
1786 }
1787 "/evnode.v1.ExecutorService/ExecuteTxs" => {
1788 #[allow(non_camel_case_types)]
1789 struct ExecuteTxsSvc<T: ExecutorService>(pub Arc<T>);
1790 impl<
1791 T: ExecutorService,
1792 > tonic::server::UnaryService<super::ExecuteTxsRequest>
1793 for ExecuteTxsSvc<T> {
1794 type Response = super::ExecuteTxsResponse;
1795 type Future = BoxFuture<
1796 tonic::Response<Self::Response>,
1797 tonic::Status,
1798 >;
1799 fn call(
1800 &mut self,
1801 request: tonic::Request<super::ExecuteTxsRequest>,
1802 ) -> Self::Future {
1803 let inner = Arc::clone(&self.0);
1804 let fut = async move {
1805 <T as ExecutorService>::execute_txs(&inner, request).await
1806 };
1807 Box::pin(fut)
1808 }
1809 }
1810 let accept_compression_encodings = self.accept_compression_encodings;
1811 let send_compression_encodings = self.send_compression_encodings;
1812 let max_decoding_message_size = self.max_decoding_message_size;
1813 let max_encoding_message_size = self.max_encoding_message_size;
1814 let inner = self.inner.clone();
1815 let fut = async move {
1816 let inner = inner.0;
1817 let method = ExecuteTxsSvc(inner);
1818 let codec = tonic::codec::ProstCodec::default();
1819 let mut grpc = tonic::server::Grpc::new(codec)
1820 .apply_compression_config(
1821 accept_compression_encodings,
1822 send_compression_encodings,
1823 )
1824 .apply_max_message_size_config(
1825 max_decoding_message_size,
1826 max_encoding_message_size,
1827 );
1828 let res = grpc.unary(method, req).await;
1829 Ok(res)
1830 };
1831 Box::pin(fut)
1832 }
1833 "/evnode.v1.ExecutorService/SetFinal" => {
1834 #[allow(non_camel_case_types)]
1835 struct SetFinalSvc<T: ExecutorService>(pub Arc<T>);
1836 impl<
1837 T: ExecutorService,
1838 > tonic::server::UnaryService<super::SetFinalRequest>
1839 for SetFinalSvc<T> {
1840 type Response = super::SetFinalResponse;
1841 type Future = BoxFuture<
1842 tonic::Response<Self::Response>,
1843 tonic::Status,
1844 >;
1845 fn call(
1846 &mut self,
1847 request: tonic::Request<super::SetFinalRequest>,
1848 ) -> Self::Future {
1849 let inner = Arc::clone(&self.0);
1850 let fut = async move {
1851 <T as ExecutorService>::set_final(&inner, request).await
1852 };
1853 Box::pin(fut)
1854 }
1855 }
1856 let accept_compression_encodings = self.accept_compression_encodings;
1857 let send_compression_encodings = self.send_compression_encodings;
1858 let max_decoding_message_size = self.max_decoding_message_size;
1859 let max_encoding_message_size = self.max_encoding_message_size;
1860 let inner = self.inner.clone();
1861 let fut = async move {
1862 let inner = inner.0;
1863 let method = SetFinalSvc(inner);
1864 let codec = tonic::codec::ProstCodec::default();
1865 let mut grpc = tonic::server::Grpc::new(codec)
1866 .apply_compression_config(
1867 accept_compression_encodings,
1868 send_compression_encodings,
1869 )
1870 .apply_max_message_size_config(
1871 max_decoding_message_size,
1872 max_encoding_message_size,
1873 );
1874 let res = grpc.unary(method, req).await;
1875 Ok(res)
1876 };
1877 Box::pin(fut)
1878 }
1879 _ => {
1880 Box::pin(async move {
1881 Ok(
1882 http::Response::builder()
1883 .status(200)
1884 .header("grpc-status", "12")
1885 .header("content-type", "application/grpc")
1886 .body(empty_body())
1887 .unwrap(),
1888 )
1889 })
1890 }
1891 }
1892 }
1893 }
1894 impl<T: ExecutorService> Clone for ExecutorServiceServer<T> {
1895 fn clone(&self) -> Self {
1896 let inner = self.inner.clone();
1897 Self {
1898 inner,
1899 accept_compression_encodings: self.accept_compression_encodings,
1900 send_compression_encodings: self.send_compression_encodings,
1901 max_decoding_message_size: self.max_decoding_message_size,
1902 max_encoding_message_size: self.max_encoding_message_size,
1903 }
1904 }
1905 }
1906 impl<T: ExecutorService> Clone for _Inner<T> {
1907 fn clone(&self) -> Self {
1908 Self(Arc::clone(&self.0))
1909 }
1910 }
1911 impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
1912 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1913 write!(f, "{:?}", self.0)
1914 }
1915 }
1916 impl<T: ExecutorService> tonic::server::NamedService for ExecutorServiceServer<T> {
1917 const NAME: &'static str = "evnode.v1.ExecutorService";
1918 }
1919}
1920#[allow(clippy::derive_partial_eq_without_eq)]
1922#[derive(Clone, PartialEq, ::prost::Message)]
1923pub struct Block {
1924 #[prost(message, optional, tag = "1")]
1925 pub header: ::core::option::Option<SignedHeader>,
1926 #[prost(message, optional, tag = "2")]
1927 pub data: ::core::option::Option<Data>,
1928}
1929#[allow(clippy::derive_partial_eq_without_eq)]
1931#[derive(Clone, PartialEq, ::prost::Message)]
1932pub struct GetBlockRequest {
1933 #[prost(oneof = "get_block_request::Identifier", tags = "1, 2")]
1935 pub identifier: ::core::option::Option<get_block_request::Identifier>,
1936}
1937pub mod get_block_request {
1939 #[allow(clippy::derive_partial_eq_without_eq)]
1941 #[derive(Clone, PartialEq, ::prost::Oneof)]
1942 pub enum Identifier {
1943 #[prost(uint64, tag = "1")]
1944 Height(u64),
1945 #[prost(bytes, tag = "2")]
1946 Hash(::prost::alloc::vec::Vec<u8>),
1947 }
1948}
1949#[allow(clippy::derive_partial_eq_without_eq)]
1951#[derive(Clone, PartialEq, ::prost::Message)]
1952pub struct GetBlockResponse {
1953 #[prost(message, optional, tag = "1")]
1954 pub block: ::core::option::Option<Block>,
1955 #[prost(uint64, tag = "2")]
1956 pub header_da_height: u64,
1957 #[prost(uint64, tag = "3")]
1958 pub data_da_height: u64,
1959}
1960#[allow(clippy::derive_partial_eq_without_eq)]
1962#[derive(Clone, PartialEq, ::prost::Message)]
1963pub struct GetStateResponse {
1964 #[prost(message, optional, tag = "1")]
1965 pub state: ::core::option::Option<State>,
1966}
1967#[allow(clippy::derive_partial_eq_without_eq)]
1969#[derive(Clone, PartialEq, ::prost::Message)]
1970pub struct GetMetadataRequest {
1971 #[prost(string, tag = "1")]
1972 pub key: ::prost::alloc::string::String,
1973}
1974#[allow(clippy::derive_partial_eq_without_eq)]
1976#[derive(Clone, PartialEq, ::prost::Message)]
1977pub struct GetMetadataResponse {
1978 #[prost(bytes = "vec", tag = "1")]
1979 pub value: ::prost::alloc::vec::Vec<u8>,
1980}
1981pub mod store_service_client {
1983 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
1984 use tonic::codegen::*;
1985 use tonic::codegen::http::Uri;
1986 #[derive(Debug, Clone)]
1988 pub struct StoreServiceClient<T> {
1989 inner: tonic::client::Grpc<T>,
1990 }
1991 impl StoreServiceClient<tonic::transport::Channel> {
1992 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1994 where
1995 D: TryInto<tonic::transport::Endpoint>,
1996 D::Error: Into<StdError>,
1997 {
1998 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1999 Ok(Self::new(conn))
2000 }
2001 }
2002 impl<T> StoreServiceClient<T>
2003 where
2004 T: tonic::client::GrpcService<tonic::body::BoxBody>,
2005 T::Error: Into<StdError>,
2006 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
2007 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
2008 {
2009 pub fn new(inner: T) -> Self {
2010 let inner = tonic::client::Grpc::new(inner);
2011 Self { inner }
2012 }
2013 pub fn with_origin(inner: T, origin: Uri) -> Self {
2014 let inner = tonic::client::Grpc::with_origin(inner, origin);
2015 Self { inner }
2016 }
2017 pub fn with_interceptor<F>(
2018 inner: T,
2019 interceptor: F,
2020 ) -> StoreServiceClient<InterceptedService<T, F>>
2021 where
2022 F: tonic::service::Interceptor,
2023 T::ResponseBody: Default,
2024 T: tonic::codegen::Service<
2025 http::Request<tonic::body::BoxBody>,
2026 Response = http::Response<
2027 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
2028 >,
2029 >,
2030 <T as tonic::codegen::Service<
2031 http::Request<tonic::body::BoxBody>,
2032 >>::Error: Into<StdError> + Send + Sync,
2033 {
2034 StoreServiceClient::new(InterceptedService::new(inner, interceptor))
2035 }
2036 #[must_use]
2041 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2042 self.inner = self.inner.send_compressed(encoding);
2043 self
2044 }
2045 #[must_use]
2047 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2048 self.inner = self.inner.accept_compressed(encoding);
2049 self
2050 }
2051 #[must_use]
2055 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2056 self.inner = self.inner.max_decoding_message_size(limit);
2057 self
2058 }
2059 #[must_use]
2063 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2064 self.inner = self.inner.max_encoding_message_size(limit);
2065 self
2066 }
2067 pub async fn get_block(
2069 &mut self,
2070 request: impl tonic::IntoRequest<super::GetBlockRequest>,
2071 ) -> std::result::Result<
2072 tonic::Response<super::GetBlockResponse>,
2073 tonic::Status,
2074 > {
2075 self.inner
2076 .ready()
2077 .await
2078 .map_err(|e| {
2079 tonic::Status::new(
2080 tonic::Code::Unknown,
2081 format!("Service was not ready: {}", e.into()),
2082 )
2083 })?;
2084 let codec = tonic::codec::ProstCodec::default();
2085 let path = http::uri::PathAndQuery::from_static(
2086 "/evnode.v1.StoreService/GetBlock",
2087 );
2088 let mut req = request.into_request();
2089 req.extensions_mut()
2090 .insert(GrpcMethod::new("evnode.v1.StoreService", "GetBlock"));
2091 self.inner.unary(req, path, codec).await
2092 }
2093 pub async fn get_state(
2095 &mut self,
2096 request: impl tonic::IntoRequest<()>,
2097 ) -> std::result::Result<
2098 tonic::Response<super::GetStateResponse>,
2099 tonic::Status,
2100 > {
2101 self.inner
2102 .ready()
2103 .await
2104 .map_err(|e| {
2105 tonic::Status::new(
2106 tonic::Code::Unknown,
2107 format!("Service was not ready: {}", e.into()),
2108 )
2109 })?;
2110 let codec = tonic::codec::ProstCodec::default();
2111 let path = http::uri::PathAndQuery::from_static(
2112 "/evnode.v1.StoreService/GetState",
2113 );
2114 let mut req = request.into_request();
2115 req.extensions_mut()
2116 .insert(GrpcMethod::new("evnode.v1.StoreService", "GetState"));
2117 self.inner.unary(req, path, codec).await
2118 }
2119 pub async fn get_metadata(
2121 &mut self,
2122 request: impl tonic::IntoRequest<super::GetMetadataRequest>,
2123 ) -> std::result::Result<
2124 tonic::Response<super::GetMetadataResponse>,
2125 tonic::Status,
2126 > {
2127 self.inner
2128 .ready()
2129 .await
2130 .map_err(|e| {
2131 tonic::Status::new(
2132 tonic::Code::Unknown,
2133 format!("Service was not ready: {}", e.into()),
2134 )
2135 })?;
2136 let codec = tonic::codec::ProstCodec::default();
2137 let path = http::uri::PathAndQuery::from_static(
2138 "/evnode.v1.StoreService/GetMetadata",
2139 );
2140 let mut req = request.into_request();
2141 req.extensions_mut()
2142 .insert(GrpcMethod::new("evnode.v1.StoreService", "GetMetadata"));
2143 self.inner.unary(req, path, codec).await
2144 }
2145 }
2146}
2147pub mod store_service_server {
2149 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
2150 use tonic::codegen::*;
2151 #[async_trait]
2153 pub trait StoreService: Send + Sync + 'static {
2154 async fn get_block(
2156 &self,
2157 request: tonic::Request<super::GetBlockRequest>,
2158 ) -> std::result::Result<
2159 tonic::Response<super::GetBlockResponse>,
2160 tonic::Status,
2161 >;
2162 async fn get_state(
2164 &self,
2165 request: tonic::Request<()>,
2166 ) -> std::result::Result<
2167 tonic::Response<super::GetStateResponse>,
2168 tonic::Status,
2169 >;
2170 async fn get_metadata(
2172 &self,
2173 request: tonic::Request<super::GetMetadataRequest>,
2174 ) -> std::result::Result<
2175 tonic::Response<super::GetMetadataResponse>,
2176 tonic::Status,
2177 >;
2178 }
2179 #[derive(Debug)]
2181 pub struct StoreServiceServer<T: StoreService> {
2182 inner: _Inner<T>,
2183 accept_compression_encodings: EnabledCompressionEncodings,
2184 send_compression_encodings: EnabledCompressionEncodings,
2185 max_decoding_message_size: Option<usize>,
2186 max_encoding_message_size: Option<usize>,
2187 }
2188 struct _Inner<T>(Arc<T>);
2189 impl<T: StoreService> StoreServiceServer<T> {
2190 pub fn new(inner: T) -> Self {
2191 Self::from_arc(Arc::new(inner))
2192 }
2193 pub fn from_arc(inner: Arc<T>) -> Self {
2194 let inner = _Inner(inner);
2195 Self {
2196 inner,
2197 accept_compression_encodings: Default::default(),
2198 send_compression_encodings: Default::default(),
2199 max_decoding_message_size: None,
2200 max_encoding_message_size: None,
2201 }
2202 }
2203 pub fn with_interceptor<F>(
2204 inner: T,
2205 interceptor: F,
2206 ) -> InterceptedService<Self, F>
2207 where
2208 F: tonic::service::Interceptor,
2209 {
2210 InterceptedService::new(Self::new(inner), interceptor)
2211 }
2212 #[must_use]
2214 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2215 self.accept_compression_encodings.enable(encoding);
2216 self
2217 }
2218 #[must_use]
2220 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2221 self.send_compression_encodings.enable(encoding);
2222 self
2223 }
2224 #[must_use]
2228 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2229 self.max_decoding_message_size = Some(limit);
2230 self
2231 }
2232 #[must_use]
2236 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2237 self.max_encoding_message_size = Some(limit);
2238 self
2239 }
2240 }
2241 impl<T, B> tonic::codegen::Service<http::Request<B>> for StoreServiceServer<T>
2242 where
2243 T: StoreService,
2244 B: Body + Send + 'static,
2245 B::Error: Into<StdError> + Send + 'static,
2246 {
2247 type Response = http::Response<tonic::body::BoxBody>;
2248 type Error = std::convert::Infallible;
2249 type Future = BoxFuture<Self::Response, Self::Error>;
2250 fn poll_ready(
2251 &mut self,
2252 _cx: &mut Context<'_>,
2253 ) -> Poll<std::result::Result<(), Self::Error>> {
2254 Poll::Ready(Ok(()))
2255 }
2256 fn call(&mut self, req: http::Request<B>) -> Self::Future {
2257 let inner = self.inner.clone();
2258 match req.uri().path() {
2259 "/evnode.v1.StoreService/GetBlock" => {
2260 #[allow(non_camel_case_types)]
2261 struct GetBlockSvc<T: StoreService>(pub Arc<T>);
2262 impl<
2263 T: StoreService,
2264 > tonic::server::UnaryService<super::GetBlockRequest>
2265 for GetBlockSvc<T> {
2266 type Response = super::GetBlockResponse;
2267 type Future = BoxFuture<
2268 tonic::Response<Self::Response>,
2269 tonic::Status,
2270 >;
2271 fn call(
2272 &mut self,
2273 request: tonic::Request<super::GetBlockRequest>,
2274 ) -> Self::Future {
2275 let inner = Arc::clone(&self.0);
2276 let fut = async move {
2277 <T as StoreService>::get_block(&inner, request).await
2278 };
2279 Box::pin(fut)
2280 }
2281 }
2282 let accept_compression_encodings = self.accept_compression_encodings;
2283 let send_compression_encodings = self.send_compression_encodings;
2284 let max_decoding_message_size = self.max_decoding_message_size;
2285 let max_encoding_message_size = self.max_encoding_message_size;
2286 let inner = self.inner.clone();
2287 let fut = async move {
2288 let inner = inner.0;
2289 let method = GetBlockSvc(inner);
2290 let codec = tonic::codec::ProstCodec::default();
2291 let mut grpc = tonic::server::Grpc::new(codec)
2292 .apply_compression_config(
2293 accept_compression_encodings,
2294 send_compression_encodings,
2295 )
2296 .apply_max_message_size_config(
2297 max_decoding_message_size,
2298 max_encoding_message_size,
2299 );
2300 let res = grpc.unary(method, req).await;
2301 Ok(res)
2302 };
2303 Box::pin(fut)
2304 }
2305 "/evnode.v1.StoreService/GetState" => {
2306 #[allow(non_camel_case_types)]
2307 struct GetStateSvc<T: StoreService>(pub Arc<T>);
2308 impl<T: StoreService> tonic::server::UnaryService<()>
2309 for GetStateSvc<T> {
2310 type Response = super::GetStateResponse;
2311 type Future = BoxFuture<
2312 tonic::Response<Self::Response>,
2313 tonic::Status,
2314 >;
2315 fn call(&mut self, request: tonic::Request<()>) -> Self::Future {
2316 let inner = Arc::clone(&self.0);
2317 let fut = async move {
2318 <T as StoreService>::get_state(&inner, request).await
2319 };
2320 Box::pin(fut)
2321 }
2322 }
2323 let accept_compression_encodings = self.accept_compression_encodings;
2324 let send_compression_encodings = self.send_compression_encodings;
2325 let max_decoding_message_size = self.max_decoding_message_size;
2326 let max_encoding_message_size = self.max_encoding_message_size;
2327 let inner = self.inner.clone();
2328 let fut = async move {
2329 let inner = inner.0;
2330 let method = GetStateSvc(inner);
2331 let codec = tonic::codec::ProstCodec::default();
2332 let mut grpc = tonic::server::Grpc::new(codec)
2333 .apply_compression_config(
2334 accept_compression_encodings,
2335 send_compression_encodings,
2336 )
2337 .apply_max_message_size_config(
2338 max_decoding_message_size,
2339 max_encoding_message_size,
2340 );
2341 let res = grpc.unary(method, req).await;
2342 Ok(res)
2343 };
2344 Box::pin(fut)
2345 }
2346 "/evnode.v1.StoreService/GetMetadata" => {
2347 #[allow(non_camel_case_types)]
2348 struct GetMetadataSvc<T: StoreService>(pub Arc<T>);
2349 impl<
2350 T: StoreService,
2351 > tonic::server::UnaryService<super::GetMetadataRequest>
2352 for GetMetadataSvc<T> {
2353 type Response = super::GetMetadataResponse;
2354 type Future = BoxFuture<
2355 tonic::Response<Self::Response>,
2356 tonic::Status,
2357 >;
2358 fn call(
2359 &mut self,
2360 request: tonic::Request<super::GetMetadataRequest>,
2361 ) -> Self::Future {
2362 let inner = Arc::clone(&self.0);
2363 let fut = async move {
2364 <T as StoreService>::get_metadata(&inner, request).await
2365 };
2366 Box::pin(fut)
2367 }
2368 }
2369 let accept_compression_encodings = self.accept_compression_encodings;
2370 let send_compression_encodings = self.send_compression_encodings;
2371 let max_decoding_message_size = self.max_decoding_message_size;
2372 let max_encoding_message_size = self.max_encoding_message_size;
2373 let inner = self.inner.clone();
2374 let fut = async move {
2375 let inner = inner.0;
2376 let method = GetMetadataSvc(inner);
2377 let codec = tonic::codec::ProstCodec::default();
2378 let mut grpc = tonic::server::Grpc::new(codec)
2379 .apply_compression_config(
2380 accept_compression_encodings,
2381 send_compression_encodings,
2382 )
2383 .apply_max_message_size_config(
2384 max_decoding_message_size,
2385 max_encoding_message_size,
2386 );
2387 let res = grpc.unary(method, req).await;
2388 Ok(res)
2389 };
2390 Box::pin(fut)
2391 }
2392 _ => {
2393 Box::pin(async move {
2394 Ok(
2395 http::Response::builder()
2396 .status(200)
2397 .header("grpc-status", "12")
2398 .header("content-type", "application/grpc")
2399 .body(empty_body())
2400 .unwrap(),
2401 )
2402 })
2403 }
2404 }
2405 }
2406 }
2407 impl<T: StoreService> Clone for StoreServiceServer<T> {
2408 fn clone(&self) -> Self {
2409 let inner = self.inner.clone();
2410 Self {
2411 inner,
2412 accept_compression_encodings: self.accept_compression_encodings,
2413 send_compression_encodings: self.send_compression_encodings,
2414 max_decoding_message_size: self.max_decoding_message_size,
2415 max_encoding_message_size: self.max_encoding_message_size,
2416 }
2417 }
2418 }
2419 impl<T: StoreService> Clone for _Inner<T> {
2420 fn clone(&self) -> Self {
2421 Self(Arc::clone(&self.0))
2422 }
2423 }
2424 impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
2425 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2426 write!(f, "{:?}", self.0)
2427 }
2428 }
2429 impl<T: StoreService> tonic::server::NamedService for StoreServiceServer<T> {
2430 const NAME: &'static str = "evnode.v1.StoreService";
2431 }
2432}