1#[derive(Clone, Copy, PartialEq, ::prost::Message)]
4pub struct TransactionsByHeightRequest {
5 #[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#[derive(Clone, PartialEq, ::prost::Message)]
21pub struct TransactionsByHeightResponse {
22 #[prost(message, repeated, tag = "1")]
24 pub transactions: ::prost::alloc::vec::Vec<
25 super::super::transaction::v1::Transaction,
26 >,
27 #[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 #[prost(string, tag = "1")]
45 pub chain_id: ::prost::alloc::string::String,
46 #[prost(message, optional, tag = "2")]
48 pub sct_params: ::core::option::Option<
49 super::super::component::sct::v1::SctParameters,
50 >,
51 #[prost(message, optional, tag = "3")]
53 pub community_pool_params: ::core::option::Option<
54 super::super::component::community_pool::v1::CommunityPoolParameters,
55 >,
56 #[prost(message, optional, tag = "4")]
58 pub governance_params: ::core::option::Option<
59 super::super::component::governance::v1::GovernanceParameters,
60 >,
61 #[prost(message, optional, tag = "5")]
63 pub ibc_params: ::core::option::Option<
64 super::super::component::ibc::v1::IbcParameters,
65 >,
66 #[prost(message, optional, tag = "6")]
68 pub stake_params: ::core::option::Option<
69 super::super::component::stake::v1::StakeParameters,
70 >,
71 #[prost(message, optional, tag = "7")]
73 pub fee_params: ::core::option::Option<
74 super::super::component::fee::v1::FeeParameters,
75 >,
76 #[prost(message, optional, tag = "8")]
78 pub distributions_params: ::core::option::Option<
79 super::super::component::distributions::v1::DistributionsParameters,
80 >,
81 #[prost(message, optional, tag = "9")]
83 pub funding_params: ::core::option::Option<
84 super::super::component::funding::v1::FundingParameters,
85 >,
86 #[prost(message, optional, tag = "10")]
88 pub shielded_pool_params: ::core::option::Option<
89 super::super::component::shielded_pool::v1::ShieldedPoolParameters,
90 >,
91 #[prost(message, optional, tag = "11")]
93 pub dex_params: ::core::option::Option<
94 super::super::component::dex::v1::DexParameters,
95 >,
96 #[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#[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}
145pub 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 #[prost(string, tag = "1")]
169 pub chain_id: ::prost::alloc::string::String,
170 #[prost(message, optional, tag = "2")]
172 pub stake_content: ::core::option::Option<
173 super::super::component::stake::v1::GenesisContent,
174 >,
175 #[prost(message, optional, tag = "3")]
177 pub shielded_pool_content: ::core::option::Option<
178 super::super::component::shielded_pool::v1::GenesisContent,
179 >,
180 #[prost(message, optional, tag = "4")]
182 pub governance_content: ::core::option::Option<
183 super::super::component::governance::v1::GenesisContent,
184 >,
185 #[prost(message, optional, tag = "5")]
187 pub ibc_content: ::core::option::Option<
188 super::super::component::ibc::v1::GenesisContent,
189 >,
190 #[prost(message, optional, tag = "6")]
192 pub sct_content: ::core::option::Option<
193 super::super::component::sct::v1::GenesisContent,
194 >,
195 #[prost(message, optional, tag = "7")]
197 pub community_pool_content: ::core::option::Option<
198 super::super::component::community_pool::v1::GenesisContent,
199 >,
200 #[prost(message, optional, tag = "8")]
202 pub fee_content: ::core::option::Option<
203 super::super::component::fee::v1::GenesisContent,
204 >,
205 #[prost(message, optional, tag = "9")]
207 pub distributions_content: ::core::option::Option<
208 super::super::component::distributions::v1::GenesisContent,
209 >,
210 #[prost(message, optional, tag = "10")]
212 pub funding_content: ::core::option::Option<
213 super::super::component::funding::v1::GenesisContent,
214 >,
215 #[prost(message, optional, tag = "11")]
217 pub dex_content: ::core::option::Option<
218 super::super::component::dex::v1::GenesisContent,
219 >,
220 #[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#[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 #[derive(Debug, Clone)]
250 pub struct QueryServiceClient<T> {
251 inner: tonic::client::Grpc<T>,
252 }
253 impl QueryServiceClient<tonic::transport::Channel> {
254 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 #[must_use]
303 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
304 self.inner = self.inner.send_compressed(encoding);
305 self
306 }
307 #[must_use]
309 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
310 self.inner = self.inner.accept_compressed(encoding);
311 self
312 }
313 #[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 #[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 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 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#[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 #[async_trait]
401 pub trait QueryService: std::marker::Send + std::marker::Sync + 'static {
402 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 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 #[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 #[must_use]
452 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
453 self.accept_compression_encodings.enable(encoding);
454 self
455 }
456 #[must_use]
458 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
459 self.send_compression_encodings.enable(encoding);
460 self
461 }
462 #[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 #[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 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}