1#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4pub struct StoreStatus {
5 #[prost(string, tag = "1")]
7 pub version: ::prost::alloc::string::String,
8 #[prost(string, tag = "2")]
10 pub status: ::prost::alloc::string::String,
11 #[prost(fixed32, tag = "3")]
13 pub chain_tip: u32,
14}
15#[derive(Clone, PartialEq, ::prost::Message)]
17pub struct AccountProofRequest {
18 #[prost(message, optional, tag = "1")]
20 pub account_id: ::core::option::Option<super::account::AccountId>,
21 #[prost(message, optional, tag = "2")]
24 pub block_num: ::core::option::Option<super::blockchain::BlockNumber>,
25 #[prost(message, optional, tag = "3")]
27 pub details: ::core::option::Option<account_proof_request::AccountDetailRequest>,
28}
29pub mod account_proof_request {
31 #[derive(Clone, PartialEq, ::prost::Message)]
33 pub struct AccountDetailRequest {
34 #[prost(message, optional, tag = "1")]
39 pub code_commitment: ::core::option::Option<super::super::primitives::Digest>,
40 #[prost(message, optional, tag = "2")]
46 pub asset_vault_commitment: ::core::option::Option<
47 super::super::primitives::Digest,
48 >,
49 #[prost(message, repeated, tag = "3")]
51 pub storage_maps: ::prost::alloc::vec::Vec<
52 account_detail_request::StorageMapDetailRequest,
53 >,
54 }
55 pub mod account_detail_request {
57 #[derive(Clone, PartialEq, ::prost::Message)]
59 pub struct StorageMapDetailRequest {
60 #[prost(uint32, tag = "1")]
62 pub slot_index: u32,
63 #[prost(oneof = "storage_map_detail_request::SlotData", tags = "2, 3")]
64 pub slot_data: ::core::option::Option<storage_map_detail_request::SlotData>,
65 }
66 pub mod storage_map_detail_request {
68 #[derive(Clone, PartialEq, ::prost::Message)]
70 pub struct MapKeys {
71 #[prost(message, repeated, tag = "1")]
73 pub map_keys: ::prost::alloc::vec::Vec<
74 super::super::super::super::primitives::Digest,
75 >,
76 }
77 #[derive(Clone, PartialEq, ::prost::Oneof)]
78 pub enum SlotData {
79 #[prost(bool, tag = "2")]
82 AllEntries(bool),
83 #[prost(message, tag = "3")]
85 MapKeys(MapKeys),
86 }
87 }
88 }
89}
90#[derive(Clone, PartialEq, ::prost::Message)]
92pub struct AccountProofResponse {
93 #[prost(message, optional, tag = "1")]
95 pub block_num: ::core::option::Option<super::blockchain::BlockNumber>,
96 #[prost(message, optional, tag = "2")]
98 pub witness: ::core::option::Option<super::account::AccountWitness>,
99 #[prost(message, optional, tag = "3")]
101 pub details: ::core::option::Option<account_proof_response::AccountDetails>,
102}
103pub mod account_proof_response {
105 #[derive(Clone, PartialEq, ::prost::Message)]
106 pub struct AccountDetails {
107 #[prost(message, optional, tag = "1")]
109 pub header: ::core::option::Option<super::super::account::AccountHeader>,
110 #[prost(message, optional, tag = "2")]
112 pub storage_details: ::core::option::Option<super::AccountStorageDetails>,
113 #[prost(bytes = "vec", optional, tag = "3")]
115 pub code: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
116 #[prost(message, optional, tag = "4")]
119 pub vault_details: ::core::option::Option<super::AccountVaultDetails>,
120 }
121}
122#[derive(Clone, PartialEq, ::prost::Message)]
124pub struct AccountVaultDetails {
125 #[prost(bool, tag = "1")]
129 pub too_many_assets: bool,
130 #[prost(message, repeated, tag = "2")]
133 pub assets: ::prost::alloc::vec::Vec<super::primitives::Asset>,
134}
135#[derive(Clone, PartialEq, ::prost::Message)]
137pub struct AccountStorageDetails {
138 #[prost(message, optional, tag = "1")]
140 pub header: ::core::option::Option<super::account::AccountStorageHeader>,
141 #[prost(message, repeated, tag = "2")]
143 pub map_details: ::prost::alloc::vec::Vec<
144 account_storage_details::AccountStorageMapDetails,
145 >,
146}
147pub mod account_storage_details {
149 #[derive(Clone, PartialEq, ::prost::Message)]
150 pub struct AccountStorageMapDetails {
151 #[prost(uint32, tag = "1")]
153 pub slot_index: u32,
154 #[prost(bool, tag = "2")]
158 pub too_many_entries: bool,
159 #[prost(message, optional, tag = "3")]
161 pub entries: ::core::option::Option<account_storage_map_details::MapEntries>,
162 }
163 pub mod account_storage_map_details {
165 #[derive(Clone, PartialEq, ::prost::Message)]
167 pub struct MapEntries {
168 #[prost(message, repeated, tag = "1")]
169 pub entries: ::prost::alloc::vec::Vec<map_entries::StorageMapEntry>,
170 }
171 pub mod map_entries {
173 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
175 pub struct StorageMapEntry {
176 #[prost(message, optional, tag = "1")]
177 pub key: ::core::option::Option<
178 super::super::super::super::primitives::Digest,
179 >,
180 #[prost(message, optional, tag = "2")]
181 pub value: ::core::option::Option<
182 super::super::super::super::primitives::Digest,
183 >,
184 }
185 }
186 }
187}
188#[derive(Clone, PartialEq, ::prost::Message)]
190pub struct NullifierList {
191 #[prost(message, repeated, tag = "1")]
193 pub nullifiers: ::prost::alloc::vec::Vec<super::primitives::Digest>,
194}
195#[derive(Clone, PartialEq, ::prost::Message)]
197pub struct CheckNullifiersResponse {
198 #[prost(message, repeated, tag = "1")]
200 pub proofs: ::prost::alloc::vec::Vec<super::primitives::SmtOpening>,
201}
202#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
204pub struct SyncNullifiersRequest {
205 #[prost(message, optional, tag = "1")]
207 pub block_range: ::core::option::Option<BlockRange>,
208 #[prost(uint32, tag = "2")]
210 pub prefix_len: u32,
211 #[prost(uint32, repeated, tag = "3")]
214 pub nullifiers: ::prost::alloc::vec::Vec<u32>,
215}
216#[derive(Clone, PartialEq, ::prost::Message)]
218pub struct SyncNullifiersResponse {
219 #[prost(message, optional, tag = "1")]
221 pub pagination_info: ::core::option::Option<PaginationInfo>,
222 #[prost(message, repeated, tag = "2")]
224 pub nullifiers: ::prost::alloc::vec::Vec<sync_nullifiers_response::NullifierUpdate>,
225}
226pub mod sync_nullifiers_response {
228 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
230 pub struct NullifierUpdate {
231 #[prost(message, optional, tag = "1")]
233 pub nullifier: ::core::option::Option<super::super::primitives::Digest>,
234 #[prost(fixed32, tag = "2")]
236 pub block_num: u32,
237 }
238}
239#[derive(Clone, PartialEq, ::prost::Message)]
245pub struct SyncStateRequest {
246 #[prost(fixed32, tag = "1")]
250 pub block_num: u32,
251 #[prost(message, repeated, tag = "2")]
257 pub account_ids: ::prost::alloc::vec::Vec<super::account::AccountId>,
258 #[prost(fixed32, repeated, tag = "3")]
260 pub note_tags: ::prost::alloc::vec::Vec<u32>,
261}
262#[derive(Clone, PartialEq, ::prost::Message)]
264pub struct SyncStateResponse {
265 #[prost(fixed32, tag = "1")]
267 pub chain_tip: u32,
268 #[prost(message, optional, tag = "2")]
270 pub block_header: ::core::option::Option<super::blockchain::BlockHeader>,
271 #[prost(message, optional, tag = "3")]
273 pub mmr_delta: ::core::option::Option<super::primitives::MmrDelta>,
274 #[prost(message, repeated, tag = "5")]
276 pub accounts: ::prost::alloc::vec::Vec<super::account::AccountSummary>,
277 #[prost(message, repeated, tag = "6")]
280 pub transactions: ::prost::alloc::vec::Vec<super::transaction::TransactionSummary>,
281 #[prost(message, repeated, tag = "7")]
283 pub notes: ::prost::alloc::vec::Vec<super::note::NoteSyncRecord>,
284}
285#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
289pub struct SyncAccountVaultRequest {
290 #[prost(message, optional, tag = "1")]
295 pub block_range: ::core::option::Option<BlockRange>,
296 #[prost(message, optional, tag = "2")]
298 pub account_id: ::core::option::Option<super::account::AccountId>,
299}
300#[derive(Clone, PartialEq, ::prost::Message)]
301pub struct SyncAccountVaultResponse {
302 #[prost(message, optional, tag = "1")]
304 pub pagination_info: ::core::option::Option<PaginationInfo>,
305 #[prost(message, repeated, tag = "2")]
310 pub updates: ::prost::alloc::vec::Vec<AccountVaultUpdate>,
311}
312#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
313pub struct AccountVaultUpdate {
314 #[prost(message, optional, tag = "1")]
316 pub vault_key: ::core::option::Option<super::primitives::Digest>,
317 #[prost(message, optional, tag = "2")]
320 pub asset: ::core::option::Option<super::primitives::Asset>,
321 #[prost(fixed32, tag = "3")]
323 pub block_num: u32,
324}
325#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
330pub struct SyncNotesRequest {
331 #[prost(message, optional, tag = "1")]
333 pub block_range: ::core::option::Option<BlockRange>,
334 #[prost(fixed32, repeated, tag = "2")]
336 pub note_tags: ::prost::alloc::vec::Vec<u32>,
337}
338#[derive(Clone, PartialEq, ::prost::Message)]
340pub struct SyncNotesResponse {
341 #[prost(message, optional, tag = "1")]
343 pub pagination_info: ::core::option::Option<PaginationInfo>,
344 #[prost(message, optional, tag = "2")]
346 pub block_header: ::core::option::Option<super::blockchain::BlockHeader>,
347 #[prost(message, optional, tag = "3")]
352 pub mmr_path: ::core::option::Option<super::primitives::MerklePath>,
353 #[prost(message, repeated, tag = "4")]
355 pub notes: ::prost::alloc::vec::Vec<super::note::NoteSyncRecord>,
356}
357#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
362pub struct SyncStorageMapsRequest {
363 #[prost(message, optional, tag = "1")]
368 pub block_range: ::core::option::Option<BlockRange>,
369 #[prost(message, optional, tag = "3")]
371 pub account_id: ::core::option::Option<super::account::AccountId>,
372}
373#[derive(Clone, PartialEq, ::prost::Message)]
374pub struct SyncStorageMapsResponse {
375 #[prost(message, optional, tag = "1")]
377 pub pagination_info: ::core::option::Option<PaginationInfo>,
378 #[prost(message, repeated, tag = "2")]
383 pub updates: ::prost::alloc::vec::Vec<StorageMapUpdate>,
384}
385#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
387pub struct StorageMapUpdate {
388 #[prost(fixed32, tag = "1")]
390 pub block_num: u32,
391 #[prost(uint32, tag = "2")]
393 pub slot_index: u32,
394 #[prost(message, optional, tag = "3")]
396 pub key: ::core::option::Option<super::primitives::Digest>,
397 #[prost(message, optional, tag = "4")]
399 pub value: ::core::option::Option<super::primitives::Digest>,
400}
401#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
403pub struct BlockRange {
404 #[prost(fixed32, tag = "1")]
406 pub block_from: u32,
407 #[prost(fixed32, optional, tag = "2")]
409 pub block_to: ::core::option::Option<u32>,
410}
411#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
420pub struct PaginationInfo {
421 #[prost(fixed32, tag = "1")]
423 pub chain_tip: u32,
424 #[prost(fixed32, tag = "2")]
430 pub block_num: u32,
431}
432#[derive(Clone, PartialEq, ::prost::Message)]
436pub struct SyncTransactionsRequest {
437 #[prost(message, optional, tag = "1")]
439 pub block_range: ::core::option::Option<BlockRange>,
440 #[prost(message, repeated, tag = "2")]
442 pub account_ids: ::prost::alloc::vec::Vec<super::account::AccountId>,
443}
444#[derive(Clone, PartialEq, ::prost::Message)]
446pub struct SyncTransactionsResponse {
447 #[prost(message, optional, tag = "1")]
449 pub pagination_info: ::core::option::Option<PaginationInfo>,
450 #[prost(message, repeated, tag = "2")]
452 pub transaction_records: ::prost::alloc::vec::Vec<TransactionRecord>,
453}
454#[derive(Clone, PartialEq, ::prost::Message)]
456pub struct TransactionRecord {
457 #[prost(fixed32, tag = "1")]
459 pub block_num: u32,
460 #[prost(message, optional, tag = "2")]
462 pub transaction_header: ::core::option::Option<
463 super::transaction::TransactionHeader,
464 >,
465}
466pub mod rpc_client {
468 #![allow(
469 unused_variables,
470 dead_code,
471 missing_docs,
472 clippy::wildcard_imports,
473 clippy::let_unit_value,
474 )]
475 use tonic::codegen::*;
476 use tonic::codegen::http::Uri;
477 #[derive(Debug, Clone)]
479 pub struct RpcClient<T> {
480 inner: tonic::client::Grpc<T>,
481 }
482 impl RpcClient<tonic::transport::Channel> {
483 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
485 where
486 D: TryInto<tonic::transport::Endpoint>,
487 D::Error: Into<StdError>,
488 {
489 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
490 Ok(Self::new(conn))
491 }
492 }
493 impl<T> RpcClient<T>
494 where
495 T: tonic::client::GrpcService<tonic::body::Body>,
496 T::Error: Into<StdError>,
497 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
498 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
499 {
500 pub fn new(inner: T) -> Self {
501 let inner = tonic::client::Grpc::new(inner);
502 Self { inner }
503 }
504 pub fn with_origin(inner: T, origin: Uri) -> Self {
505 let inner = tonic::client::Grpc::with_origin(inner, origin);
506 Self { inner }
507 }
508 pub fn with_interceptor<F>(
509 inner: T,
510 interceptor: F,
511 ) -> RpcClient<InterceptedService<T, F>>
512 where
513 F: tonic::service::Interceptor,
514 T::ResponseBody: Default,
515 T: tonic::codegen::Service<
516 http::Request<tonic::body::Body>,
517 Response = http::Response<
518 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
519 >,
520 >,
521 <T as tonic::codegen::Service<
522 http::Request<tonic::body::Body>,
523 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
524 {
525 RpcClient::new(InterceptedService::new(inner, interceptor))
526 }
527 #[must_use]
532 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
533 self.inner = self.inner.send_compressed(encoding);
534 self
535 }
536 #[must_use]
538 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
539 self.inner = self.inner.accept_compressed(encoding);
540 self
541 }
542 #[must_use]
546 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
547 self.inner = self.inner.max_decoding_message_size(limit);
548 self
549 }
550 #[must_use]
554 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
555 self.inner = self.inner.max_encoding_message_size(limit);
556 self
557 }
558 pub async fn status(
560 &mut self,
561 request: impl tonic::IntoRequest<()>,
562 ) -> std::result::Result<tonic::Response<super::StoreStatus>, tonic::Status> {
563 self.inner
564 .ready()
565 .await
566 .map_err(|e| {
567 tonic::Status::unknown(
568 format!("Service was not ready: {}", e.into()),
569 )
570 })?;
571 let codec = tonic_prost::ProstCodec::default();
572 let path = http::uri::PathAndQuery::from_static("/rpc_store.Rpc/Status");
573 let mut req = request.into_request();
574 req.extensions_mut().insert(GrpcMethod::new("rpc_store.Rpc", "Status"));
575 self.inner.unary(req, path, codec).await
576 }
577 pub async fn check_nullifiers(
579 &mut self,
580 request: impl tonic::IntoRequest<super::NullifierList>,
581 ) -> std::result::Result<
582 tonic::Response<super::CheckNullifiersResponse>,
583 tonic::Status,
584 > {
585 self.inner
586 .ready()
587 .await
588 .map_err(|e| {
589 tonic::Status::unknown(
590 format!("Service was not ready: {}", e.into()),
591 )
592 })?;
593 let codec = tonic_prost::ProstCodec::default();
594 let path = http::uri::PathAndQuery::from_static(
595 "/rpc_store.Rpc/CheckNullifiers",
596 );
597 let mut req = request.into_request();
598 req.extensions_mut()
599 .insert(GrpcMethod::new("rpc_store.Rpc", "CheckNullifiers"));
600 self.inner.unary(req, path, codec).await
601 }
602 pub async fn get_account_details(
604 &mut self,
605 request: impl tonic::IntoRequest<super::super::account::AccountId>,
606 ) -> std::result::Result<
607 tonic::Response<super::super::account::AccountDetails>,
608 tonic::Status,
609 > {
610 self.inner
611 .ready()
612 .await
613 .map_err(|e| {
614 tonic::Status::unknown(
615 format!("Service was not ready: {}", e.into()),
616 )
617 })?;
618 let codec = tonic_prost::ProstCodec::default();
619 let path = http::uri::PathAndQuery::from_static(
620 "/rpc_store.Rpc/GetAccountDetails",
621 );
622 let mut req = request.into_request();
623 req.extensions_mut()
624 .insert(GrpcMethod::new("rpc_store.Rpc", "GetAccountDetails"));
625 self.inner.unary(req, path, codec).await
626 }
627 pub async fn get_account_proof(
629 &mut self,
630 request: impl tonic::IntoRequest<super::AccountProofRequest>,
631 ) -> std::result::Result<
632 tonic::Response<super::AccountProofResponse>,
633 tonic::Status,
634 > {
635 self.inner
636 .ready()
637 .await
638 .map_err(|e| {
639 tonic::Status::unknown(
640 format!("Service was not ready: {}", e.into()),
641 )
642 })?;
643 let codec = tonic_prost::ProstCodec::default();
644 let path = http::uri::PathAndQuery::from_static(
645 "/rpc_store.Rpc/GetAccountProof",
646 );
647 let mut req = request.into_request();
648 req.extensions_mut()
649 .insert(GrpcMethod::new("rpc_store.Rpc", "GetAccountProof"));
650 self.inner.unary(req, path, codec).await
651 }
652 pub async fn get_block_by_number(
654 &mut self,
655 request: impl tonic::IntoRequest<super::super::blockchain::BlockNumber>,
656 ) -> std::result::Result<
657 tonic::Response<super::super::blockchain::MaybeBlock>,
658 tonic::Status,
659 > {
660 self.inner
661 .ready()
662 .await
663 .map_err(|e| {
664 tonic::Status::unknown(
665 format!("Service was not ready: {}", e.into()),
666 )
667 })?;
668 let codec = tonic_prost::ProstCodec::default();
669 let path = http::uri::PathAndQuery::from_static(
670 "/rpc_store.Rpc/GetBlockByNumber",
671 );
672 let mut req = request.into_request();
673 req.extensions_mut()
674 .insert(GrpcMethod::new("rpc_store.Rpc", "GetBlockByNumber"));
675 self.inner.unary(req, path, codec).await
676 }
677 pub async fn get_block_header_by_number(
680 &mut self,
681 request: impl tonic::IntoRequest<
682 super::super::shared::BlockHeaderByNumberRequest,
683 >,
684 ) -> std::result::Result<
685 tonic::Response<super::super::shared::BlockHeaderByNumberResponse>,
686 tonic::Status,
687 > {
688 self.inner
689 .ready()
690 .await
691 .map_err(|e| {
692 tonic::Status::unknown(
693 format!("Service was not ready: {}", e.into()),
694 )
695 })?;
696 let codec = tonic_prost::ProstCodec::default();
697 let path = http::uri::PathAndQuery::from_static(
698 "/rpc_store.Rpc/GetBlockHeaderByNumber",
699 );
700 let mut req = request.into_request();
701 req.extensions_mut()
702 .insert(GrpcMethod::new("rpc_store.Rpc", "GetBlockHeaderByNumber"));
703 self.inner.unary(req, path, codec).await
704 }
705 pub async fn get_notes_by_id(
707 &mut self,
708 request: impl tonic::IntoRequest<super::super::note::NoteIdList>,
709 ) -> std::result::Result<
710 tonic::Response<super::super::note::CommittedNoteList>,
711 tonic::Status,
712 > {
713 self.inner
714 .ready()
715 .await
716 .map_err(|e| {
717 tonic::Status::unknown(
718 format!("Service was not ready: {}", e.into()),
719 )
720 })?;
721 let codec = tonic_prost::ProstCodec::default();
722 let path = http::uri::PathAndQuery::from_static(
723 "/rpc_store.Rpc/GetNotesById",
724 );
725 let mut req = request.into_request();
726 req.extensions_mut()
727 .insert(GrpcMethod::new("rpc_store.Rpc", "GetNotesById"));
728 self.inner.unary(req, path, codec).await
729 }
730 pub async fn get_note_script_by_root(
732 &mut self,
733 request: impl tonic::IntoRequest<super::super::note::NoteRoot>,
734 ) -> std::result::Result<
735 tonic::Response<super::super::shared::MaybeNoteScript>,
736 tonic::Status,
737 > {
738 self.inner
739 .ready()
740 .await
741 .map_err(|e| {
742 tonic::Status::unknown(
743 format!("Service was not ready: {}", e.into()),
744 )
745 })?;
746 let codec = tonic_prost::ProstCodec::default();
747 let path = http::uri::PathAndQuery::from_static(
748 "/rpc_store.Rpc/GetNoteScriptByRoot",
749 );
750 let mut req = request.into_request();
751 req.extensions_mut()
752 .insert(GrpcMethod::new("rpc_store.Rpc", "GetNoteScriptByRoot"));
753 self.inner.unary(req, path, codec).await
754 }
755 pub async fn sync_nullifiers(
759 &mut self,
760 request: impl tonic::IntoRequest<super::SyncNullifiersRequest>,
761 ) -> std::result::Result<
762 tonic::Response<super::SyncNullifiersResponse>,
763 tonic::Status,
764 > {
765 self.inner
766 .ready()
767 .await
768 .map_err(|e| {
769 tonic::Status::unknown(
770 format!("Service was not ready: {}", e.into()),
771 )
772 })?;
773 let codec = tonic_prost::ProstCodec::default();
774 let path = http::uri::PathAndQuery::from_static(
775 "/rpc_store.Rpc/SyncNullifiers",
776 );
777 let mut req = request.into_request();
778 req.extensions_mut()
779 .insert(GrpcMethod::new("rpc_store.Rpc", "SyncNullifiers"));
780 self.inner.unary(req, path, codec).await
781 }
782 pub async fn sync_notes(
792 &mut self,
793 request: impl tonic::IntoRequest<super::SyncNotesRequest>,
794 ) -> std::result::Result<
795 tonic::Response<super::SyncNotesResponse>,
796 tonic::Status,
797 > {
798 self.inner
799 .ready()
800 .await
801 .map_err(|e| {
802 tonic::Status::unknown(
803 format!("Service was not ready: {}", e.into()),
804 )
805 })?;
806 let codec = tonic_prost::ProstCodec::default();
807 let path = http::uri::PathAndQuery::from_static("/rpc_store.Rpc/SyncNotes");
808 let mut req = request.into_request();
809 req.extensions_mut().insert(GrpcMethod::new("rpc_store.Rpc", "SyncNotes"));
810 self.inner.unary(req, path, codec).await
811 }
812 pub async fn sync_state(
828 &mut self,
829 request: impl tonic::IntoRequest<super::SyncStateRequest>,
830 ) -> std::result::Result<
831 tonic::Response<super::SyncStateResponse>,
832 tonic::Status,
833 > {
834 self.inner
835 .ready()
836 .await
837 .map_err(|e| {
838 tonic::Status::unknown(
839 format!("Service was not ready: {}", e.into()),
840 )
841 })?;
842 let codec = tonic_prost::ProstCodec::default();
843 let path = http::uri::PathAndQuery::from_static("/rpc_store.Rpc/SyncState");
844 let mut req = request.into_request();
845 req.extensions_mut().insert(GrpcMethod::new("rpc_store.Rpc", "SyncState"));
846 self.inner.unary(req, path, codec).await
847 }
848 pub async fn sync_account_vault(
850 &mut self,
851 request: impl tonic::IntoRequest<super::SyncAccountVaultRequest>,
852 ) -> std::result::Result<
853 tonic::Response<super::SyncAccountVaultResponse>,
854 tonic::Status,
855 > {
856 self.inner
857 .ready()
858 .await
859 .map_err(|e| {
860 tonic::Status::unknown(
861 format!("Service was not ready: {}", e.into()),
862 )
863 })?;
864 let codec = tonic_prost::ProstCodec::default();
865 let path = http::uri::PathAndQuery::from_static(
866 "/rpc_store.Rpc/SyncAccountVault",
867 );
868 let mut req = request.into_request();
869 req.extensions_mut()
870 .insert(GrpcMethod::new("rpc_store.Rpc", "SyncAccountVault"));
871 self.inner.unary(req, path, codec).await
872 }
873 pub async fn sync_storage_maps(
875 &mut self,
876 request: impl tonic::IntoRequest<super::SyncStorageMapsRequest>,
877 ) -> std::result::Result<
878 tonic::Response<super::SyncStorageMapsResponse>,
879 tonic::Status,
880 > {
881 self.inner
882 .ready()
883 .await
884 .map_err(|e| {
885 tonic::Status::unknown(
886 format!("Service was not ready: {}", e.into()),
887 )
888 })?;
889 let codec = tonic_prost::ProstCodec::default();
890 let path = http::uri::PathAndQuery::from_static(
891 "/rpc_store.Rpc/SyncStorageMaps",
892 );
893 let mut req = request.into_request();
894 req.extensions_mut()
895 .insert(GrpcMethod::new("rpc_store.Rpc", "SyncStorageMaps"));
896 self.inner.unary(req, path, codec).await
897 }
898 pub async fn sync_transactions(
900 &mut self,
901 request: impl tonic::IntoRequest<super::SyncTransactionsRequest>,
902 ) -> std::result::Result<
903 tonic::Response<super::SyncTransactionsResponse>,
904 tonic::Status,
905 > {
906 self.inner
907 .ready()
908 .await
909 .map_err(|e| {
910 tonic::Status::unknown(
911 format!("Service was not ready: {}", e.into()),
912 )
913 })?;
914 let codec = tonic_prost::ProstCodec::default();
915 let path = http::uri::PathAndQuery::from_static(
916 "/rpc_store.Rpc/SyncTransactions",
917 );
918 let mut req = request.into_request();
919 req.extensions_mut()
920 .insert(GrpcMethod::new("rpc_store.Rpc", "SyncTransactions"));
921 self.inner.unary(req, path, codec).await
922 }
923 }
924}
925pub mod rpc_server {
927 #![allow(
928 unused_variables,
929 dead_code,
930 missing_docs,
931 clippy::wildcard_imports,
932 clippy::let_unit_value,
933 )]
934 use tonic::codegen::*;
935 #[async_trait]
937 pub trait Rpc: std::marker::Send + std::marker::Sync + 'static {
938 async fn status(
940 &self,
941 request: tonic::Request<()>,
942 ) -> std::result::Result<tonic::Response<super::StoreStatus>, tonic::Status>;
943 async fn check_nullifiers(
945 &self,
946 request: tonic::Request<super::NullifierList>,
947 ) -> std::result::Result<
948 tonic::Response<super::CheckNullifiersResponse>,
949 tonic::Status,
950 >;
951 async fn get_account_details(
953 &self,
954 request: tonic::Request<super::super::account::AccountId>,
955 ) -> std::result::Result<
956 tonic::Response<super::super::account::AccountDetails>,
957 tonic::Status,
958 >;
959 async fn get_account_proof(
961 &self,
962 request: tonic::Request<super::AccountProofRequest>,
963 ) -> std::result::Result<
964 tonic::Response<super::AccountProofResponse>,
965 tonic::Status,
966 >;
967 async fn get_block_by_number(
969 &self,
970 request: tonic::Request<super::super::blockchain::BlockNumber>,
971 ) -> std::result::Result<
972 tonic::Response<super::super::blockchain::MaybeBlock>,
973 tonic::Status,
974 >;
975 async fn get_block_header_by_number(
978 &self,
979 request: tonic::Request<super::super::shared::BlockHeaderByNumberRequest>,
980 ) -> std::result::Result<
981 tonic::Response<super::super::shared::BlockHeaderByNumberResponse>,
982 tonic::Status,
983 >;
984 async fn get_notes_by_id(
986 &self,
987 request: tonic::Request<super::super::note::NoteIdList>,
988 ) -> std::result::Result<
989 tonic::Response<super::super::note::CommittedNoteList>,
990 tonic::Status,
991 >;
992 async fn get_note_script_by_root(
994 &self,
995 request: tonic::Request<super::super::note::NoteRoot>,
996 ) -> std::result::Result<
997 tonic::Response<super::super::shared::MaybeNoteScript>,
998 tonic::Status,
999 >;
1000 async fn sync_nullifiers(
1004 &self,
1005 request: tonic::Request<super::SyncNullifiersRequest>,
1006 ) -> std::result::Result<
1007 tonic::Response<super::SyncNullifiersResponse>,
1008 tonic::Status,
1009 >;
1010 async fn sync_notes(
1020 &self,
1021 request: tonic::Request<super::SyncNotesRequest>,
1022 ) -> std::result::Result<
1023 tonic::Response<super::SyncNotesResponse>,
1024 tonic::Status,
1025 >;
1026 async fn sync_state(
1042 &self,
1043 request: tonic::Request<super::SyncStateRequest>,
1044 ) -> std::result::Result<
1045 tonic::Response<super::SyncStateResponse>,
1046 tonic::Status,
1047 >;
1048 async fn sync_account_vault(
1050 &self,
1051 request: tonic::Request<super::SyncAccountVaultRequest>,
1052 ) -> std::result::Result<
1053 tonic::Response<super::SyncAccountVaultResponse>,
1054 tonic::Status,
1055 >;
1056 async fn sync_storage_maps(
1058 &self,
1059 request: tonic::Request<super::SyncStorageMapsRequest>,
1060 ) -> std::result::Result<
1061 tonic::Response<super::SyncStorageMapsResponse>,
1062 tonic::Status,
1063 >;
1064 async fn sync_transactions(
1066 &self,
1067 request: tonic::Request<super::SyncTransactionsRequest>,
1068 ) -> std::result::Result<
1069 tonic::Response<super::SyncTransactionsResponse>,
1070 tonic::Status,
1071 >;
1072 }
1073 #[derive(Debug)]
1075 pub struct RpcServer<T> {
1076 inner: Arc<T>,
1077 accept_compression_encodings: EnabledCompressionEncodings,
1078 send_compression_encodings: EnabledCompressionEncodings,
1079 max_decoding_message_size: Option<usize>,
1080 max_encoding_message_size: Option<usize>,
1081 }
1082 impl<T> RpcServer<T> {
1083 pub fn new(inner: T) -> Self {
1084 Self::from_arc(Arc::new(inner))
1085 }
1086 pub fn from_arc(inner: Arc<T>) -> Self {
1087 Self {
1088 inner,
1089 accept_compression_encodings: Default::default(),
1090 send_compression_encodings: Default::default(),
1091 max_decoding_message_size: None,
1092 max_encoding_message_size: None,
1093 }
1094 }
1095 pub fn with_interceptor<F>(
1096 inner: T,
1097 interceptor: F,
1098 ) -> InterceptedService<Self, F>
1099 where
1100 F: tonic::service::Interceptor,
1101 {
1102 InterceptedService::new(Self::new(inner), interceptor)
1103 }
1104 #[must_use]
1106 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1107 self.accept_compression_encodings.enable(encoding);
1108 self
1109 }
1110 #[must_use]
1112 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1113 self.send_compression_encodings.enable(encoding);
1114 self
1115 }
1116 #[must_use]
1120 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1121 self.max_decoding_message_size = Some(limit);
1122 self
1123 }
1124 #[must_use]
1128 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1129 self.max_encoding_message_size = Some(limit);
1130 self
1131 }
1132 }
1133 impl<T, B> tonic::codegen::Service<http::Request<B>> for RpcServer<T>
1134 where
1135 T: Rpc,
1136 B: Body + std::marker::Send + 'static,
1137 B::Error: Into<StdError> + std::marker::Send + 'static,
1138 {
1139 type Response = http::Response<tonic::body::Body>;
1140 type Error = std::convert::Infallible;
1141 type Future = BoxFuture<Self::Response, Self::Error>;
1142 fn poll_ready(
1143 &mut self,
1144 _cx: &mut Context<'_>,
1145 ) -> Poll<std::result::Result<(), Self::Error>> {
1146 Poll::Ready(Ok(()))
1147 }
1148 fn call(&mut self, req: http::Request<B>) -> Self::Future {
1149 match req.uri().path() {
1150 "/rpc_store.Rpc/Status" => {
1151 #[allow(non_camel_case_types)]
1152 struct StatusSvc<T: Rpc>(pub Arc<T>);
1153 impl<T: Rpc> tonic::server::UnaryService<()> for StatusSvc<T> {
1154 type Response = super::StoreStatus;
1155 type Future = BoxFuture<
1156 tonic::Response<Self::Response>,
1157 tonic::Status,
1158 >;
1159 fn call(&mut self, request: tonic::Request<()>) -> Self::Future {
1160 let inner = Arc::clone(&self.0);
1161 let fut = async move {
1162 <T as Rpc>::status(&inner, request).await
1163 };
1164 Box::pin(fut)
1165 }
1166 }
1167 let accept_compression_encodings = self.accept_compression_encodings;
1168 let send_compression_encodings = self.send_compression_encodings;
1169 let max_decoding_message_size = self.max_decoding_message_size;
1170 let max_encoding_message_size = self.max_encoding_message_size;
1171 let inner = self.inner.clone();
1172 let fut = async move {
1173 let method = StatusSvc(inner);
1174 let codec = tonic_prost::ProstCodec::default();
1175 let mut grpc = tonic::server::Grpc::new(codec)
1176 .apply_compression_config(
1177 accept_compression_encodings,
1178 send_compression_encodings,
1179 )
1180 .apply_max_message_size_config(
1181 max_decoding_message_size,
1182 max_encoding_message_size,
1183 );
1184 let res = grpc.unary(method, req).await;
1185 Ok(res)
1186 };
1187 Box::pin(fut)
1188 }
1189 "/rpc_store.Rpc/CheckNullifiers" => {
1190 #[allow(non_camel_case_types)]
1191 struct CheckNullifiersSvc<T: Rpc>(pub Arc<T>);
1192 impl<T: Rpc> tonic::server::UnaryService<super::NullifierList>
1193 for CheckNullifiersSvc<T> {
1194 type Response = super::CheckNullifiersResponse;
1195 type Future = BoxFuture<
1196 tonic::Response<Self::Response>,
1197 tonic::Status,
1198 >;
1199 fn call(
1200 &mut self,
1201 request: tonic::Request<super::NullifierList>,
1202 ) -> Self::Future {
1203 let inner = Arc::clone(&self.0);
1204 let fut = async move {
1205 <T as Rpc>::check_nullifiers(&inner, request).await
1206 };
1207 Box::pin(fut)
1208 }
1209 }
1210 let accept_compression_encodings = self.accept_compression_encodings;
1211 let send_compression_encodings = self.send_compression_encodings;
1212 let max_decoding_message_size = self.max_decoding_message_size;
1213 let max_encoding_message_size = self.max_encoding_message_size;
1214 let inner = self.inner.clone();
1215 let fut = async move {
1216 let method = CheckNullifiersSvc(inner);
1217 let codec = tonic_prost::ProstCodec::default();
1218 let mut grpc = tonic::server::Grpc::new(codec)
1219 .apply_compression_config(
1220 accept_compression_encodings,
1221 send_compression_encodings,
1222 )
1223 .apply_max_message_size_config(
1224 max_decoding_message_size,
1225 max_encoding_message_size,
1226 );
1227 let res = grpc.unary(method, req).await;
1228 Ok(res)
1229 };
1230 Box::pin(fut)
1231 }
1232 "/rpc_store.Rpc/GetAccountDetails" => {
1233 #[allow(non_camel_case_types)]
1234 struct GetAccountDetailsSvc<T: Rpc>(pub Arc<T>);
1235 impl<
1236 T: Rpc,
1237 > tonic::server::UnaryService<super::super::account::AccountId>
1238 for GetAccountDetailsSvc<T> {
1239 type Response = super::super::account::AccountDetails;
1240 type Future = BoxFuture<
1241 tonic::Response<Self::Response>,
1242 tonic::Status,
1243 >;
1244 fn call(
1245 &mut self,
1246 request: tonic::Request<super::super::account::AccountId>,
1247 ) -> Self::Future {
1248 let inner = Arc::clone(&self.0);
1249 let fut = async move {
1250 <T as Rpc>::get_account_details(&inner, request).await
1251 };
1252 Box::pin(fut)
1253 }
1254 }
1255 let accept_compression_encodings = self.accept_compression_encodings;
1256 let send_compression_encodings = self.send_compression_encodings;
1257 let max_decoding_message_size = self.max_decoding_message_size;
1258 let max_encoding_message_size = self.max_encoding_message_size;
1259 let inner = self.inner.clone();
1260 let fut = async move {
1261 let method = GetAccountDetailsSvc(inner);
1262 let codec = tonic_prost::ProstCodec::default();
1263 let mut grpc = tonic::server::Grpc::new(codec)
1264 .apply_compression_config(
1265 accept_compression_encodings,
1266 send_compression_encodings,
1267 )
1268 .apply_max_message_size_config(
1269 max_decoding_message_size,
1270 max_encoding_message_size,
1271 );
1272 let res = grpc.unary(method, req).await;
1273 Ok(res)
1274 };
1275 Box::pin(fut)
1276 }
1277 "/rpc_store.Rpc/GetAccountProof" => {
1278 #[allow(non_camel_case_types)]
1279 struct GetAccountProofSvc<T: Rpc>(pub Arc<T>);
1280 impl<T: Rpc> tonic::server::UnaryService<super::AccountProofRequest>
1281 for GetAccountProofSvc<T> {
1282 type Response = super::AccountProofResponse;
1283 type Future = BoxFuture<
1284 tonic::Response<Self::Response>,
1285 tonic::Status,
1286 >;
1287 fn call(
1288 &mut self,
1289 request: tonic::Request<super::AccountProofRequest>,
1290 ) -> Self::Future {
1291 let inner = Arc::clone(&self.0);
1292 let fut = async move {
1293 <T as Rpc>::get_account_proof(&inner, request).await
1294 };
1295 Box::pin(fut)
1296 }
1297 }
1298 let accept_compression_encodings = self.accept_compression_encodings;
1299 let send_compression_encodings = self.send_compression_encodings;
1300 let max_decoding_message_size = self.max_decoding_message_size;
1301 let max_encoding_message_size = self.max_encoding_message_size;
1302 let inner = self.inner.clone();
1303 let fut = async move {
1304 let method = GetAccountProofSvc(inner);
1305 let codec = tonic_prost::ProstCodec::default();
1306 let mut grpc = tonic::server::Grpc::new(codec)
1307 .apply_compression_config(
1308 accept_compression_encodings,
1309 send_compression_encodings,
1310 )
1311 .apply_max_message_size_config(
1312 max_decoding_message_size,
1313 max_encoding_message_size,
1314 );
1315 let res = grpc.unary(method, req).await;
1316 Ok(res)
1317 };
1318 Box::pin(fut)
1319 }
1320 "/rpc_store.Rpc/GetBlockByNumber" => {
1321 #[allow(non_camel_case_types)]
1322 struct GetBlockByNumberSvc<T: Rpc>(pub Arc<T>);
1323 impl<
1324 T: Rpc,
1325 > tonic::server::UnaryService<super::super::blockchain::BlockNumber>
1326 for GetBlockByNumberSvc<T> {
1327 type Response = super::super::blockchain::MaybeBlock;
1328 type Future = BoxFuture<
1329 tonic::Response<Self::Response>,
1330 tonic::Status,
1331 >;
1332 fn call(
1333 &mut self,
1334 request: tonic::Request<
1335 super::super::blockchain::BlockNumber,
1336 >,
1337 ) -> Self::Future {
1338 let inner = Arc::clone(&self.0);
1339 let fut = async move {
1340 <T as Rpc>::get_block_by_number(&inner, request).await
1341 };
1342 Box::pin(fut)
1343 }
1344 }
1345 let accept_compression_encodings = self.accept_compression_encodings;
1346 let send_compression_encodings = self.send_compression_encodings;
1347 let max_decoding_message_size = self.max_decoding_message_size;
1348 let max_encoding_message_size = self.max_encoding_message_size;
1349 let inner = self.inner.clone();
1350 let fut = async move {
1351 let method = GetBlockByNumberSvc(inner);
1352 let codec = tonic_prost::ProstCodec::default();
1353 let mut grpc = tonic::server::Grpc::new(codec)
1354 .apply_compression_config(
1355 accept_compression_encodings,
1356 send_compression_encodings,
1357 )
1358 .apply_max_message_size_config(
1359 max_decoding_message_size,
1360 max_encoding_message_size,
1361 );
1362 let res = grpc.unary(method, req).await;
1363 Ok(res)
1364 };
1365 Box::pin(fut)
1366 }
1367 "/rpc_store.Rpc/GetBlockHeaderByNumber" => {
1368 #[allow(non_camel_case_types)]
1369 struct GetBlockHeaderByNumberSvc<T: Rpc>(pub Arc<T>);
1370 impl<
1371 T: Rpc,
1372 > tonic::server::UnaryService<
1373 super::super::shared::BlockHeaderByNumberRequest,
1374 > for GetBlockHeaderByNumberSvc<T> {
1375 type Response = super::super::shared::BlockHeaderByNumberResponse;
1376 type Future = BoxFuture<
1377 tonic::Response<Self::Response>,
1378 tonic::Status,
1379 >;
1380 fn call(
1381 &mut self,
1382 request: tonic::Request<
1383 super::super::shared::BlockHeaderByNumberRequest,
1384 >,
1385 ) -> Self::Future {
1386 let inner = Arc::clone(&self.0);
1387 let fut = async move {
1388 <T as Rpc>::get_block_header_by_number(&inner, request)
1389 .await
1390 };
1391 Box::pin(fut)
1392 }
1393 }
1394 let accept_compression_encodings = self.accept_compression_encodings;
1395 let send_compression_encodings = self.send_compression_encodings;
1396 let max_decoding_message_size = self.max_decoding_message_size;
1397 let max_encoding_message_size = self.max_encoding_message_size;
1398 let inner = self.inner.clone();
1399 let fut = async move {
1400 let method = GetBlockHeaderByNumberSvc(inner);
1401 let codec = tonic_prost::ProstCodec::default();
1402 let mut grpc = tonic::server::Grpc::new(codec)
1403 .apply_compression_config(
1404 accept_compression_encodings,
1405 send_compression_encodings,
1406 )
1407 .apply_max_message_size_config(
1408 max_decoding_message_size,
1409 max_encoding_message_size,
1410 );
1411 let res = grpc.unary(method, req).await;
1412 Ok(res)
1413 };
1414 Box::pin(fut)
1415 }
1416 "/rpc_store.Rpc/GetNotesById" => {
1417 #[allow(non_camel_case_types)]
1418 struct GetNotesByIdSvc<T: Rpc>(pub Arc<T>);
1419 impl<
1420 T: Rpc,
1421 > tonic::server::UnaryService<super::super::note::NoteIdList>
1422 for GetNotesByIdSvc<T> {
1423 type Response = super::super::note::CommittedNoteList;
1424 type Future = BoxFuture<
1425 tonic::Response<Self::Response>,
1426 tonic::Status,
1427 >;
1428 fn call(
1429 &mut self,
1430 request: tonic::Request<super::super::note::NoteIdList>,
1431 ) -> Self::Future {
1432 let inner = Arc::clone(&self.0);
1433 let fut = async move {
1434 <T as Rpc>::get_notes_by_id(&inner, request).await
1435 };
1436 Box::pin(fut)
1437 }
1438 }
1439 let accept_compression_encodings = self.accept_compression_encodings;
1440 let send_compression_encodings = self.send_compression_encodings;
1441 let max_decoding_message_size = self.max_decoding_message_size;
1442 let max_encoding_message_size = self.max_encoding_message_size;
1443 let inner = self.inner.clone();
1444 let fut = async move {
1445 let method = GetNotesByIdSvc(inner);
1446 let codec = tonic_prost::ProstCodec::default();
1447 let mut grpc = tonic::server::Grpc::new(codec)
1448 .apply_compression_config(
1449 accept_compression_encodings,
1450 send_compression_encodings,
1451 )
1452 .apply_max_message_size_config(
1453 max_decoding_message_size,
1454 max_encoding_message_size,
1455 );
1456 let res = grpc.unary(method, req).await;
1457 Ok(res)
1458 };
1459 Box::pin(fut)
1460 }
1461 "/rpc_store.Rpc/GetNoteScriptByRoot" => {
1462 #[allow(non_camel_case_types)]
1463 struct GetNoteScriptByRootSvc<T: Rpc>(pub Arc<T>);
1464 impl<
1465 T: Rpc,
1466 > tonic::server::UnaryService<super::super::note::NoteRoot>
1467 for GetNoteScriptByRootSvc<T> {
1468 type Response = super::super::shared::MaybeNoteScript;
1469 type Future = BoxFuture<
1470 tonic::Response<Self::Response>,
1471 tonic::Status,
1472 >;
1473 fn call(
1474 &mut self,
1475 request: tonic::Request<super::super::note::NoteRoot>,
1476 ) -> Self::Future {
1477 let inner = Arc::clone(&self.0);
1478 let fut = async move {
1479 <T as Rpc>::get_note_script_by_root(&inner, request).await
1480 };
1481 Box::pin(fut)
1482 }
1483 }
1484 let accept_compression_encodings = self.accept_compression_encodings;
1485 let send_compression_encodings = self.send_compression_encodings;
1486 let max_decoding_message_size = self.max_decoding_message_size;
1487 let max_encoding_message_size = self.max_encoding_message_size;
1488 let inner = self.inner.clone();
1489 let fut = async move {
1490 let method = GetNoteScriptByRootSvc(inner);
1491 let codec = tonic_prost::ProstCodec::default();
1492 let mut grpc = tonic::server::Grpc::new(codec)
1493 .apply_compression_config(
1494 accept_compression_encodings,
1495 send_compression_encodings,
1496 )
1497 .apply_max_message_size_config(
1498 max_decoding_message_size,
1499 max_encoding_message_size,
1500 );
1501 let res = grpc.unary(method, req).await;
1502 Ok(res)
1503 };
1504 Box::pin(fut)
1505 }
1506 "/rpc_store.Rpc/SyncNullifiers" => {
1507 #[allow(non_camel_case_types)]
1508 struct SyncNullifiersSvc<T: Rpc>(pub Arc<T>);
1509 impl<
1510 T: Rpc,
1511 > tonic::server::UnaryService<super::SyncNullifiersRequest>
1512 for SyncNullifiersSvc<T> {
1513 type Response = super::SyncNullifiersResponse;
1514 type Future = BoxFuture<
1515 tonic::Response<Self::Response>,
1516 tonic::Status,
1517 >;
1518 fn call(
1519 &mut self,
1520 request: tonic::Request<super::SyncNullifiersRequest>,
1521 ) -> Self::Future {
1522 let inner = Arc::clone(&self.0);
1523 let fut = async move {
1524 <T as Rpc>::sync_nullifiers(&inner, request).await
1525 };
1526 Box::pin(fut)
1527 }
1528 }
1529 let accept_compression_encodings = self.accept_compression_encodings;
1530 let send_compression_encodings = self.send_compression_encodings;
1531 let max_decoding_message_size = self.max_decoding_message_size;
1532 let max_encoding_message_size = self.max_encoding_message_size;
1533 let inner = self.inner.clone();
1534 let fut = async move {
1535 let method = SyncNullifiersSvc(inner);
1536 let codec = tonic_prost::ProstCodec::default();
1537 let mut grpc = tonic::server::Grpc::new(codec)
1538 .apply_compression_config(
1539 accept_compression_encodings,
1540 send_compression_encodings,
1541 )
1542 .apply_max_message_size_config(
1543 max_decoding_message_size,
1544 max_encoding_message_size,
1545 );
1546 let res = grpc.unary(method, req).await;
1547 Ok(res)
1548 };
1549 Box::pin(fut)
1550 }
1551 "/rpc_store.Rpc/SyncNotes" => {
1552 #[allow(non_camel_case_types)]
1553 struct SyncNotesSvc<T: Rpc>(pub Arc<T>);
1554 impl<T: Rpc> tonic::server::UnaryService<super::SyncNotesRequest>
1555 for SyncNotesSvc<T> {
1556 type Response = super::SyncNotesResponse;
1557 type Future = BoxFuture<
1558 tonic::Response<Self::Response>,
1559 tonic::Status,
1560 >;
1561 fn call(
1562 &mut self,
1563 request: tonic::Request<super::SyncNotesRequest>,
1564 ) -> Self::Future {
1565 let inner = Arc::clone(&self.0);
1566 let fut = async move {
1567 <T as Rpc>::sync_notes(&inner, request).await
1568 };
1569 Box::pin(fut)
1570 }
1571 }
1572 let accept_compression_encodings = self.accept_compression_encodings;
1573 let send_compression_encodings = self.send_compression_encodings;
1574 let max_decoding_message_size = self.max_decoding_message_size;
1575 let max_encoding_message_size = self.max_encoding_message_size;
1576 let inner = self.inner.clone();
1577 let fut = async move {
1578 let method = SyncNotesSvc(inner);
1579 let codec = tonic_prost::ProstCodec::default();
1580 let mut grpc = tonic::server::Grpc::new(codec)
1581 .apply_compression_config(
1582 accept_compression_encodings,
1583 send_compression_encodings,
1584 )
1585 .apply_max_message_size_config(
1586 max_decoding_message_size,
1587 max_encoding_message_size,
1588 );
1589 let res = grpc.unary(method, req).await;
1590 Ok(res)
1591 };
1592 Box::pin(fut)
1593 }
1594 "/rpc_store.Rpc/SyncState" => {
1595 #[allow(non_camel_case_types)]
1596 struct SyncStateSvc<T: Rpc>(pub Arc<T>);
1597 impl<T: Rpc> tonic::server::UnaryService<super::SyncStateRequest>
1598 for SyncStateSvc<T> {
1599 type Response = super::SyncStateResponse;
1600 type Future = BoxFuture<
1601 tonic::Response<Self::Response>,
1602 tonic::Status,
1603 >;
1604 fn call(
1605 &mut self,
1606 request: tonic::Request<super::SyncStateRequest>,
1607 ) -> Self::Future {
1608 let inner = Arc::clone(&self.0);
1609 let fut = async move {
1610 <T as Rpc>::sync_state(&inner, request).await
1611 };
1612 Box::pin(fut)
1613 }
1614 }
1615 let accept_compression_encodings = self.accept_compression_encodings;
1616 let send_compression_encodings = self.send_compression_encodings;
1617 let max_decoding_message_size = self.max_decoding_message_size;
1618 let max_encoding_message_size = self.max_encoding_message_size;
1619 let inner = self.inner.clone();
1620 let fut = async move {
1621 let method = SyncStateSvc(inner);
1622 let codec = tonic_prost::ProstCodec::default();
1623 let mut grpc = tonic::server::Grpc::new(codec)
1624 .apply_compression_config(
1625 accept_compression_encodings,
1626 send_compression_encodings,
1627 )
1628 .apply_max_message_size_config(
1629 max_decoding_message_size,
1630 max_encoding_message_size,
1631 );
1632 let res = grpc.unary(method, req).await;
1633 Ok(res)
1634 };
1635 Box::pin(fut)
1636 }
1637 "/rpc_store.Rpc/SyncAccountVault" => {
1638 #[allow(non_camel_case_types)]
1639 struct SyncAccountVaultSvc<T: Rpc>(pub Arc<T>);
1640 impl<
1641 T: Rpc,
1642 > tonic::server::UnaryService<super::SyncAccountVaultRequest>
1643 for SyncAccountVaultSvc<T> {
1644 type Response = super::SyncAccountVaultResponse;
1645 type Future = BoxFuture<
1646 tonic::Response<Self::Response>,
1647 tonic::Status,
1648 >;
1649 fn call(
1650 &mut self,
1651 request: tonic::Request<super::SyncAccountVaultRequest>,
1652 ) -> Self::Future {
1653 let inner = Arc::clone(&self.0);
1654 let fut = async move {
1655 <T as Rpc>::sync_account_vault(&inner, request).await
1656 };
1657 Box::pin(fut)
1658 }
1659 }
1660 let accept_compression_encodings = self.accept_compression_encodings;
1661 let send_compression_encodings = self.send_compression_encodings;
1662 let max_decoding_message_size = self.max_decoding_message_size;
1663 let max_encoding_message_size = self.max_encoding_message_size;
1664 let inner = self.inner.clone();
1665 let fut = async move {
1666 let method = SyncAccountVaultSvc(inner);
1667 let codec = tonic_prost::ProstCodec::default();
1668 let mut grpc = tonic::server::Grpc::new(codec)
1669 .apply_compression_config(
1670 accept_compression_encodings,
1671 send_compression_encodings,
1672 )
1673 .apply_max_message_size_config(
1674 max_decoding_message_size,
1675 max_encoding_message_size,
1676 );
1677 let res = grpc.unary(method, req).await;
1678 Ok(res)
1679 };
1680 Box::pin(fut)
1681 }
1682 "/rpc_store.Rpc/SyncStorageMaps" => {
1683 #[allow(non_camel_case_types)]
1684 struct SyncStorageMapsSvc<T: Rpc>(pub Arc<T>);
1685 impl<
1686 T: Rpc,
1687 > tonic::server::UnaryService<super::SyncStorageMapsRequest>
1688 for SyncStorageMapsSvc<T> {
1689 type Response = super::SyncStorageMapsResponse;
1690 type Future = BoxFuture<
1691 tonic::Response<Self::Response>,
1692 tonic::Status,
1693 >;
1694 fn call(
1695 &mut self,
1696 request: tonic::Request<super::SyncStorageMapsRequest>,
1697 ) -> Self::Future {
1698 let inner = Arc::clone(&self.0);
1699 let fut = async move {
1700 <T as Rpc>::sync_storage_maps(&inner, request).await
1701 };
1702 Box::pin(fut)
1703 }
1704 }
1705 let accept_compression_encodings = self.accept_compression_encodings;
1706 let send_compression_encodings = self.send_compression_encodings;
1707 let max_decoding_message_size = self.max_decoding_message_size;
1708 let max_encoding_message_size = self.max_encoding_message_size;
1709 let inner = self.inner.clone();
1710 let fut = async move {
1711 let method = SyncStorageMapsSvc(inner);
1712 let codec = tonic_prost::ProstCodec::default();
1713 let mut grpc = tonic::server::Grpc::new(codec)
1714 .apply_compression_config(
1715 accept_compression_encodings,
1716 send_compression_encodings,
1717 )
1718 .apply_max_message_size_config(
1719 max_decoding_message_size,
1720 max_encoding_message_size,
1721 );
1722 let res = grpc.unary(method, req).await;
1723 Ok(res)
1724 };
1725 Box::pin(fut)
1726 }
1727 "/rpc_store.Rpc/SyncTransactions" => {
1728 #[allow(non_camel_case_types)]
1729 struct SyncTransactionsSvc<T: Rpc>(pub Arc<T>);
1730 impl<
1731 T: Rpc,
1732 > tonic::server::UnaryService<super::SyncTransactionsRequest>
1733 for SyncTransactionsSvc<T> {
1734 type Response = super::SyncTransactionsResponse;
1735 type Future = BoxFuture<
1736 tonic::Response<Self::Response>,
1737 tonic::Status,
1738 >;
1739 fn call(
1740 &mut self,
1741 request: tonic::Request<super::SyncTransactionsRequest>,
1742 ) -> Self::Future {
1743 let inner = Arc::clone(&self.0);
1744 let fut = async move {
1745 <T as Rpc>::sync_transactions(&inner, request).await
1746 };
1747 Box::pin(fut)
1748 }
1749 }
1750 let accept_compression_encodings = self.accept_compression_encodings;
1751 let send_compression_encodings = self.send_compression_encodings;
1752 let max_decoding_message_size = self.max_decoding_message_size;
1753 let max_encoding_message_size = self.max_encoding_message_size;
1754 let inner = self.inner.clone();
1755 let fut = async move {
1756 let method = SyncTransactionsSvc(inner);
1757 let codec = tonic_prost::ProstCodec::default();
1758 let mut grpc = tonic::server::Grpc::new(codec)
1759 .apply_compression_config(
1760 accept_compression_encodings,
1761 send_compression_encodings,
1762 )
1763 .apply_max_message_size_config(
1764 max_decoding_message_size,
1765 max_encoding_message_size,
1766 );
1767 let res = grpc.unary(method, req).await;
1768 Ok(res)
1769 };
1770 Box::pin(fut)
1771 }
1772 _ => {
1773 Box::pin(async move {
1774 let mut response = http::Response::new(
1775 tonic::body::Body::default(),
1776 );
1777 let headers = response.headers_mut();
1778 headers
1779 .insert(
1780 tonic::Status::GRPC_STATUS,
1781 (tonic::Code::Unimplemented as i32).into(),
1782 );
1783 headers
1784 .insert(
1785 http::header::CONTENT_TYPE,
1786 tonic::metadata::GRPC_CONTENT_TYPE,
1787 );
1788 Ok(response)
1789 })
1790 }
1791 }
1792 }
1793 }
1794 impl<T> Clone for RpcServer<T> {
1795 fn clone(&self) -> Self {
1796 let inner = self.inner.clone();
1797 Self {
1798 inner,
1799 accept_compression_encodings: self.accept_compression_encodings,
1800 send_compression_encodings: self.send_compression_encodings,
1801 max_decoding_message_size: self.max_decoding_message_size,
1802 max_encoding_message_size: self.max_encoding_message_size,
1803 }
1804 }
1805 }
1806 pub const SERVICE_NAME: &str = "rpc_store.Rpc";
1808 impl<T> tonic::server::NamedService for RpcServer<T> {
1809 const NAME: &'static str = SERVICE_NAME;
1810 }
1811}