1#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4pub struct RpcStatus {
5 #[prost(string, tag = "1")]
7 pub version: ::prost::alloc::string::String,
8 #[prost(message, optional, tag = "2")]
10 pub genesis_commitment: ::core::option::Option<super::primitives::Digest>,
11 #[prost(message, optional, tag = "3")]
13 pub store: ::core::option::Option<super::rpc_store::StoreStatus>,
14 #[prost(message, optional, tag = "4")]
16 pub block_producer: ::core::option::Option<
17 super::block_producer::BlockProducerStatus,
18 >,
19}
20pub mod api_client {
22 #![allow(
23 unused_variables,
24 dead_code,
25 missing_docs,
26 clippy::wildcard_imports,
27 clippy::let_unit_value,
28 )]
29 use tonic::codegen::*;
30 use tonic::codegen::http::Uri;
31 #[derive(Debug, Clone)]
33 pub struct ApiClient<T> {
34 inner: tonic::client::Grpc<T>,
35 }
36 impl ApiClient<tonic::transport::Channel> {
37 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
39 where
40 D: TryInto<tonic::transport::Endpoint>,
41 D::Error: Into<StdError>,
42 {
43 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
44 Ok(Self::new(conn))
45 }
46 }
47 impl<T> ApiClient<T>
48 where
49 T: tonic::client::GrpcService<tonic::body::Body>,
50 T::Error: Into<StdError>,
51 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
52 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
53 {
54 pub fn new(inner: T) -> Self {
55 let inner = tonic::client::Grpc::new(inner);
56 Self { inner }
57 }
58 pub fn with_origin(inner: T, origin: Uri) -> Self {
59 let inner = tonic::client::Grpc::with_origin(inner, origin);
60 Self { inner }
61 }
62 pub fn with_interceptor<F>(
63 inner: T,
64 interceptor: F,
65 ) -> ApiClient<InterceptedService<T, F>>
66 where
67 F: tonic::service::Interceptor,
68 T::ResponseBody: Default,
69 T: tonic::codegen::Service<
70 http::Request<tonic::body::Body>,
71 Response = http::Response<
72 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
73 >,
74 >,
75 <T as tonic::codegen::Service<
76 http::Request<tonic::body::Body>,
77 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
78 {
79 ApiClient::new(InterceptedService::new(inner, interceptor))
80 }
81 #[must_use]
86 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
87 self.inner = self.inner.send_compressed(encoding);
88 self
89 }
90 #[must_use]
92 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
93 self.inner = self.inner.accept_compressed(encoding);
94 self
95 }
96 #[must_use]
100 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
101 self.inner = self.inner.max_decoding_message_size(limit);
102 self
103 }
104 #[must_use]
108 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
109 self.inner = self.inner.max_encoding_message_size(limit);
110 self
111 }
112 pub async fn status(
114 &mut self,
115 request: impl tonic::IntoRequest<()>,
116 ) -> std::result::Result<tonic::Response<super::RpcStatus>, tonic::Status> {
117 self.inner
118 .ready()
119 .await
120 .map_err(|e| {
121 tonic::Status::unknown(
122 format!("Service was not ready: {}", e.into()),
123 )
124 })?;
125 let codec = tonic_prost::ProstCodec::default();
126 let path = http::uri::PathAndQuery::from_static("/rpc.Api/Status");
127 let mut req = request.into_request();
128 req.extensions_mut().insert(GrpcMethod::new("rpc.Api", "Status"));
129 self.inner.unary(req, path, codec).await
130 }
131 pub async fn check_nullifiers(
133 &mut self,
134 request: impl tonic::IntoRequest<super::super::rpc_store::NullifierList>,
135 ) -> std::result::Result<
136 tonic::Response<super::super::rpc_store::CheckNullifiersResponse>,
137 tonic::Status,
138 > {
139 self.inner
140 .ready()
141 .await
142 .map_err(|e| {
143 tonic::Status::unknown(
144 format!("Service was not ready: {}", e.into()),
145 )
146 })?;
147 let codec = tonic_prost::ProstCodec::default();
148 let path = http::uri::PathAndQuery::from_static("/rpc.Api/CheckNullifiers");
149 let mut req = request.into_request();
150 req.extensions_mut().insert(GrpcMethod::new("rpc.Api", "CheckNullifiers"));
151 self.inner.unary(req, path, codec).await
152 }
153 pub async fn get_account_details(
155 &mut self,
156 request: impl tonic::IntoRequest<super::super::account::AccountId>,
157 ) -> std::result::Result<
158 tonic::Response<super::super::account::AccountDetails>,
159 tonic::Status,
160 > {
161 self.inner
162 .ready()
163 .await
164 .map_err(|e| {
165 tonic::Status::unknown(
166 format!("Service was not ready: {}", e.into()),
167 )
168 })?;
169 let codec = tonic_prost::ProstCodec::default();
170 let path = http::uri::PathAndQuery::from_static(
171 "/rpc.Api/GetAccountDetails",
172 );
173 let mut req = request.into_request();
174 req.extensions_mut().insert(GrpcMethod::new("rpc.Api", "GetAccountDetails"));
175 self.inner.unary(req, path, codec).await
176 }
177 pub async fn get_account_proof(
179 &mut self,
180 request: impl tonic::IntoRequest<
181 super::super::rpc_store::AccountProofRequest,
182 >,
183 ) -> std::result::Result<
184 tonic::Response<super::super::rpc_store::AccountProofResponse>,
185 tonic::Status,
186 > {
187 self.inner
188 .ready()
189 .await
190 .map_err(|e| {
191 tonic::Status::unknown(
192 format!("Service was not ready: {}", e.into()),
193 )
194 })?;
195 let codec = tonic_prost::ProstCodec::default();
196 let path = http::uri::PathAndQuery::from_static("/rpc.Api/GetAccountProof");
197 let mut req = request.into_request();
198 req.extensions_mut().insert(GrpcMethod::new("rpc.Api", "GetAccountProof"));
199 self.inner.unary(req, path, codec).await
200 }
201 pub async fn get_block_by_number(
203 &mut self,
204 request: impl tonic::IntoRequest<super::super::blockchain::BlockNumber>,
205 ) -> std::result::Result<
206 tonic::Response<super::super::blockchain::MaybeBlock>,
207 tonic::Status,
208 > {
209 self.inner
210 .ready()
211 .await
212 .map_err(|e| {
213 tonic::Status::unknown(
214 format!("Service was not ready: {}", e.into()),
215 )
216 })?;
217 let codec = tonic_prost::ProstCodec::default();
218 let path = http::uri::PathAndQuery::from_static("/rpc.Api/GetBlockByNumber");
219 let mut req = request.into_request();
220 req.extensions_mut().insert(GrpcMethod::new("rpc.Api", "GetBlockByNumber"));
221 self.inner.unary(req, path, codec).await
222 }
223 pub async fn get_block_header_by_number(
226 &mut self,
227 request: impl tonic::IntoRequest<
228 super::super::shared::BlockHeaderByNumberRequest,
229 >,
230 ) -> std::result::Result<
231 tonic::Response<super::super::shared::BlockHeaderByNumberResponse>,
232 tonic::Status,
233 > {
234 self.inner
235 .ready()
236 .await
237 .map_err(|e| {
238 tonic::Status::unknown(
239 format!("Service was not ready: {}", e.into()),
240 )
241 })?;
242 let codec = tonic_prost::ProstCodec::default();
243 let path = http::uri::PathAndQuery::from_static(
244 "/rpc.Api/GetBlockHeaderByNumber",
245 );
246 let mut req = request.into_request();
247 req.extensions_mut()
248 .insert(GrpcMethod::new("rpc.Api", "GetBlockHeaderByNumber"));
249 self.inner.unary(req, path, codec).await
250 }
251 pub async fn get_notes_by_id(
253 &mut self,
254 request: impl tonic::IntoRequest<super::super::note::NoteIdList>,
255 ) -> std::result::Result<
256 tonic::Response<super::super::note::CommittedNoteList>,
257 tonic::Status,
258 > {
259 self.inner
260 .ready()
261 .await
262 .map_err(|e| {
263 tonic::Status::unknown(
264 format!("Service was not ready: {}", e.into()),
265 )
266 })?;
267 let codec = tonic_prost::ProstCodec::default();
268 let path = http::uri::PathAndQuery::from_static("/rpc.Api/GetNotesById");
269 let mut req = request.into_request();
270 req.extensions_mut().insert(GrpcMethod::new("rpc.Api", "GetNotesById"));
271 self.inner.unary(req, path, codec).await
272 }
273 pub async fn get_note_script_by_root(
275 &mut self,
276 request: impl tonic::IntoRequest<super::super::note::NoteRoot>,
277 ) -> std::result::Result<
278 tonic::Response<super::super::shared::MaybeNoteScript>,
279 tonic::Status,
280 > {
281 self.inner
282 .ready()
283 .await
284 .map_err(|e| {
285 tonic::Status::unknown(
286 format!("Service was not ready: {}", e.into()),
287 )
288 })?;
289 let codec = tonic_prost::ProstCodec::default();
290 let path = http::uri::PathAndQuery::from_static(
291 "/rpc.Api/GetNoteScriptByRoot",
292 );
293 let mut req = request.into_request();
294 req.extensions_mut()
295 .insert(GrpcMethod::new("rpc.Api", "GetNoteScriptByRoot"));
296 self.inner.unary(req, path, codec).await
297 }
298 pub async fn submit_proven_transaction(
300 &mut self,
301 request: impl tonic::IntoRequest<
302 super::super::transaction::ProvenTransaction,
303 >,
304 ) -> std::result::Result<
305 tonic::Response<
306 super::super::block_producer::SubmitProvenTransactionResponse,
307 >,
308 tonic::Status,
309 > {
310 self.inner
311 .ready()
312 .await
313 .map_err(|e| {
314 tonic::Status::unknown(
315 format!("Service was not ready: {}", e.into()),
316 )
317 })?;
318 let codec = tonic_prost::ProstCodec::default();
319 let path = http::uri::PathAndQuery::from_static(
320 "/rpc.Api/SubmitProvenTransaction",
321 );
322 let mut req = request.into_request();
323 req.extensions_mut()
324 .insert(GrpcMethod::new("rpc.Api", "SubmitProvenTransaction"));
325 self.inner.unary(req, path, codec).await
326 }
327 pub async fn submit_proven_batch(
338 &mut self,
339 request: impl tonic::IntoRequest<
340 super::super::transaction::ProvenTransactionBatch,
341 >,
342 ) -> std::result::Result<
343 tonic::Response<super::super::block_producer::SubmitProvenBatchResponse>,
344 tonic::Status,
345 > {
346 self.inner
347 .ready()
348 .await
349 .map_err(|e| {
350 tonic::Status::unknown(
351 format!("Service was not ready: {}", e.into()),
352 )
353 })?;
354 let codec = tonic_prost::ProstCodec::default();
355 let path = http::uri::PathAndQuery::from_static(
356 "/rpc.Api/SubmitProvenBatch",
357 );
358 let mut req = request.into_request();
359 req.extensions_mut().insert(GrpcMethod::new("rpc.Api", "SubmitProvenBatch"));
360 self.inner.unary(req, path, codec).await
361 }
362 pub async fn sync_nullifiers(
366 &mut self,
367 request: impl tonic::IntoRequest<
368 super::super::rpc_store::SyncNullifiersRequest,
369 >,
370 ) -> std::result::Result<
371 tonic::Response<super::super::rpc_store::SyncNullifiersResponse>,
372 tonic::Status,
373 > {
374 self.inner
375 .ready()
376 .await
377 .map_err(|e| {
378 tonic::Status::unknown(
379 format!("Service was not ready: {}", e.into()),
380 )
381 })?;
382 let codec = tonic_prost::ProstCodec::default();
383 let path = http::uri::PathAndQuery::from_static("/rpc.Api/SyncNullifiers");
384 let mut req = request.into_request();
385 req.extensions_mut().insert(GrpcMethod::new("rpc.Api", "SyncNullifiers"));
386 self.inner.unary(req, path, codec).await
387 }
388 pub async fn sync_account_vault(
390 &mut self,
391 request: impl tonic::IntoRequest<
392 super::super::rpc_store::SyncAccountVaultRequest,
393 >,
394 ) -> std::result::Result<
395 tonic::Response<super::super::rpc_store::SyncAccountVaultResponse>,
396 tonic::Status,
397 > {
398 self.inner
399 .ready()
400 .await
401 .map_err(|e| {
402 tonic::Status::unknown(
403 format!("Service was not ready: {}", e.into()),
404 )
405 })?;
406 let codec = tonic_prost::ProstCodec::default();
407 let path = http::uri::PathAndQuery::from_static("/rpc.Api/SyncAccountVault");
408 let mut req = request.into_request();
409 req.extensions_mut().insert(GrpcMethod::new("rpc.Api", "SyncAccountVault"));
410 self.inner.unary(req, path, codec).await
411 }
412 pub async fn sync_notes(
422 &mut self,
423 request: impl tonic::IntoRequest<super::super::rpc_store::SyncNotesRequest>,
424 ) -> std::result::Result<
425 tonic::Response<super::super::rpc_store::SyncNotesResponse>,
426 tonic::Status,
427 > {
428 self.inner
429 .ready()
430 .await
431 .map_err(|e| {
432 tonic::Status::unknown(
433 format!("Service was not ready: {}", e.into()),
434 )
435 })?;
436 let codec = tonic_prost::ProstCodec::default();
437 let path = http::uri::PathAndQuery::from_static("/rpc.Api/SyncNotes");
438 let mut req = request.into_request();
439 req.extensions_mut().insert(GrpcMethod::new("rpc.Api", "SyncNotes"));
440 self.inner.unary(req, path, codec).await
441 }
442 pub async fn sync_state(
458 &mut self,
459 request: impl tonic::IntoRequest<super::super::rpc_store::SyncStateRequest>,
460 ) -> std::result::Result<
461 tonic::Response<super::super::rpc_store::SyncStateResponse>,
462 tonic::Status,
463 > {
464 self.inner
465 .ready()
466 .await
467 .map_err(|e| {
468 tonic::Status::unknown(
469 format!("Service was not ready: {}", e.into()),
470 )
471 })?;
472 let codec = tonic_prost::ProstCodec::default();
473 let path = http::uri::PathAndQuery::from_static("/rpc.Api/SyncState");
474 let mut req = request.into_request();
475 req.extensions_mut().insert(GrpcMethod::new("rpc.Api", "SyncState"));
476 self.inner.unary(req, path, codec).await
477 }
478 pub async fn sync_storage_maps(
480 &mut self,
481 request: impl tonic::IntoRequest<
482 super::super::rpc_store::SyncStorageMapsRequest,
483 >,
484 ) -> std::result::Result<
485 tonic::Response<super::super::rpc_store::SyncStorageMapsResponse>,
486 tonic::Status,
487 > {
488 self.inner
489 .ready()
490 .await
491 .map_err(|e| {
492 tonic::Status::unknown(
493 format!("Service was not ready: {}", e.into()),
494 )
495 })?;
496 let codec = tonic_prost::ProstCodec::default();
497 let path = http::uri::PathAndQuery::from_static("/rpc.Api/SyncStorageMaps");
498 let mut req = request.into_request();
499 req.extensions_mut().insert(GrpcMethod::new("rpc.Api", "SyncStorageMaps"));
500 self.inner.unary(req, path, codec).await
501 }
502 pub async fn sync_transactions(
504 &mut self,
505 request: impl tonic::IntoRequest<
506 super::super::rpc_store::SyncTransactionsRequest,
507 >,
508 ) -> std::result::Result<
509 tonic::Response<super::super::rpc_store::SyncTransactionsResponse>,
510 tonic::Status,
511 > {
512 self.inner
513 .ready()
514 .await
515 .map_err(|e| {
516 tonic::Status::unknown(
517 format!("Service was not ready: {}", e.into()),
518 )
519 })?;
520 let codec = tonic_prost::ProstCodec::default();
521 let path = http::uri::PathAndQuery::from_static("/rpc.Api/SyncTransactions");
522 let mut req = request.into_request();
523 req.extensions_mut().insert(GrpcMethod::new("rpc.Api", "SyncTransactions"));
524 self.inner.unary(req, path, codec).await
525 }
526 }
527}
528pub mod api_server {
530 #![allow(
531 unused_variables,
532 dead_code,
533 missing_docs,
534 clippy::wildcard_imports,
535 clippy::let_unit_value,
536 )]
537 use tonic::codegen::*;
538 #[async_trait]
540 pub trait Api: std::marker::Send + std::marker::Sync + 'static {
541 async fn status(
543 &self,
544 request: tonic::Request<()>,
545 ) -> std::result::Result<tonic::Response<super::RpcStatus>, tonic::Status>;
546 async fn check_nullifiers(
548 &self,
549 request: tonic::Request<super::super::rpc_store::NullifierList>,
550 ) -> std::result::Result<
551 tonic::Response<super::super::rpc_store::CheckNullifiersResponse>,
552 tonic::Status,
553 >;
554 async fn get_account_details(
556 &self,
557 request: tonic::Request<super::super::account::AccountId>,
558 ) -> std::result::Result<
559 tonic::Response<super::super::account::AccountDetails>,
560 tonic::Status,
561 >;
562 async fn get_account_proof(
564 &self,
565 request: tonic::Request<super::super::rpc_store::AccountProofRequest>,
566 ) -> std::result::Result<
567 tonic::Response<super::super::rpc_store::AccountProofResponse>,
568 tonic::Status,
569 >;
570 async fn get_block_by_number(
572 &self,
573 request: tonic::Request<super::super::blockchain::BlockNumber>,
574 ) -> std::result::Result<
575 tonic::Response<super::super::blockchain::MaybeBlock>,
576 tonic::Status,
577 >;
578 async fn get_block_header_by_number(
581 &self,
582 request: tonic::Request<super::super::shared::BlockHeaderByNumberRequest>,
583 ) -> std::result::Result<
584 tonic::Response<super::super::shared::BlockHeaderByNumberResponse>,
585 tonic::Status,
586 >;
587 async fn get_notes_by_id(
589 &self,
590 request: tonic::Request<super::super::note::NoteIdList>,
591 ) -> std::result::Result<
592 tonic::Response<super::super::note::CommittedNoteList>,
593 tonic::Status,
594 >;
595 async fn get_note_script_by_root(
597 &self,
598 request: tonic::Request<super::super::note::NoteRoot>,
599 ) -> std::result::Result<
600 tonic::Response<super::super::shared::MaybeNoteScript>,
601 tonic::Status,
602 >;
603 async fn submit_proven_transaction(
605 &self,
606 request: tonic::Request<super::super::transaction::ProvenTransaction>,
607 ) -> std::result::Result<
608 tonic::Response<
609 super::super::block_producer::SubmitProvenTransactionResponse,
610 >,
611 tonic::Status,
612 >;
613 async fn submit_proven_batch(
624 &self,
625 request: tonic::Request<super::super::transaction::ProvenTransactionBatch>,
626 ) -> std::result::Result<
627 tonic::Response<super::super::block_producer::SubmitProvenBatchResponse>,
628 tonic::Status,
629 >;
630 async fn sync_nullifiers(
634 &self,
635 request: tonic::Request<super::super::rpc_store::SyncNullifiersRequest>,
636 ) -> std::result::Result<
637 tonic::Response<super::super::rpc_store::SyncNullifiersResponse>,
638 tonic::Status,
639 >;
640 async fn sync_account_vault(
642 &self,
643 request: tonic::Request<super::super::rpc_store::SyncAccountVaultRequest>,
644 ) -> std::result::Result<
645 tonic::Response<super::super::rpc_store::SyncAccountVaultResponse>,
646 tonic::Status,
647 >;
648 async fn sync_notes(
658 &self,
659 request: tonic::Request<super::super::rpc_store::SyncNotesRequest>,
660 ) -> std::result::Result<
661 tonic::Response<super::super::rpc_store::SyncNotesResponse>,
662 tonic::Status,
663 >;
664 async fn sync_state(
680 &self,
681 request: tonic::Request<super::super::rpc_store::SyncStateRequest>,
682 ) -> std::result::Result<
683 tonic::Response<super::super::rpc_store::SyncStateResponse>,
684 tonic::Status,
685 >;
686 async fn sync_storage_maps(
688 &self,
689 request: tonic::Request<super::super::rpc_store::SyncStorageMapsRequest>,
690 ) -> std::result::Result<
691 tonic::Response<super::super::rpc_store::SyncStorageMapsResponse>,
692 tonic::Status,
693 >;
694 async fn sync_transactions(
696 &self,
697 request: tonic::Request<super::super::rpc_store::SyncTransactionsRequest>,
698 ) -> std::result::Result<
699 tonic::Response<super::super::rpc_store::SyncTransactionsResponse>,
700 tonic::Status,
701 >;
702 }
703 #[derive(Debug)]
705 pub struct ApiServer<T> {
706 inner: Arc<T>,
707 accept_compression_encodings: EnabledCompressionEncodings,
708 send_compression_encodings: EnabledCompressionEncodings,
709 max_decoding_message_size: Option<usize>,
710 max_encoding_message_size: Option<usize>,
711 }
712 impl<T> ApiServer<T> {
713 pub fn new(inner: T) -> Self {
714 Self::from_arc(Arc::new(inner))
715 }
716 pub fn from_arc(inner: Arc<T>) -> Self {
717 Self {
718 inner,
719 accept_compression_encodings: Default::default(),
720 send_compression_encodings: Default::default(),
721 max_decoding_message_size: None,
722 max_encoding_message_size: None,
723 }
724 }
725 pub fn with_interceptor<F>(
726 inner: T,
727 interceptor: F,
728 ) -> InterceptedService<Self, F>
729 where
730 F: tonic::service::Interceptor,
731 {
732 InterceptedService::new(Self::new(inner), interceptor)
733 }
734 #[must_use]
736 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
737 self.accept_compression_encodings.enable(encoding);
738 self
739 }
740 #[must_use]
742 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
743 self.send_compression_encodings.enable(encoding);
744 self
745 }
746 #[must_use]
750 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
751 self.max_decoding_message_size = Some(limit);
752 self
753 }
754 #[must_use]
758 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
759 self.max_encoding_message_size = Some(limit);
760 self
761 }
762 }
763 impl<T, B> tonic::codegen::Service<http::Request<B>> for ApiServer<T>
764 where
765 T: Api,
766 B: Body + std::marker::Send + 'static,
767 B::Error: Into<StdError> + std::marker::Send + 'static,
768 {
769 type Response = http::Response<tonic::body::Body>;
770 type Error = std::convert::Infallible;
771 type Future = BoxFuture<Self::Response, Self::Error>;
772 fn poll_ready(
773 &mut self,
774 _cx: &mut Context<'_>,
775 ) -> Poll<std::result::Result<(), Self::Error>> {
776 Poll::Ready(Ok(()))
777 }
778 fn call(&mut self, req: http::Request<B>) -> Self::Future {
779 match req.uri().path() {
780 "/rpc.Api/Status" => {
781 #[allow(non_camel_case_types)]
782 struct StatusSvc<T: Api>(pub Arc<T>);
783 impl<T: Api> tonic::server::UnaryService<()> for StatusSvc<T> {
784 type Response = super::RpcStatus;
785 type Future = BoxFuture<
786 tonic::Response<Self::Response>,
787 tonic::Status,
788 >;
789 fn call(&mut self, request: tonic::Request<()>) -> Self::Future {
790 let inner = Arc::clone(&self.0);
791 let fut = async move {
792 <T as Api>::status(&inner, request).await
793 };
794 Box::pin(fut)
795 }
796 }
797 let accept_compression_encodings = self.accept_compression_encodings;
798 let send_compression_encodings = self.send_compression_encodings;
799 let max_decoding_message_size = self.max_decoding_message_size;
800 let max_encoding_message_size = self.max_encoding_message_size;
801 let inner = self.inner.clone();
802 let fut = async move {
803 let method = StatusSvc(inner);
804 let codec = tonic_prost::ProstCodec::default();
805 let mut grpc = tonic::server::Grpc::new(codec)
806 .apply_compression_config(
807 accept_compression_encodings,
808 send_compression_encodings,
809 )
810 .apply_max_message_size_config(
811 max_decoding_message_size,
812 max_encoding_message_size,
813 );
814 let res = grpc.unary(method, req).await;
815 Ok(res)
816 };
817 Box::pin(fut)
818 }
819 "/rpc.Api/CheckNullifiers" => {
820 #[allow(non_camel_case_types)]
821 struct CheckNullifiersSvc<T: Api>(pub Arc<T>);
822 impl<
823 T: Api,
824 > tonic::server::UnaryService<super::super::rpc_store::NullifierList>
825 for CheckNullifiersSvc<T> {
826 type Response = super::super::rpc_store::CheckNullifiersResponse;
827 type Future = BoxFuture<
828 tonic::Response<Self::Response>,
829 tonic::Status,
830 >;
831 fn call(
832 &mut self,
833 request: tonic::Request<
834 super::super::rpc_store::NullifierList,
835 >,
836 ) -> Self::Future {
837 let inner = Arc::clone(&self.0);
838 let fut = async move {
839 <T as Api>::check_nullifiers(&inner, request).await
840 };
841 Box::pin(fut)
842 }
843 }
844 let accept_compression_encodings = self.accept_compression_encodings;
845 let send_compression_encodings = self.send_compression_encodings;
846 let max_decoding_message_size = self.max_decoding_message_size;
847 let max_encoding_message_size = self.max_encoding_message_size;
848 let inner = self.inner.clone();
849 let fut = async move {
850 let method = CheckNullifiersSvc(inner);
851 let codec = tonic_prost::ProstCodec::default();
852 let mut grpc = tonic::server::Grpc::new(codec)
853 .apply_compression_config(
854 accept_compression_encodings,
855 send_compression_encodings,
856 )
857 .apply_max_message_size_config(
858 max_decoding_message_size,
859 max_encoding_message_size,
860 );
861 let res = grpc.unary(method, req).await;
862 Ok(res)
863 };
864 Box::pin(fut)
865 }
866 "/rpc.Api/GetAccountDetails" => {
867 #[allow(non_camel_case_types)]
868 struct GetAccountDetailsSvc<T: Api>(pub Arc<T>);
869 impl<
870 T: Api,
871 > tonic::server::UnaryService<super::super::account::AccountId>
872 for GetAccountDetailsSvc<T> {
873 type Response = super::super::account::AccountDetails;
874 type Future = BoxFuture<
875 tonic::Response<Self::Response>,
876 tonic::Status,
877 >;
878 fn call(
879 &mut self,
880 request: tonic::Request<super::super::account::AccountId>,
881 ) -> Self::Future {
882 let inner = Arc::clone(&self.0);
883 let fut = async move {
884 <T as Api>::get_account_details(&inner, request).await
885 };
886 Box::pin(fut)
887 }
888 }
889 let accept_compression_encodings = self.accept_compression_encodings;
890 let send_compression_encodings = self.send_compression_encodings;
891 let max_decoding_message_size = self.max_decoding_message_size;
892 let max_encoding_message_size = self.max_encoding_message_size;
893 let inner = self.inner.clone();
894 let fut = async move {
895 let method = GetAccountDetailsSvc(inner);
896 let codec = tonic_prost::ProstCodec::default();
897 let mut grpc = tonic::server::Grpc::new(codec)
898 .apply_compression_config(
899 accept_compression_encodings,
900 send_compression_encodings,
901 )
902 .apply_max_message_size_config(
903 max_decoding_message_size,
904 max_encoding_message_size,
905 );
906 let res = grpc.unary(method, req).await;
907 Ok(res)
908 };
909 Box::pin(fut)
910 }
911 "/rpc.Api/GetAccountProof" => {
912 #[allow(non_camel_case_types)]
913 struct GetAccountProofSvc<T: Api>(pub Arc<T>);
914 impl<
915 T: Api,
916 > tonic::server::UnaryService<
917 super::super::rpc_store::AccountProofRequest,
918 > for GetAccountProofSvc<T> {
919 type Response = super::super::rpc_store::AccountProofResponse;
920 type Future = BoxFuture<
921 tonic::Response<Self::Response>,
922 tonic::Status,
923 >;
924 fn call(
925 &mut self,
926 request: tonic::Request<
927 super::super::rpc_store::AccountProofRequest,
928 >,
929 ) -> Self::Future {
930 let inner = Arc::clone(&self.0);
931 let fut = async move {
932 <T as Api>::get_account_proof(&inner, request).await
933 };
934 Box::pin(fut)
935 }
936 }
937 let accept_compression_encodings = self.accept_compression_encodings;
938 let send_compression_encodings = self.send_compression_encodings;
939 let max_decoding_message_size = self.max_decoding_message_size;
940 let max_encoding_message_size = self.max_encoding_message_size;
941 let inner = self.inner.clone();
942 let fut = async move {
943 let method = GetAccountProofSvc(inner);
944 let codec = tonic_prost::ProstCodec::default();
945 let mut grpc = tonic::server::Grpc::new(codec)
946 .apply_compression_config(
947 accept_compression_encodings,
948 send_compression_encodings,
949 )
950 .apply_max_message_size_config(
951 max_decoding_message_size,
952 max_encoding_message_size,
953 );
954 let res = grpc.unary(method, req).await;
955 Ok(res)
956 };
957 Box::pin(fut)
958 }
959 "/rpc.Api/GetBlockByNumber" => {
960 #[allow(non_camel_case_types)]
961 struct GetBlockByNumberSvc<T: Api>(pub Arc<T>);
962 impl<
963 T: Api,
964 > tonic::server::UnaryService<super::super::blockchain::BlockNumber>
965 for GetBlockByNumberSvc<T> {
966 type Response = super::super::blockchain::MaybeBlock;
967 type Future = BoxFuture<
968 tonic::Response<Self::Response>,
969 tonic::Status,
970 >;
971 fn call(
972 &mut self,
973 request: tonic::Request<
974 super::super::blockchain::BlockNumber,
975 >,
976 ) -> Self::Future {
977 let inner = Arc::clone(&self.0);
978 let fut = async move {
979 <T as Api>::get_block_by_number(&inner, request).await
980 };
981 Box::pin(fut)
982 }
983 }
984 let accept_compression_encodings = self.accept_compression_encodings;
985 let send_compression_encodings = self.send_compression_encodings;
986 let max_decoding_message_size = self.max_decoding_message_size;
987 let max_encoding_message_size = self.max_encoding_message_size;
988 let inner = self.inner.clone();
989 let fut = async move {
990 let method = GetBlockByNumberSvc(inner);
991 let codec = tonic_prost::ProstCodec::default();
992 let mut grpc = tonic::server::Grpc::new(codec)
993 .apply_compression_config(
994 accept_compression_encodings,
995 send_compression_encodings,
996 )
997 .apply_max_message_size_config(
998 max_decoding_message_size,
999 max_encoding_message_size,
1000 );
1001 let res = grpc.unary(method, req).await;
1002 Ok(res)
1003 };
1004 Box::pin(fut)
1005 }
1006 "/rpc.Api/GetBlockHeaderByNumber" => {
1007 #[allow(non_camel_case_types)]
1008 struct GetBlockHeaderByNumberSvc<T: Api>(pub Arc<T>);
1009 impl<
1010 T: Api,
1011 > tonic::server::UnaryService<
1012 super::super::shared::BlockHeaderByNumberRequest,
1013 > for GetBlockHeaderByNumberSvc<T> {
1014 type Response = super::super::shared::BlockHeaderByNumberResponse;
1015 type Future = BoxFuture<
1016 tonic::Response<Self::Response>,
1017 tonic::Status,
1018 >;
1019 fn call(
1020 &mut self,
1021 request: tonic::Request<
1022 super::super::shared::BlockHeaderByNumberRequest,
1023 >,
1024 ) -> Self::Future {
1025 let inner = Arc::clone(&self.0);
1026 let fut = async move {
1027 <T as Api>::get_block_header_by_number(&inner, request)
1028 .await
1029 };
1030 Box::pin(fut)
1031 }
1032 }
1033 let accept_compression_encodings = self.accept_compression_encodings;
1034 let send_compression_encodings = self.send_compression_encodings;
1035 let max_decoding_message_size = self.max_decoding_message_size;
1036 let max_encoding_message_size = self.max_encoding_message_size;
1037 let inner = self.inner.clone();
1038 let fut = async move {
1039 let method = GetBlockHeaderByNumberSvc(inner);
1040 let codec = tonic_prost::ProstCodec::default();
1041 let mut grpc = tonic::server::Grpc::new(codec)
1042 .apply_compression_config(
1043 accept_compression_encodings,
1044 send_compression_encodings,
1045 )
1046 .apply_max_message_size_config(
1047 max_decoding_message_size,
1048 max_encoding_message_size,
1049 );
1050 let res = grpc.unary(method, req).await;
1051 Ok(res)
1052 };
1053 Box::pin(fut)
1054 }
1055 "/rpc.Api/GetNotesById" => {
1056 #[allow(non_camel_case_types)]
1057 struct GetNotesByIdSvc<T: Api>(pub Arc<T>);
1058 impl<
1059 T: Api,
1060 > tonic::server::UnaryService<super::super::note::NoteIdList>
1061 for GetNotesByIdSvc<T> {
1062 type Response = super::super::note::CommittedNoteList;
1063 type Future = BoxFuture<
1064 tonic::Response<Self::Response>,
1065 tonic::Status,
1066 >;
1067 fn call(
1068 &mut self,
1069 request: tonic::Request<super::super::note::NoteIdList>,
1070 ) -> Self::Future {
1071 let inner = Arc::clone(&self.0);
1072 let fut = async move {
1073 <T as Api>::get_notes_by_id(&inner, request).await
1074 };
1075 Box::pin(fut)
1076 }
1077 }
1078 let accept_compression_encodings = self.accept_compression_encodings;
1079 let send_compression_encodings = self.send_compression_encodings;
1080 let max_decoding_message_size = self.max_decoding_message_size;
1081 let max_encoding_message_size = self.max_encoding_message_size;
1082 let inner = self.inner.clone();
1083 let fut = async move {
1084 let method = GetNotesByIdSvc(inner);
1085 let codec = tonic_prost::ProstCodec::default();
1086 let mut grpc = tonic::server::Grpc::new(codec)
1087 .apply_compression_config(
1088 accept_compression_encodings,
1089 send_compression_encodings,
1090 )
1091 .apply_max_message_size_config(
1092 max_decoding_message_size,
1093 max_encoding_message_size,
1094 );
1095 let res = grpc.unary(method, req).await;
1096 Ok(res)
1097 };
1098 Box::pin(fut)
1099 }
1100 "/rpc.Api/GetNoteScriptByRoot" => {
1101 #[allow(non_camel_case_types)]
1102 struct GetNoteScriptByRootSvc<T: Api>(pub Arc<T>);
1103 impl<
1104 T: Api,
1105 > tonic::server::UnaryService<super::super::note::NoteRoot>
1106 for GetNoteScriptByRootSvc<T> {
1107 type Response = super::super::shared::MaybeNoteScript;
1108 type Future = BoxFuture<
1109 tonic::Response<Self::Response>,
1110 tonic::Status,
1111 >;
1112 fn call(
1113 &mut self,
1114 request: tonic::Request<super::super::note::NoteRoot>,
1115 ) -> Self::Future {
1116 let inner = Arc::clone(&self.0);
1117 let fut = async move {
1118 <T as Api>::get_note_script_by_root(&inner, request).await
1119 };
1120 Box::pin(fut)
1121 }
1122 }
1123 let accept_compression_encodings = self.accept_compression_encodings;
1124 let send_compression_encodings = self.send_compression_encodings;
1125 let max_decoding_message_size = self.max_decoding_message_size;
1126 let max_encoding_message_size = self.max_encoding_message_size;
1127 let inner = self.inner.clone();
1128 let fut = async move {
1129 let method = GetNoteScriptByRootSvc(inner);
1130 let codec = tonic_prost::ProstCodec::default();
1131 let mut grpc = tonic::server::Grpc::new(codec)
1132 .apply_compression_config(
1133 accept_compression_encodings,
1134 send_compression_encodings,
1135 )
1136 .apply_max_message_size_config(
1137 max_decoding_message_size,
1138 max_encoding_message_size,
1139 );
1140 let res = grpc.unary(method, req).await;
1141 Ok(res)
1142 };
1143 Box::pin(fut)
1144 }
1145 "/rpc.Api/SubmitProvenTransaction" => {
1146 #[allow(non_camel_case_types)]
1147 struct SubmitProvenTransactionSvc<T: Api>(pub Arc<T>);
1148 impl<
1149 T: Api,
1150 > tonic::server::UnaryService<
1151 super::super::transaction::ProvenTransaction,
1152 > for SubmitProvenTransactionSvc<T> {
1153 type Response = super::super::block_producer::SubmitProvenTransactionResponse;
1154 type Future = BoxFuture<
1155 tonic::Response<Self::Response>,
1156 tonic::Status,
1157 >;
1158 fn call(
1159 &mut self,
1160 request: tonic::Request<
1161 super::super::transaction::ProvenTransaction,
1162 >,
1163 ) -> Self::Future {
1164 let inner = Arc::clone(&self.0);
1165 let fut = async move {
1166 <T as Api>::submit_proven_transaction(&inner, request).await
1167 };
1168 Box::pin(fut)
1169 }
1170 }
1171 let accept_compression_encodings = self.accept_compression_encodings;
1172 let send_compression_encodings = self.send_compression_encodings;
1173 let max_decoding_message_size = self.max_decoding_message_size;
1174 let max_encoding_message_size = self.max_encoding_message_size;
1175 let inner = self.inner.clone();
1176 let fut = async move {
1177 let method = SubmitProvenTransactionSvc(inner);
1178 let codec = tonic_prost::ProstCodec::default();
1179 let mut grpc = tonic::server::Grpc::new(codec)
1180 .apply_compression_config(
1181 accept_compression_encodings,
1182 send_compression_encodings,
1183 )
1184 .apply_max_message_size_config(
1185 max_decoding_message_size,
1186 max_encoding_message_size,
1187 );
1188 let res = grpc.unary(method, req).await;
1189 Ok(res)
1190 };
1191 Box::pin(fut)
1192 }
1193 "/rpc.Api/SubmitProvenBatch" => {
1194 #[allow(non_camel_case_types)]
1195 struct SubmitProvenBatchSvc<T: Api>(pub Arc<T>);
1196 impl<
1197 T: Api,
1198 > tonic::server::UnaryService<
1199 super::super::transaction::ProvenTransactionBatch,
1200 > for SubmitProvenBatchSvc<T> {
1201 type Response = super::super::block_producer::SubmitProvenBatchResponse;
1202 type Future = BoxFuture<
1203 tonic::Response<Self::Response>,
1204 tonic::Status,
1205 >;
1206 fn call(
1207 &mut self,
1208 request: tonic::Request<
1209 super::super::transaction::ProvenTransactionBatch,
1210 >,
1211 ) -> Self::Future {
1212 let inner = Arc::clone(&self.0);
1213 let fut = async move {
1214 <T as Api>::submit_proven_batch(&inner, request).await
1215 };
1216 Box::pin(fut)
1217 }
1218 }
1219 let accept_compression_encodings = self.accept_compression_encodings;
1220 let send_compression_encodings = self.send_compression_encodings;
1221 let max_decoding_message_size = self.max_decoding_message_size;
1222 let max_encoding_message_size = self.max_encoding_message_size;
1223 let inner = self.inner.clone();
1224 let fut = async move {
1225 let method = SubmitProvenBatchSvc(inner);
1226 let codec = tonic_prost::ProstCodec::default();
1227 let mut grpc = tonic::server::Grpc::new(codec)
1228 .apply_compression_config(
1229 accept_compression_encodings,
1230 send_compression_encodings,
1231 )
1232 .apply_max_message_size_config(
1233 max_decoding_message_size,
1234 max_encoding_message_size,
1235 );
1236 let res = grpc.unary(method, req).await;
1237 Ok(res)
1238 };
1239 Box::pin(fut)
1240 }
1241 "/rpc.Api/SyncNullifiers" => {
1242 #[allow(non_camel_case_types)]
1243 struct SyncNullifiersSvc<T: Api>(pub Arc<T>);
1244 impl<
1245 T: Api,
1246 > tonic::server::UnaryService<
1247 super::super::rpc_store::SyncNullifiersRequest,
1248 > for SyncNullifiersSvc<T> {
1249 type Response = super::super::rpc_store::SyncNullifiersResponse;
1250 type Future = BoxFuture<
1251 tonic::Response<Self::Response>,
1252 tonic::Status,
1253 >;
1254 fn call(
1255 &mut self,
1256 request: tonic::Request<
1257 super::super::rpc_store::SyncNullifiersRequest,
1258 >,
1259 ) -> Self::Future {
1260 let inner = Arc::clone(&self.0);
1261 let fut = async move {
1262 <T as Api>::sync_nullifiers(&inner, request).await
1263 };
1264 Box::pin(fut)
1265 }
1266 }
1267 let accept_compression_encodings = self.accept_compression_encodings;
1268 let send_compression_encodings = self.send_compression_encodings;
1269 let max_decoding_message_size = self.max_decoding_message_size;
1270 let max_encoding_message_size = self.max_encoding_message_size;
1271 let inner = self.inner.clone();
1272 let fut = async move {
1273 let method = SyncNullifiersSvc(inner);
1274 let codec = tonic_prost::ProstCodec::default();
1275 let mut grpc = tonic::server::Grpc::new(codec)
1276 .apply_compression_config(
1277 accept_compression_encodings,
1278 send_compression_encodings,
1279 )
1280 .apply_max_message_size_config(
1281 max_decoding_message_size,
1282 max_encoding_message_size,
1283 );
1284 let res = grpc.unary(method, req).await;
1285 Ok(res)
1286 };
1287 Box::pin(fut)
1288 }
1289 "/rpc.Api/SyncAccountVault" => {
1290 #[allow(non_camel_case_types)]
1291 struct SyncAccountVaultSvc<T: Api>(pub Arc<T>);
1292 impl<
1293 T: Api,
1294 > tonic::server::UnaryService<
1295 super::super::rpc_store::SyncAccountVaultRequest,
1296 > for SyncAccountVaultSvc<T> {
1297 type Response = super::super::rpc_store::SyncAccountVaultResponse;
1298 type Future = BoxFuture<
1299 tonic::Response<Self::Response>,
1300 tonic::Status,
1301 >;
1302 fn call(
1303 &mut self,
1304 request: tonic::Request<
1305 super::super::rpc_store::SyncAccountVaultRequest,
1306 >,
1307 ) -> Self::Future {
1308 let inner = Arc::clone(&self.0);
1309 let fut = async move {
1310 <T as Api>::sync_account_vault(&inner, request).await
1311 };
1312 Box::pin(fut)
1313 }
1314 }
1315 let accept_compression_encodings = self.accept_compression_encodings;
1316 let send_compression_encodings = self.send_compression_encodings;
1317 let max_decoding_message_size = self.max_decoding_message_size;
1318 let max_encoding_message_size = self.max_encoding_message_size;
1319 let inner = self.inner.clone();
1320 let fut = async move {
1321 let method = SyncAccountVaultSvc(inner);
1322 let codec = tonic_prost::ProstCodec::default();
1323 let mut grpc = tonic::server::Grpc::new(codec)
1324 .apply_compression_config(
1325 accept_compression_encodings,
1326 send_compression_encodings,
1327 )
1328 .apply_max_message_size_config(
1329 max_decoding_message_size,
1330 max_encoding_message_size,
1331 );
1332 let res = grpc.unary(method, req).await;
1333 Ok(res)
1334 };
1335 Box::pin(fut)
1336 }
1337 "/rpc.Api/SyncNotes" => {
1338 #[allow(non_camel_case_types)]
1339 struct SyncNotesSvc<T: Api>(pub Arc<T>);
1340 impl<
1341 T: Api,
1342 > tonic::server::UnaryService<
1343 super::super::rpc_store::SyncNotesRequest,
1344 > for SyncNotesSvc<T> {
1345 type Response = super::super::rpc_store::SyncNotesResponse;
1346 type Future = BoxFuture<
1347 tonic::Response<Self::Response>,
1348 tonic::Status,
1349 >;
1350 fn call(
1351 &mut self,
1352 request: tonic::Request<
1353 super::super::rpc_store::SyncNotesRequest,
1354 >,
1355 ) -> Self::Future {
1356 let inner = Arc::clone(&self.0);
1357 let fut = async move {
1358 <T as Api>::sync_notes(&inner, request).await
1359 };
1360 Box::pin(fut)
1361 }
1362 }
1363 let accept_compression_encodings = self.accept_compression_encodings;
1364 let send_compression_encodings = self.send_compression_encodings;
1365 let max_decoding_message_size = self.max_decoding_message_size;
1366 let max_encoding_message_size = self.max_encoding_message_size;
1367 let inner = self.inner.clone();
1368 let fut = async move {
1369 let method = SyncNotesSvc(inner);
1370 let codec = tonic_prost::ProstCodec::default();
1371 let mut grpc = tonic::server::Grpc::new(codec)
1372 .apply_compression_config(
1373 accept_compression_encodings,
1374 send_compression_encodings,
1375 )
1376 .apply_max_message_size_config(
1377 max_decoding_message_size,
1378 max_encoding_message_size,
1379 );
1380 let res = grpc.unary(method, req).await;
1381 Ok(res)
1382 };
1383 Box::pin(fut)
1384 }
1385 "/rpc.Api/SyncState" => {
1386 #[allow(non_camel_case_types)]
1387 struct SyncStateSvc<T: Api>(pub Arc<T>);
1388 impl<
1389 T: Api,
1390 > tonic::server::UnaryService<
1391 super::super::rpc_store::SyncStateRequest,
1392 > for SyncStateSvc<T> {
1393 type Response = super::super::rpc_store::SyncStateResponse;
1394 type Future = BoxFuture<
1395 tonic::Response<Self::Response>,
1396 tonic::Status,
1397 >;
1398 fn call(
1399 &mut self,
1400 request: tonic::Request<
1401 super::super::rpc_store::SyncStateRequest,
1402 >,
1403 ) -> Self::Future {
1404 let inner = Arc::clone(&self.0);
1405 let fut = async move {
1406 <T as Api>::sync_state(&inner, request).await
1407 };
1408 Box::pin(fut)
1409 }
1410 }
1411 let accept_compression_encodings = self.accept_compression_encodings;
1412 let send_compression_encodings = self.send_compression_encodings;
1413 let max_decoding_message_size = self.max_decoding_message_size;
1414 let max_encoding_message_size = self.max_encoding_message_size;
1415 let inner = self.inner.clone();
1416 let fut = async move {
1417 let method = SyncStateSvc(inner);
1418 let codec = tonic_prost::ProstCodec::default();
1419 let mut grpc = tonic::server::Grpc::new(codec)
1420 .apply_compression_config(
1421 accept_compression_encodings,
1422 send_compression_encodings,
1423 )
1424 .apply_max_message_size_config(
1425 max_decoding_message_size,
1426 max_encoding_message_size,
1427 );
1428 let res = grpc.unary(method, req).await;
1429 Ok(res)
1430 };
1431 Box::pin(fut)
1432 }
1433 "/rpc.Api/SyncStorageMaps" => {
1434 #[allow(non_camel_case_types)]
1435 struct SyncStorageMapsSvc<T: Api>(pub Arc<T>);
1436 impl<
1437 T: Api,
1438 > tonic::server::UnaryService<
1439 super::super::rpc_store::SyncStorageMapsRequest,
1440 > for SyncStorageMapsSvc<T> {
1441 type Response = super::super::rpc_store::SyncStorageMapsResponse;
1442 type Future = BoxFuture<
1443 tonic::Response<Self::Response>,
1444 tonic::Status,
1445 >;
1446 fn call(
1447 &mut self,
1448 request: tonic::Request<
1449 super::super::rpc_store::SyncStorageMapsRequest,
1450 >,
1451 ) -> Self::Future {
1452 let inner = Arc::clone(&self.0);
1453 let fut = async move {
1454 <T as Api>::sync_storage_maps(&inner, request).await
1455 };
1456 Box::pin(fut)
1457 }
1458 }
1459 let accept_compression_encodings = self.accept_compression_encodings;
1460 let send_compression_encodings = self.send_compression_encodings;
1461 let max_decoding_message_size = self.max_decoding_message_size;
1462 let max_encoding_message_size = self.max_encoding_message_size;
1463 let inner = self.inner.clone();
1464 let fut = async move {
1465 let method = SyncStorageMapsSvc(inner);
1466 let codec = tonic_prost::ProstCodec::default();
1467 let mut grpc = tonic::server::Grpc::new(codec)
1468 .apply_compression_config(
1469 accept_compression_encodings,
1470 send_compression_encodings,
1471 )
1472 .apply_max_message_size_config(
1473 max_decoding_message_size,
1474 max_encoding_message_size,
1475 );
1476 let res = grpc.unary(method, req).await;
1477 Ok(res)
1478 };
1479 Box::pin(fut)
1480 }
1481 "/rpc.Api/SyncTransactions" => {
1482 #[allow(non_camel_case_types)]
1483 struct SyncTransactionsSvc<T: Api>(pub Arc<T>);
1484 impl<
1485 T: Api,
1486 > tonic::server::UnaryService<
1487 super::super::rpc_store::SyncTransactionsRequest,
1488 > for SyncTransactionsSvc<T> {
1489 type Response = super::super::rpc_store::SyncTransactionsResponse;
1490 type Future = BoxFuture<
1491 tonic::Response<Self::Response>,
1492 tonic::Status,
1493 >;
1494 fn call(
1495 &mut self,
1496 request: tonic::Request<
1497 super::super::rpc_store::SyncTransactionsRequest,
1498 >,
1499 ) -> Self::Future {
1500 let inner = Arc::clone(&self.0);
1501 let fut = async move {
1502 <T as Api>::sync_transactions(&inner, request).await
1503 };
1504 Box::pin(fut)
1505 }
1506 }
1507 let accept_compression_encodings = self.accept_compression_encodings;
1508 let send_compression_encodings = self.send_compression_encodings;
1509 let max_decoding_message_size = self.max_decoding_message_size;
1510 let max_encoding_message_size = self.max_encoding_message_size;
1511 let inner = self.inner.clone();
1512 let fut = async move {
1513 let method = SyncTransactionsSvc(inner);
1514 let codec = tonic_prost::ProstCodec::default();
1515 let mut grpc = tonic::server::Grpc::new(codec)
1516 .apply_compression_config(
1517 accept_compression_encodings,
1518 send_compression_encodings,
1519 )
1520 .apply_max_message_size_config(
1521 max_decoding_message_size,
1522 max_encoding_message_size,
1523 );
1524 let res = grpc.unary(method, req).await;
1525 Ok(res)
1526 };
1527 Box::pin(fut)
1528 }
1529 _ => {
1530 Box::pin(async move {
1531 let mut response = http::Response::new(
1532 tonic::body::Body::default(),
1533 );
1534 let headers = response.headers_mut();
1535 headers
1536 .insert(
1537 tonic::Status::GRPC_STATUS,
1538 (tonic::Code::Unimplemented as i32).into(),
1539 );
1540 headers
1541 .insert(
1542 http::header::CONTENT_TYPE,
1543 tonic::metadata::GRPC_CONTENT_TYPE,
1544 );
1545 Ok(response)
1546 })
1547 }
1548 }
1549 }
1550 }
1551 impl<T> Clone for ApiServer<T> {
1552 fn clone(&self) -> Self {
1553 let inner = self.inner.clone();
1554 Self {
1555 inner,
1556 accept_compression_encodings: self.accept_compression_encodings,
1557 send_compression_encodings: self.send_compression_encodings,
1558 max_decoding_message_size: self.max_decoding_message_size,
1559 max_encoding_message_size: self.max_encoding_message_size,
1560 }
1561 }
1562 }
1563 pub const SERVICE_NAME: &str = "rpc.Api";
1565 impl<T> tonic::server::NamedService for ApiServer<T> {
1566 const NAME: &'static str = SERVICE_NAME;
1567 }
1568}