penumbra_sdk_proto/gen/
penumbra.core.app.v1.rs

1// This file is @generated by prost-build.
2/// Requests the list of all transactions that occurred within a given block.
3#[derive(Clone, Copy, PartialEq, ::prost::Message)]
4pub struct TransactionsByHeightRequest {
5    /// The block height to retrieve.
6    #[prost(uint64, tag = "2")]
7    pub block_height: u64,
8}
9impl ::prost::Name for TransactionsByHeightRequest {
10    const NAME: &'static str = "TransactionsByHeightRequest";
11    const PACKAGE: &'static str = "penumbra.core.app.v1";
12    fn full_name() -> ::prost::alloc::string::String {
13        "penumbra.core.app.v1.TransactionsByHeightRequest".into()
14    }
15    fn type_url() -> ::prost::alloc::string::String {
16        "/penumbra.core.app.v1.TransactionsByHeightRequest".into()
17    }
18}
19/// A transaction that appeared within a given block.
20#[derive(Clone, PartialEq, ::prost::Message)]
21pub struct TransactionsByHeightResponse {
22    /// The transactions.
23    #[prost(message, repeated, tag = "1")]
24    pub transactions: ::prost::alloc::vec::Vec<
25        super::super::transaction::v1::Transaction,
26    >,
27    /// The block height.
28    #[prost(uint64, tag = "2")]
29    pub block_height: u64,
30}
31impl ::prost::Name for TransactionsByHeightResponse {
32    const NAME: &'static str = "TransactionsByHeightResponse";
33    const PACKAGE: &'static str = "penumbra.core.app.v1";
34    fn full_name() -> ::prost::alloc::string::String {
35        "penumbra.core.app.v1.TransactionsByHeightResponse".into()
36    }
37    fn type_url() -> ::prost::alloc::string::String {
38        "/penumbra.core.app.v1.TransactionsByHeightResponse".into()
39    }
40}
41#[derive(Clone, PartialEq, ::prost::Message)]
42pub struct AppParameters {
43    /// The chain identifier.
44    #[prost(string, tag = "1")]
45    pub chain_id: ::prost::alloc::string::String,
46    /// Sct module parameters.
47    #[prost(message, optional, tag = "2")]
48    pub sct_params: ::core::option::Option<
49        super::super::component::sct::v1::SctParameters,
50    >,
51    /// Community Pool module parameters.
52    #[prost(message, optional, tag = "3")]
53    pub community_pool_params: ::core::option::Option<
54        super::super::component::community_pool::v1::CommunityPoolParameters,
55    >,
56    /// Governance module parameters.
57    #[prost(message, optional, tag = "4")]
58    pub governance_params: ::core::option::Option<
59        super::super::component::governance::v1::GovernanceParameters,
60    >,
61    /// IBC module parameters.
62    #[prost(message, optional, tag = "5")]
63    pub ibc_params: ::core::option::Option<
64        super::super::component::ibc::v1::IbcParameters,
65    >,
66    /// Stake module parameters.
67    #[prost(message, optional, tag = "6")]
68    pub stake_params: ::core::option::Option<
69        super::super::component::stake::v1::StakeParameters,
70    >,
71    /// Fee module parameters.
72    #[prost(message, optional, tag = "7")]
73    pub fee_params: ::core::option::Option<
74        super::super::component::fee::v1::FeeParameters,
75    >,
76    /// Distributions module parameters.
77    #[prost(message, optional, tag = "8")]
78    pub distributions_params: ::core::option::Option<
79        super::super::component::distributions::v1::DistributionsParameters,
80    >,
81    /// Funding module parameters.
82    #[prost(message, optional, tag = "9")]
83    pub funding_params: ::core::option::Option<
84        super::super::component::funding::v1::FundingParameters,
85    >,
86    /// Shielded pool module parameters.
87    #[prost(message, optional, tag = "10")]
88    pub shielded_pool_params: ::core::option::Option<
89        super::super::component::shielded_pool::v1::ShieldedPoolParameters,
90    >,
91    /// DEX module parameters.
92    #[prost(message, optional, tag = "11")]
93    pub dex_params: ::core::option::Option<
94        super::super::component::dex::v1::DexParameters,
95    >,
96    /// Auction module parameters.
97    #[prost(message, optional, tag = "12")]
98    pub auction_params: ::core::option::Option<
99        super::super::component::auction::v1::AuctionParameters,
100    >,
101}
102impl ::prost::Name for AppParameters {
103    const NAME: &'static str = "AppParameters";
104    const PACKAGE: &'static str = "penumbra.core.app.v1";
105    fn full_name() -> ::prost::alloc::string::String {
106        "penumbra.core.app.v1.AppParameters".into()
107    }
108    fn type_url() -> ::prost::alloc::string::String {
109        "/penumbra.core.app.v1.AppParameters".into()
110    }
111}
112/// Requests the global configuration data for the app.
113#[derive(Clone, Copy, PartialEq, ::prost::Message)]
114pub struct AppParametersRequest {}
115impl ::prost::Name for AppParametersRequest {
116    const NAME: &'static str = "AppParametersRequest";
117    const PACKAGE: &'static str = "penumbra.core.app.v1";
118    fn full_name() -> ::prost::alloc::string::String {
119        "penumbra.core.app.v1.AppParametersRequest".into()
120    }
121    fn type_url() -> ::prost::alloc::string::String {
122        "/penumbra.core.app.v1.AppParametersRequest".into()
123    }
124}
125#[derive(Clone, PartialEq, ::prost::Message)]
126pub struct AppParametersResponse {
127    #[prost(message, optional, tag = "1")]
128    pub app_parameters: ::core::option::Option<AppParameters>,
129}
130impl ::prost::Name for AppParametersResponse {
131    const NAME: &'static str = "AppParametersResponse";
132    const PACKAGE: &'static str = "penumbra.core.app.v1";
133    fn full_name() -> ::prost::alloc::string::String {
134        "penumbra.core.app.v1.AppParametersResponse".into()
135    }
136    fn type_url() -> ::prost::alloc::string::String {
137        "/penumbra.core.app.v1.AppParametersResponse".into()
138    }
139}
140#[derive(Clone, PartialEq, ::prost::Message)]
141pub struct GenesisAppState {
142    #[prost(oneof = "genesis_app_state::GenesisAppState", tags = "1, 2")]
143    pub genesis_app_state: ::core::option::Option<genesis_app_state::GenesisAppState>,
144}
145/// Nested message and enum types in `GenesisAppState`.
146pub mod genesis_app_state {
147    #[derive(Clone, PartialEq, ::prost::Oneof)]
148    pub enum GenesisAppState {
149        #[prost(message, tag = "1")]
150        GenesisContent(super::GenesisContent),
151        #[prost(bytes, tag = "2")]
152        GenesisCheckpoint(::prost::alloc::vec::Vec<u8>),
153    }
154}
155impl ::prost::Name for GenesisAppState {
156    const NAME: &'static str = "GenesisAppState";
157    const PACKAGE: &'static str = "penumbra.core.app.v1";
158    fn full_name() -> ::prost::alloc::string::String {
159        "penumbra.core.app.v1.GenesisAppState".into()
160    }
161    fn type_url() -> ::prost::alloc::string::String {
162        "/penumbra.core.app.v1.GenesisAppState".into()
163    }
164}
165#[derive(Clone, PartialEq, ::prost::Message)]
166pub struct GenesisContent {
167    /// The initial chain identifier.
168    #[prost(string, tag = "1")]
169    pub chain_id: ::prost::alloc::string::String,
170    /// Stake module genesis state.
171    #[prost(message, optional, tag = "2")]
172    pub stake_content: ::core::option::Option<
173        super::super::component::stake::v1::GenesisContent,
174    >,
175    /// Shielded pool module genesis state.
176    #[prost(message, optional, tag = "3")]
177    pub shielded_pool_content: ::core::option::Option<
178        super::super::component::shielded_pool::v1::GenesisContent,
179    >,
180    /// Governance module genesis state.
181    #[prost(message, optional, tag = "4")]
182    pub governance_content: ::core::option::Option<
183        super::super::component::governance::v1::GenesisContent,
184    >,
185    /// IBC module genesis state.
186    #[prost(message, optional, tag = "5")]
187    pub ibc_content: ::core::option::Option<
188        super::super::component::ibc::v1::GenesisContent,
189    >,
190    /// Sct module genesis state.
191    #[prost(message, optional, tag = "6")]
192    pub sct_content: ::core::option::Option<
193        super::super::component::sct::v1::GenesisContent,
194    >,
195    /// Community Pool module genesis state.
196    #[prost(message, optional, tag = "7")]
197    pub community_pool_content: ::core::option::Option<
198        super::super::component::community_pool::v1::GenesisContent,
199    >,
200    /// Fee module genesis state.
201    #[prost(message, optional, tag = "8")]
202    pub fee_content: ::core::option::Option<
203        super::super::component::fee::v1::GenesisContent,
204    >,
205    /// Distributions module genesis state.
206    #[prost(message, optional, tag = "9")]
207    pub distributions_content: ::core::option::Option<
208        super::super::component::distributions::v1::GenesisContent,
209    >,
210    /// Funding module genesis state.
211    #[prost(message, optional, tag = "10")]
212    pub funding_content: ::core::option::Option<
213        super::super::component::funding::v1::GenesisContent,
214    >,
215    /// DEX component genesis state.
216    #[prost(message, optional, tag = "11")]
217    pub dex_content: ::core::option::Option<
218        super::super::component::dex::v1::GenesisContent,
219    >,
220    /// Auction component genesis state.
221    #[prost(message, optional, tag = "12")]
222    pub auction_content: ::core::option::Option<
223        super::super::component::auction::v1::GenesisContent,
224    >,
225}
226impl ::prost::Name for GenesisContent {
227    const NAME: &'static str = "GenesisContent";
228    const PACKAGE: &'static str = "penumbra.core.app.v1";
229    fn full_name() -> ::prost::alloc::string::String {
230        "penumbra.core.app.v1.GenesisContent".into()
231    }
232    fn type_url() -> ::prost::alloc::string::String {
233        "/penumbra.core.app.v1.GenesisContent".into()
234    }
235}
236/// Generated client implementations.
237#[cfg(feature = "rpc")]
238pub mod query_service_client {
239    #![allow(
240        unused_variables,
241        dead_code,
242        missing_docs,
243        clippy::wildcard_imports,
244        clippy::let_unit_value,
245    )]
246    use tonic::codegen::*;
247    use tonic::codegen::http::Uri;
248    /// Query operations for the overall Penumbra application.
249    #[derive(Debug, Clone)]
250    pub struct QueryServiceClient<T> {
251        inner: tonic::client::Grpc<T>,
252    }
253    impl QueryServiceClient<tonic::transport::Channel> {
254        /// Attempt to create a new client by connecting to a given endpoint.
255        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
256        where
257            D: TryInto<tonic::transport::Endpoint>,
258            D::Error: Into<StdError>,
259        {
260            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
261            Ok(Self::new(conn))
262        }
263    }
264    impl<T> QueryServiceClient<T>
265    where
266        T: tonic::client::GrpcService<tonic::body::BoxBody>,
267        T::Error: Into<StdError>,
268        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
269        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
270    {
271        pub fn new(inner: T) -> Self {
272            let inner = tonic::client::Grpc::new(inner);
273            Self { inner }
274        }
275        pub fn with_origin(inner: T, origin: Uri) -> Self {
276            let inner = tonic::client::Grpc::with_origin(inner, origin);
277            Self { inner }
278        }
279        pub fn with_interceptor<F>(
280            inner: T,
281            interceptor: F,
282        ) -> QueryServiceClient<InterceptedService<T, F>>
283        where
284            F: tonic::service::Interceptor,
285            T::ResponseBody: Default,
286            T: tonic::codegen::Service<
287                http::Request<tonic::body::BoxBody>,
288                Response = http::Response<
289                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
290                >,
291            >,
292            <T as tonic::codegen::Service<
293                http::Request<tonic::body::BoxBody>,
294            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
295        {
296            QueryServiceClient::new(InterceptedService::new(inner, interceptor))
297        }
298        /// Compress requests with the given encoding.
299        ///
300        /// This requires the server to support it otherwise it might respond with an
301        /// error.
302        #[must_use]
303        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
304            self.inner = self.inner.send_compressed(encoding);
305            self
306        }
307        /// Enable decompressing responses.
308        #[must_use]
309        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
310            self.inner = self.inner.accept_compressed(encoding);
311            self
312        }
313        /// Limits the maximum size of a decoded message.
314        ///
315        /// Default: `4MB`
316        #[must_use]
317        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
318            self.inner = self.inner.max_decoding_message_size(limit);
319            self
320        }
321        /// Limits the maximum size of an encoded message.
322        ///
323        /// Default: `usize::MAX`
324        #[must_use]
325        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
326            self.inner = self.inner.max_encoding_message_size(limit);
327            self
328        }
329        /// Gets the app parameters.
330        pub async fn app_parameters(
331            &mut self,
332            request: impl tonic::IntoRequest<super::AppParametersRequest>,
333        ) -> std::result::Result<
334            tonic::Response<super::AppParametersResponse>,
335            tonic::Status,
336        > {
337            self.inner
338                .ready()
339                .await
340                .map_err(|e| {
341                    tonic::Status::unknown(
342                        format!("Service was not ready: {}", e.into()),
343                    )
344                })?;
345            let codec = tonic::codec::ProstCodec::default();
346            let path = http::uri::PathAndQuery::from_static(
347                "/penumbra.core.app.v1.QueryService/AppParameters",
348            );
349            let mut req = request.into_request();
350            req.extensions_mut()
351                .insert(
352                    GrpcMethod::new("penumbra.core.app.v1.QueryService", "AppParameters"),
353                );
354            self.inner.unary(req, path, codec).await
355        }
356        /// Returns the CometBFT transactions that occurred during a given block.
357        pub async fn transactions_by_height(
358            &mut self,
359            request: impl tonic::IntoRequest<super::TransactionsByHeightRequest>,
360        ) -> std::result::Result<
361            tonic::Response<super::TransactionsByHeightResponse>,
362            tonic::Status,
363        > {
364            self.inner
365                .ready()
366                .await
367                .map_err(|e| {
368                    tonic::Status::unknown(
369                        format!("Service was not ready: {}", e.into()),
370                    )
371                })?;
372            let codec = tonic::codec::ProstCodec::default();
373            let path = http::uri::PathAndQuery::from_static(
374                "/penumbra.core.app.v1.QueryService/TransactionsByHeight",
375            );
376            let mut req = request.into_request();
377            req.extensions_mut()
378                .insert(
379                    GrpcMethod::new(
380                        "penumbra.core.app.v1.QueryService",
381                        "TransactionsByHeight",
382                    ),
383                );
384            self.inner.unary(req, path, codec).await
385        }
386    }
387}
388/// Generated server implementations.
389#[cfg(feature = "rpc")]
390pub mod query_service_server {
391    #![allow(
392        unused_variables,
393        dead_code,
394        missing_docs,
395        clippy::wildcard_imports,
396        clippy::let_unit_value,
397    )]
398    use tonic::codegen::*;
399    /// Generated trait containing gRPC methods that should be implemented for use with QueryServiceServer.
400    #[async_trait]
401    pub trait QueryService: std::marker::Send + std::marker::Sync + 'static {
402        /// Gets the app parameters.
403        async fn app_parameters(
404            &self,
405            request: tonic::Request<super::AppParametersRequest>,
406        ) -> std::result::Result<
407            tonic::Response<super::AppParametersResponse>,
408            tonic::Status,
409        >;
410        /// Returns the CometBFT transactions that occurred during a given block.
411        async fn transactions_by_height(
412            &self,
413            request: tonic::Request<super::TransactionsByHeightRequest>,
414        ) -> std::result::Result<
415            tonic::Response<super::TransactionsByHeightResponse>,
416            tonic::Status,
417        >;
418    }
419    /// Query operations for the overall Penumbra application.
420    #[derive(Debug)]
421    pub struct QueryServiceServer<T> {
422        inner: Arc<T>,
423        accept_compression_encodings: EnabledCompressionEncodings,
424        send_compression_encodings: EnabledCompressionEncodings,
425        max_decoding_message_size: Option<usize>,
426        max_encoding_message_size: Option<usize>,
427    }
428    impl<T> QueryServiceServer<T> {
429        pub fn new(inner: T) -> Self {
430            Self::from_arc(Arc::new(inner))
431        }
432        pub fn from_arc(inner: Arc<T>) -> Self {
433            Self {
434                inner,
435                accept_compression_encodings: Default::default(),
436                send_compression_encodings: Default::default(),
437                max_decoding_message_size: None,
438                max_encoding_message_size: None,
439            }
440        }
441        pub fn with_interceptor<F>(
442            inner: T,
443            interceptor: F,
444        ) -> InterceptedService<Self, F>
445        where
446            F: tonic::service::Interceptor,
447        {
448            InterceptedService::new(Self::new(inner), interceptor)
449        }
450        /// Enable decompressing requests with the given encoding.
451        #[must_use]
452        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
453            self.accept_compression_encodings.enable(encoding);
454            self
455        }
456        /// Compress responses with the given encoding, if the client supports it.
457        #[must_use]
458        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
459            self.send_compression_encodings.enable(encoding);
460            self
461        }
462        /// Limits the maximum size of a decoded message.
463        ///
464        /// Default: `4MB`
465        #[must_use]
466        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
467            self.max_decoding_message_size = Some(limit);
468            self
469        }
470        /// Limits the maximum size of an encoded message.
471        ///
472        /// Default: `usize::MAX`
473        #[must_use]
474        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
475            self.max_encoding_message_size = Some(limit);
476            self
477        }
478    }
479    impl<T, B> tonic::codegen::Service<http::Request<B>> for QueryServiceServer<T>
480    where
481        T: QueryService,
482        B: Body + std::marker::Send + 'static,
483        B::Error: Into<StdError> + std::marker::Send + 'static,
484    {
485        type Response = http::Response<tonic::body::BoxBody>;
486        type Error = std::convert::Infallible;
487        type Future = BoxFuture<Self::Response, Self::Error>;
488        fn poll_ready(
489            &mut self,
490            _cx: &mut Context<'_>,
491        ) -> Poll<std::result::Result<(), Self::Error>> {
492            Poll::Ready(Ok(()))
493        }
494        fn call(&mut self, req: http::Request<B>) -> Self::Future {
495            match req.uri().path() {
496                "/penumbra.core.app.v1.QueryService/AppParameters" => {
497                    #[allow(non_camel_case_types)]
498                    struct AppParametersSvc<T: QueryService>(pub Arc<T>);
499                    impl<
500                        T: QueryService,
501                    > tonic::server::UnaryService<super::AppParametersRequest>
502                    for AppParametersSvc<T> {
503                        type Response = super::AppParametersResponse;
504                        type Future = BoxFuture<
505                            tonic::Response<Self::Response>,
506                            tonic::Status,
507                        >;
508                        fn call(
509                            &mut self,
510                            request: tonic::Request<super::AppParametersRequest>,
511                        ) -> Self::Future {
512                            let inner = Arc::clone(&self.0);
513                            let fut = async move {
514                                <T as QueryService>::app_parameters(&inner, request).await
515                            };
516                            Box::pin(fut)
517                        }
518                    }
519                    let accept_compression_encodings = self.accept_compression_encodings;
520                    let send_compression_encodings = self.send_compression_encodings;
521                    let max_decoding_message_size = self.max_decoding_message_size;
522                    let max_encoding_message_size = self.max_encoding_message_size;
523                    let inner = self.inner.clone();
524                    let fut = async move {
525                        let method = AppParametersSvc(inner);
526                        let codec = tonic::codec::ProstCodec::default();
527                        let mut grpc = tonic::server::Grpc::new(codec)
528                            .apply_compression_config(
529                                accept_compression_encodings,
530                                send_compression_encodings,
531                            )
532                            .apply_max_message_size_config(
533                                max_decoding_message_size,
534                                max_encoding_message_size,
535                            );
536                        let res = grpc.unary(method, req).await;
537                        Ok(res)
538                    };
539                    Box::pin(fut)
540                }
541                "/penumbra.core.app.v1.QueryService/TransactionsByHeight" => {
542                    #[allow(non_camel_case_types)]
543                    struct TransactionsByHeightSvc<T: QueryService>(pub Arc<T>);
544                    impl<
545                        T: QueryService,
546                    > tonic::server::UnaryService<super::TransactionsByHeightRequest>
547                    for TransactionsByHeightSvc<T> {
548                        type Response = super::TransactionsByHeightResponse;
549                        type Future = BoxFuture<
550                            tonic::Response<Self::Response>,
551                            tonic::Status,
552                        >;
553                        fn call(
554                            &mut self,
555                            request: tonic::Request<super::TransactionsByHeightRequest>,
556                        ) -> Self::Future {
557                            let inner = Arc::clone(&self.0);
558                            let fut = async move {
559                                <T as QueryService>::transactions_by_height(&inner, request)
560                                    .await
561                            };
562                            Box::pin(fut)
563                        }
564                    }
565                    let accept_compression_encodings = self.accept_compression_encodings;
566                    let send_compression_encodings = self.send_compression_encodings;
567                    let max_decoding_message_size = self.max_decoding_message_size;
568                    let max_encoding_message_size = self.max_encoding_message_size;
569                    let inner = self.inner.clone();
570                    let fut = async move {
571                        let method = TransactionsByHeightSvc(inner);
572                        let codec = tonic::codec::ProstCodec::default();
573                        let mut grpc = tonic::server::Grpc::new(codec)
574                            .apply_compression_config(
575                                accept_compression_encodings,
576                                send_compression_encodings,
577                            )
578                            .apply_max_message_size_config(
579                                max_decoding_message_size,
580                                max_encoding_message_size,
581                            );
582                        let res = grpc.unary(method, req).await;
583                        Ok(res)
584                    };
585                    Box::pin(fut)
586                }
587                _ => {
588                    Box::pin(async move {
589                        let mut response = http::Response::new(empty_body());
590                        let headers = response.headers_mut();
591                        headers
592                            .insert(
593                                tonic::Status::GRPC_STATUS,
594                                (tonic::Code::Unimplemented as i32).into(),
595                            );
596                        headers
597                            .insert(
598                                http::header::CONTENT_TYPE,
599                                tonic::metadata::GRPC_CONTENT_TYPE,
600                            );
601                        Ok(response)
602                    })
603                }
604            }
605        }
606    }
607    impl<T> Clone for QueryServiceServer<T> {
608        fn clone(&self) -> Self {
609            let inner = self.inner.clone();
610            Self {
611                inner,
612                accept_compression_encodings: self.accept_compression_encodings,
613                send_compression_encodings: self.send_compression_encodings,
614                max_decoding_message_size: self.max_decoding_message_size,
615                max_encoding_message_size: self.max_encoding_message_size,
616            }
617        }
618    }
619    /// Generated gRPC service name
620    pub const SERVICE_NAME: &str = "penumbra.core.app.v1.QueryService";
621    impl<T> tonic::server::NamedService for QueryServiceServer<T> {
622        const NAME: &'static str = SERVICE_NAME;
623    }
624}