1#[allow(clippy::derive_partial_eq_without_eq)]
5#[derive(Clone, PartialEq, ::prost::Message)]
6pub struct WeightedVoteOption {
7 #[prost(enumeration = "VoteOption", tag = "1")]
8 pub option: i32,
9 #[prost(string, tag = "2")]
10 pub weight: ::prost::alloc::string::String,
11}
12#[allow(clippy::derive_partial_eq_without_eq)]
15#[derive(Clone, PartialEq, ::prost::Message)]
16pub struct TextProposal {
17 #[prost(string, tag = "1")]
18 pub title: ::prost::alloc::string::String,
19 #[prost(string, tag = "2")]
20 pub description: ::prost::alloc::string::String,
21}
22#[allow(clippy::derive_partial_eq_without_eq)]
25#[derive(Clone, PartialEq, ::prost::Message)]
26pub struct Deposit {
27 #[prost(uint64, tag = "1")]
28 pub proposal_id: u64,
29 #[prost(string, tag = "2")]
30 pub depositor: ::prost::alloc::string::String,
31 #[prost(message, repeated, tag = "3")]
32 pub amount: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
33}
34#[allow(clippy::derive_partial_eq_without_eq)]
36#[derive(Clone, PartialEq, ::prost::Message)]
37pub struct Proposal {
38 #[prost(uint64, tag = "1")]
39 pub proposal_id: u64,
40 #[prost(message, optional, tag = "2")]
41 pub content: ::core::option::Option<::prost_types::Any>,
42 #[prost(enumeration = "ProposalStatus", tag = "3")]
43 pub status: i32,
44 #[prost(message, optional, tag = "4")]
45 pub final_tally_result: ::core::option::Option<TallyResult>,
46 #[prost(message, optional, tag = "5")]
47 pub submit_time: ::core::option::Option<::prost_types::Timestamp>,
48 #[prost(message, optional, tag = "6")]
49 pub deposit_end_time: ::core::option::Option<::prost_types::Timestamp>,
50 #[prost(message, repeated, tag = "7")]
51 pub total_deposit: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
52 #[prost(message, optional, tag = "8")]
53 pub voting_start_time: ::core::option::Option<::prost_types::Timestamp>,
54 #[prost(message, optional, tag = "9")]
55 pub voting_end_time: ::core::option::Option<::prost_types::Timestamp>,
56}
57#[allow(clippy::derive_partial_eq_without_eq)]
59#[derive(Clone, PartialEq, ::prost::Message)]
60pub struct TallyResult {
61 #[prost(string, tag = "1")]
62 pub yes: ::prost::alloc::string::String,
63 #[prost(string, tag = "2")]
64 pub abstain: ::prost::alloc::string::String,
65 #[prost(string, tag = "3")]
66 pub no: ::prost::alloc::string::String,
67 #[prost(string, tag = "4")]
68 pub no_with_veto: ::prost::alloc::string::String,
69}
70#[allow(clippy::derive_partial_eq_without_eq)]
73#[derive(Clone, PartialEq, ::prost::Message)]
74pub struct Vote {
75 #[prost(uint64, tag = "1")]
76 pub proposal_id: u64,
77 #[prost(string, tag = "2")]
78 pub voter: ::prost::alloc::string::String,
79 #[deprecated]
83 #[prost(enumeration = "VoteOption", tag = "3")]
84 pub option: i32,
85 #[prost(message, repeated, tag = "4")]
87 pub options: ::prost::alloc::vec::Vec<WeightedVoteOption>,
88}
89#[allow(clippy::derive_partial_eq_without_eq)]
91#[derive(Clone, PartialEq, ::prost::Message)]
92pub struct DepositParams {
93 #[prost(message, repeated, tag = "1")]
95 pub min_deposit: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
96 #[prost(message, optional, tag = "2")]
99 pub max_deposit_period: ::core::option::Option<::prost_types::Duration>,
100}
101#[allow(clippy::derive_partial_eq_without_eq)]
103#[derive(Clone, PartialEq, ::prost::Message)]
104pub struct VotingParams {
105 #[prost(message, optional, tag = "1")]
107 pub voting_period: ::core::option::Option<::prost_types::Duration>,
108}
109#[allow(clippy::derive_partial_eq_without_eq)]
111#[derive(Clone, PartialEq, ::prost::Message)]
112pub struct TallyParams {
113 #[prost(bytes = "vec", tag = "1")]
116 pub quorum: ::prost::alloc::vec::Vec<u8>,
117 #[prost(bytes = "vec", tag = "2")]
119 pub threshold: ::prost::alloc::vec::Vec<u8>,
120 #[prost(bytes = "vec", tag = "3")]
123 pub veto_threshold: ::prost::alloc::vec::Vec<u8>,
124}
125#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
127#[repr(i32)]
128pub enum VoteOption {
129 Unspecified = 0,
131 Yes = 1,
133 Abstain = 2,
135 No = 3,
137 NoWithVeto = 4,
139}
140impl VoteOption {
141 pub fn as_str_name(&self) -> &'static str {
146 match self {
147 VoteOption::Unspecified => "VOTE_OPTION_UNSPECIFIED",
148 VoteOption::Yes => "VOTE_OPTION_YES",
149 VoteOption::Abstain => "VOTE_OPTION_ABSTAIN",
150 VoteOption::No => "VOTE_OPTION_NO",
151 VoteOption::NoWithVeto => "VOTE_OPTION_NO_WITH_VETO",
152 }
153 }
154 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
156 match value {
157 "VOTE_OPTION_UNSPECIFIED" => Some(Self::Unspecified),
158 "VOTE_OPTION_YES" => Some(Self::Yes),
159 "VOTE_OPTION_ABSTAIN" => Some(Self::Abstain),
160 "VOTE_OPTION_NO" => Some(Self::No),
161 "VOTE_OPTION_NO_WITH_VETO" => Some(Self::NoWithVeto),
162 _ => None,
163 }
164 }
165}
166#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
168#[repr(i32)]
169pub enum ProposalStatus {
170 Unspecified = 0,
172 DepositPeriod = 1,
175 VotingPeriod = 2,
178 Passed = 3,
181 Rejected = 4,
184 Failed = 5,
187}
188impl ProposalStatus {
189 pub fn as_str_name(&self) -> &'static str {
194 match self {
195 ProposalStatus::Unspecified => "PROPOSAL_STATUS_UNSPECIFIED",
196 ProposalStatus::DepositPeriod => "PROPOSAL_STATUS_DEPOSIT_PERIOD",
197 ProposalStatus::VotingPeriod => "PROPOSAL_STATUS_VOTING_PERIOD",
198 ProposalStatus::Passed => "PROPOSAL_STATUS_PASSED",
199 ProposalStatus::Rejected => "PROPOSAL_STATUS_REJECTED",
200 ProposalStatus::Failed => "PROPOSAL_STATUS_FAILED",
201 }
202 }
203 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
205 match value {
206 "PROPOSAL_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
207 "PROPOSAL_STATUS_DEPOSIT_PERIOD" => Some(Self::DepositPeriod),
208 "PROPOSAL_STATUS_VOTING_PERIOD" => Some(Self::VotingPeriod),
209 "PROPOSAL_STATUS_PASSED" => Some(Self::Passed),
210 "PROPOSAL_STATUS_REJECTED" => Some(Self::Rejected),
211 "PROPOSAL_STATUS_FAILED" => Some(Self::Failed),
212 _ => None,
213 }
214 }
215}
216#[allow(clippy::derive_partial_eq_without_eq)]
219#[derive(Clone, PartialEq, ::prost::Message)]
220pub struct MsgSubmitProposal {
221 #[prost(message, optional, tag = "1")]
222 pub content: ::core::option::Option<::prost_types::Any>,
223 #[prost(message, repeated, tag = "2")]
224 pub initial_deposit: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
225 #[prost(string, tag = "3")]
226 pub proposer: ::prost::alloc::string::String,
227}
228#[allow(clippy::derive_partial_eq_without_eq)]
230#[derive(Clone, PartialEq, ::prost::Message)]
231pub struct MsgSubmitProposalResponse {
232 #[prost(uint64, tag = "1")]
233 pub proposal_id: u64,
234}
235#[allow(clippy::derive_partial_eq_without_eq)]
237#[derive(Clone, PartialEq, ::prost::Message)]
238pub struct MsgVote {
239 #[prost(uint64, tag = "1")]
240 pub proposal_id: u64,
241 #[prost(string, tag = "2")]
242 pub voter: ::prost::alloc::string::String,
243 #[prost(enumeration = "VoteOption", tag = "3")]
244 pub option: i32,
245}
246#[allow(clippy::derive_partial_eq_without_eq)]
248#[derive(Clone, PartialEq, ::prost::Message)]
249pub struct MsgVoteResponse {}
250#[allow(clippy::derive_partial_eq_without_eq)]
254#[derive(Clone, PartialEq, ::prost::Message)]
255pub struct MsgVoteWeighted {
256 #[prost(uint64, tag = "1")]
257 pub proposal_id: u64,
258 #[prost(string, tag = "2")]
259 pub voter: ::prost::alloc::string::String,
260 #[prost(message, repeated, tag = "3")]
261 pub options: ::prost::alloc::vec::Vec<WeightedVoteOption>,
262}
263#[allow(clippy::derive_partial_eq_without_eq)]
267#[derive(Clone, PartialEq, ::prost::Message)]
268pub struct MsgVoteWeightedResponse {}
269#[allow(clippy::derive_partial_eq_without_eq)]
271#[derive(Clone, PartialEq, ::prost::Message)]
272pub struct MsgDeposit {
273 #[prost(uint64, tag = "1")]
274 pub proposal_id: u64,
275 #[prost(string, tag = "2")]
276 pub depositor: ::prost::alloc::string::String,
277 #[prost(message, repeated, tag = "3")]
278 pub amount: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
279}
280#[allow(clippy::derive_partial_eq_without_eq)]
282#[derive(Clone, PartialEq, ::prost::Message)]
283pub struct MsgDepositResponse {}
284#[cfg(feature = "grpc")]
286#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
287pub mod msg_client {
288 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
289 use tonic::codegen::http::Uri;
290 use tonic::codegen::*;
291 #[derive(Debug, Clone)]
293 pub struct MsgClient<T> {
294 inner: tonic::client::Grpc<T>,
295 }
296 #[cfg(feature = "grpc-transport")]
297 #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))]
298 impl MsgClient<tonic::transport::Channel> {
299 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
301 where
302 D: std::convert::TryInto<tonic::transport::Endpoint>,
303 D::Error: Into<StdError>,
304 {
305 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
306 Ok(Self::new(conn))
307 }
308 }
309 impl<T> MsgClient<T>
310 where
311 T: tonic::client::GrpcService<tonic::body::BoxBody>,
312 T::Error: Into<StdError>,
313 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
314 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
315 {
316 pub fn new(inner: T) -> Self {
317 let inner = tonic::client::Grpc::new(inner);
318 Self { inner }
319 }
320 pub fn with_origin(inner: T, origin: Uri) -> Self {
321 let inner = tonic::client::Grpc::with_origin(inner, origin);
322 Self { inner }
323 }
324 pub fn with_interceptor<F>(inner: T, interceptor: F) -> MsgClient<InterceptedService<T, F>>
325 where
326 F: tonic::service::Interceptor,
327 T::ResponseBody: Default,
328 T: tonic::codegen::Service<
329 http::Request<tonic::body::BoxBody>,
330 Response = http::Response<
331 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
332 >,
333 >,
334 <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
335 Into<StdError> + Send + Sync,
336 {
337 MsgClient::new(InterceptedService::new(inner, interceptor))
338 }
339 #[must_use]
344 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
345 self.inner = self.inner.send_compressed(encoding);
346 self
347 }
348 #[must_use]
350 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
351 self.inner = self.inner.accept_compressed(encoding);
352 self
353 }
354 pub async fn submit_proposal(
356 &mut self,
357 request: impl tonic::IntoRequest<super::MsgSubmitProposal>,
358 ) -> Result<tonic::Response<super::MsgSubmitProposalResponse>, tonic::Status> {
359 self.inner.ready().await.map_err(|e| {
360 tonic::Status::new(
361 tonic::Code::Unknown,
362 format!("Service was not ready: {}", e.into()),
363 )
364 })?;
365 let codec = tonic::codec::ProstCodec::default();
366 let path =
367 http::uri::PathAndQuery::from_static("/cosmos.gov.v1beta1.Msg/SubmitProposal");
368 self.inner.unary(request.into_request(), path, codec).await
369 }
370 pub async fn vote(
372 &mut self,
373 request: impl tonic::IntoRequest<super::MsgVote>,
374 ) -> Result<tonic::Response<super::MsgVoteResponse>, tonic::Status> {
375 self.inner.ready().await.map_err(|e| {
376 tonic::Status::new(
377 tonic::Code::Unknown,
378 format!("Service was not ready: {}", e.into()),
379 )
380 })?;
381 let codec = tonic::codec::ProstCodec::default();
382 let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1beta1.Msg/Vote");
383 self.inner.unary(request.into_request(), path, codec).await
384 }
385 pub async fn vote_weighted(
389 &mut self,
390 request: impl tonic::IntoRequest<super::MsgVoteWeighted>,
391 ) -> Result<tonic::Response<super::MsgVoteWeightedResponse>, tonic::Status> {
392 self.inner.ready().await.map_err(|e| {
393 tonic::Status::new(
394 tonic::Code::Unknown,
395 format!("Service was not ready: {}", e.into()),
396 )
397 })?;
398 let codec = tonic::codec::ProstCodec::default();
399 let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1beta1.Msg/VoteWeighted");
400 self.inner.unary(request.into_request(), path, codec).await
401 }
402 pub async fn deposit(
404 &mut self,
405 request: impl tonic::IntoRequest<super::MsgDeposit>,
406 ) -> Result<tonic::Response<super::MsgDepositResponse>, tonic::Status> {
407 self.inner.ready().await.map_err(|e| {
408 tonic::Status::new(
409 tonic::Code::Unknown,
410 format!("Service was not ready: {}", e.into()),
411 )
412 })?;
413 let codec = tonic::codec::ProstCodec::default();
414 let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1beta1.Msg/Deposit");
415 self.inner.unary(request.into_request(), path, codec).await
416 }
417 }
418}
419#[cfg(feature = "grpc")]
421#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
422pub mod msg_server {
423 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
424 use tonic::codegen::*;
425 #[async_trait]
427 pub trait Msg: Send + Sync + 'static {
428 async fn submit_proposal(
430 &self,
431 request: tonic::Request<super::MsgSubmitProposal>,
432 ) -> Result<tonic::Response<super::MsgSubmitProposalResponse>, tonic::Status>;
433 async fn vote(
435 &self,
436 request: tonic::Request<super::MsgVote>,
437 ) -> Result<tonic::Response<super::MsgVoteResponse>, tonic::Status>;
438 async fn vote_weighted(
442 &self,
443 request: tonic::Request<super::MsgVoteWeighted>,
444 ) -> Result<tonic::Response<super::MsgVoteWeightedResponse>, tonic::Status>;
445 async fn deposit(
447 &self,
448 request: tonic::Request<super::MsgDeposit>,
449 ) -> Result<tonic::Response<super::MsgDepositResponse>, tonic::Status>;
450 }
451 #[derive(Debug)]
453 pub struct MsgServer<T: Msg> {
454 inner: _Inner<T>,
455 accept_compression_encodings: EnabledCompressionEncodings,
456 send_compression_encodings: EnabledCompressionEncodings,
457 }
458 struct _Inner<T>(Arc<T>);
459 impl<T: Msg> MsgServer<T> {
460 pub fn new(inner: T) -> Self {
461 Self::from_arc(Arc::new(inner))
462 }
463 pub fn from_arc(inner: Arc<T>) -> Self {
464 let inner = _Inner(inner);
465 Self {
466 inner,
467 accept_compression_encodings: Default::default(),
468 send_compression_encodings: Default::default(),
469 }
470 }
471 pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
472 where
473 F: tonic::service::Interceptor,
474 {
475 InterceptedService::new(Self::new(inner), interceptor)
476 }
477 #[must_use]
479 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
480 self.accept_compression_encodings.enable(encoding);
481 self
482 }
483 #[must_use]
485 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
486 self.send_compression_encodings.enable(encoding);
487 self
488 }
489 }
490 impl<T, B> tonic::codegen::Service<http::Request<B>> for MsgServer<T>
491 where
492 T: Msg,
493 B: Body + Send + 'static,
494 B::Error: Into<StdError> + Send + 'static,
495 {
496 type Response = http::Response<tonic::body::BoxBody>;
497 type Error = std::convert::Infallible;
498 type Future = BoxFuture<Self::Response, Self::Error>;
499 fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
500 Poll::Ready(Ok(()))
501 }
502 fn call(&mut self, req: http::Request<B>) -> Self::Future {
503 let inner = self.inner.clone();
504 match req.uri().path() {
505 "/cosmos.gov.v1beta1.Msg/SubmitProposal" => {
506 #[allow(non_camel_case_types)]
507 struct SubmitProposalSvc<T: Msg>(pub Arc<T>);
508 impl<T: Msg> tonic::server::UnaryService<super::MsgSubmitProposal> for SubmitProposalSvc<T> {
509 type Response = super::MsgSubmitProposalResponse;
510 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
511 fn call(
512 &mut self,
513 request: tonic::Request<super::MsgSubmitProposal>,
514 ) -> Self::Future {
515 let inner = self.0.clone();
516 let fut = async move { (*inner).submit_proposal(request).await };
517 Box::pin(fut)
518 }
519 }
520 let accept_compression_encodings = self.accept_compression_encodings;
521 let send_compression_encodings = self.send_compression_encodings;
522 let inner = self.inner.clone();
523 let fut = async move {
524 let inner = inner.0;
525 let method = SubmitProposalSvc(inner);
526 let codec = tonic::codec::ProstCodec::default();
527 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
528 accept_compression_encodings,
529 send_compression_encodings,
530 );
531 let res = grpc.unary(method, req).await;
532 Ok(res)
533 };
534 Box::pin(fut)
535 }
536 "/cosmos.gov.v1beta1.Msg/Vote" => {
537 #[allow(non_camel_case_types)]
538 struct VoteSvc<T: Msg>(pub Arc<T>);
539 impl<T: Msg> tonic::server::UnaryService<super::MsgVote> for VoteSvc<T> {
540 type Response = super::MsgVoteResponse;
541 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
542 fn call(
543 &mut self,
544 request: tonic::Request<super::MsgVote>,
545 ) -> Self::Future {
546 let inner = self.0.clone();
547 let fut = async move { (*inner).vote(request).await };
548 Box::pin(fut)
549 }
550 }
551 let accept_compression_encodings = self.accept_compression_encodings;
552 let send_compression_encodings = self.send_compression_encodings;
553 let inner = self.inner.clone();
554 let fut = async move {
555 let inner = inner.0;
556 let method = VoteSvc(inner);
557 let codec = tonic::codec::ProstCodec::default();
558 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
559 accept_compression_encodings,
560 send_compression_encodings,
561 );
562 let res = grpc.unary(method, req).await;
563 Ok(res)
564 };
565 Box::pin(fut)
566 }
567 "/cosmos.gov.v1beta1.Msg/VoteWeighted" => {
568 #[allow(non_camel_case_types)]
569 struct VoteWeightedSvc<T: Msg>(pub Arc<T>);
570 impl<T: Msg> tonic::server::UnaryService<super::MsgVoteWeighted> for VoteWeightedSvc<T> {
571 type Response = super::MsgVoteWeightedResponse;
572 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
573 fn call(
574 &mut self,
575 request: tonic::Request<super::MsgVoteWeighted>,
576 ) -> Self::Future {
577 let inner = self.0.clone();
578 let fut = async move { (*inner).vote_weighted(request).await };
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 inner = self.inner.clone();
585 let fut = async move {
586 let inner = inner.0;
587 let method = VoteWeightedSvc(inner);
588 let codec = tonic::codec::ProstCodec::default();
589 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
590 accept_compression_encodings,
591 send_compression_encodings,
592 );
593 let res = grpc.unary(method, req).await;
594 Ok(res)
595 };
596 Box::pin(fut)
597 }
598 "/cosmos.gov.v1beta1.Msg/Deposit" => {
599 #[allow(non_camel_case_types)]
600 struct DepositSvc<T: Msg>(pub Arc<T>);
601 impl<T: Msg> tonic::server::UnaryService<super::MsgDeposit> for DepositSvc<T> {
602 type Response = super::MsgDepositResponse;
603 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
604 fn call(
605 &mut self,
606 request: tonic::Request<super::MsgDeposit>,
607 ) -> Self::Future {
608 let inner = self.0.clone();
609 let fut = async move { (*inner).deposit(request).await };
610 Box::pin(fut)
611 }
612 }
613 let accept_compression_encodings = self.accept_compression_encodings;
614 let send_compression_encodings = self.send_compression_encodings;
615 let inner = self.inner.clone();
616 let fut = async move {
617 let inner = inner.0;
618 let method = DepositSvc(inner);
619 let codec = tonic::codec::ProstCodec::default();
620 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
621 accept_compression_encodings,
622 send_compression_encodings,
623 );
624 let res = grpc.unary(method, req).await;
625 Ok(res)
626 };
627 Box::pin(fut)
628 }
629 _ => Box::pin(async move {
630 Ok(http::Response::builder()
631 .status(200)
632 .header("grpc-status", "12")
633 .header("content-type", "application/grpc")
634 .body(empty_body())
635 .unwrap())
636 }),
637 }
638 }
639 }
640 impl<T: Msg> Clone for MsgServer<T> {
641 fn clone(&self) -> Self {
642 let inner = self.inner.clone();
643 Self {
644 inner,
645 accept_compression_encodings: self.accept_compression_encodings,
646 send_compression_encodings: self.send_compression_encodings,
647 }
648 }
649 }
650 impl<T: Msg> Clone for _Inner<T> {
651 fn clone(&self) -> Self {
652 Self(self.0.clone())
653 }
654 }
655 impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
656 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
657 write!(f, "{:?}", self.0)
658 }
659 }
660 impl<T: Msg> tonic::server::NamedService for MsgServer<T> {
661 const NAME: &'static str = "cosmos.gov.v1beta1.Msg";
662 }
663}
664#[allow(clippy::derive_partial_eq_without_eq)]
666#[derive(Clone, PartialEq, ::prost::Message)]
667pub struct QueryProposalRequest {
668 #[prost(uint64, tag = "1")]
670 pub proposal_id: u64,
671}
672#[allow(clippy::derive_partial_eq_without_eq)]
674#[derive(Clone, PartialEq, ::prost::Message)]
675pub struct QueryProposalResponse {
676 #[prost(message, optional, tag = "1")]
677 pub proposal: ::core::option::Option<Proposal>,
678}
679#[allow(clippy::derive_partial_eq_without_eq)]
681#[derive(Clone, PartialEq, ::prost::Message)]
682pub struct QueryProposalsRequest {
683 #[prost(enumeration = "ProposalStatus", tag = "1")]
685 pub proposal_status: i32,
686 #[prost(string, tag = "2")]
688 pub voter: ::prost::alloc::string::String,
689 #[prost(string, tag = "3")]
691 pub depositor: ::prost::alloc::string::String,
692 #[prost(message, optional, tag = "4")]
694 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
695}
696#[allow(clippy::derive_partial_eq_without_eq)]
699#[derive(Clone, PartialEq, ::prost::Message)]
700pub struct QueryProposalsResponse {
701 #[prost(message, repeated, tag = "1")]
702 pub proposals: ::prost::alloc::vec::Vec<Proposal>,
703 #[prost(message, optional, tag = "2")]
705 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
706}
707#[allow(clippy::derive_partial_eq_without_eq)]
709#[derive(Clone, PartialEq, ::prost::Message)]
710pub struct QueryVoteRequest {
711 #[prost(uint64, tag = "1")]
713 pub proposal_id: u64,
714 #[prost(string, tag = "2")]
716 pub voter: ::prost::alloc::string::String,
717}
718#[allow(clippy::derive_partial_eq_without_eq)]
720#[derive(Clone, PartialEq, ::prost::Message)]
721pub struct QueryVoteResponse {
722 #[prost(message, optional, tag = "1")]
724 pub vote: ::core::option::Option<Vote>,
725}
726#[allow(clippy::derive_partial_eq_without_eq)]
728#[derive(Clone, PartialEq, ::prost::Message)]
729pub struct QueryVotesRequest {
730 #[prost(uint64, tag = "1")]
732 pub proposal_id: u64,
733 #[prost(message, optional, tag = "2")]
735 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
736}
737#[allow(clippy::derive_partial_eq_without_eq)]
739#[derive(Clone, PartialEq, ::prost::Message)]
740pub struct QueryVotesResponse {
741 #[prost(message, repeated, tag = "1")]
743 pub votes: ::prost::alloc::vec::Vec<Vote>,
744 #[prost(message, optional, tag = "2")]
746 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
747}
748#[allow(clippy::derive_partial_eq_without_eq)]
750#[derive(Clone, PartialEq, ::prost::Message)]
751pub struct QueryParamsRequest {
752 #[prost(string, tag = "1")]
755 pub params_type: ::prost::alloc::string::String,
756}
757#[allow(clippy::derive_partial_eq_without_eq)]
759#[derive(Clone, PartialEq, ::prost::Message)]
760pub struct QueryParamsResponse {
761 #[prost(message, optional, tag = "1")]
763 pub voting_params: ::core::option::Option<VotingParams>,
764 #[prost(message, optional, tag = "2")]
766 pub deposit_params: ::core::option::Option<DepositParams>,
767 #[prost(message, optional, tag = "3")]
769 pub tally_params: ::core::option::Option<TallyParams>,
770}
771#[allow(clippy::derive_partial_eq_without_eq)]
773#[derive(Clone, PartialEq, ::prost::Message)]
774pub struct QueryDepositRequest {
775 #[prost(uint64, tag = "1")]
777 pub proposal_id: u64,
778 #[prost(string, tag = "2")]
780 pub depositor: ::prost::alloc::string::String,
781}
782#[allow(clippy::derive_partial_eq_without_eq)]
784#[derive(Clone, PartialEq, ::prost::Message)]
785pub struct QueryDepositResponse {
786 #[prost(message, optional, tag = "1")]
788 pub deposit: ::core::option::Option<Deposit>,
789}
790#[allow(clippy::derive_partial_eq_without_eq)]
792#[derive(Clone, PartialEq, ::prost::Message)]
793pub struct QueryDepositsRequest {
794 #[prost(uint64, tag = "1")]
796 pub proposal_id: u64,
797 #[prost(message, optional, tag = "2")]
799 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
800}
801#[allow(clippy::derive_partial_eq_without_eq)]
803#[derive(Clone, PartialEq, ::prost::Message)]
804pub struct QueryDepositsResponse {
805 #[prost(message, repeated, tag = "1")]
806 pub deposits: ::prost::alloc::vec::Vec<Deposit>,
807 #[prost(message, optional, tag = "2")]
809 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
810}
811#[allow(clippy::derive_partial_eq_without_eq)]
813#[derive(Clone, PartialEq, ::prost::Message)]
814pub struct QueryTallyResultRequest {
815 #[prost(uint64, tag = "1")]
817 pub proposal_id: u64,
818}
819#[allow(clippy::derive_partial_eq_without_eq)]
821#[derive(Clone, PartialEq, ::prost::Message)]
822pub struct QueryTallyResultResponse {
823 #[prost(message, optional, tag = "1")]
825 pub tally: ::core::option::Option<TallyResult>,
826}
827#[cfg(feature = "grpc")]
829#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
830pub mod query_client {
831 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
832 use tonic::codegen::http::Uri;
833 use tonic::codegen::*;
834 #[derive(Debug, Clone)]
836 pub struct QueryClient<T> {
837 inner: tonic::client::Grpc<T>,
838 }
839 #[cfg(feature = "grpc-transport")]
840 #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))]
841 impl QueryClient<tonic::transport::Channel> {
842 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
844 where
845 D: std::convert::TryInto<tonic::transport::Endpoint>,
846 D::Error: Into<StdError>,
847 {
848 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
849 Ok(Self::new(conn))
850 }
851 }
852 impl<T> QueryClient<T>
853 where
854 T: tonic::client::GrpcService<tonic::body::BoxBody>,
855 T::Error: Into<StdError>,
856 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
857 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
858 {
859 pub fn new(inner: T) -> Self {
860 let inner = tonic::client::Grpc::new(inner);
861 Self { inner }
862 }
863 pub fn with_origin(inner: T, origin: Uri) -> Self {
864 let inner = tonic::client::Grpc::with_origin(inner, origin);
865 Self { inner }
866 }
867 pub fn with_interceptor<F>(
868 inner: T,
869 interceptor: F,
870 ) -> QueryClient<InterceptedService<T, F>>
871 where
872 F: tonic::service::Interceptor,
873 T::ResponseBody: Default,
874 T: tonic::codegen::Service<
875 http::Request<tonic::body::BoxBody>,
876 Response = http::Response<
877 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
878 >,
879 >,
880 <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
881 Into<StdError> + Send + Sync,
882 {
883 QueryClient::new(InterceptedService::new(inner, interceptor))
884 }
885 #[must_use]
890 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
891 self.inner = self.inner.send_compressed(encoding);
892 self
893 }
894 #[must_use]
896 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
897 self.inner = self.inner.accept_compressed(encoding);
898 self
899 }
900 pub async fn proposal(
902 &mut self,
903 request: impl tonic::IntoRequest<super::QueryProposalRequest>,
904 ) -> Result<tonic::Response<super::QueryProposalResponse>, tonic::Status> {
905 self.inner.ready().await.map_err(|e| {
906 tonic::Status::new(
907 tonic::Code::Unknown,
908 format!("Service was not ready: {}", e.into()),
909 )
910 })?;
911 let codec = tonic::codec::ProstCodec::default();
912 let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1beta1.Query/Proposal");
913 self.inner.unary(request.into_request(), path, codec).await
914 }
915 pub async fn proposals(
917 &mut self,
918 request: impl tonic::IntoRequest<super::QueryProposalsRequest>,
919 ) -> Result<tonic::Response<super::QueryProposalsResponse>, tonic::Status> {
920 self.inner.ready().await.map_err(|e| {
921 tonic::Status::new(
922 tonic::Code::Unknown,
923 format!("Service was not ready: {}", e.into()),
924 )
925 })?;
926 let codec = tonic::codec::ProstCodec::default();
927 let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1beta1.Query/Proposals");
928 self.inner.unary(request.into_request(), path, codec).await
929 }
930 pub async fn vote(
932 &mut self,
933 request: impl tonic::IntoRequest<super::QueryVoteRequest>,
934 ) -> Result<tonic::Response<super::QueryVoteResponse>, tonic::Status> {
935 self.inner.ready().await.map_err(|e| {
936 tonic::Status::new(
937 tonic::Code::Unknown,
938 format!("Service was not ready: {}", e.into()),
939 )
940 })?;
941 let codec = tonic::codec::ProstCodec::default();
942 let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1beta1.Query/Vote");
943 self.inner.unary(request.into_request(), path, codec).await
944 }
945 pub async fn votes(
947 &mut self,
948 request: impl tonic::IntoRequest<super::QueryVotesRequest>,
949 ) -> Result<tonic::Response<super::QueryVotesResponse>, tonic::Status> {
950 self.inner.ready().await.map_err(|e| {
951 tonic::Status::new(
952 tonic::Code::Unknown,
953 format!("Service was not ready: {}", e.into()),
954 )
955 })?;
956 let codec = tonic::codec::ProstCodec::default();
957 let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1beta1.Query/Votes");
958 self.inner.unary(request.into_request(), path, codec).await
959 }
960 pub async fn params(
962 &mut self,
963 request: impl tonic::IntoRequest<super::QueryParamsRequest>,
964 ) -> Result<tonic::Response<super::QueryParamsResponse>, tonic::Status> {
965 self.inner.ready().await.map_err(|e| {
966 tonic::Status::new(
967 tonic::Code::Unknown,
968 format!("Service was not ready: {}", e.into()),
969 )
970 })?;
971 let codec = tonic::codec::ProstCodec::default();
972 let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1beta1.Query/Params");
973 self.inner.unary(request.into_request(), path, codec).await
974 }
975 pub async fn deposit(
977 &mut self,
978 request: impl tonic::IntoRequest<super::QueryDepositRequest>,
979 ) -> Result<tonic::Response<super::QueryDepositResponse>, tonic::Status> {
980 self.inner.ready().await.map_err(|e| {
981 tonic::Status::new(
982 tonic::Code::Unknown,
983 format!("Service was not ready: {}", e.into()),
984 )
985 })?;
986 let codec = tonic::codec::ProstCodec::default();
987 let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1beta1.Query/Deposit");
988 self.inner.unary(request.into_request(), path, codec).await
989 }
990 pub async fn deposits(
992 &mut self,
993 request: impl tonic::IntoRequest<super::QueryDepositsRequest>,
994 ) -> Result<tonic::Response<super::QueryDepositsResponse>, tonic::Status> {
995 self.inner.ready().await.map_err(|e| {
996 tonic::Status::new(
997 tonic::Code::Unknown,
998 format!("Service was not ready: {}", e.into()),
999 )
1000 })?;
1001 let codec = tonic::codec::ProstCodec::default();
1002 let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1beta1.Query/Deposits");
1003 self.inner.unary(request.into_request(), path, codec).await
1004 }
1005 pub async fn tally_result(
1007 &mut self,
1008 request: impl tonic::IntoRequest<super::QueryTallyResultRequest>,
1009 ) -> Result<tonic::Response<super::QueryTallyResultResponse>, tonic::Status> {
1010 self.inner.ready().await.map_err(|e| {
1011 tonic::Status::new(
1012 tonic::Code::Unknown,
1013 format!("Service was not ready: {}", e.into()),
1014 )
1015 })?;
1016 let codec = tonic::codec::ProstCodec::default();
1017 let path =
1018 http::uri::PathAndQuery::from_static("/cosmos.gov.v1beta1.Query/TallyResult");
1019 self.inner.unary(request.into_request(), path, codec).await
1020 }
1021 }
1022}
1023#[cfg(feature = "grpc")]
1025#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
1026pub mod query_server {
1027 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
1028 use tonic::codegen::*;
1029 #[async_trait]
1031 pub trait Query: Send + Sync + 'static {
1032 async fn proposal(
1034 &self,
1035 request: tonic::Request<super::QueryProposalRequest>,
1036 ) -> Result<tonic::Response<super::QueryProposalResponse>, tonic::Status>;
1037 async fn proposals(
1039 &self,
1040 request: tonic::Request<super::QueryProposalsRequest>,
1041 ) -> Result<tonic::Response<super::QueryProposalsResponse>, tonic::Status>;
1042 async fn vote(
1044 &self,
1045 request: tonic::Request<super::QueryVoteRequest>,
1046 ) -> Result<tonic::Response<super::QueryVoteResponse>, tonic::Status>;
1047 async fn votes(
1049 &self,
1050 request: tonic::Request<super::QueryVotesRequest>,
1051 ) -> Result<tonic::Response<super::QueryVotesResponse>, tonic::Status>;
1052 async fn params(
1054 &self,
1055 request: tonic::Request<super::QueryParamsRequest>,
1056 ) -> Result<tonic::Response<super::QueryParamsResponse>, tonic::Status>;
1057 async fn deposit(
1059 &self,
1060 request: tonic::Request<super::QueryDepositRequest>,
1061 ) -> Result<tonic::Response<super::QueryDepositResponse>, tonic::Status>;
1062 async fn deposits(
1064 &self,
1065 request: tonic::Request<super::QueryDepositsRequest>,
1066 ) -> Result<tonic::Response<super::QueryDepositsResponse>, tonic::Status>;
1067 async fn tally_result(
1069 &self,
1070 request: tonic::Request<super::QueryTallyResultRequest>,
1071 ) -> Result<tonic::Response<super::QueryTallyResultResponse>, tonic::Status>;
1072 }
1073 #[derive(Debug)]
1075 pub struct QueryServer<T: Query> {
1076 inner: _Inner<T>,
1077 accept_compression_encodings: EnabledCompressionEncodings,
1078 send_compression_encodings: EnabledCompressionEncodings,
1079 }
1080 struct _Inner<T>(Arc<T>);
1081 impl<T: Query> QueryServer<T> {
1082 pub fn new(inner: T) -> Self {
1083 Self::from_arc(Arc::new(inner))
1084 }
1085 pub fn from_arc(inner: Arc<T>) -> Self {
1086 let inner = _Inner(inner);
1087 Self {
1088 inner,
1089 accept_compression_encodings: Default::default(),
1090 send_compression_encodings: Default::default(),
1091 }
1092 }
1093 pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
1094 where
1095 F: tonic::service::Interceptor,
1096 {
1097 InterceptedService::new(Self::new(inner), interceptor)
1098 }
1099 #[must_use]
1101 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1102 self.accept_compression_encodings.enable(encoding);
1103 self
1104 }
1105 #[must_use]
1107 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1108 self.send_compression_encodings.enable(encoding);
1109 self
1110 }
1111 }
1112 impl<T, B> tonic::codegen::Service<http::Request<B>> for QueryServer<T>
1113 where
1114 T: Query,
1115 B: Body + Send + 'static,
1116 B::Error: Into<StdError> + Send + 'static,
1117 {
1118 type Response = http::Response<tonic::body::BoxBody>;
1119 type Error = std::convert::Infallible;
1120 type Future = BoxFuture<Self::Response, Self::Error>;
1121 fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
1122 Poll::Ready(Ok(()))
1123 }
1124 fn call(&mut self, req: http::Request<B>) -> Self::Future {
1125 let inner = self.inner.clone();
1126 match req.uri().path() {
1127 "/cosmos.gov.v1beta1.Query/Proposal" => {
1128 #[allow(non_camel_case_types)]
1129 struct ProposalSvc<T: Query>(pub Arc<T>);
1130 impl<T: Query> tonic::server::UnaryService<super::QueryProposalRequest> for ProposalSvc<T> {
1131 type Response = super::QueryProposalResponse;
1132 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1133 fn call(
1134 &mut self,
1135 request: tonic::Request<super::QueryProposalRequest>,
1136 ) -> Self::Future {
1137 let inner = self.0.clone();
1138 let fut = async move { (*inner).proposal(request).await };
1139 Box::pin(fut)
1140 }
1141 }
1142 let accept_compression_encodings = self.accept_compression_encodings;
1143 let send_compression_encodings = self.send_compression_encodings;
1144 let inner = self.inner.clone();
1145 let fut = async move {
1146 let inner = inner.0;
1147 let method = ProposalSvc(inner);
1148 let codec = tonic::codec::ProstCodec::default();
1149 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1150 accept_compression_encodings,
1151 send_compression_encodings,
1152 );
1153 let res = grpc.unary(method, req).await;
1154 Ok(res)
1155 };
1156 Box::pin(fut)
1157 }
1158 "/cosmos.gov.v1beta1.Query/Proposals" => {
1159 #[allow(non_camel_case_types)]
1160 struct ProposalsSvc<T: Query>(pub Arc<T>);
1161 impl<T: Query> tonic::server::UnaryService<super::QueryProposalsRequest> for ProposalsSvc<T> {
1162 type Response = super::QueryProposalsResponse;
1163 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1164 fn call(
1165 &mut self,
1166 request: tonic::Request<super::QueryProposalsRequest>,
1167 ) -> Self::Future {
1168 let inner = self.0.clone();
1169 let fut = async move { (*inner).proposals(request).await };
1170 Box::pin(fut)
1171 }
1172 }
1173 let accept_compression_encodings = self.accept_compression_encodings;
1174 let send_compression_encodings = self.send_compression_encodings;
1175 let inner = self.inner.clone();
1176 let fut = async move {
1177 let inner = inner.0;
1178 let method = ProposalsSvc(inner);
1179 let codec = tonic::codec::ProstCodec::default();
1180 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1181 accept_compression_encodings,
1182 send_compression_encodings,
1183 );
1184 let res = grpc.unary(method, req).await;
1185 Ok(res)
1186 };
1187 Box::pin(fut)
1188 }
1189 "/cosmos.gov.v1beta1.Query/Vote" => {
1190 #[allow(non_camel_case_types)]
1191 struct VoteSvc<T: Query>(pub Arc<T>);
1192 impl<T: Query> tonic::server::UnaryService<super::QueryVoteRequest> for VoteSvc<T> {
1193 type Response = super::QueryVoteResponse;
1194 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1195 fn call(
1196 &mut self,
1197 request: tonic::Request<super::QueryVoteRequest>,
1198 ) -> Self::Future {
1199 let inner = self.0.clone();
1200 let fut = async move { (*inner).vote(request).await };
1201 Box::pin(fut)
1202 }
1203 }
1204 let accept_compression_encodings = self.accept_compression_encodings;
1205 let send_compression_encodings = self.send_compression_encodings;
1206 let inner = self.inner.clone();
1207 let fut = async move {
1208 let inner = inner.0;
1209 let method = VoteSvc(inner);
1210 let codec = tonic::codec::ProstCodec::default();
1211 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1212 accept_compression_encodings,
1213 send_compression_encodings,
1214 );
1215 let res = grpc.unary(method, req).await;
1216 Ok(res)
1217 };
1218 Box::pin(fut)
1219 }
1220 "/cosmos.gov.v1beta1.Query/Votes" => {
1221 #[allow(non_camel_case_types)]
1222 struct VotesSvc<T: Query>(pub Arc<T>);
1223 impl<T: Query> tonic::server::UnaryService<super::QueryVotesRequest> for VotesSvc<T> {
1224 type Response = super::QueryVotesResponse;
1225 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1226 fn call(
1227 &mut self,
1228 request: tonic::Request<super::QueryVotesRequest>,
1229 ) -> Self::Future {
1230 let inner = self.0.clone();
1231 let fut = async move { (*inner).votes(request).await };
1232 Box::pin(fut)
1233 }
1234 }
1235 let accept_compression_encodings = self.accept_compression_encodings;
1236 let send_compression_encodings = self.send_compression_encodings;
1237 let inner = self.inner.clone();
1238 let fut = async move {
1239 let inner = inner.0;
1240 let method = VotesSvc(inner);
1241 let codec = tonic::codec::ProstCodec::default();
1242 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1243 accept_compression_encodings,
1244 send_compression_encodings,
1245 );
1246 let res = grpc.unary(method, req).await;
1247 Ok(res)
1248 };
1249 Box::pin(fut)
1250 }
1251 "/cosmos.gov.v1beta1.Query/Params" => {
1252 #[allow(non_camel_case_types)]
1253 struct ParamsSvc<T: Query>(pub Arc<T>);
1254 impl<T: Query> tonic::server::UnaryService<super::QueryParamsRequest> for ParamsSvc<T> {
1255 type Response = super::QueryParamsResponse;
1256 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1257 fn call(
1258 &mut self,
1259 request: tonic::Request<super::QueryParamsRequest>,
1260 ) -> Self::Future {
1261 let inner = self.0.clone();
1262 let fut = async move { (*inner).params(request).await };
1263 Box::pin(fut)
1264 }
1265 }
1266 let accept_compression_encodings = self.accept_compression_encodings;
1267 let send_compression_encodings = self.send_compression_encodings;
1268 let inner = self.inner.clone();
1269 let fut = async move {
1270 let inner = inner.0;
1271 let method = ParamsSvc(inner);
1272 let codec = tonic::codec::ProstCodec::default();
1273 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1274 accept_compression_encodings,
1275 send_compression_encodings,
1276 );
1277 let res = grpc.unary(method, req).await;
1278 Ok(res)
1279 };
1280 Box::pin(fut)
1281 }
1282 "/cosmos.gov.v1beta1.Query/Deposit" => {
1283 #[allow(non_camel_case_types)]
1284 struct DepositSvc<T: Query>(pub Arc<T>);
1285 impl<T: Query> tonic::server::UnaryService<super::QueryDepositRequest> for DepositSvc<T> {
1286 type Response = super::QueryDepositResponse;
1287 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1288 fn call(
1289 &mut self,
1290 request: tonic::Request<super::QueryDepositRequest>,
1291 ) -> Self::Future {
1292 let inner = self.0.clone();
1293 let fut = async move { (*inner).deposit(request).await };
1294 Box::pin(fut)
1295 }
1296 }
1297 let accept_compression_encodings = self.accept_compression_encodings;
1298 let send_compression_encodings = self.send_compression_encodings;
1299 let inner = self.inner.clone();
1300 let fut = async move {
1301 let inner = inner.0;
1302 let method = DepositSvc(inner);
1303 let codec = tonic::codec::ProstCodec::default();
1304 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1305 accept_compression_encodings,
1306 send_compression_encodings,
1307 );
1308 let res = grpc.unary(method, req).await;
1309 Ok(res)
1310 };
1311 Box::pin(fut)
1312 }
1313 "/cosmos.gov.v1beta1.Query/Deposits" => {
1314 #[allow(non_camel_case_types)]
1315 struct DepositsSvc<T: Query>(pub Arc<T>);
1316 impl<T: Query> tonic::server::UnaryService<super::QueryDepositsRequest> for DepositsSvc<T> {
1317 type Response = super::QueryDepositsResponse;
1318 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1319 fn call(
1320 &mut self,
1321 request: tonic::Request<super::QueryDepositsRequest>,
1322 ) -> Self::Future {
1323 let inner = self.0.clone();
1324 let fut = async move { (*inner).deposits(request).await };
1325 Box::pin(fut)
1326 }
1327 }
1328 let accept_compression_encodings = self.accept_compression_encodings;
1329 let send_compression_encodings = self.send_compression_encodings;
1330 let inner = self.inner.clone();
1331 let fut = async move {
1332 let inner = inner.0;
1333 let method = DepositsSvc(inner);
1334 let codec = tonic::codec::ProstCodec::default();
1335 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1336 accept_compression_encodings,
1337 send_compression_encodings,
1338 );
1339 let res = grpc.unary(method, req).await;
1340 Ok(res)
1341 };
1342 Box::pin(fut)
1343 }
1344 "/cosmos.gov.v1beta1.Query/TallyResult" => {
1345 #[allow(non_camel_case_types)]
1346 struct TallyResultSvc<T: Query>(pub Arc<T>);
1347 impl<T: Query> tonic::server::UnaryService<super::QueryTallyResultRequest> for TallyResultSvc<T> {
1348 type Response = super::QueryTallyResultResponse;
1349 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1350 fn call(
1351 &mut self,
1352 request: tonic::Request<super::QueryTallyResultRequest>,
1353 ) -> Self::Future {
1354 let inner = self.0.clone();
1355 let fut = async move { (*inner).tally_result(request).await };
1356 Box::pin(fut)
1357 }
1358 }
1359 let accept_compression_encodings = self.accept_compression_encodings;
1360 let send_compression_encodings = self.send_compression_encodings;
1361 let inner = self.inner.clone();
1362 let fut = async move {
1363 let inner = inner.0;
1364 let method = TallyResultSvc(inner);
1365 let codec = tonic::codec::ProstCodec::default();
1366 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1367 accept_compression_encodings,
1368 send_compression_encodings,
1369 );
1370 let res = grpc.unary(method, req).await;
1371 Ok(res)
1372 };
1373 Box::pin(fut)
1374 }
1375 _ => Box::pin(async move {
1376 Ok(http::Response::builder()
1377 .status(200)
1378 .header("grpc-status", "12")
1379 .header("content-type", "application/grpc")
1380 .body(empty_body())
1381 .unwrap())
1382 }),
1383 }
1384 }
1385 }
1386 impl<T: Query> Clone for QueryServer<T> {
1387 fn clone(&self) -> Self {
1388 let inner = self.inner.clone();
1389 Self {
1390 inner,
1391 accept_compression_encodings: self.accept_compression_encodings,
1392 send_compression_encodings: self.send_compression_encodings,
1393 }
1394 }
1395 }
1396 impl<T: Query> Clone for _Inner<T> {
1397 fn clone(&self) -> Self {
1398 Self(self.0.clone())
1399 }
1400 }
1401 impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
1402 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1403 write!(f, "{:?}", self.0)
1404 }
1405 }
1406 impl<T: Query> tonic::server::NamedService for QueryServer<T> {
1407 const NAME: &'static str = "cosmos.gov.v1beta1.Query";
1408 }
1409}
1410#[allow(clippy::derive_partial_eq_without_eq)]
1412#[derive(Clone, PartialEq, ::prost::Message)]
1413pub struct GenesisState {
1414 #[prost(uint64, tag = "1")]
1416 pub starting_proposal_id: u64,
1417 #[prost(message, repeated, tag = "2")]
1419 pub deposits: ::prost::alloc::vec::Vec<Deposit>,
1420 #[prost(message, repeated, tag = "3")]
1422 pub votes: ::prost::alloc::vec::Vec<Vote>,
1423 #[prost(message, repeated, tag = "4")]
1425 pub proposals: ::prost::alloc::vec::Vec<Proposal>,
1426 #[prost(message, optional, tag = "5")]
1428 pub deposit_params: ::core::option::Option<DepositParams>,
1429 #[prost(message, optional, tag = "6")]
1431 pub voting_params: ::core::option::Option<VotingParams>,
1432 #[prost(message, optional, tag = "7")]
1434 pub tally_params: ::core::option::Option<TallyParams>,
1435}