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/// An event triggering when the app parameters change.
237#[derive(Clone, PartialEq, ::prost::Message)]
238pub struct EventAppParametersChange {
239    /// The new parameters, in their entirety.
240    #[prost(message, optional, tag = "1")]
241    pub new_parameters: ::core::option::Option<AppParameters>,
242}
243impl ::prost::Name for EventAppParametersChange {
244    const NAME: &'static str = "EventAppParametersChange";
245    const PACKAGE: &'static str = "penumbra.core.app.v1";
246    fn full_name() -> ::prost::alloc::string::String {
247        "penumbra.core.app.v1.EventAppParametersChange".into()
248    }
249    fn type_url() -> ::prost::alloc::string::String {
250        "/penumbra.core.app.v1.EventAppParametersChange".into()
251    }
252}
253/// Generated client implementations.
254#[cfg(feature = "rpc")]
255pub mod query_service_client {
256    #![allow(
257        unused_variables,
258        dead_code,
259        missing_docs,
260        clippy::wildcard_imports,
261        clippy::let_unit_value,
262    )]
263    use tonic::codegen::*;
264    use tonic::codegen::http::Uri;
265    /// Query operations for the overall Penumbra application.
266    #[derive(Debug, Clone)]
267    pub struct QueryServiceClient<T> {
268        inner: tonic::client::Grpc<T>,
269    }
270    impl QueryServiceClient<tonic::transport::Channel> {
271        /// Attempt to create a new client by connecting to a given endpoint.
272        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
273        where
274            D: TryInto<tonic::transport::Endpoint>,
275            D::Error: Into<StdError>,
276        {
277            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
278            Ok(Self::new(conn))
279        }
280    }
281    impl<T> QueryServiceClient<T>
282    where
283        T: tonic::client::GrpcService<tonic::body::BoxBody>,
284        T::Error: Into<StdError>,
285        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
286        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
287    {
288        pub fn new(inner: T) -> Self {
289            let inner = tonic::client::Grpc::new(inner);
290            Self { inner }
291        }
292        pub fn with_origin(inner: T, origin: Uri) -> Self {
293            let inner = tonic::client::Grpc::with_origin(inner, origin);
294            Self { inner }
295        }
296        pub fn with_interceptor<F>(
297            inner: T,
298            interceptor: F,
299        ) -> QueryServiceClient<InterceptedService<T, F>>
300        where
301            F: tonic::service::Interceptor,
302            T::ResponseBody: Default,
303            T: tonic::codegen::Service<
304                http::Request<tonic::body::BoxBody>,
305                Response = http::Response<
306                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
307                >,
308            >,
309            <T as tonic::codegen::Service<
310                http::Request<tonic::body::BoxBody>,
311            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
312        {
313            QueryServiceClient::new(InterceptedService::new(inner, interceptor))
314        }
315        /// Compress requests with the given encoding.
316        ///
317        /// This requires the server to support it otherwise it might respond with an
318        /// error.
319        #[must_use]
320        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
321            self.inner = self.inner.send_compressed(encoding);
322            self
323        }
324        /// Enable decompressing responses.
325        #[must_use]
326        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
327            self.inner = self.inner.accept_compressed(encoding);
328            self
329        }
330        /// Limits the maximum size of a decoded message.
331        ///
332        /// Default: `4MB`
333        #[must_use]
334        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
335            self.inner = self.inner.max_decoding_message_size(limit);
336            self
337        }
338        /// Limits the maximum size of an encoded message.
339        ///
340        /// Default: `usize::MAX`
341        #[must_use]
342        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
343            self.inner = self.inner.max_encoding_message_size(limit);
344            self
345        }
346        /// Gets the app parameters.
347        pub async fn app_parameters(
348            &mut self,
349            request: impl tonic::IntoRequest<super::AppParametersRequest>,
350        ) -> std::result::Result<
351            tonic::Response<super::AppParametersResponse>,
352            tonic::Status,
353        > {
354            self.inner
355                .ready()
356                .await
357                .map_err(|e| {
358                    tonic::Status::unknown(
359                        format!("Service was not ready: {}", e.into()),
360                    )
361                })?;
362            let codec = tonic::codec::ProstCodec::default();
363            let path = http::uri::PathAndQuery::from_static(
364                "/penumbra.core.app.v1.QueryService/AppParameters",
365            );
366            let mut req = request.into_request();
367            req.extensions_mut()
368                .insert(
369                    GrpcMethod::new("penumbra.core.app.v1.QueryService", "AppParameters"),
370                );
371            self.inner.unary(req, path, codec).await
372        }
373        /// Returns the CometBFT transactions that occurred during a given block.
374        pub async fn transactions_by_height(
375            &mut self,
376            request: impl tonic::IntoRequest<super::TransactionsByHeightRequest>,
377        ) -> std::result::Result<
378            tonic::Response<super::TransactionsByHeightResponse>,
379            tonic::Status,
380        > {
381            self.inner
382                .ready()
383                .await
384                .map_err(|e| {
385                    tonic::Status::unknown(
386                        format!("Service was not ready: {}", e.into()),
387                    )
388                })?;
389            let codec = tonic::codec::ProstCodec::default();
390            let path = http::uri::PathAndQuery::from_static(
391                "/penumbra.core.app.v1.QueryService/TransactionsByHeight",
392            );
393            let mut req = request.into_request();
394            req.extensions_mut()
395                .insert(
396                    GrpcMethod::new(
397                        "penumbra.core.app.v1.QueryService",
398                        "TransactionsByHeight",
399                    ),
400                );
401            self.inner.unary(req, path, codec).await
402        }
403    }
404}
405/// Generated server implementations.
406#[cfg(feature = "rpc")]
407pub mod query_service_server {
408    #![allow(
409        unused_variables,
410        dead_code,
411        missing_docs,
412        clippy::wildcard_imports,
413        clippy::let_unit_value,
414    )]
415    use tonic::codegen::*;
416    /// Generated trait containing gRPC methods that should be implemented for use with QueryServiceServer.
417    #[async_trait]
418    pub trait QueryService: std::marker::Send + std::marker::Sync + 'static {
419        /// Gets the app parameters.
420        async fn app_parameters(
421            &self,
422            request: tonic::Request<super::AppParametersRequest>,
423        ) -> std::result::Result<
424            tonic::Response<super::AppParametersResponse>,
425            tonic::Status,
426        >;
427        /// Returns the CometBFT transactions that occurred during a given block.
428        async fn transactions_by_height(
429            &self,
430            request: tonic::Request<super::TransactionsByHeightRequest>,
431        ) -> std::result::Result<
432            tonic::Response<super::TransactionsByHeightResponse>,
433            tonic::Status,
434        >;
435    }
436    /// Query operations for the overall Penumbra application.
437    #[derive(Debug)]
438    pub struct QueryServiceServer<T> {
439        inner: Arc<T>,
440        accept_compression_encodings: EnabledCompressionEncodings,
441        send_compression_encodings: EnabledCompressionEncodings,
442        max_decoding_message_size: Option<usize>,
443        max_encoding_message_size: Option<usize>,
444    }
445    impl<T> QueryServiceServer<T> {
446        pub fn new(inner: T) -> Self {
447            Self::from_arc(Arc::new(inner))
448        }
449        pub fn from_arc(inner: Arc<T>) -> Self {
450            Self {
451                inner,
452                accept_compression_encodings: Default::default(),
453                send_compression_encodings: Default::default(),
454                max_decoding_message_size: None,
455                max_encoding_message_size: None,
456            }
457        }
458        pub fn with_interceptor<F>(
459            inner: T,
460            interceptor: F,
461        ) -> InterceptedService<Self, F>
462        where
463            F: tonic::service::Interceptor,
464        {
465            InterceptedService::new(Self::new(inner), interceptor)
466        }
467        /// Enable decompressing requests with the given encoding.
468        #[must_use]
469        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
470            self.accept_compression_encodings.enable(encoding);
471            self
472        }
473        /// Compress responses with the given encoding, if the client supports it.
474        #[must_use]
475        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
476            self.send_compression_encodings.enable(encoding);
477            self
478        }
479        /// Limits the maximum size of a decoded message.
480        ///
481        /// Default: `4MB`
482        #[must_use]
483        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
484            self.max_decoding_message_size = Some(limit);
485            self
486        }
487        /// Limits the maximum size of an encoded message.
488        ///
489        /// Default: `usize::MAX`
490        #[must_use]
491        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
492            self.max_encoding_message_size = Some(limit);
493            self
494        }
495    }
496    impl<T, B> tonic::codegen::Service<http::Request<B>> for QueryServiceServer<T>
497    where
498        T: QueryService,
499        B: Body + std::marker::Send + 'static,
500        B::Error: Into<StdError> + std::marker::Send + 'static,
501    {
502        type Response = http::Response<tonic::body::BoxBody>;
503        type Error = std::convert::Infallible;
504        type Future = BoxFuture<Self::Response, Self::Error>;
505        fn poll_ready(
506            &mut self,
507            _cx: &mut Context<'_>,
508        ) -> Poll<std::result::Result<(), Self::Error>> {
509            Poll::Ready(Ok(()))
510        }
511        fn call(&mut self, req: http::Request<B>) -> Self::Future {
512            match req.uri().path() {
513                "/penumbra.core.app.v1.QueryService/AppParameters" => {
514                    #[allow(non_camel_case_types)]
515                    struct AppParametersSvc<T: QueryService>(pub Arc<T>);
516                    impl<
517                        T: QueryService,
518                    > tonic::server::UnaryService<super::AppParametersRequest>
519                    for AppParametersSvc<T> {
520                        type Response = super::AppParametersResponse;
521                        type Future = BoxFuture<
522                            tonic::Response<Self::Response>,
523                            tonic::Status,
524                        >;
525                        fn call(
526                            &mut self,
527                            request: tonic::Request<super::AppParametersRequest>,
528                        ) -> Self::Future {
529                            let inner = Arc::clone(&self.0);
530                            let fut = async move {
531                                <T as QueryService>::app_parameters(&inner, request).await
532                            };
533                            Box::pin(fut)
534                        }
535                    }
536                    let accept_compression_encodings = self.accept_compression_encodings;
537                    let send_compression_encodings = self.send_compression_encodings;
538                    let max_decoding_message_size = self.max_decoding_message_size;
539                    let max_encoding_message_size = self.max_encoding_message_size;
540                    let inner = self.inner.clone();
541                    let fut = async move {
542                        let method = AppParametersSvc(inner);
543                        let codec = tonic::codec::ProstCodec::default();
544                        let mut grpc = tonic::server::Grpc::new(codec)
545                            .apply_compression_config(
546                                accept_compression_encodings,
547                                send_compression_encodings,
548                            )
549                            .apply_max_message_size_config(
550                                max_decoding_message_size,
551                                max_encoding_message_size,
552                            );
553                        let res = grpc.unary(method, req).await;
554                        Ok(res)
555                    };
556                    Box::pin(fut)
557                }
558                "/penumbra.core.app.v1.QueryService/TransactionsByHeight" => {
559                    #[allow(non_camel_case_types)]
560                    struct TransactionsByHeightSvc<T: QueryService>(pub Arc<T>);
561                    impl<
562                        T: QueryService,
563                    > tonic::server::UnaryService<super::TransactionsByHeightRequest>
564                    for TransactionsByHeightSvc<T> {
565                        type Response = super::TransactionsByHeightResponse;
566                        type Future = BoxFuture<
567                            tonic::Response<Self::Response>,
568                            tonic::Status,
569                        >;
570                        fn call(
571                            &mut self,
572                            request: tonic::Request<super::TransactionsByHeightRequest>,
573                        ) -> Self::Future {
574                            let inner = Arc::clone(&self.0);
575                            let fut = async move {
576                                <T as QueryService>::transactions_by_height(&inner, request)
577                                    .await
578                            };
579                            Box::pin(fut)
580                        }
581                    }
582                    let accept_compression_encodings = self.accept_compression_encodings;
583                    let send_compression_encodings = self.send_compression_encodings;
584                    let max_decoding_message_size = self.max_decoding_message_size;
585                    let max_encoding_message_size = self.max_encoding_message_size;
586                    let inner = self.inner.clone();
587                    let fut = async move {
588                        let method = TransactionsByHeightSvc(inner);
589                        let codec = tonic::codec::ProstCodec::default();
590                        let mut grpc = tonic::server::Grpc::new(codec)
591                            .apply_compression_config(
592                                accept_compression_encodings,
593                                send_compression_encodings,
594                            )
595                            .apply_max_message_size_config(
596                                max_decoding_message_size,
597                                max_encoding_message_size,
598                            );
599                        let res = grpc.unary(method, req).await;
600                        Ok(res)
601                    };
602                    Box::pin(fut)
603                }
604                _ => {
605                    Box::pin(async move {
606                        let mut response = http::Response::new(empty_body());
607                        let headers = response.headers_mut();
608                        headers
609                            .insert(
610                                tonic::Status::GRPC_STATUS,
611                                (tonic::Code::Unimplemented as i32).into(),
612                            );
613                        headers
614                            .insert(
615                                http::header::CONTENT_TYPE,
616                                tonic::metadata::GRPC_CONTENT_TYPE,
617                            );
618                        Ok(response)
619                    })
620                }
621            }
622        }
623    }
624    impl<T> Clone for QueryServiceServer<T> {
625        fn clone(&self) -> Self {
626            let inner = self.inner.clone();
627            Self {
628                inner,
629                accept_compression_encodings: self.accept_compression_encodings,
630                send_compression_encodings: self.send_compression_encodings,
631                max_decoding_message_size: self.max_decoding_message_size,
632                max_encoding_message_size: self.max_encoding_message_size,
633            }
634        }
635    }
636    /// Generated gRPC service name
637    pub const SERVICE_NAME: &str = "penumbra.core.app.v1.QueryService";
638    impl<T> tonic::server::NamedService for QueryServiceServer<T> {
639        const NAME: &'static str = SERVICE_NAME;
640    }
641}