/// Params defines the set of params for the distribution module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { #[prost(string, tag = "1")] pub community_tax: ::prost::alloc::string::String, /// Deprecated: The base_proposer_reward field is deprecated and is no longer used /// in the x/distribution module's reward mechanism. #[deprecated] #[prost(string, tag = "2")] pub base_proposer_reward: ::prost::alloc::string::String, /// Deprecated: The bonus_proposer_reward field is deprecated and is no longer used /// in the x/distribution module's reward mechanism. #[deprecated] #[prost(string, tag = "3")] pub bonus_proposer_reward: ::prost::alloc::string::String, #[prost(bool, tag = "4")] pub withdraw_addr_enabled: bool, } /// ValidatorHistoricalRewards represents historical rewards for a validator. /// Height is implicit within the store key. /// Cumulative reward ratio is the sum from the zeroeth period /// until this period of rewards / tokens, per the spec. /// The reference count indicates the number of objects /// which might need to reference this historical entry at any point. /// ReferenceCount = /// number of outstanding delegations which ended the associated period (and /// might need to read that record) /// + number of slashes which ended the associated period (and might need to /// read that record) /// + one per validator for the zeroeth period, set on initialization #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorHistoricalRewards { #[prost(message, repeated, tag = "1")] pub cumulative_reward_ratio: ::prost::alloc::vec::Vec, #[prost(uint32, tag = "2")] pub reference_count: u32, } /// ValidatorCurrentRewards represents current rewards and current /// period for a validator kept as a running counter and incremented /// each block as long as the validator's tokens remain constant. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorCurrentRewards { #[prost(message, repeated, tag = "1")] pub rewards: ::prost::alloc::vec::Vec, #[prost(uint64, tag = "2")] pub period: u64, } /// ValidatorAccumulatedCommission represents accumulated commission /// for a validator kept as a running counter, can be withdrawn at any time. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorAccumulatedCommission { #[prost(message, repeated, tag = "1")] pub commission: ::prost::alloc::vec::Vec, } /// ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards /// for a validator inexpensive to track, allows simple sanity checks. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorOutstandingRewards { #[prost(message, repeated, tag = "1")] pub rewards: ::prost::alloc::vec::Vec, } /// ValidatorSlashEvent represents a validator slash event. /// Height is implicit within the store key. /// This is needed to calculate appropriate amount of staking tokens /// for delegations which are withdrawn after a slash has occurred. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorSlashEvent { #[prost(uint64, tag = "1")] pub validator_period: u64, #[prost(string, tag = "2")] pub fraction: ::prost::alloc::string::String, } /// ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorSlashEvents { #[prost(message, repeated, tag = "1")] pub validator_slash_events: ::prost::alloc::vec::Vec, } /// FeePool is the global fee pool for distribution. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FeePool { #[prost(message, repeated, tag = "1")] pub community_pool: ::prost::alloc::vec::Vec, } /// CommunityPoolSpendProposal details a proposal for use of community funds, /// together with how many coins are proposed to be spent, and to which /// recipient account. /// /// Deprecated: Do not use. As of the Cosmos SDK release v0.47.x, there is no /// longer a need for an explicit CommunityPoolSpendProposal. To spend community /// pool funds, a simple MsgCommunityPoolSpend can be invoked from the x/gov /// module via a v1 governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CommunityPoolSpendProposal { #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, #[prost(string, tag = "3")] pub recipient: ::prost::alloc::string::String, #[prost(message, repeated, tag = "4")] pub amount: ::prost::alloc::vec::Vec, } /// DelegatorStartingInfo represents the starting info for a delegator reward /// period. It tracks the previous validator period, the delegation's amount of /// staking token, and the creation height (to check later on if any slashes have /// occurred). NOTE: Even though validators are slashed to whole staking tokens, /// the delegators within the validator may be left with less than a full token, /// thus sdk.Dec is used. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DelegatorStartingInfo { #[prost(uint64, tag = "1")] pub previous_period: u64, #[prost(string, tag = "2")] pub stake: ::prost::alloc::string::String, #[prost(uint64, tag = "3")] pub height: u64, } /// DelegationDelegatorReward represents the properties /// of a delegator's delegation reward. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DelegationDelegatorReward { #[prost(string, tag = "1")] pub validator_address: ::prost::alloc::string::String, #[prost(message, repeated, tag = "2")] pub reward: ::prost::alloc::vec::Vec, } /// CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal /// with a deposit #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CommunityPoolSpendProposalWithDeposit { #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, #[prost(string, tag = "3")] pub recipient: ::prost::alloc::string::String, #[prost(string, tag = "4")] pub amount: ::prost::alloc::string::String, #[prost(string, tag = "5")] pub deposit: ::prost::alloc::string::String, } /// DelegatorWithdrawInfo is the address for where distributions rewards are /// withdrawn to by default this struct is only used at genesis to feed in /// default withdraw addresses. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DelegatorWithdrawInfo { /// delegator_address is the address of the delegator. #[prost(string, tag = "1")] pub delegator_address: ::prost::alloc::string::String, /// withdraw_address is the address to withdraw the delegation rewards to. #[prost(string, tag = "2")] pub withdraw_address: ::prost::alloc::string::String, } /// ValidatorOutstandingRewardsRecord is used for import/export via genesis json. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorOutstandingRewardsRecord { /// validator_address is the address of the validator. #[prost(string, tag = "1")] pub validator_address: ::prost::alloc::string::String, /// outstanding_rewards represents the outstanding rewards of a validator. #[prost(message, repeated, tag = "2")] pub outstanding_rewards: ::prost::alloc::vec::Vec, } /// ValidatorAccumulatedCommissionRecord is used for import / export via genesis /// json. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorAccumulatedCommissionRecord { /// validator_address is the address of the validator. #[prost(string, tag = "1")] pub validator_address: ::prost::alloc::string::String, /// accumulated is the accumulated commission of a validator. #[prost(message, optional, tag = "2")] pub accumulated: ::core::option::Option, } /// ValidatorHistoricalRewardsRecord is used for import / export via genesis /// json. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorHistoricalRewardsRecord { /// validator_address is the address of the validator. #[prost(string, tag = "1")] pub validator_address: ::prost::alloc::string::String, /// period defines the period the historical rewards apply to. #[prost(uint64, tag = "2")] pub period: u64, /// rewards defines the historical rewards of a validator. #[prost(message, optional, tag = "3")] pub rewards: ::core::option::Option, } /// ValidatorCurrentRewardsRecord is used for import / export via genesis json. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorCurrentRewardsRecord { /// validator_address is the address of the validator. #[prost(string, tag = "1")] pub validator_address: ::prost::alloc::string::String, /// rewards defines the current rewards of a validator. #[prost(message, optional, tag = "2")] pub rewards: ::core::option::Option, } /// DelegatorStartingInfoRecord used for import / export via genesis json. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DelegatorStartingInfoRecord { /// delegator_address is the address of the delegator. #[prost(string, tag = "1")] pub delegator_address: ::prost::alloc::string::String, /// validator_address is the address of the validator. #[prost(string, tag = "2")] pub validator_address: ::prost::alloc::string::String, /// starting_info defines the starting info of a delegator. #[prost(message, optional, tag = "3")] pub starting_info: ::core::option::Option, } /// ValidatorSlashEventRecord is used for import / export via genesis json. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorSlashEventRecord { /// validator_address is the address of the validator. #[prost(string, tag = "1")] pub validator_address: ::prost::alloc::string::String, /// height defines the block height at which the slash event occurred. #[prost(uint64, tag = "2")] pub height: u64, /// period is the period of the slash event. #[prost(uint64, tag = "3")] pub period: u64, /// validator_slash_event describes the slash event. #[prost(message, optional, tag = "4")] pub validator_slash_event: ::core::option::Option, } /// GenesisState defines the distribution module's genesis state. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { /// params defines all the parameters of the module. #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, /// fee_pool defines the fee pool at genesis. #[prost(message, optional, tag = "2")] pub fee_pool: ::core::option::Option, /// fee_pool defines the delegator withdraw infos at genesis. #[prost(message, repeated, tag = "3")] pub delegator_withdraw_infos: ::prost::alloc::vec::Vec, /// fee_pool defines the previous proposer at genesis. #[prost(string, tag = "4")] pub previous_proposer: ::prost::alloc::string::String, /// fee_pool defines the outstanding rewards of all validators at genesis. #[prost(message, repeated, tag = "5")] pub outstanding_rewards: ::prost::alloc::vec::Vec, /// fee_pool defines the accumulated commissions of all validators at genesis. #[prost(message, repeated, tag = "6")] pub validator_accumulated_commissions: ::prost::alloc::vec::Vec, /// fee_pool defines the historical rewards of all validators at genesis. #[prost(message, repeated, tag = "7")] pub validator_historical_rewards: ::prost::alloc::vec::Vec, /// fee_pool defines the current rewards of all validators at genesis. #[prost(message, repeated, tag = "8")] pub validator_current_rewards: ::prost::alloc::vec::Vec, /// fee_pool defines the delegator starting infos at genesis. #[prost(message, repeated, tag = "9")] pub delegator_starting_infos: ::prost::alloc::vec::Vec, /// fee_pool defines the validator slash events at genesis. #[prost(message, repeated, tag = "10")] pub validator_slash_events: ::prost::alloc::vec::Vec, } /// 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 {} /// 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 { /// params defines the parameters of the module. #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } /// QueryValidatorDistributionInfoRequest is the request type for the Query/ValidatorDistributionInfo RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorDistributionInfoRequest { /// validator_address defines the validator address to query for. #[prost(string, tag = "1")] pub validator_address: ::prost::alloc::string::String, } /// QueryValidatorDistributionInfoResponse is the response type for the Query/ValidatorDistributionInfo RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorDistributionInfoResponse { /// operator_address defines the validator operator address. #[prost(string, tag = "1")] pub operator_address: ::prost::alloc::string::String, /// self_bond_rewards defines the self delegations rewards. #[prost(message, repeated, tag = "2")] pub self_bond_rewards: ::prost::alloc::vec::Vec, /// commission defines the commission the validator received. #[prost(message, repeated, tag = "3")] pub commission: ::prost::alloc::vec::Vec, } /// QueryValidatorOutstandingRewardsRequest is the request type for the /// Query/ValidatorOutstandingRewards RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorOutstandingRewardsRequest { /// validator_address defines the validator address to query for. #[prost(string, tag = "1")] pub validator_address: ::prost::alloc::string::String, } /// QueryValidatorOutstandingRewardsResponse is the response type for the /// Query/ValidatorOutstandingRewards RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorOutstandingRewardsResponse { #[prost(message, optional, tag = "1")] pub rewards: ::core::option::Option, } /// QueryValidatorCommissionRequest is the request type for the /// Query/ValidatorCommission RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorCommissionRequest { /// validator_address defines the validator address to query for. #[prost(string, tag = "1")] pub validator_address: ::prost::alloc::string::String, } /// QueryValidatorCommissionResponse is the response type for the /// Query/ValidatorCommission RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorCommissionResponse { /// commission defines the commission the validator received. #[prost(message, optional, tag = "1")] pub commission: ::core::option::Option, } /// QueryValidatorSlashesRequest is the request type for the /// Query/ValidatorSlashes RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorSlashesRequest { /// validator_address defines the validator address to query for. #[prost(string, tag = "1")] pub validator_address: ::prost::alloc::string::String, /// starting_height defines the optional starting height to query the slashes. #[prost(uint64, tag = "2")] pub starting_height: u64, /// starting_height defines the optional ending height to query the slashes. #[prost(uint64, tag = "3")] pub ending_height: u64, /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "4")] pub pagination: ::core::option::Option, } /// QueryValidatorSlashesResponse is the response type for the /// Query/ValidatorSlashes RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorSlashesResponse { /// slashes defines the slashes the validator received. #[prost(message, repeated, tag = "1")] pub slashes: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } /// QueryDelegationRewardsRequest is the request type for the /// Query/DelegationRewards RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegationRewardsRequest { /// delegator_address defines the delegator address to query for. #[prost(string, tag = "1")] pub delegator_address: ::prost::alloc::string::String, /// validator_address defines the validator address to query for. #[prost(string, tag = "2")] pub validator_address: ::prost::alloc::string::String, } /// QueryDelegationRewardsResponse is the response type for the /// Query/DelegationRewards RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegationRewardsResponse { /// rewards defines the rewards accrued by a delegation. #[prost(message, repeated, tag = "1")] pub rewards: ::prost::alloc::vec::Vec, } /// QueryDelegationTotalRewardsRequest is the request type for the /// Query/DelegationTotalRewards RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegationTotalRewardsRequest { /// delegator_address defines the delegator address to query for. #[prost(string, tag = "1")] pub delegator_address: ::prost::alloc::string::String, } /// QueryDelegationTotalRewardsResponse is the response type for the /// Query/DelegationTotalRewards RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegationTotalRewardsResponse { /// rewards defines all the rewards accrued by a delegator. #[prost(message, repeated, tag = "1")] pub rewards: ::prost::alloc::vec::Vec, /// total defines the sum of all the rewards. #[prost(message, repeated, tag = "2")] pub total: ::prost::alloc::vec::Vec, } /// QueryDelegatorValidatorsRequest is the request type for the /// Query/DelegatorValidators RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorValidatorsRequest { /// delegator_address defines the delegator address to query for. #[prost(string, tag = "1")] pub delegator_address: ::prost::alloc::string::String, } /// QueryDelegatorValidatorsResponse is the response type for the /// Query/DelegatorValidators RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorValidatorsResponse { /// validators defines the validators a delegator is delegating for. #[prost(string, repeated, tag = "1")] pub validators: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } /// QueryDelegatorWithdrawAddressRequest is the request type for the /// Query/DelegatorWithdrawAddress RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorWithdrawAddressRequest { /// delegator_address defines the delegator address to query for. #[prost(string, tag = "1")] pub delegator_address: ::prost::alloc::string::String, } /// QueryDelegatorWithdrawAddressResponse is the response type for the /// Query/DelegatorWithdrawAddress RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorWithdrawAddressResponse { /// withdraw_address defines the delegator address to query for. #[prost(string, tag = "1")] pub withdraw_address: ::prost::alloc::string::String, } /// QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC /// method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryCommunityPoolRequest {} /// QueryCommunityPoolResponse is the response type for the Query/CommunityPool /// RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryCommunityPoolResponse { /// pool defines community pool's coins. #[prost(message, repeated, tag = "1")] pub pool: ::prost::alloc::vec::Vec, } /// 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 distribution 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 } /// Params queries params of the distribution 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.distribution.v1beta1.Query/Params"); self.inner.unary(request.into_request(), path, codec).await } /// ValidatorDistributionInfo queries validator commission and self-delegation rewards for validator pub async fn validator_distribution_info( &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.distribution.v1beta1.Query/ValidatorDistributionInfo", ); self.inner.unary(request.into_request(), path, codec).await } /// ValidatorOutstandingRewards queries rewards of a validator address. pub async fn validator_outstanding_rewards( &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.distribution.v1beta1.Query/ValidatorOutstandingRewards", ); self.inner.unary(request.into_request(), path, codec).await } /// ValidatorCommission queries accumulated commission for a validator. pub async fn validator_commission( &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.distribution.v1beta1.Query/ValidatorCommission", ); self.inner.unary(request.into_request(), path, codec).await } /// ValidatorSlashes queries slash events of a validator. pub async fn validator_slashes( &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.distribution.v1beta1.Query/ValidatorSlashes", ); self.inner.unary(request.into_request(), path, codec).await } /// DelegationRewards queries the total rewards accrued by a delegation. pub async fn delegation_rewards( &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.distribution.v1beta1.Query/DelegationRewards", ); self.inner.unary(request.into_request(), path, codec).await } /// DelegationTotalRewards queries the total rewards accrued by a each /// validator. pub async fn delegation_total_rewards( &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.distribution.v1beta1.Query/DelegationTotalRewards", ); self.inner.unary(request.into_request(), path, codec).await } /// DelegatorValidators queries the validators of a delegator. pub async fn delegator_validators( &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.distribution.v1beta1.Query/DelegatorValidators", ); self.inner.unary(request.into_request(), path, codec).await } /// DelegatorWithdrawAddress queries withdraw address of a delegator. pub async fn delegator_withdraw_address( &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.distribution.v1beta1.Query/DelegatorWithdrawAddress", ); self.inner.unary(request.into_request(), path, codec).await } /// CommunityPool queries the community pool coins. pub async fn community_pool( &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.distribution.v1beta1.Query/CommunityPool", ); 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 { /// Params queries params of the distribution module. async fn params( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// ValidatorDistributionInfo queries validator commission and self-delegation rewards for validator async fn validator_distribution_info( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// ValidatorOutstandingRewards queries rewards of a validator address. async fn validator_outstanding_rewards( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// ValidatorCommission queries accumulated commission for a validator. async fn validator_commission( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// ValidatorSlashes queries slash events of a validator. async fn validator_slashes( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// DelegationRewards queries the total rewards accrued by a delegation. async fn delegation_rewards( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// DelegationTotalRewards queries the total rewards accrued by a each /// validator. async fn delegation_total_rewards( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// DelegatorValidators queries the validators of a delegator. async fn delegator_validators( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// DelegatorWithdrawAddress queries withdraw address of a delegator. async fn delegator_withdraw_address( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// CommunityPool queries the community pool coins. async fn community_pool( &self, request: tonic::Request, ) -> Result, tonic::Status>; } /// Query defines the gRPC querier service for distribution 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.distribution.v1beta1.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.distribution.v1beta1.Query/ValidatorDistributionInfo" => { #[allow(non_camel_case_types)] struct ValidatorDistributionInfoSvc(pub Arc); impl tonic::server::UnaryService for ValidatorDistributionInfoSvc { type Response = super::QueryValidatorDistributionInfoResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).validator_distribution_info(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 = ValidatorDistributionInfoSvc(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.distribution.v1beta1.Query/ValidatorOutstandingRewards" => { #[allow(non_camel_case_types)] struct ValidatorOutstandingRewardsSvc(pub Arc); impl tonic::server::UnaryService for ValidatorOutstandingRewardsSvc { type Response = super::QueryValidatorOutstandingRewardsResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).validator_outstanding_rewards(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 = ValidatorOutstandingRewardsSvc(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.distribution.v1beta1.Query/ValidatorCommission" => { #[allow(non_camel_case_types)] struct ValidatorCommissionSvc(pub Arc); impl tonic::server::UnaryService for ValidatorCommissionSvc { type Response = super::QueryValidatorCommissionResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).validator_commission(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 = ValidatorCommissionSvc(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.distribution.v1beta1.Query/ValidatorSlashes" => { #[allow(non_camel_case_types)] struct ValidatorSlashesSvc(pub Arc); impl tonic::server::UnaryService for ValidatorSlashesSvc { type Response = super::QueryValidatorSlashesResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).validator_slashes(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 = ValidatorSlashesSvc(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.distribution.v1beta1.Query/DelegationRewards" => { #[allow(non_camel_case_types)] struct DelegationRewardsSvc(pub Arc); impl tonic::server::UnaryService for DelegationRewardsSvc { type Response = super::QueryDelegationRewardsResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).delegation_rewards(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 = DelegationRewardsSvc(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.distribution.v1beta1.Query/DelegationTotalRewards" => { #[allow(non_camel_case_types)] struct DelegationTotalRewardsSvc(pub Arc); impl tonic::server::UnaryService for DelegationTotalRewardsSvc { type Response = super::QueryDelegationTotalRewardsResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).delegation_total_rewards(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 = DelegationTotalRewardsSvc(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.distribution.v1beta1.Query/DelegatorValidators" => { #[allow(non_camel_case_types)] struct DelegatorValidatorsSvc(pub Arc); impl tonic::server::UnaryService for DelegatorValidatorsSvc { type Response = super::QueryDelegatorValidatorsResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).delegator_validators(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 = DelegatorValidatorsSvc(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.distribution.v1beta1.Query/DelegatorWithdrawAddress" => { #[allow(non_camel_case_types)] struct DelegatorWithdrawAddressSvc(pub Arc); impl tonic::server::UnaryService for DelegatorWithdrawAddressSvc { type Response = super::QueryDelegatorWithdrawAddressResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).delegator_withdraw_address(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 = DelegatorWithdrawAddressSvc(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.distribution.v1beta1.Query/CommunityPool" => { #[allow(non_camel_case_types)] struct CommunityPoolSvc(pub Arc); impl tonic::server::UnaryService for CommunityPoolSvc { type Response = super::QueryCommunityPoolResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).community_pool(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 = CommunityPoolSvc(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.distribution.v1beta1.Query"; } } /// MsgSetWithdrawAddress sets the withdraw address for /// a delegator (or validator self-delegation). #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSetWithdrawAddress { #[prost(string, tag = "1")] pub delegator_address: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub withdraw_address: ::prost::alloc::string::String, } /// MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response /// type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSetWithdrawAddressResponse {} /// MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator /// from a single validator. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgWithdrawDelegatorReward { #[prost(string, tag = "1")] pub delegator_address: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub validator_address: ::prost::alloc::string::String, } /// MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward /// response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgWithdrawDelegatorRewardResponse { /// Since: cosmos-sdk 0.46 #[prost(message, repeated, tag = "1")] pub amount: ::prost::alloc::vec::Vec, } /// MsgWithdrawValidatorCommission withdraws the full commission to the validator /// address. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgWithdrawValidatorCommission { #[prost(string, tag = "1")] pub validator_address: ::prost::alloc::string::String, } /// MsgWithdrawValidatorCommissionResponse defines the /// Msg/WithdrawValidatorCommission response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgWithdrawValidatorCommissionResponse { /// Since: cosmos-sdk 0.46 #[prost(message, repeated, tag = "1")] pub amount: ::prost::alloc::vec::Vec, } /// MsgFundCommunityPool allows an account to directly /// fund the community pool. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgFundCommunityPool { #[prost(message, repeated, tag = "1")] pub amount: ::prost::alloc::vec::Vec, #[prost(string, tag = "2")] pub depositor: ::prost::alloc::string::String, } /// MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgFundCommunityPoolResponse {} /// 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/distribution 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 {} /// MsgCommunityPoolSpend defines a message for sending tokens from the community /// pool to another account. This message is typically executed via a governance /// proposal with the governance module being the executing authority. /// /// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCommunityPoolSpend { /// authority is the address that controls the module (defaults to x/gov unless overwritten). #[prost(string, tag = "1")] pub authority: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub recipient: ::prost::alloc::string::String, #[prost(message, repeated, tag = "3")] pub amount: ::prost::alloc::vec::Vec, } /// MsgCommunityPoolSpendResponse defines the response to executing a /// MsgCommunityPoolSpend message. /// /// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCommunityPoolSpendResponse {} /// 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 distribution 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 } /// SetWithdrawAddress defines a method to change the withdraw address /// for a delegator (or validator self-delegation). pub async fn set_withdraw_address( &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.distribution.v1beta1.Msg/SetWithdrawAddress", ); self.inner.unary(request.into_request(), path, codec).await } /// WithdrawDelegatorReward defines a method to withdraw rewards of delegator /// from a single validator. pub async fn withdraw_delegator_reward( &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.distribution.v1beta1.Msg/WithdrawDelegatorReward", ); self.inner.unary(request.into_request(), path, codec).await } /// WithdrawValidatorCommission defines a method to withdraw the /// full commission to the validator address. pub async fn withdraw_validator_commission( &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.distribution.v1beta1.Msg/WithdrawValidatorCommission", ); self.inner.unary(request.into_request(), path, codec).await } /// FundCommunityPool defines a method to allow an account to directly /// fund the community pool. pub async fn fund_community_pool( &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.distribution.v1beta1.Msg/FundCommunityPool", ); self.inner.unary(request.into_request(), path, codec).await } /// UpdateParams defines a governance operation for updating the x/distribution /// 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.distribution.v1beta1.Msg/UpdateParams", ); self.inner.unary(request.into_request(), path, codec).await } /// CommunityPoolSpend defines a governance operation for sending tokens from /// the community pool in the x/distribution module to another account, which /// could be the governance module itself. The authority is defined in the /// keeper. /// /// Since: cosmos-sdk 0.47 pub async fn community_pool_spend( &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.distribution.v1beta1.Msg/CommunityPoolSpend", ); 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 { /// SetWithdrawAddress defines a method to change the withdraw address /// for a delegator (or validator self-delegation). async fn set_withdraw_address( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// WithdrawDelegatorReward defines a method to withdraw rewards of delegator /// from a single validator. async fn withdraw_delegator_reward( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// WithdrawValidatorCommission defines a method to withdraw the /// full commission to the validator address. async fn withdraw_validator_commission( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// FundCommunityPool defines a method to allow an account to directly /// fund the community pool. async fn fund_community_pool( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// UpdateParams defines a governance operation for updating the x/distribution /// 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>; /// CommunityPoolSpend defines a governance operation for sending tokens from /// the community pool in the x/distribution module to another account, which /// could be the governance module itself. The authority is defined in the /// keeper. /// /// Since: cosmos-sdk 0.47 async fn community_pool_spend( &self, request: tonic::Request, ) -> Result, tonic::Status>; } /// Msg defines the distribution 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.distribution.v1beta1.Msg/SetWithdrawAddress" => { #[allow(non_camel_case_types)] struct SetWithdrawAddressSvc(pub Arc); impl tonic::server::UnaryService for SetWithdrawAddressSvc { type Response = super::MsgSetWithdrawAddressResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).set_withdraw_address(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 = SetWithdrawAddressSvc(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.distribution.v1beta1.Msg/WithdrawDelegatorReward" => { #[allow(non_camel_case_types)] struct WithdrawDelegatorRewardSvc(pub Arc); impl tonic::server::UnaryService for WithdrawDelegatorRewardSvc { type Response = super::MsgWithdrawDelegatorRewardResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).withdraw_delegator_reward(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 = WithdrawDelegatorRewardSvc(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.distribution.v1beta1.Msg/WithdrawValidatorCommission" => { #[allow(non_camel_case_types)] struct WithdrawValidatorCommissionSvc(pub Arc); impl tonic::server::UnaryService for WithdrawValidatorCommissionSvc { type Response = super::MsgWithdrawValidatorCommissionResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).withdraw_validator_commission(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 = WithdrawValidatorCommissionSvc(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.distribution.v1beta1.Msg/FundCommunityPool" => { #[allow(non_camel_case_types)] struct FundCommunityPoolSvc(pub Arc); impl tonic::server::UnaryService for FundCommunityPoolSvc { type Response = super::MsgFundCommunityPoolResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).fund_community_pool(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 = FundCommunityPoolSvc(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.distribution.v1beta1.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) } "/cosmos.distribution.v1beta1.Msg/CommunityPoolSpend" => { #[allow(non_camel_case_types)] struct CommunityPoolSpendSvc(pub Arc); impl tonic::server::UnaryService for CommunityPoolSpendSvc { type Response = super::MsgCommunityPoolSpendResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).community_pool_spend(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 = CommunityPoolSpendSvc(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.distribution.v1beta1.Msg"; } }