/// WeightedVoteOption defines a unit of vote for vote split. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct WeightedVoteOption { /// option defines the valid vote options, it must not contain duplicate vote options. #[prost(enumeration = "VoteOption", tag = "1")] pub option: i32, /// weight is the vote weight associated with the vote option. #[prost(string, tag = "2")] pub weight: ::prost::alloc::string::String, } /// Deposit defines an amount deposited by an account address to an active /// proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Deposit { /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, /// depositor defines the deposit addresses from the proposals. #[prost(string, tag = "2")] pub depositor: ::prost::alloc::string::String, /// amount to be deposited by depositor. #[prost(message, repeated, tag = "3")] pub amount: ::prost::alloc::vec::Vec, } /// Proposal defines the core field members of a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Proposal { /// id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub id: u64, /// messages are the arbitrary messages to be executed if the proposal passes. #[prost(message, repeated, tag = "2")] pub messages: ::prost::alloc::vec::Vec<::prost_types::Any>, /// status defines the proposal status. #[prost(enumeration = "ProposalStatus", tag = "3")] pub status: i32, /// final_tally_result is the final tally result of the proposal. When /// querying a proposal via gRPC, this field is not populated until the /// proposal's voting period has ended. #[prost(message, optional, tag = "4")] pub final_tally_result: ::core::option::Option, /// submit_time is the time of proposal submission. #[prost(message, optional, tag = "5")] pub submit_time: ::core::option::Option<::prost_types::Timestamp>, /// deposit_end_time is the end time for deposition. #[prost(message, optional, tag = "6")] pub deposit_end_time: ::core::option::Option<::prost_types::Timestamp>, /// total_deposit is the total deposit on the proposal. #[prost(message, repeated, tag = "7")] pub total_deposit: ::prost::alloc::vec::Vec, /// voting_start_time is the starting time to vote on a proposal. #[prost(message, optional, tag = "8")] pub voting_start_time: ::core::option::Option<::prost_types::Timestamp>, /// voting_end_time is the end time of voting on a proposal. #[prost(message, optional, tag = "9")] pub voting_end_time: ::core::option::Option<::prost_types::Timestamp>, /// metadata is any arbitrary metadata attached to the proposal. #[prost(string, tag = "10")] pub metadata: ::prost::alloc::string::String, /// title is the title of the proposal /// /// Since: cosmos-sdk 0.47 #[prost(string, tag = "11")] pub title: ::prost::alloc::string::String, /// summary is a short summary of the proposal /// /// Since: cosmos-sdk 0.47 #[prost(string, tag = "12")] pub summary: ::prost::alloc::string::String, /// Proposer is the address of the proposal sumbitter /// /// Since: cosmos-sdk 0.47 #[prost(string, tag = "13")] pub proposer: ::prost::alloc::string::String, } /// TallyResult defines a standard tally for a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TallyResult { /// yes_count is the number of yes votes on a proposal. #[prost(string, tag = "1")] pub yes_count: ::prost::alloc::string::String, /// abstain_count is the number of abstain votes on a proposal. #[prost(string, tag = "2")] pub abstain_count: ::prost::alloc::string::String, /// no_count is the number of no votes on a proposal. #[prost(string, tag = "3")] pub no_count: ::prost::alloc::string::String, /// no_with_veto_count is the number of no with veto votes on a proposal. #[prost(string, tag = "4")] pub no_with_veto_count: ::prost::alloc::string::String, } /// Vote defines a vote on a governance proposal. /// A Vote consists of a proposal ID, the voter, and the vote option. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Vote { /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, /// voter is the voter address of the proposal. #[prost(string, tag = "2")] pub voter: ::prost::alloc::string::String, /// options is the weighted vote options. #[prost(message, repeated, tag = "4")] pub options: ::prost::alloc::vec::Vec, /// metadata is any arbitrary metadata to attached to the vote. #[prost(string, tag = "5")] pub metadata: ::prost::alloc::string::String, } /// DepositParams defines the params for deposits on governance proposals. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DepositParams { /// Minimum deposit for a proposal to enter voting period. #[prost(message, repeated, tag = "1")] pub min_deposit: ::prost::alloc::vec::Vec, /// Maximum period for Atom holders to deposit on a proposal. Initial value: 2 /// months. #[prost(message, optional, tag = "2")] pub max_deposit_period: ::core::option::Option<::prost_types::Duration>, } /// VotingParams defines the params for voting on governance proposals. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct VotingParams { /// Duration of the voting period. #[prost(message, optional, tag = "1")] pub voting_period: ::core::option::Option<::prost_types::Duration>, } /// TallyParams defines the params for tallying votes on governance proposals. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TallyParams { /// Minimum percentage of total stake needed to vote for a result to be /// considered valid. #[prost(string, tag = "1")] pub quorum: ::prost::alloc::string::String, /// Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. #[prost(string, tag = "2")] pub threshold: ::prost::alloc::string::String, /// Minimum value of Veto votes to Total votes ratio for proposal to be /// vetoed. Default value: 1/3. #[prost(string, tag = "3")] pub veto_threshold: ::prost::alloc::string::String, } /// Params defines the parameters for the x/gov module. /// /// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { /// Minimum deposit for a proposal to enter voting period. #[prost(message, repeated, tag = "1")] pub min_deposit: ::prost::alloc::vec::Vec, /// Maximum period for Atom holders to deposit on a proposal. Initial value: 2 /// months. #[prost(message, optional, tag = "2")] pub max_deposit_period: ::core::option::Option<::prost_types::Duration>, /// Duration of the voting period. #[prost(message, optional, tag = "3")] pub voting_period: ::core::option::Option<::prost_types::Duration>, /// Minimum percentage of total stake needed to vote for a result to be /// considered valid. #[prost(string, tag = "4")] pub quorum: ::prost::alloc::string::String, /// Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. #[prost(string, tag = "5")] pub threshold: ::prost::alloc::string::String, /// Minimum value of Veto votes to Total votes ratio for proposal to be /// vetoed. Default value: 1/3. #[prost(string, tag = "6")] pub veto_threshold: ::prost::alloc::string::String, /// The ratio representing the proportion of the deposit value that must be paid at proposal submission. #[prost(string, tag = "7")] pub min_initial_deposit_ratio: ::prost::alloc::string::String, /// burn deposits if a proposal does not meet quorum #[prost(bool, tag = "13")] pub burn_vote_quorum: bool, /// burn deposits if the proposal does not enter voting period #[prost(bool, tag = "14")] pub burn_proposal_deposit_prevote: bool, /// burn deposits if quorum with vote type no_veto is met #[prost(bool, tag = "15")] pub burn_vote_veto: bool, } /// VoteOption enumerates the valid vote options for a given governance proposal. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum VoteOption { /// VOTE_OPTION_UNSPECIFIED defines a no-op vote option. Unspecified = 0, /// VOTE_OPTION_YES defines a yes vote option. Yes = 1, /// VOTE_OPTION_ABSTAIN defines an abstain vote option. Abstain = 2, /// VOTE_OPTION_NO defines a no vote option. No = 3, /// VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. NoWithVeto = 4, } impl VoteOption { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { VoteOption::Unspecified => "VOTE_OPTION_UNSPECIFIED", VoteOption::Yes => "VOTE_OPTION_YES", VoteOption::Abstain => "VOTE_OPTION_ABSTAIN", VoteOption::No => "VOTE_OPTION_NO", VoteOption::NoWithVeto => "VOTE_OPTION_NO_WITH_VETO", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { "VOTE_OPTION_UNSPECIFIED" => Some(Self::Unspecified), "VOTE_OPTION_YES" => Some(Self::Yes), "VOTE_OPTION_ABSTAIN" => Some(Self::Abstain), "VOTE_OPTION_NO" => Some(Self::No), "VOTE_OPTION_NO_WITH_VETO" => Some(Self::NoWithVeto), _ => None, } } } /// ProposalStatus enumerates the valid statuses of a proposal. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum ProposalStatus { /// PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. Unspecified = 0, /// PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit /// period. DepositPeriod = 1, /// PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting /// period. VotingPeriod = 2, /// PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has /// passed. Passed = 3, /// PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has /// been rejected. Rejected = 4, /// PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has /// failed. Failed = 5, } impl ProposalStatus { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { ProposalStatus::Unspecified => "PROPOSAL_STATUS_UNSPECIFIED", ProposalStatus::DepositPeriod => "PROPOSAL_STATUS_DEPOSIT_PERIOD", ProposalStatus::VotingPeriod => "PROPOSAL_STATUS_VOTING_PERIOD", ProposalStatus::Passed => "PROPOSAL_STATUS_PASSED", ProposalStatus::Rejected => "PROPOSAL_STATUS_REJECTED", ProposalStatus::Failed => "PROPOSAL_STATUS_FAILED", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { "PROPOSAL_STATUS_UNSPECIFIED" => Some(Self::Unspecified), "PROPOSAL_STATUS_DEPOSIT_PERIOD" => Some(Self::DepositPeriod), "PROPOSAL_STATUS_VOTING_PERIOD" => Some(Self::VotingPeriod), "PROPOSAL_STATUS_PASSED" => Some(Self::Passed), "PROPOSAL_STATUS_REJECTED" => Some(Self::Rejected), "PROPOSAL_STATUS_FAILED" => Some(Self::Failed), _ => None, } } } /// GenesisState defines the gov module's genesis state. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { /// starting_proposal_id is the ID of the starting proposal. #[prost(uint64, tag = "1")] pub starting_proposal_id: u64, /// deposits defines all the deposits present at genesis. #[prost(message, repeated, tag = "2")] pub deposits: ::prost::alloc::vec::Vec, /// votes defines all the votes present at genesis. #[prost(message, repeated, tag = "3")] pub votes: ::prost::alloc::vec::Vec, /// proposals defines all the proposals present at genesis. #[prost(message, repeated, tag = "4")] pub proposals: ::prost::alloc::vec::Vec, /// Deprecated: Prefer to use `params` instead. /// deposit_params defines all the paramaters of related to deposit. #[deprecated] #[prost(message, optional, tag = "5")] pub deposit_params: ::core::option::Option, /// Deprecated: Prefer to use `params` instead. /// voting_params defines all the paramaters of related to voting. #[deprecated] #[prost(message, optional, tag = "6")] pub voting_params: ::core::option::Option, /// Deprecated: Prefer to use `params` instead. /// tally_params defines all the paramaters of related to tally. #[deprecated] #[prost(message, optional, tag = "7")] pub tally_params: ::core::option::Option, /// params defines all the paramaters of x/gov module. /// /// Since: cosmos-sdk 0.47 #[prost(message, optional, tag = "8")] pub params: ::core::option::Option, } /// QueryProposalRequest is the request type for the Query/Proposal RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalRequest { /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, } /// QueryProposalResponse is the response type for the Query/Proposal RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalResponse { /// proposal is the requested governance proposal. #[prost(message, optional, tag = "1")] pub proposal: ::core::option::Option, } /// QueryProposalsRequest is the request type for the Query/Proposals RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalsRequest { /// proposal_status defines the status of the proposals. #[prost(enumeration = "ProposalStatus", tag = "1")] pub proposal_status: i32, /// voter defines the voter address for the proposals. #[prost(string, tag = "2")] pub voter: ::prost::alloc::string::String, /// depositor defines the deposit addresses from the proposals. #[prost(string, tag = "3")] pub depositor: ::prost::alloc::string::String, /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "4")] pub pagination: ::core::option::Option, } /// QueryProposalsResponse is the response type for the Query/Proposals RPC /// method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalsResponse { /// proposals defines all the requested governance proposals. #[prost(message, repeated, tag = "1")] pub proposals: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } /// QueryVoteRequest is the request type for the Query/Vote RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVoteRequest { /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, /// voter defines the voter address for the proposals. #[prost(string, tag = "2")] pub voter: ::prost::alloc::string::String, } /// QueryVoteResponse is the response type for the Query/Vote RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVoteResponse { /// vote defines the queried vote. #[prost(message, optional, tag = "1")] pub vote: ::core::option::Option, } /// QueryVotesRequest is the request type for the Query/Votes RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVotesRequest { /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } /// QueryVotesResponse is the response type for the Query/Votes RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVotesResponse { /// votes defines the queried votes. #[prost(message, repeated, tag = "1")] pub votes: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } /// QueryParamsRequest is the request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest { /// params_type defines which parameters to query for, can be one of "voting", /// "tallying" or "deposit". #[prost(string, tag = "1")] pub params_type: ::prost::alloc::string::String, } /// QueryParamsResponse is the response type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { /// Deprecated: Prefer to use `params` instead. /// voting_params defines the parameters related to voting. #[deprecated] #[prost(message, optional, tag = "1")] pub voting_params: ::core::option::Option, /// Deprecated: Prefer to use `params` instead. /// deposit_params defines the parameters related to deposit. #[deprecated] #[prost(message, optional, tag = "2")] pub deposit_params: ::core::option::Option, /// Deprecated: Prefer to use `params` instead. /// tally_params defines the parameters related to tally. #[deprecated] #[prost(message, optional, tag = "3")] pub tally_params: ::core::option::Option, /// params defines all the paramaters of x/gov module. /// /// Since: cosmos-sdk 0.47 #[prost(message, optional, tag = "4")] pub params: ::core::option::Option, } /// QueryDepositRequest is the request type for the Query/Deposit RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDepositRequest { /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, /// depositor defines the deposit addresses from the proposals. #[prost(string, tag = "2")] pub depositor: ::prost::alloc::string::String, } /// QueryDepositResponse is the response type for the Query/Deposit RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDepositResponse { /// deposit defines the requested deposit. #[prost(message, optional, tag = "1")] pub deposit: ::core::option::Option, } /// QueryDepositsRequest is the request type for the Query/Deposits RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDepositsRequest { /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } /// QueryDepositsResponse is the response type for the Query/Deposits RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDepositsResponse { /// deposits defines the requested deposits. #[prost(message, repeated, tag = "1")] pub deposits: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } /// QueryTallyResultRequest is the request type for the Query/Tally RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTallyResultRequest { /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, } /// QueryTallyResultResponse is the response type for the Query/Tally RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTallyResultResponse { /// tally defines the requested tally. #[prost(message, optional, tag = "1")] pub tally: ::core::option::Option, } /// Generated client implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] pub mod query_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; /// Query defines the gRPC querier service for gov module #[derive(Debug, Clone)] pub struct QueryClient { inner: tonic::client::Grpc, } #[cfg(feature = "grpc-transport")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] impl QueryClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where D: std::convert::TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; Ok(Self::new(conn)) } } impl QueryClient where T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + Send + 'static, ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); Self { inner } } pub fn with_origin(inner: T, origin: Uri) -> Self { let inner = tonic::client::Grpc::with_origin(inner, origin); Self { inner } } pub fn with_interceptor( inner: T, interceptor: F, ) -> QueryClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< http::Request, Response = http::Response< >::ResponseBody, >, >, >>::Error: Into + Send + Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// /// This requires the server to support it otherwise it might respond with an /// error. #[must_use] pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { self.inner = self.inner.send_compressed(encoding); self } /// Enable decompressing responses. #[must_use] pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { self.inner = self.inner.accept_compressed(encoding); self } /// Proposal queries proposal details based on ProposalID. pub async fn proposal( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Query/Proposal"); self.inner.unary(request.into_request(), path, codec).await } /// Proposals queries all proposals based on given status. pub async fn proposals( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Query/Proposals"); self.inner.unary(request.into_request(), path, codec).await } /// Vote queries voted information based on proposalID, voterAddr. pub async fn vote( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Query/Vote"); self.inner.unary(request.into_request(), path, codec).await } /// Votes queries votes of a given proposal. pub async fn votes( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Query/Votes"); self.inner.unary(request.into_request(), path, codec).await } /// Params queries all parameters of the gov module. pub async fn params( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Query/Params"); self.inner.unary(request.into_request(), path, codec).await } /// Deposit queries single deposit information based proposalID, depositAddr. pub async fn deposit( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Query/Deposit"); self.inner.unary(request.into_request(), path, codec).await } /// Deposits queries all deposits of a single proposal. pub async fn deposits( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Query/Deposits"); self.inner.unary(request.into_request(), path, codec).await } /// TallyResult queries the tally of a proposal vote. pub async fn tally_result( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Query/TallyResult"); self.inner.unary(request.into_request(), path, codec).await } } } /// Generated server implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] pub mod query_server { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. #[async_trait] pub trait Query: Send + Sync + 'static { /// Proposal queries proposal details based on ProposalID. async fn proposal( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// Proposals queries all proposals based on given status. async fn proposals( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// Vote queries voted information based on proposalID, voterAddr. async fn vote( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// Votes queries votes of a given proposal. async fn votes( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// Params queries all parameters of the gov module. async fn params( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// Deposit queries single deposit information based proposalID, depositAddr. async fn deposit( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// Deposits queries all deposits of a single proposal. async fn deposits( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// TallyResult queries the tally of a proposal vote. async fn tally_result( &self, request: tonic::Request, ) -> Result, tonic::Status>; } /// Query defines the gRPC querier service for gov module #[derive(Debug)] pub struct QueryServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, } struct _Inner(Arc); impl QueryServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } pub fn from_arc(inner: Arc) -> Self { let inner = _Inner(inner); Self { inner, accept_compression_encodings: Default::default(), send_compression_encodings: Default::default(), } } pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService where F: tonic::service::Interceptor, { InterceptedService::new(Self::new(inner), interceptor) } /// Enable decompressing requests with the given encoding. #[must_use] pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { self.accept_compression_encodings.enable(encoding); self } /// Compress responses with the given encoding, if the client supports it. #[must_use] pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { self.send_compression_encodings.enable(encoding); self } } impl tonic::codegen::Service> for QueryServer where T: Query, B: Body + Send + 'static, B::Error: Into + Send + 'static, { type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { "/cosmos.gov.v1.Query/Proposal" => { #[allow(non_camel_case_types)] struct ProposalSvc(pub Arc); impl tonic::server::UnaryService for ProposalSvc { type Response = super::QueryProposalResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).proposal(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = ProposalSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/cosmos.gov.v1.Query/Proposals" => { #[allow(non_camel_case_types)] struct ProposalsSvc(pub Arc); impl tonic::server::UnaryService for ProposalsSvc { type Response = super::QueryProposalsResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).proposals(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = ProposalsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/cosmos.gov.v1.Query/Vote" => { #[allow(non_camel_case_types)] struct VoteSvc(pub Arc); impl tonic::server::UnaryService for VoteSvc { type Response = super::QueryVoteResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).vote(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = VoteSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/cosmos.gov.v1.Query/Votes" => { #[allow(non_camel_case_types)] struct VotesSvc(pub Arc); impl tonic::server::UnaryService for VotesSvc { type Response = super::QueryVotesResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).votes(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = VotesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/cosmos.gov.v1.Query/Params" => { #[allow(non_camel_case_types)] struct ParamsSvc(pub Arc); impl tonic::server::UnaryService for ParamsSvc { type Response = super::QueryParamsResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).params(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = ParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/cosmos.gov.v1.Query/Deposit" => { #[allow(non_camel_case_types)] struct DepositSvc(pub Arc); impl tonic::server::UnaryService for DepositSvc { type Response = super::QueryDepositResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).deposit(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = DepositSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/cosmos.gov.v1.Query/Deposits" => { #[allow(non_camel_case_types)] struct DepositsSvc(pub Arc); impl tonic::server::UnaryService for DepositsSvc { type Response = super::QueryDepositsResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).deposits(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = DepositsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/cosmos.gov.v1.Query/TallyResult" => { #[allow(non_camel_case_types)] struct TallyResultSvc(pub Arc); impl tonic::server::UnaryService for TallyResultSvc { type Response = super::QueryTallyResultResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).tally_result(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = TallyResultSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } _ => Box::pin(async move { Ok(http::Response::builder() .status(200) .header("grpc-status", "12") .header("content-type", "application/grpc") .body(empty_body()) .unwrap()) }), } } } impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { inner, accept_compression_encodings: self.accept_compression_encodings, send_compression_encodings: self.send_compression_encodings, } } } impl Clone for _Inner { fn clone(&self) -> Self { Self(self.0.clone()) } } impl std::fmt::Debug for _Inner { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{:?}", self.0) } } impl tonic::server::NamedService for QueryServer { const NAME: &'static str = "cosmos.gov.v1.Query"; } } /// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary /// proposal Content. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitProposal { /// messages are the arbitrary messages to be executed if proposal passes. #[prost(message, repeated, tag = "1")] pub messages: ::prost::alloc::vec::Vec<::prost_types::Any>, /// initial_deposit is the deposit value that must be paid at proposal submission. #[prost(message, repeated, tag = "2")] pub initial_deposit: ::prost::alloc::vec::Vec, /// proposer is the account address of the proposer. #[prost(string, tag = "3")] pub proposer: ::prost::alloc::string::String, /// metadata is any arbitrary metadata attached to the proposal. #[prost(string, tag = "4")] pub metadata: ::prost::alloc::string::String, /// title is the title of the proposal. /// /// Since: cosmos-sdk 0.47 #[prost(string, tag = "5")] pub title: ::prost::alloc::string::String, /// summary is the summary of the proposal /// /// Since: cosmos-sdk 0.47 #[prost(string, tag = "6")] pub summary: ::prost::alloc::string::String, } /// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitProposalResponse { /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, } /// MsgExecLegacyContent is used to wrap the legacy content field into a message. /// This ensures backwards compatibility with v1beta1.MsgSubmitProposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgExecLegacyContent { /// content is the proposal's content. #[prost(message, optional, tag = "1")] pub content: ::core::option::Option<::prost_types::Any>, /// authority must be the gov module address. #[prost(string, tag = "2")] pub authority: ::prost::alloc::string::String, } /// MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgExecLegacyContentResponse {} /// MsgVote defines a message to cast a vote. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVote { /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, /// voter is the voter address for the proposal. #[prost(string, tag = "2")] pub voter: ::prost::alloc::string::String, /// option defines the vote option. #[prost(enumeration = "VoteOption", tag = "3")] pub option: i32, /// metadata is any arbitrary metadata attached to the Vote. #[prost(string, tag = "4")] pub metadata: ::prost::alloc::string::String, } /// MsgVoteResponse defines the Msg/Vote response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVoteResponse {} /// MsgVoteWeighted defines a message to cast a vote. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVoteWeighted { /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, /// voter is the voter address for the proposal. #[prost(string, tag = "2")] pub voter: ::prost::alloc::string::String, /// options defines the weighted vote options. #[prost(message, repeated, tag = "3")] pub options: ::prost::alloc::vec::Vec, /// metadata is any arbitrary metadata attached to the VoteWeighted. #[prost(string, tag = "4")] pub metadata: ::prost::alloc::string::String, } /// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVoteWeightedResponse {} /// MsgDeposit defines a message to submit a deposit to an existing proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgDeposit { /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, /// depositor defines the deposit addresses from the proposals. #[prost(string, tag = "2")] pub depositor: ::prost::alloc::string::String, /// amount to be deposited by depositor. #[prost(message, repeated, tag = "3")] pub amount: ::prost::alloc::vec::Vec, } /// MsgDepositResponse defines the Msg/Deposit response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgDepositResponse {} /// MsgUpdateParams is the Msg/UpdateParams request type. /// /// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { /// authority is the address that controls the module (defaults to x/gov unless overwritten). #[prost(string, tag = "1")] pub authority: ::prost::alloc::string::String, /// params defines the x/gov parameters to update. /// /// NOTE: All parameters must be supplied. #[prost(message, optional, tag = "2")] pub params: ::core::option::Option, } /// MsgUpdateParamsResponse defines the response structure for executing a /// MsgUpdateParams message. /// /// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} /// Generated client implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] pub mod msg_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; /// Msg defines the gov Msg service. #[derive(Debug, Clone)] pub struct MsgClient { inner: tonic::client::Grpc, } #[cfg(feature = "grpc-transport")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] impl MsgClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where D: std::convert::TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; Ok(Self::new(conn)) } } impl MsgClient where T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + Send + 'static, ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); Self { inner } } pub fn with_origin(inner: T, origin: Uri) -> Self { let inner = tonic::client::Grpc::with_origin(inner, origin); Self { inner } } pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< http::Request, Response = http::Response< >::ResponseBody, >, >, >>::Error: Into + Send + Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// /// This requires the server to support it otherwise it might respond with an /// error. #[must_use] pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { self.inner = self.inner.send_compressed(encoding); self } /// Enable decompressing responses. #[must_use] pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { self.inner = self.inner.accept_compressed(encoding); self } /// SubmitProposal defines a method to create new proposal given the messages. pub async fn submit_proposal( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Msg/SubmitProposal"); self.inner.unary(request.into_request(), path, codec).await } /// ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal /// to execute a legacy content-based proposal. pub async fn exec_legacy_content( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Msg/ExecLegacyContent"); self.inner.unary(request.into_request(), path, codec).await } /// Vote defines a method to add a vote on a specific proposal. pub async fn vote( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Msg/Vote"); self.inner.unary(request.into_request(), path, codec).await } /// VoteWeighted defines a method to add a weighted vote on a specific proposal. pub async fn vote_weighted( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Msg/VoteWeighted"); self.inner.unary(request.into_request(), path, codec).await } /// Deposit defines a method to add deposit on a specific proposal. pub async fn deposit( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Msg/Deposit"); self.inner.unary(request.into_request(), path, codec).await } /// UpdateParams defines a governance operation for updating the x/gov module /// parameters. The authority is defined in the keeper. /// /// Since: cosmos-sdk 0.47 pub async fn update_params( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Msg/UpdateParams"); self.inner.unary(request.into_request(), path, codec).await } } } /// Generated server implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] pub mod msg_server { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. #[async_trait] pub trait Msg: Send + Sync + 'static { /// SubmitProposal defines a method to create new proposal given the messages. async fn submit_proposal( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal /// to execute a legacy content-based proposal. async fn exec_legacy_content( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// Vote defines a method to add a vote on a specific proposal. async fn vote( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// VoteWeighted defines a method to add a weighted vote on a specific proposal. async fn vote_weighted( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// Deposit defines a method to add deposit on a specific proposal. async fn deposit( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// UpdateParams defines a governance operation for updating the x/gov module /// parameters. The authority is defined in the keeper. /// /// Since: cosmos-sdk 0.47 async fn update_params( &self, request: tonic::Request, ) -> Result, tonic::Status>; } /// Msg defines the gov Msg service. #[derive(Debug)] pub struct MsgServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, } struct _Inner(Arc); impl MsgServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } pub fn from_arc(inner: Arc) -> Self { let inner = _Inner(inner); Self { inner, accept_compression_encodings: Default::default(), send_compression_encodings: Default::default(), } } pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService where F: tonic::service::Interceptor, { InterceptedService::new(Self::new(inner), interceptor) } /// Enable decompressing requests with the given encoding. #[must_use] pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { self.accept_compression_encodings.enable(encoding); self } /// Compress responses with the given encoding, if the client supports it. #[must_use] pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { self.send_compression_encodings.enable(encoding); self } } impl tonic::codegen::Service> for MsgServer where T: Msg, B: Body + Send + 'static, B::Error: Into + Send + 'static, { type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { "/cosmos.gov.v1.Msg/SubmitProposal" => { #[allow(non_camel_case_types)] struct SubmitProposalSvc(pub Arc); impl tonic::server::UnaryService for SubmitProposalSvc { type Response = super::MsgSubmitProposalResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).submit_proposal(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = SubmitProposalSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/cosmos.gov.v1.Msg/ExecLegacyContent" => { #[allow(non_camel_case_types)] struct ExecLegacyContentSvc(pub Arc); impl tonic::server::UnaryService for ExecLegacyContentSvc { type Response = super::MsgExecLegacyContentResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).exec_legacy_content(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = ExecLegacyContentSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/cosmos.gov.v1.Msg/Vote" => { #[allow(non_camel_case_types)] struct VoteSvc(pub Arc); impl tonic::server::UnaryService for VoteSvc { type Response = super::MsgVoteResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).vote(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = VoteSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/cosmos.gov.v1.Msg/VoteWeighted" => { #[allow(non_camel_case_types)] struct VoteWeightedSvc(pub Arc); impl tonic::server::UnaryService for VoteWeightedSvc { type Response = super::MsgVoteWeightedResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).vote_weighted(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = VoteWeightedSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/cosmos.gov.v1.Msg/Deposit" => { #[allow(non_camel_case_types)] struct DepositSvc(pub Arc); impl tonic::server::UnaryService for DepositSvc { type Response = super::MsgDepositResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).deposit(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = DepositSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/cosmos.gov.v1.Msg/UpdateParams" => { #[allow(non_camel_case_types)] struct UpdateParamsSvc(pub Arc); impl tonic::server::UnaryService for UpdateParamsSvc { type Response = super::MsgUpdateParamsResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).update_params(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = UpdateParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } _ => Box::pin(async move { Ok(http::Response::builder() .status(200) .header("grpc-status", "12") .header("content-type", "application/grpc") .body(empty_body()) .unwrap()) }), } } } impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { inner, accept_compression_encodings: self.accept_compression_encodings, send_compression_encodings: self.send_compression_encodings, } } } impl Clone for _Inner { fn clone(&self) -> Self { Self(self.0.clone()) } } impl std::fmt::Debug for _Inner { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{:?}", self.0) } } impl tonic::server::NamedService for MsgServer { const NAME: &'static str = "cosmos.gov.v1.Msg"; } }