#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HistoricalInfo {
#[prost(message, optional, tag = "1")]
pub header: ::core::option::Option<::tendermint_proto::types::Header>,
#[prost(message, repeated, tag = "2")]
pub valset: ::prost::alloc::vec::Vec<Validator>,
}
impl ::prost::Name for HistoricalInfo {
const NAME: &'static str = "HistoricalInfo";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CommissionRates {
#[prost(string, tag = "1")]
pub rate: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub max_rate: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub max_change_rate: ::prost::alloc::string::String,
}
impl ::prost::Name for CommissionRates {
const NAME: &'static str = "CommissionRates";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Commission {
#[prost(message, optional, tag = "1")]
pub commission_rates: ::core::option::Option<CommissionRates>,
#[prost(message, optional, tag = "2")]
pub update_time: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
}
impl ::prost::Name for Commission {
const NAME: &'static str = "Commission";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Description {
#[prost(string, tag = "1")]
pub moniker: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub identity: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub website: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub security_contact: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub details: ::prost::alloc::string::String,
}
impl ::prost::Name for Description {
const NAME: &'static str = "Description";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Validator {
#[prost(string, tag = "1")]
pub operator_address: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub consensus_pubkey: ::core::option::Option<
super::super::super::google::protobuf::Any,
>,
#[prost(bool, tag = "3")]
pub jailed: bool,
#[prost(enumeration = "BondStatus", tag = "4")]
pub status: i32,
#[prost(string, tag = "5")]
pub tokens: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub delegator_shares: ::prost::alloc::string::String,
#[prost(message, optional, tag = "7")]
pub description: ::core::option::Option<Description>,
#[prost(int64, tag = "8")]
pub unbonding_height: i64,
#[prost(message, optional, tag = "9")]
pub unbonding_time: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "10")]
pub commission: ::core::option::Option<Commission>,
#[prost(string, tag = "11")]
pub min_self_delegation: ::prost::alloc::string::String,
#[prost(int64, tag = "12")]
pub unbonding_on_hold_ref_count: i64,
#[prost(uint64, repeated, tag = "13")]
pub unbonding_ids: ::prost::alloc::vec::Vec<u64>,
}
impl ::prost::Name for Validator {
const NAME: &'static str = "Validator";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValAddresses {
#[prost(string, repeated, tag = "1")]
pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
impl ::prost::Name for ValAddresses {
const NAME: &'static str = "ValAddresses";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DvPair {
#[prost(string, tag = "1")]
pub delegator_address: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub validator_address: ::prost::alloc::string::String,
}
impl ::prost::Name for DvPair {
const NAME: &'static str = "DVPair";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DvPairs {
#[prost(message, repeated, tag = "1")]
pub pairs: ::prost::alloc::vec::Vec<DvPair>,
}
impl ::prost::Name for DvPairs {
const NAME: &'static str = "DVPairs";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DvvTriplet {
#[prost(string, tag = "1")]
pub delegator_address: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub validator_src_address: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub validator_dst_address: ::prost::alloc::string::String,
}
impl ::prost::Name for DvvTriplet {
const NAME: &'static str = "DVVTriplet";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DvvTriplets {
#[prost(message, repeated, tag = "1")]
pub triplets: ::prost::alloc::vec::Vec<DvvTriplet>,
}
impl ::prost::Name for DvvTriplets {
const NAME: &'static str = "DVVTriplets";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Delegation {
#[prost(string, tag = "1")]
pub delegator_address: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub validator_address: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub shares: ::prost::alloc::string::String,
}
impl ::prost::Name for Delegation {
const NAME: &'static str = "Delegation";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UnbondingDelegation {
#[prost(string, tag = "1")]
pub delegator_address: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub validator_address: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "3")]
pub entries: ::prost::alloc::vec::Vec<UnbondingDelegationEntry>,
}
impl ::prost::Name for UnbondingDelegation {
const NAME: &'static str = "UnbondingDelegation";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UnbondingDelegationEntry {
#[prost(int64, tag = "1")]
pub creation_height: i64,
#[prost(message, optional, tag = "2")]
pub completion_time: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(string, tag = "3")]
pub initial_balance: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub balance: ::prost::alloc::string::String,
#[prost(uint64, tag = "5")]
pub unbonding_id: u64,
#[prost(int64, tag = "6")]
pub unbonding_on_hold_ref_count: i64,
}
impl ::prost::Name for UnbondingDelegationEntry {
const NAME: &'static str = "UnbondingDelegationEntry";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RedelegationEntry {
#[prost(int64, tag = "1")]
pub creation_height: i64,
#[prost(message, optional, tag = "2")]
pub completion_time: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(string, tag = "3")]
pub initial_balance: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub shares_dst: ::prost::alloc::string::String,
#[prost(uint64, tag = "5")]
pub unbonding_id: u64,
#[prost(int64, tag = "6")]
pub unbonding_on_hold_ref_count: i64,
}
impl ::prost::Name for RedelegationEntry {
const NAME: &'static str = "RedelegationEntry";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Redelegation {
#[prost(string, tag = "1")]
pub delegator_address: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub validator_src_address: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub validator_dst_address: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "4")]
pub entries: ::prost::alloc::vec::Vec<RedelegationEntry>,
}
impl ::prost::Name for Redelegation {
const NAME: &'static str = "Redelegation";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Params {
#[prost(message, optional, tag = "1")]
pub unbonding_time: ::core::option::Option<
super::super::super::google::protobuf::Duration,
>,
#[prost(uint32, tag = "2")]
pub max_validators: u32,
#[prost(uint32, tag = "3")]
pub max_entries: u32,
#[prost(uint32, tag = "4")]
pub historical_entries: u32,
#[prost(string, tag = "5")]
pub bond_denom: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub min_commission_rate: ::prost::alloc::string::String,
}
impl ::prost::Name for Params {
const NAME: &'static str = "Params";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DelegationResponse {
#[prost(message, optional, tag = "1")]
pub delegation: ::core::option::Option<Delegation>,
#[prost(message, optional, tag = "2")]
pub balance: ::core::option::Option<super::super::base::v1beta1::Coin>,
}
impl ::prost::Name for DelegationResponse {
const NAME: &'static str = "DelegationResponse";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RedelegationEntryResponse {
#[prost(message, optional, tag = "1")]
pub redelegation_entry: ::core::option::Option<RedelegationEntry>,
#[prost(string, tag = "4")]
pub balance: ::prost::alloc::string::String,
}
impl ::prost::Name for RedelegationEntryResponse {
const NAME: &'static str = "RedelegationEntryResponse";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RedelegationResponse {
#[prost(message, optional, tag = "1")]
pub redelegation: ::core::option::Option<Redelegation>,
#[prost(message, repeated, tag = "2")]
pub entries: ::prost::alloc::vec::Vec<RedelegationEntryResponse>,
}
impl ::prost::Name for RedelegationResponse {
const NAME: &'static str = "RedelegationResponse";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Pool {
#[prost(string, tag = "1")]
pub not_bonded_tokens: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub bonded_tokens: ::prost::alloc::string::String,
}
impl ::prost::Name for Pool {
const NAME: &'static str = "Pool";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorUpdates {
#[prost(message, repeated, tag = "1")]
pub updates: ::prost::alloc::vec::Vec<::tendermint_proto::abci::ValidatorUpdate>,
}
impl ::prost::Name for ValidatorUpdates {
const NAME: &'static str = "ValidatorUpdates";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum BondStatus {
Unspecified = 0,
Unbonded = 1,
Unbonding = 2,
Bonded = 3,
}
impl BondStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
BondStatus::Unspecified => "BOND_STATUS_UNSPECIFIED",
BondStatus::Unbonded => "BOND_STATUS_UNBONDED",
BondStatus::Unbonding => "BOND_STATUS_UNBONDING",
BondStatus::Bonded => "BOND_STATUS_BONDED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"BOND_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
"BOND_STATUS_UNBONDED" => Some(Self::Unbonded),
"BOND_STATUS_UNBONDING" => Some(Self::Unbonding),
"BOND_STATUS_BONDED" => Some(Self::Bonded),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Infraction {
Unspecified = 0,
DoubleSign = 1,
Downtime = 2,
}
impl Infraction {
pub fn as_str_name(&self) -> &'static str {
match self {
Infraction::Unspecified => "INFRACTION_UNSPECIFIED",
Infraction::DoubleSign => "INFRACTION_DOUBLE_SIGN",
Infraction::Downtime => "INFRACTION_DOWNTIME",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"INFRACTION_UNSPECIFIED" => Some(Self::Unspecified),
"INFRACTION_DOUBLE_SIGN" => Some(Self::DoubleSign),
"INFRACTION_DOWNTIME" => Some(Self::Downtime),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum InfractionType {
Unspecified = 0,
DoubleSign = 1,
Downtime = 2,
}
impl InfractionType {
pub fn as_str_name(&self) -> &'static str {
match self {
InfractionType::Unspecified => "INFRACTION_TYPE_UNSPECIFIED",
InfractionType::DoubleSign => "INFRACTION_TYPE_DOUBLE_SIGN",
InfractionType::Downtime => "INFRACTION_TYPE_DOWNTIME",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"INFRACTION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"INFRACTION_TYPE_DOUBLE_SIGN" => Some(Self::DoubleSign),
"INFRACTION_TYPE_DOWNTIME" => Some(Self::Downtime),
_ => None,
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgCreateValidator {
#[prost(message, optional, tag = "1")]
pub description: ::core::option::Option<Description>,
#[prost(message, optional, tag = "2")]
pub commission: ::core::option::Option<CommissionRates>,
#[prost(string, tag = "3")]
pub min_self_delegation: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub delegator_address: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub validator_address: ::prost::alloc::string::String,
#[prost(message, optional, tag = "6")]
pub pubkey: ::core::option::Option<super::super::super::google::protobuf::Any>,
#[prost(message, optional, tag = "7")]
pub value: ::core::option::Option<super::super::base::v1beta1::Coin>,
}
impl ::prost::Name for MsgCreateValidator {
const NAME: &'static str = "MsgCreateValidator";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgCreateValidatorResponse {}
impl ::prost::Name for MsgCreateValidatorResponse {
const NAME: &'static str = "MsgCreateValidatorResponse";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgEditValidator {
#[prost(message, optional, tag = "1")]
pub description: ::core::option::Option<Description>,
#[prost(string, tag = "2")]
pub validator_address: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub commission_rate: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub min_self_delegation: ::prost::alloc::string::String,
}
impl ::prost::Name for MsgEditValidator {
const NAME: &'static str = "MsgEditValidator";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgEditValidatorResponse {}
impl ::prost::Name for MsgEditValidatorResponse {
const NAME: &'static str = "MsgEditValidatorResponse";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgDelegate {
#[prost(string, tag = "1")]
pub delegator_address: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub validator_address: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub amount: ::core::option::Option<super::super::base::v1beta1::Coin>,
}
impl ::prost::Name for MsgDelegate {
const NAME: &'static str = "MsgDelegate";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgDelegateResponse {}
impl ::prost::Name for MsgDelegateResponse {
const NAME: &'static str = "MsgDelegateResponse";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgBeginRedelegate {
#[prost(string, tag = "1")]
pub delegator_address: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub validator_src_address: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub validator_dst_address: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub amount: ::core::option::Option<super::super::base::v1beta1::Coin>,
}
impl ::prost::Name for MsgBeginRedelegate {
const NAME: &'static str = "MsgBeginRedelegate";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgBeginRedelegateResponse {
#[prost(message, optional, tag = "1")]
pub completion_time: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
}
impl ::prost::Name for MsgBeginRedelegateResponse {
const NAME: &'static str = "MsgBeginRedelegateResponse";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgUndelegate {
#[prost(string, tag = "1")]
pub delegator_address: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub validator_address: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub amount: ::core::option::Option<super::super::base::v1beta1::Coin>,
}
impl ::prost::Name for MsgUndelegate {
const NAME: &'static str = "MsgUndelegate";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgUndelegateResponse {
#[prost(message, optional, tag = "1")]
pub completion_time: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
}
impl ::prost::Name for MsgUndelegateResponse {
const NAME: &'static str = "MsgUndelegateResponse";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgCancelUnbondingDelegation {
#[prost(string, tag = "1")]
pub delegator_address: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub validator_address: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub amount: ::core::option::Option<super::super::base::v1beta1::Coin>,
#[prost(int64, tag = "4")]
pub creation_height: i64,
}
impl ::prost::Name for MsgCancelUnbondingDelegation {
const NAME: &'static str = "MsgCancelUnbondingDelegation";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgCancelUnbondingDelegationResponse {}
impl ::prost::Name for MsgCancelUnbondingDelegationResponse {
const NAME: &'static str = "MsgCancelUnbondingDelegationResponse";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgUpdateParams {
#[prost(string, tag = "1")]
pub authority: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub params: ::core::option::Option<Params>,
}
impl ::prost::Name for MsgUpdateParams {
const NAME: &'static str = "MsgUpdateParams";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgUpdateParamsResponse {}
impl ::prost::Name for MsgUpdateParamsResponse {
const NAME: &'static str = "MsgUpdateParamsResponse";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[cfg(feature = "client")]
pub mod msg_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct MsgClient<T> {
inner: tonic::client::Grpc<T>,
}
impl MsgClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> MsgClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + 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<F>(
inner: T,
interceptor: F,
) -> MsgClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
MsgClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn create_validator(
&mut self,
request: impl tonic::IntoRequest<super::MsgCreateValidator>,
) -> std::result::Result<
tonic::Response<super::MsgCreateValidatorResponse>,
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.staking.v1beta1.Msg/CreateValidator",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("cosmos.staking.v1beta1.Msg", "CreateValidator"),
);
self.inner.unary(req, path, codec).await
}
pub async fn edit_validator(
&mut self,
request: impl tonic::IntoRequest<super::MsgEditValidator>,
) -> std::result::Result<
tonic::Response<super::MsgEditValidatorResponse>,
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.staking.v1beta1.Msg/EditValidator",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("cosmos.staking.v1beta1.Msg", "EditValidator"));
self.inner.unary(req, path, codec).await
}
pub async fn delegate(
&mut self,
request: impl tonic::IntoRequest<super::MsgDelegate>,
) -> std::result::Result<
tonic::Response<super::MsgDelegateResponse>,
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.staking.v1beta1.Msg/Delegate",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("cosmos.staking.v1beta1.Msg", "Delegate"));
self.inner.unary(req, path, codec).await
}
pub async fn begin_redelegate(
&mut self,
request: impl tonic::IntoRequest<super::MsgBeginRedelegate>,
) -> std::result::Result<
tonic::Response<super::MsgBeginRedelegateResponse>,
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.staking.v1beta1.Msg/BeginRedelegate",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("cosmos.staking.v1beta1.Msg", "BeginRedelegate"),
);
self.inner.unary(req, path, codec).await
}
pub async fn undelegate(
&mut self,
request: impl tonic::IntoRequest<super::MsgUndelegate>,
) -> std::result::Result<
tonic::Response<super::MsgUndelegateResponse>,
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.staking.v1beta1.Msg/Undelegate",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("cosmos.staking.v1beta1.Msg", "Undelegate"));
self.inner.unary(req, path, codec).await
}
pub async fn cancel_unbonding_delegation(
&mut self,
request: impl tonic::IntoRequest<super::MsgCancelUnbondingDelegation>,
) -> std::result::Result<
tonic::Response<super::MsgCancelUnbondingDelegationResponse>,
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.staking.v1beta1.Msg/CancelUnbondingDelegation",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"cosmos.staking.v1beta1.Msg",
"CancelUnbondingDelegation",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn update_params(
&mut self,
request: impl tonic::IntoRequest<super::MsgUpdateParams>,
) -> std::result::Result<
tonic::Response<super::MsgUpdateParamsResponse>,
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.staking.v1beta1.Msg/UpdateParams",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("cosmos.staking.v1beta1.Msg", "UpdateParams"));
self.inner.unary(req, path, codec).await
}
}
}
#[cfg(feature = "server")]
pub mod msg_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[async_trait]
pub trait Msg: Send + Sync + 'static {
async fn create_validator(
&self,
request: tonic::Request<super::MsgCreateValidator>,
) -> std::result::Result<
tonic::Response<super::MsgCreateValidatorResponse>,
tonic::Status,
>;
async fn edit_validator(
&self,
request: tonic::Request<super::MsgEditValidator>,
) -> std::result::Result<
tonic::Response<super::MsgEditValidatorResponse>,
tonic::Status,
>;
async fn delegate(
&self,
request: tonic::Request<super::MsgDelegate>,
) -> std::result::Result<
tonic::Response<super::MsgDelegateResponse>,
tonic::Status,
>;
async fn begin_redelegate(
&self,
request: tonic::Request<super::MsgBeginRedelegate>,
) -> std::result::Result<
tonic::Response<super::MsgBeginRedelegateResponse>,
tonic::Status,
>;
async fn undelegate(
&self,
request: tonic::Request<super::MsgUndelegate>,
) -> std::result::Result<
tonic::Response<super::MsgUndelegateResponse>,
tonic::Status,
>;
async fn cancel_unbonding_delegation(
&self,
request: tonic::Request<super::MsgCancelUnbondingDelegation>,
) -> std::result::Result<
tonic::Response<super::MsgCancelUnbondingDelegationResponse>,
tonic::Status,
>;
async fn update_params(
&self,
request: tonic::Request<super::MsgUpdateParams>,
) -> std::result::Result<
tonic::Response<super::MsgUpdateParamsResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct MsgServer<T: Msg> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
struct _Inner<T>(Arc<T>);
impl<T: Msg> MsgServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
let inner = _Inner(inner);
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for MsgServer<T>
where
T: Msg,
B: Body + Send + 'static,
B::Error: Into<StdError> + Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
let inner = self.inner.clone();
match req.uri().path() {
"/cosmos.staking.v1beta1.Msg/CreateValidator" => {
#[allow(non_camel_case_types)]
struct CreateValidatorSvc<T: Msg>(pub Arc<T>);
impl<T: Msg> tonic::server::UnaryService<super::MsgCreateValidator>
for CreateValidatorSvc<T> {
type Response = super::MsgCreateValidatorResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::MsgCreateValidator>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Msg>::create_validator(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = CreateValidatorSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.staking.v1beta1.Msg/EditValidator" => {
#[allow(non_camel_case_types)]
struct EditValidatorSvc<T: Msg>(pub Arc<T>);
impl<T: Msg> tonic::server::UnaryService<super::MsgEditValidator>
for EditValidatorSvc<T> {
type Response = super::MsgEditValidatorResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::MsgEditValidator>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Msg>::edit_validator(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = EditValidatorSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.staking.v1beta1.Msg/Delegate" => {
#[allow(non_camel_case_types)]
struct DelegateSvc<T: Msg>(pub Arc<T>);
impl<T: Msg> tonic::server::UnaryService<super::MsgDelegate>
for DelegateSvc<T> {
type Response = super::MsgDelegateResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::MsgDelegate>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Msg>::delegate(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = DelegateSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.staking.v1beta1.Msg/BeginRedelegate" => {
#[allow(non_camel_case_types)]
struct BeginRedelegateSvc<T: Msg>(pub Arc<T>);
impl<T: Msg> tonic::server::UnaryService<super::MsgBeginRedelegate>
for BeginRedelegateSvc<T> {
type Response = super::MsgBeginRedelegateResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::MsgBeginRedelegate>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Msg>::begin_redelegate(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = BeginRedelegateSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.staking.v1beta1.Msg/Undelegate" => {
#[allow(non_camel_case_types)]
struct UndelegateSvc<T: Msg>(pub Arc<T>);
impl<T: Msg> tonic::server::UnaryService<super::MsgUndelegate>
for UndelegateSvc<T> {
type Response = super::MsgUndelegateResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::MsgUndelegate>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Msg>::undelegate(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = UndelegateSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.staking.v1beta1.Msg/CancelUnbondingDelegation" => {
#[allow(non_camel_case_types)]
struct CancelUnbondingDelegationSvc<T: Msg>(pub Arc<T>);
impl<
T: Msg,
> tonic::server::UnaryService<super::MsgCancelUnbondingDelegation>
for CancelUnbondingDelegationSvc<T> {
type Response = super::MsgCancelUnbondingDelegationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::MsgCancelUnbondingDelegation>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Msg>::cancel_unbonding_delegation(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = CancelUnbondingDelegationSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.staking.v1beta1.Msg/UpdateParams" => {
#[allow(non_camel_case_types)]
struct UpdateParamsSvc<T: Msg>(pub Arc<T>);
impl<T: Msg> tonic::server::UnaryService<super::MsgUpdateParams>
for UpdateParamsSvc<T> {
type Response = super::MsgUpdateParamsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::MsgUpdateParams>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Msg>::update_params(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
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,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
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<T: Msg> Clone for MsgServer<T> {
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,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
impl<T: Msg> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(Arc::clone(&self.0))
}
}
impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.0)
}
}
impl<T: Msg> tonic::server::NamedService for MsgServer<T> {
const NAME: &'static str = "cosmos.staking.v1beta1.Msg";
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryValidatorsRequest {
#[prost(string, tag = "1")]
pub status: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageRequest,
>,
}
impl ::prost::Name for QueryValidatorsRequest {
const NAME: &'static str = "QueryValidatorsRequest";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryValidatorsResponse {
#[prost(message, repeated, tag = "1")]
pub validators: ::prost::alloc::vec::Vec<Validator>,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageResponse,
>,
}
impl ::prost::Name for QueryValidatorsResponse {
const NAME: &'static str = "QueryValidatorsResponse";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryValidatorRequest {
#[prost(string, tag = "1")]
pub validator_addr: ::prost::alloc::string::String,
}
impl ::prost::Name for QueryValidatorRequest {
const NAME: &'static str = "QueryValidatorRequest";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryValidatorResponse {
#[prost(message, optional, tag = "1")]
pub validator: ::core::option::Option<Validator>,
}
impl ::prost::Name for QueryValidatorResponse {
const NAME: &'static str = "QueryValidatorResponse";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryValidatorDelegationsRequest {
#[prost(string, tag = "1")]
pub validator_addr: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageRequest,
>,
}
impl ::prost::Name for QueryValidatorDelegationsRequest {
const NAME: &'static str = "QueryValidatorDelegationsRequest";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryValidatorDelegationsResponse {
#[prost(message, repeated, tag = "1")]
pub delegation_responses: ::prost::alloc::vec::Vec<DelegationResponse>,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageResponse,
>,
}
impl ::prost::Name for QueryValidatorDelegationsResponse {
const NAME: &'static str = "QueryValidatorDelegationsResponse";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryValidatorUnbondingDelegationsRequest {
#[prost(string, tag = "1")]
pub validator_addr: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageRequest,
>,
}
impl ::prost::Name for QueryValidatorUnbondingDelegationsRequest {
const NAME: &'static str = "QueryValidatorUnbondingDelegationsRequest";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryValidatorUnbondingDelegationsResponse {
#[prost(message, repeated, tag = "1")]
pub unbonding_responses: ::prost::alloc::vec::Vec<UnbondingDelegation>,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageResponse,
>,
}
impl ::prost::Name for QueryValidatorUnbondingDelegationsResponse {
const NAME: &'static str = "QueryValidatorUnbondingDelegationsResponse";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryDelegationRequest {
#[prost(string, tag = "1")]
pub delegator_addr: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub validator_addr: ::prost::alloc::string::String,
}
impl ::prost::Name for QueryDelegationRequest {
const NAME: &'static str = "QueryDelegationRequest";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryDelegationResponse {
#[prost(message, optional, tag = "1")]
pub delegation_response: ::core::option::Option<DelegationResponse>,
}
impl ::prost::Name for QueryDelegationResponse {
const NAME: &'static str = "QueryDelegationResponse";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryUnbondingDelegationRequest {
#[prost(string, tag = "1")]
pub delegator_addr: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub validator_addr: ::prost::alloc::string::String,
}
impl ::prost::Name for QueryUnbondingDelegationRequest {
const NAME: &'static str = "QueryUnbondingDelegationRequest";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryUnbondingDelegationResponse {
#[prost(message, optional, tag = "1")]
pub unbond: ::core::option::Option<UnbondingDelegation>,
}
impl ::prost::Name for QueryUnbondingDelegationResponse {
const NAME: &'static str = "QueryUnbondingDelegationResponse";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryDelegatorDelegationsRequest {
#[prost(string, tag = "1")]
pub delegator_addr: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageRequest,
>,
}
impl ::prost::Name for QueryDelegatorDelegationsRequest {
const NAME: &'static str = "QueryDelegatorDelegationsRequest";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryDelegatorDelegationsResponse {
#[prost(message, repeated, tag = "1")]
pub delegation_responses: ::prost::alloc::vec::Vec<DelegationResponse>,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageResponse,
>,
}
impl ::prost::Name for QueryDelegatorDelegationsResponse {
const NAME: &'static str = "QueryDelegatorDelegationsResponse";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryDelegatorUnbondingDelegationsRequest {
#[prost(string, tag = "1")]
pub delegator_addr: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageRequest,
>,
}
impl ::prost::Name for QueryDelegatorUnbondingDelegationsRequest {
const NAME: &'static str = "QueryDelegatorUnbondingDelegationsRequest";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryDelegatorUnbondingDelegationsResponse {
#[prost(message, repeated, tag = "1")]
pub unbonding_responses: ::prost::alloc::vec::Vec<UnbondingDelegation>,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageResponse,
>,
}
impl ::prost::Name for QueryDelegatorUnbondingDelegationsResponse {
const NAME: &'static str = "QueryDelegatorUnbondingDelegationsResponse";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryRedelegationsRequest {
#[prost(string, tag = "1")]
pub delegator_addr: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub src_validator_addr: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub dst_validator_addr: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageRequest,
>,
}
impl ::prost::Name for QueryRedelegationsRequest {
const NAME: &'static str = "QueryRedelegationsRequest";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryRedelegationsResponse {
#[prost(message, repeated, tag = "1")]
pub redelegation_responses: ::prost::alloc::vec::Vec<RedelegationResponse>,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageResponse,
>,
}
impl ::prost::Name for QueryRedelegationsResponse {
const NAME: &'static str = "QueryRedelegationsResponse";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryDelegatorValidatorsRequest {
#[prost(string, tag = "1")]
pub delegator_addr: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageRequest,
>,
}
impl ::prost::Name for QueryDelegatorValidatorsRequest {
const NAME: &'static str = "QueryDelegatorValidatorsRequest";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryDelegatorValidatorsResponse {
#[prost(message, repeated, tag = "1")]
pub validators: ::prost::alloc::vec::Vec<Validator>,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageResponse,
>,
}
impl ::prost::Name for QueryDelegatorValidatorsResponse {
const NAME: &'static str = "QueryDelegatorValidatorsResponse";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryDelegatorValidatorRequest {
#[prost(string, tag = "1")]
pub delegator_addr: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub validator_addr: ::prost::alloc::string::String,
}
impl ::prost::Name for QueryDelegatorValidatorRequest {
const NAME: &'static str = "QueryDelegatorValidatorRequest";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryDelegatorValidatorResponse {
#[prost(message, optional, tag = "1")]
pub validator: ::core::option::Option<Validator>,
}
impl ::prost::Name for QueryDelegatorValidatorResponse {
const NAME: &'static str = "QueryDelegatorValidatorResponse";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryHistoricalInfoRequest {
#[prost(int64, tag = "1")]
pub height: i64,
}
impl ::prost::Name for QueryHistoricalInfoRequest {
const NAME: &'static str = "QueryHistoricalInfoRequest";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryHistoricalInfoResponse {
#[prost(message, optional, tag = "1")]
pub hist: ::core::option::Option<HistoricalInfo>,
}
impl ::prost::Name for QueryHistoricalInfoResponse {
const NAME: &'static str = "QueryHistoricalInfoResponse";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryPoolRequest {}
impl ::prost::Name for QueryPoolRequest {
const NAME: &'static str = "QueryPoolRequest";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryPoolResponse {
#[prost(message, optional, tag = "1")]
pub pool: ::core::option::Option<Pool>,
}
impl ::prost::Name for QueryPoolResponse {
const NAME: &'static str = "QueryPoolResponse";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryParamsRequest {}
impl ::prost::Name for QueryParamsRequest {
const NAME: &'static str = "QueryParamsRequest";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryParamsResponse {
#[prost(message, optional, tag = "1")]
pub params: ::core::option::Option<Params>,
}
impl ::prost::Name for QueryParamsResponse {
const NAME: &'static str = "QueryParamsResponse";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[cfg(feature = "client")]
pub mod query_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct QueryClient<T> {
inner: tonic::client::Grpc<T>,
}
impl QueryClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> QueryClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + 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<F>(
inner: T,
interceptor: F,
) -> QueryClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
QueryClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn validators(
&mut self,
request: impl tonic::IntoRequest<super::QueryValidatorsRequest>,
) -> std::result::Result<
tonic::Response<super::QueryValidatorsResponse>,
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.staking.v1beta1.Query/Validators",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("cosmos.staking.v1beta1.Query", "Validators"));
self.inner.unary(req, path, codec).await
}
pub async fn validator(
&mut self,
request: impl tonic::IntoRequest<super::QueryValidatorRequest>,
) -> std::result::Result<
tonic::Response<super::QueryValidatorResponse>,
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.staking.v1beta1.Query/Validator",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("cosmos.staking.v1beta1.Query", "Validator"));
self.inner.unary(req, path, codec).await
}
pub async fn validator_delegations(
&mut self,
request: impl tonic::IntoRequest<super::QueryValidatorDelegationsRequest>,
) -> std::result::Result<
tonic::Response<super::QueryValidatorDelegationsResponse>,
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.staking.v1beta1.Query/ValidatorDelegations",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"cosmos.staking.v1beta1.Query",
"ValidatorDelegations",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn validator_unbonding_delegations(
&mut self,
request: impl tonic::IntoRequest<
super::QueryValidatorUnbondingDelegationsRequest,
>,
) -> std::result::Result<
tonic::Response<super::QueryValidatorUnbondingDelegationsResponse>,
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.staking.v1beta1.Query/ValidatorUnbondingDelegations",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"cosmos.staking.v1beta1.Query",
"ValidatorUnbondingDelegations",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn delegation(
&mut self,
request: impl tonic::IntoRequest<super::QueryDelegationRequest>,
) -> std::result::Result<
tonic::Response<super::QueryDelegationResponse>,
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.staking.v1beta1.Query/Delegation",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("cosmos.staking.v1beta1.Query", "Delegation"));
self.inner.unary(req, path, codec).await
}
pub async fn unbonding_delegation(
&mut self,
request: impl tonic::IntoRequest<super::QueryUnbondingDelegationRequest>,
) -> std::result::Result<
tonic::Response<super::QueryUnbondingDelegationResponse>,
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.staking.v1beta1.Query/UnbondingDelegation",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"cosmos.staking.v1beta1.Query",
"UnbondingDelegation",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn delegator_delegations(
&mut self,
request: impl tonic::IntoRequest<super::QueryDelegatorDelegationsRequest>,
) -> std::result::Result<
tonic::Response<super::QueryDelegatorDelegationsResponse>,
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.staking.v1beta1.Query/DelegatorDelegations",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"cosmos.staking.v1beta1.Query",
"DelegatorDelegations",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn delegator_unbonding_delegations(
&mut self,
request: impl tonic::IntoRequest<
super::QueryDelegatorUnbondingDelegationsRequest,
>,
) -> std::result::Result<
tonic::Response<super::QueryDelegatorUnbondingDelegationsResponse>,
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.staking.v1beta1.Query/DelegatorUnbondingDelegations",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"cosmos.staking.v1beta1.Query",
"DelegatorUnbondingDelegations",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn redelegations(
&mut self,
request: impl tonic::IntoRequest<super::QueryRedelegationsRequest>,
) -> std::result::Result<
tonic::Response<super::QueryRedelegationsResponse>,
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.staking.v1beta1.Query/Redelegations",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("cosmos.staking.v1beta1.Query", "Redelegations"),
);
self.inner.unary(req, path, codec).await
}
pub async fn delegator_validators(
&mut self,
request: impl tonic::IntoRequest<super::QueryDelegatorValidatorsRequest>,
) -> std::result::Result<
tonic::Response<super::QueryDelegatorValidatorsResponse>,
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.staking.v1beta1.Query/DelegatorValidators",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"cosmos.staking.v1beta1.Query",
"DelegatorValidators",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn delegator_validator(
&mut self,
request: impl tonic::IntoRequest<super::QueryDelegatorValidatorRequest>,
) -> std::result::Result<
tonic::Response<super::QueryDelegatorValidatorResponse>,
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.staking.v1beta1.Query/DelegatorValidator",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("cosmos.staking.v1beta1.Query", "DelegatorValidator"),
);
self.inner.unary(req, path, codec).await
}
pub async fn historical_info(
&mut self,
request: impl tonic::IntoRequest<super::QueryHistoricalInfoRequest>,
) -> std::result::Result<
tonic::Response<super::QueryHistoricalInfoResponse>,
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.staking.v1beta1.Query/HistoricalInfo",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("cosmos.staking.v1beta1.Query", "HistoricalInfo"),
);
self.inner.unary(req, path, codec).await
}
pub async fn pool(
&mut self,
request: impl tonic::IntoRequest<super::QueryPoolRequest>,
) -> std::result::Result<
tonic::Response<super::QueryPoolResponse>,
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.staking.v1beta1.Query/Pool",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("cosmos.staking.v1beta1.Query", "Pool"));
self.inner.unary(req, path, codec).await
}
pub async fn params(
&mut self,
request: impl tonic::IntoRequest<super::QueryParamsRequest>,
) -> std::result::Result<
tonic::Response<super::QueryParamsResponse>,
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.staking.v1beta1.Query/Params",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("cosmos.staking.v1beta1.Query", "Params"));
self.inner.unary(req, path, codec).await
}
}
}
#[cfg(feature = "server")]
pub mod query_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[async_trait]
pub trait Query: Send + Sync + 'static {
async fn validators(
&self,
request: tonic::Request<super::QueryValidatorsRequest>,
) -> std::result::Result<
tonic::Response<super::QueryValidatorsResponse>,
tonic::Status,
>;
async fn validator(
&self,
request: tonic::Request<super::QueryValidatorRequest>,
) -> std::result::Result<
tonic::Response<super::QueryValidatorResponse>,
tonic::Status,
>;
async fn validator_delegations(
&self,
request: tonic::Request<super::QueryValidatorDelegationsRequest>,
) -> std::result::Result<
tonic::Response<super::QueryValidatorDelegationsResponse>,
tonic::Status,
>;
async fn validator_unbonding_delegations(
&self,
request: tonic::Request<super::QueryValidatorUnbondingDelegationsRequest>,
) -> std::result::Result<
tonic::Response<super::QueryValidatorUnbondingDelegationsResponse>,
tonic::Status,
>;
async fn delegation(
&self,
request: tonic::Request<super::QueryDelegationRequest>,
) -> std::result::Result<
tonic::Response<super::QueryDelegationResponse>,
tonic::Status,
>;
async fn unbonding_delegation(
&self,
request: tonic::Request<super::QueryUnbondingDelegationRequest>,
) -> std::result::Result<
tonic::Response<super::QueryUnbondingDelegationResponse>,
tonic::Status,
>;
async fn delegator_delegations(
&self,
request: tonic::Request<super::QueryDelegatorDelegationsRequest>,
) -> std::result::Result<
tonic::Response<super::QueryDelegatorDelegationsResponse>,
tonic::Status,
>;
async fn delegator_unbonding_delegations(
&self,
request: tonic::Request<super::QueryDelegatorUnbondingDelegationsRequest>,
) -> std::result::Result<
tonic::Response<super::QueryDelegatorUnbondingDelegationsResponse>,
tonic::Status,
>;
async fn redelegations(
&self,
request: tonic::Request<super::QueryRedelegationsRequest>,
) -> std::result::Result<
tonic::Response<super::QueryRedelegationsResponse>,
tonic::Status,
>;
async fn delegator_validators(
&self,
request: tonic::Request<super::QueryDelegatorValidatorsRequest>,
) -> std::result::Result<
tonic::Response<super::QueryDelegatorValidatorsResponse>,
tonic::Status,
>;
async fn delegator_validator(
&self,
request: tonic::Request<super::QueryDelegatorValidatorRequest>,
) -> std::result::Result<
tonic::Response<super::QueryDelegatorValidatorResponse>,
tonic::Status,
>;
async fn historical_info(
&self,
request: tonic::Request<super::QueryHistoricalInfoRequest>,
) -> std::result::Result<
tonic::Response<super::QueryHistoricalInfoResponse>,
tonic::Status,
>;
async fn pool(
&self,
request: tonic::Request<super::QueryPoolRequest>,
) -> std::result::Result<
tonic::Response<super::QueryPoolResponse>,
tonic::Status,
>;
async fn params(
&self,
request: tonic::Request<super::QueryParamsRequest>,
) -> std::result::Result<
tonic::Response<super::QueryParamsResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct QueryServer<T: Query> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
struct _Inner<T>(Arc<T>);
impl<T: Query> QueryServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
let inner = _Inner(inner);
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for QueryServer<T>
where
T: Query,
B: Body + Send + 'static,
B::Error: Into<StdError> + Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
let inner = self.inner.clone();
match req.uri().path() {
"/cosmos.staking.v1beta1.Query/Validators" => {
#[allow(non_camel_case_types)]
struct ValidatorsSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QueryValidatorsRequest>
for ValidatorsSvc<T> {
type Response = super::QueryValidatorsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryValidatorsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::validators(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = ValidatorsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.staking.v1beta1.Query/Validator" => {
#[allow(non_camel_case_types)]
struct ValidatorSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QueryValidatorRequest>
for ValidatorSvc<T> {
type Response = super::QueryValidatorResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryValidatorRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::validator(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = ValidatorSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.staking.v1beta1.Query/ValidatorDelegations" => {
#[allow(non_camel_case_types)]
struct ValidatorDelegationsSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<
super::QueryValidatorDelegationsRequest,
> for ValidatorDelegationsSvc<T> {
type Response = super::QueryValidatorDelegationsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::QueryValidatorDelegationsRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::validator_delegations(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = ValidatorDelegationsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.staking.v1beta1.Query/ValidatorUnbondingDelegations" => {
#[allow(non_camel_case_types)]
struct ValidatorUnbondingDelegationsSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<
super::QueryValidatorUnbondingDelegationsRequest,
> for ValidatorUnbondingDelegationsSvc<T> {
type Response = super::QueryValidatorUnbondingDelegationsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::QueryValidatorUnbondingDelegationsRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::validator_unbonding_delegations(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = ValidatorUnbondingDelegationsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.staking.v1beta1.Query/Delegation" => {
#[allow(non_camel_case_types)]
struct DelegationSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QueryDelegationRequest>
for DelegationSvc<T> {
type Response = super::QueryDelegationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryDelegationRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::delegation(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = DelegationSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.staking.v1beta1.Query/UnbondingDelegation" => {
#[allow(non_camel_case_types)]
struct UnbondingDelegationSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QueryUnbondingDelegationRequest>
for UnbondingDelegationSvc<T> {
type Response = super::QueryUnbondingDelegationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::QueryUnbondingDelegationRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::unbonding_delegation(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = UnbondingDelegationSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.staking.v1beta1.Query/DelegatorDelegations" => {
#[allow(non_camel_case_types)]
struct DelegatorDelegationsSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<
super::QueryDelegatorDelegationsRequest,
> for DelegatorDelegationsSvc<T> {
type Response = super::QueryDelegatorDelegationsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::QueryDelegatorDelegationsRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::delegator_delegations(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = DelegatorDelegationsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.staking.v1beta1.Query/DelegatorUnbondingDelegations" => {
#[allow(non_camel_case_types)]
struct DelegatorUnbondingDelegationsSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<
super::QueryDelegatorUnbondingDelegationsRequest,
> for DelegatorUnbondingDelegationsSvc<T> {
type Response = super::QueryDelegatorUnbondingDelegationsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::QueryDelegatorUnbondingDelegationsRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::delegator_unbonding_delegations(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = DelegatorUnbondingDelegationsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.staking.v1beta1.Query/Redelegations" => {
#[allow(non_camel_case_types)]
struct RedelegationsSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QueryRedelegationsRequest>
for RedelegationsSvc<T> {
type Response = super::QueryRedelegationsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryRedelegationsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::redelegations(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = RedelegationsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.staking.v1beta1.Query/DelegatorValidators" => {
#[allow(non_camel_case_types)]
struct DelegatorValidatorsSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QueryDelegatorValidatorsRequest>
for DelegatorValidatorsSvc<T> {
type Response = super::QueryDelegatorValidatorsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::QueryDelegatorValidatorsRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::delegator_validators(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
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,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.staking.v1beta1.Query/DelegatorValidator" => {
#[allow(non_camel_case_types)]
struct DelegatorValidatorSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QueryDelegatorValidatorRequest>
for DelegatorValidatorSvc<T> {
type Response = super::QueryDelegatorValidatorResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::QueryDelegatorValidatorRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::delegator_validator(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = DelegatorValidatorSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.staking.v1beta1.Query/HistoricalInfo" => {
#[allow(non_camel_case_types)]
struct HistoricalInfoSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QueryHistoricalInfoRequest>
for HistoricalInfoSvc<T> {
type Response = super::QueryHistoricalInfoResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryHistoricalInfoRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::historical_info(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = HistoricalInfoSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.staking.v1beta1.Query/Pool" => {
#[allow(non_camel_case_types)]
struct PoolSvc<T: Query>(pub Arc<T>);
impl<T: Query> tonic::server::UnaryService<super::QueryPoolRequest>
for PoolSvc<T> {
type Response = super::QueryPoolResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryPoolRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::pool(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = PoolSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.staking.v1beta1.Query/Params" => {
#[allow(non_camel_case_types)]
struct ParamsSvc<T: Query>(pub Arc<T>);
impl<T: Query> tonic::server::UnaryService<super::QueryParamsRequest>
for ParamsSvc<T> {
type Response = super::QueryParamsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryParamsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::params(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
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,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
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<T: Query> Clone for QueryServer<T> {
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,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
impl<T: Query> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(Arc::clone(&self.0))
}
}
impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.0)
}
}
impl<T: Query> tonic::server::NamedService for QueryServer<T> {
const NAME: &'static str = "cosmos.staking.v1beta1.Query";
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StakeAuthorization {
#[prost(message, optional, tag = "1")]
pub max_tokens: ::core::option::Option<super::super::base::v1beta1::Coin>,
#[prost(enumeration = "AuthorizationType", tag = "4")]
pub authorization_type: i32,
#[prost(oneof = "stake_authorization::Validators", tags = "2, 3")]
pub validators: ::core::option::Option<stake_authorization::Validators>,
}
pub mod stake_authorization {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorsVec {
#[prost(string, repeated, tag = "1")]
pub address: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
impl ::prost::Name for ValidatorsVec {
const NAME: &'static str = "Validators";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!(
"cosmos.staking.v1beta1.StakeAuthorization.{}", Self::NAME
)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Validators {
#[prost(message, tag = "2")]
AllowList(ValidatorsVec),
#[prost(message, tag = "3")]
DenyList(ValidatorsVec),
}
}
impl ::prost::Name for StakeAuthorization {
const NAME: &'static str = "StakeAuthorization";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AuthorizationType {
Unspecified = 0,
Delegate = 1,
Undelegate = 2,
Redelegate = 3,
}
impl AuthorizationType {
pub fn as_str_name(&self) -> &'static str {
match self {
AuthorizationType::Unspecified => "AUTHORIZATION_TYPE_UNSPECIFIED",
AuthorizationType::Delegate => "AUTHORIZATION_TYPE_DELEGATE",
AuthorizationType::Undelegate => "AUTHORIZATION_TYPE_UNDELEGATE",
AuthorizationType::Redelegate => "AUTHORIZATION_TYPE_REDELEGATE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"AUTHORIZATION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"AUTHORIZATION_TYPE_DELEGATE" => Some(Self::Delegate),
"AUTHORIZATION_TYPE_UNDELEGATE" => Some(Self::Undelegate),
"AUTHORIZATION_TYPE_REDELEGATE" => Some(Self::Redelegate),
_ => None,
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenesisState {
#[prost(message, optional, tag = "1")]
pub params: ::core::option::Option<Params>,
#[prost(bytes = "vec", tag = "2")]
pub last_total_power: ::prost::alloc::vec::Vec<u8>,
#[prost(message, repeated, tag = "3")]
pub last_validator_powers: ::prost::alloc::vec::Vec<LastValidatorPower>,
#[prost(message, repeated, tag = "4")]
pub validators: ::prost::alloc::vec::Vec<Validator>,
#[prost(message, repeated, tag = "5")]
pub delegations: ::prost::alloc::vec::Vec<Delegation>,
#[prost(message, repeated, tag = "6")]
pub unbonding_delegations: ::prost::alloc::vec::Vec<UnbondingDelegation>,
#[prost(message, repeated, tag = "7")]
pub redelegations: ::prost::alloc::vec::Vec<Redelegation>,
#[prost(bool, tag = "8")]
pub exported: bool,
}
impl ::prost::Name for GenesisState {
const NAME: &'static str = "GenesisState";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LastValidatorPower {
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub power: i64,
}
impl ::prost::Name for LastValidatorPower {
const NAME: &'static str = "LastValidatorPower";
const PACKAGE: &'static str = "cosmos.staking.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME)
}
}