#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ZkUndelegateClaimProof {
#[prost(bytes = "vec", tag = "1")]
pub inner: ::prost::alloc::vec::Vec<u8>,
}
impl ::prost::Name for ZkUndelegateClaimProof {
const NAME: &'static str = "ZKUndelegateClaimProof";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Validator {
#[prost(message, optional, tag = "1")]
pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
#[prost(bytes = "vec", tag = "2")]
pub consensus_key: ::prost::alloc::vec::Vec<u8>,
#[prost(string, tag = "3")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub website: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub description: ::prost::alloc::string::String,
#[prost(bool, tag = "8")]
pub enabled: bool,
#[prost(message, repeated, tag = "6")]
pub funding_streams: ::prost::alloc::vec::Vec<FundingStream>,
#[prost(uint32, tag = "7")]
pub sequence_number: u32,
#[prost(message, optional, tag = "9")]
pub governance_key: ::core::option::Option<
super::super::super::keys::v1::GovernanceKey,
>,
}
impl ::prost::Name for Validator {
const NAME: &'static str = "Validator";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorList {
#[prost(message, repeated, tag = "1")]
pub validator_keys: ::prost::alloc::vec::Vec<
super::super::super::keys::v1::IdentityKey,
>,
}
impl ::prost::Name for ValidatorList {
const NAME: &'static str = "ValidatorList";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FundingStream {
#[prost(oneof = "funding_stream::Recipient", tags = "1, 2")]
pub recipient: ::core::option::Option<funding_stream::Recipient>,
}
pub mod funding_stream {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ToAddress {
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
#[prost(uint32, tag = "2")]
pub rate_bps: u32,
}
impl ::prost::Name for ToAddress {
const NAME: &'static str = "ToAddress";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!(
"penumbra.core.component.stake.v1.FundingStream.{}", Self::NAME
)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ToCommunityPool {
#[prost(uint32, tag = "2")]
pub rate_bps: u32,
}
impl ::prost::Name for ToCommunityPool {
const NAME: &'static str = "ToCommunityPool";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!(
"penumbra.core.component.stake.v1.FundingStream.{}", Self::NAME
)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Recipient {
#[prost(message, tag = "1")]
ToAddress(ToAddress),
#[prost(message, tag = "2")]
ToCommunityPool(ToCommunityPool),
}
}
impl ::prost::Name for FundingStream {
const NAME: &'static str = "FundingStream";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RateData {
#[prost(message, optional, tag = "1")]
pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
#[deprecated]
#[prost(uint64, tag = "2")]
pub epoch_index: u64,
#[prost(message, optional, tag = "4")]
pub validator_reward_rate: ::core::option::Option<
super::super::super::num::v1::Amount,
>,
#[prost(message, optional, tag = "5")]
pub validator_exchange_rate: ::core::option::Option<
super::super::super::num::v1::Amount,
>,
}
impl ::prost::Name for RateData {
const NAME: &'static str = "RateData";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BaseRateData {
#[prost(uint64, tag = "1")]
pub epoch_index: u64,
#[prost(message, optional, tag = "2")]
pub base_reward_rate: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(message, optional, tag = "3")]
pub base_exchange_rate: ::core::option::Option<super::super::super::num::v1::Amount>,
}
impl ::prost::Name for BaseRateData {
const NAME: &'static str = "BaseRateData";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorStatus {
#[prost(message, optional, tag = "1")]
pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
#[prost(message, optional, tag = "2")]
pub state: ::core::option::Option<ValidatorState>,
#[prost(message, optional, tag = "3")]
pub voting_power: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(message, optional, tag = "4")]
pub bonding_state: ::core::option::Option<BondingState>,
}
impl ::prost::Name for ValidatorStatus {
const NAME: &'static str = "ValidatorStatus";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BondingState {
#[prost(enumeration = "bonding_state::BondingStateEnum", tag = "1")]
pub state: i32,
#[deprecated]
#[prost(uint64, tag = "2")]
pub unbonds_at_epoch: u64,
#[prost(uint64, tag = "3")]
pub unbonds_at_height: u64,
}
pub mod bonding_state {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum BondingStateEnum {
Unspecified = 0,
Bonded = 1,
Unbonding = 2,
Unbonded = 3,
}
impl BondingStateEnum {
pub fn as_str_name(&self) -> &'static str {
match self {
BondingStateEnum::Unspecified => "BONDING_STATE_ENUM_UNSPECIFIED",
BondingStateEnum::Bonded => "BONDING_STATE_ENUM_BONDED",
BondingStateEnum::Unbonding => "BONDING_STATE_ENUM_UNBONDING",
BondingStateEnum::Unbonded => "BONDING_STATE_ENUM_UNBONDED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"BONDING_STATE_ENUM_UNSPECIFIED" => Some(Self::Unspecified),
"BONDING_STATE_ENUM_BONDED" => Some(Self::Bonded),
"BONDING_STATE_ENUM_UNBONDING" => Some(Self::Unbonding),
"BONDING_STATE_ENUM_UNBONDED" => Some(Self::Unbonded),
_ => None,
}
}
}
}
impl ::prost::Name for BondingState {
const NAME: &'static str = "BondingState";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorState {
#[prost(enumeration = "validator_state::ValidatorStateEnum", tag = "1")]
pub state: i32,
}
pub mod validator_state {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ValidatorStateEnum {
Unspecified = 0,
Defined = 1,
Inactive = 2,
Active = 3,
Jailed = 4,
Tombstoned = 5,
Disabled = 6,
}
impl ValidatorStateEnum {
pub fn as_str_name(&self) -> &'static str {
match self {
ValidatorStateEnum::Unspecified => "VALIDATOR_STATE_ENUM_UNSPECIFIED",
ValidatorStateEnum::Defined => "VALIDATOR_STATE_ENUM_DEFINED",
ValidatorStateEnum::Inactive => "VALIDATOR_STATE_ENUM_INACTIVE",
ValidatorStateEnum::Active => "VALIDATOR_STATE_ENUM_ACTIVE",
ValidatorStateEnum::Jailed => "VALIDATOR_STATE_ENUM_JAILED",
ValidatorStateEnum::Tombstoned => "VALIDATOR_STATE_ENUM_TOMBSTONED",
ValidatorStateEnum::Disabled => "VALIDATOR_STATE_ENUM_DISABLED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"VALIDATOR_STATE_ENUM_UNSPECIFIED" => Some(Self::Unspecified),
"VALIDATOR_STATE_ENUM_DEFINED" => Some(Self::Defined),
"VALIDATOR_STATE_ENUM_INACTIVE" => Some(Self::Inactive),
"VALIDATOR_STATE_ENUM_ACTIVE" => Some(Self::Active),
"VALIDATOR_STATE_ENUM_JAILED" => Some(Self::Jailed),
"VALIDATOR_STATE_ENUM_TOMBSTONED" => Some(Self::Tombstoned),
"VALIDATOR_STATE_ENUM_DISABLED" => Some(Self::Disabled),
_ => None,
}
}
}
}
impl ::prost::Name for ValidatorState {
const NAME: &'static str = "ValidatorState";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorInfo {
#[prost(message, optional, tag = "1")]
pub validator: ::core::option::Option<Validator>,
#[prost(message, optional, tag = "2")]
pub status: ::core::option::Option<ValidatorStatus>,
#[prost(message, optional, tag = "3")]
pub rate_data: ::core::option::Option<RateData>,
}
impl ::prost::Name for ValidatorInfo {
const NAME: &'static str = "ValidatorInfo";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorDefinition {
#[prost(message, optional, tag = "1")]
pub validator: ::core::option::Option<Validator>,
#[prost(bytes = "vec", tag = "2")]
pub auth_sig: ::prost::alloc::vec::Vec<u8>,
}
impl ::prost::Name for ValidatorDefinition {
const NAME: &'static str = "ValidatorDefinition";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Delegate {
#[prost(message, optional, tag = "1")]
pub validator_identity: ::core::option::Option<
super::super::super::keys::v1::IdentityKey,
>,
#[prost(uint64, tag = "2")]
pub epoch_index: u64,
#[prost(message, optional, tag = "3")]
pub unbonded_amount: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(message, optional, tag = "4")]
pub delegation_amount: ::core::option::Option<super::super::super::num::v1::Amount>,
}
impl ::prost::Name for Delegate {
const NAME: &'static str = "Delegate";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Undelegate {
#[prost(message, optional, tag = "1")]
pub validator_identity: ::core::option::Option<
super::super::super::keys::v1::IdentityKey,
>,
#[deprecated]
#[prost(uint64, tag = "2")]
pub start_epoch_index: u64,
#[prost(message, optional, tag = "3")]
pub unbonded_amount: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(message, optional, tag = "4")]
pub delegation_amount: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(message, optional, tag = "5")]
pub from_epoch: ::core::option::Option<super::super::sct::v1::Epoch>,
}
impl ::prost::Name for Undelegate {
const NAME: &'static str = "Undelegate";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UndelegateClaim {
#[prost(message, optional, tag = "1")]
pub body: ::core::option::Option<UndelegateClaimBody>,
#[prost(bytes = "vec", tag = "2")]
pub proof: ::prost::alloc::vec::Vec<u8>,
}
impl ::prost::Name for UndelegateClaim {
const NAME: &'static str = "UndelegateClaim";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UndelegateClaimBody {
#[prost(message, optional, tag = "1")]
pub validator_identity: ::core::option::Option<
super::super::super::keys::v1::IdentityKey,
>,
#[deprecated]
#[prost(uint64, tag = "2")]
pub start_epoch_index: u64,
#[prost(message, optional, tag = "3")]
pub penalty: ::core::option::Option<Penalty>,
#[prost(message, optional, tag = "4")]
pub balance_commitment: ::core::option::Option<
super::super::super::asset::v1::BalanceCommitment,
>,
#[prost(uint64, tag = "5")]
pub unbonding_start_height: u64,
}
impl ::prost::Name for UndelegateClaimBody {
const NAME: &'static str = "UndelegateClaimBody";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UndelegateClaimPlan {
#[prost(message, optional, tag = "1")]
pub validator_identity: ::core::option::Option<
super::super::super::keys::v1::IdentityKey,
>,
#[deprecated]
#[prost(uint64, tag = "2")]
pub start_epoch_index: u64,
#[prost(message, optional, tag = "4")]
pub penalty: ::core::option::Option<Penalty>,
#[prost(message, optional, tag = "5")]
pub unbonding_amount: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(bytes = "vec", tag = "6")]
pub balance_blinding: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "7")]
pub proof_blinding_r: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "8")]
pub proof_blinding_s: ::prost::alloc::vec::Vec<u8>,
#[prost(uint64, tag = "9")]
pub unbonding_start_height: u64,
}
impl ::prost::Name for UndelegateClaimPlan {
const NAME: &'static str = "UndelegateClaimPlan";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DelegationChanges {
#[prost(message, repeated, tag = "1")]
pub delegations: ::prost::alloc::vec::Vec<Delegate>,
#[prost(message, repeated, tag = "2")]
pub undelegations: ::prost::alloc::vec::Vec<Undelegate>,
}
impl ::prost::Name for DelegationChanges {
const NAME: &'static str = "DelegationChanges";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Uptime {
#[prost(uint64, tag = "1")]
pub as_of_block_height: u64,
#[prost(uint32, tag = "2")]
pub window_len: u32,
#[prost(bytes = "vec", tag = "3")]
pub bitvec: ::prost::alloc::vec::Vec<u8>,
}
impl ::prost::Name for Uptime {
const NAME: &'static str = "Uptime";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CurrentConsensusKeys {
#[prost(message, repeated, tag = "1")]
pub consensus_keys: ::prost::alloc::vec::Vec<
super::super::super::keys::v1::ConsensusKey,
>,
}
impl ::prost::Name for CurrentConsensusKeys {
const NAME: &'static str = "CurrentConsensusKeys";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Penalty {
#[prost(bytes = "vec", tag = "1")]
pub inner: ::prost::alloc::vec::Vec<u8>,
}
impl ::prost::Name for Penalty {
const NAME: &'static str = "Penalty";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetValidatorInfoRequest {
#[prost(message, optional, tag = "2")]
pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
}
impl ::prost::Name for GetValidatorInfoRequest {
const NAME: &'static str = "GetValidatorInfoRequest";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetValidatorInfoResponse {
#[prost(message, optional, tag = "1")]
pub validator_info: ::core::option::Option<ValidatorInfo>,
}
impl ::prost::Name for GetValidatorInfoResponse {
const NAME: &'static str = "GetValidatorInfoResponse";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorInfoRequest {
#[prost(bool, tag = "2")]
pub show_inactive: bool,
}
impl ::prost::Name for ValidatorInfoRequest {
const NAME: &'static str = "ValidatorInfoRequest";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorInfoResponse {
#[prost(message, optional, tag = "1")]
pub validator_info: ::core::option::Option<ValidatorInfo>,
}
impl ::prost::Name for ValidatorInfoResponse {
const NAME: &'static str = "ValidatorInfoResponse";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorStatusRequest {
#[prost(message, optional, tag = "2")]
pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
}
impl ::prost::Name for ValidatorStatusRequest {
const NAME: &'static str = "ValidatorStatusRequest";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorStatusResponse {
#[prost(message, optional, tag = "1")]
pub status: ::core::option::Option<ValidatorStatus>,
}
impl ::prost::Name for ValidatorStatusResponse {
const NAME: &'static str = "ValidatorStatusResponse";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorPenaltyRequest {
#[prost(message, optional, tag = "2")]
pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
#[prost(uint64, tag = "3")]
pub start_epoch_index: u64,
#[prost(uint64, tag = "4")]
pub end_epoch_index: u64,
}
impl ::prost::Name for ValidatorPenaltyRequest {
const NAME: &'static str = "ValidatorPenaltyRequest";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorPenaltyResponse {
#[prost(message, optional, tag = "1")]
pub penalty: ::core::option::Option<Penalty>,
}
impl ::prost::Name for ValidatorPenaltyResponse {
const NAME: &'static str = "ValidatorPenaltyResponse";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CurrentValidatorRateRequest {
#[prost(message, optional, tag = "2")]
pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
}
impl ::prost::Name for CurrentValidatorRateRequest {
const NAME: &'static str = "CurrentValidatorRateRequest";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CurrentValidatorRateResponse {
#[prost(message, optional, tag = "1")]
pub data: ::core::option::Option<RateData>,
}
impl ::prost::Name for CurrentValidatorRateResponse {
const NAME: &'static str = "CurrentValidatorRateResponse";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorUptimeRequest {
#[prost(message, optional, tag = "2")]
pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
}
impl ::prost::Name for ValidatorUptimeRequest {
const NAME: &'static str = "ValidatorUptimeRequest";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorUptimeResponse {
#[prost(message, optional, tag = "1")]
pub uptime: ::core::option::Option<Uptime>,
}
impl ::prost::Name for ValidatorUptimeResponse {
const NAME: &'static str = "ValidatorUptimeResponse";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StakeParameters {
#[deprecated]
#[prost(uint64, tag = "1")]
pub unbonding_epochs: u64,
#[prost(uint64, tag = "2")]
pub active_validator_limit: u64,
#[deprecated]
#[prost(uint64, tag = "3")]
pub base_reward_rate: u64,
#[prost(uint64, tag = "4")]
pub slashing_penalty_misbehavior: u64,
#[prost(uint64, tag = "5")]
pub slashing_penalty_downtime: u64,
#[prost(uint64, tag = "6")]
pub signed_blocks_window_len: u64,
#[prost(uint64, tag = "7")]
pub missed_blocks_maximum: u64,
#[prost(message, optional, tag = "8")]
pub min_validator_stake: ::core::option::Option<
super::super::super::num::v1::Amount,
>,
#[prost(uint64, tag = "9")]
pub unbonding_delay: u64,
}
impl ::prost::Name for StakeParameters {
const NAME: &'static str = "StakeParameters";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenesisContent {
#[prost(message, optional, tag = "1")]
pub stake_params: ::core::option::Option<StakeParameters>,
#[prost(message, repeated, tag = "2")]
pub validators: ::prost::alloc::vec::Vec<Validator>,
}
impl ::prost::Name for GenesisContent {
const NAME: &'static str = "GenesisContent";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventTombstoneValidator {
#[prost(uint64, tag = "1")]
pub evidence_height: u64,
#[prost(uint64, tag = "2")]
pub current_height: u64,
#[prost(message, optional, tag = "4")]
pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
#[prost(bytes = "vec", tag = "5")]
pub address: ::prost::alloc::vec::Vec<u8>,
#[prost(uint64, tag = "6")]
pub voting_power: u64,
}
impl ::prost::Name for EventTombstoneValidator {
const NAME: &'static str = "EventTombstoneValidator";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventValidatorStateChange {
#[prost(message, optional, tag = "1")]
pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
#[prost(message, optional, tag = "2")]
pub state: ::core::option::Option<ValidatorState>,
}
impl ::prost::Name for EventValidatorStateChange {
const NAME: &'static str = "EventValidatorStateChange";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventValidatorVotingPowerChange {
#[prost(message, optional, tag = "1")]
pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
#[prost(message, optional, tag = "2")]
pub voting_power: ::core::option::Option<super::super::super::num::v1::Amount>,
}
impl ::prost::Name for EventValidatorVotingPowerChange {
const NAME: &'static str = "EventValidatorVotingPowerChange";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventValidatorBondingStateChange {
#[prost(message, optional, tag = "1")]
pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
#[prost(message, optional, tag = "2")]
pub bonding_state: ::core::option::Option<BondingState>,
}
impl ::prost::Name for EventValidatorBondingStateChange {
const NAME: &'static str = "EventValidatorBondingStateChange";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventRateDataChange {
#[prost(message, optional, tag = "1")]
pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
#[prost(message, optional, tag = "2")]
pub rate_data: ::core::option::Option<RateData>,
}
impl ::prost::Name for EventRateDataChange {
const NAME: &'static str = "EventRateDataChange";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventValidatorDefinitionUpload {
#[prost(message, optional, tag = "1")]
pub validator: ::core::option::Option<Validator>,
}
impl ::prost::Name for EventValidatorDefinitionUpload {
const NAME: &'static str = "EventValidatorDefinitionUpload";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventValidatorMissedBlock {
#[prost(message, optional, tag = "1")]
pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
}
impl ::prost::Name for EventValidatorMissedBlock {
const NAME: &'static str = "EventValidatorMissedBlock";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventDelegate {
#[prost(message, optional, tag = "1")]
pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
#[prost(message, optional, tag = "3")]
pub amount: ::core::option::Option<super::super::super::num::v1::Amount>,
}
impl ::prost::Name for EventDelegate {
const NAME: &'static str = "EventDelegate";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventUndelegate {
#[prost(message, optional, tag = "1")]
pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
#[prost(message, optional, tag = "3")]
pub amount: ::core::option::Option<super::super::super::num::v1::Amount>,
}
impl ::prost::Name for EventUndelegate {
const NAME: &'static str = "EventUndelegate";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventSlashingPenaltyApplied {
#[prost(message, optional, tag = "1")]
pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
#[prost(uint64, tag = "2")]
pub epoch_index: u64,
#[prost(message, optional, tag = "3")]
pub new_penalty: ::core::option::Option<Penalty>,
}
impl ::prost::Name for EventSlashingPenaltyApplied {
const NAME: &'static str = "EventSlashingPenaltyApplied";
const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.stake.v1.{}", Self::NAME)
}
}
#[cfg(feature = "rpc")]
pub mod query_service_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 QueryServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl QueryServiceClient<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> QueryServiceClient<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,
) -> QueryServiceClient<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,
{
QueryServiceClient::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 get_validator_info(
&mut self,
request: impl tonic::IntoRequest<super::GetValidatorInfoRequest>,
) -> std::result::Result<
tonic::Response<super::GetValidatorInfoResponse>,
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(
"/penumbra.core.component.stake.v1.QueryService/GetValidatorInfo",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"penumbra.core.component.stake.v1.QueryService",
"GetValidatorInfo",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn validator_info(
&mut self,
request: impl tonic::IntoRequest<super::ValidatorInfoRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::ValidatorInfoResponse>>,
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(
"/penumbra.core.component.stake.v1.QueryService/ValidatorInfo",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"penumbra.core.component.stake.v1.QueryService",
"ValidatorInfo",
),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn validator_status(
&mut self,
request: impl tonic::IntoRequest<super::ValidatorStatusRequest>,
) -> std::result::Result<
tonic::Response<super::ValidatorStatusResponse>,
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(
"/penumbra.core.component.stake.v1.QueryService/ValidatorStatus",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"penumbra.core.component.stake.v1.QueryService",
"ValidatorStatus",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn validator_penalty(
&mut self,
request: impl tonic::IntoRequest<super::ValidatorPenaltyRequest>,
) -> std::result::Result<
tonic::Response<super::ValidatorPenaltyResponse>,
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(
"/penumbra.core.component.stake.v1.QueryService/ValidatorPenalty",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"penumbra.core.component.stake.v1.QueryService",
"ValidatorPenalty",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn current_validator_rate(
&mut self,
request: impl tonic::IntoRequest<super::CurrentValidatorRateRequest>,
) -> std::result::Result<
tonic::Response<super::CurrentValidatorRateResponse>,
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(
"/penumbra.core.component.stake.v1.QueryService/CurrentValidatorRate",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"penumbra.core.component.stake.v1.QueryService",
"CurrentValidatorRate",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn validator_uptime(
&mut self,
request: impl tonic::IntoRequest<super::ValidatorUptimeRequest>,
) -> std::result::Result<
tonic::Response<super::ValidatorUptimeResponse>,
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(
"/penumbra.core.component.stake.v1.QueryService/ValidatorUptime",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"penumbra.core.component.stake.v1.QueryService",
"ValidatorUptime",
),
);
self.inner.unary(req, path, codec).await
}
}
}
#[cfg(feature = "rpc")]
pub mod query_service_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[async_trait]
pub trait QueryService: Send + Sync + 'static {
async fn get_validator_info(
&self,
request: tonic::Request<super::GetValidatorInfoRequest>,
) -> std::result::Result<
tonic::Response<super::GetValidatorInfoResponse>,
tonic::Status,
>;
type ValidatorInfoStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::ValidatorInfoResponse, tonic::Status>,
>
+ Send
+ 'static;
async fn validator_info(
&self,
request: tonic::Request<super::ValidatorInfoRequest>,
) -> std::result::Result<
tonic::Response<Self::ValidatorInfoStream>,
tonic::Status,
>;
async fn validator_status(
&self,
request: tonic::Request<super::ValidatorStatusRequest>,
) -> std::result::Result<
tonic::Response<super::ValidatorStatusResponse>,
tonic::Status,
>;
async fn validator_penalty(
&self,
request: tonic::Request<super::ValidatorPenaltyRequest>,
) -> std::result::Result<
tonic::Response<super::ValidatorPenaltyResponse>,
tonic::Status,
>;
async fn current_validator_rate(
&self,
request: tonic::Request<super::CurrentValidatorRateRequest>,
) -> std::result::Result<
tonic::Response<super::CurrentValidatorRateResponse>,
tonic::Status,
>;
async fn validator_uptime(
&self,
request: tonic::Request<super::ValidatorUptimeRequest>,
) -> std::result::Result<
tonic::Response<super::ValidatorUptimeResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct QueryServiceServer<T: QueryService> {
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: QueryService> QueryServiceServer<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 QueryServiceServer<T>
where
T: QueryService,
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() {
"/penumbra.core.component.stake.v1.QueryService/GetValidatorInfo" => {
#[allow(non_camel_case_types)]
struct GetValidatorInfoSvc<T: QueryService>(pub Arc<T>);
impl<
T: QueryService,
> tonic::server::UnaryService<super::GetValidatorInfoRequest>
for GetValidatorInfoSvc<T> {
type Response = super::GetValidatorInfoResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetValidatorInfoRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as QueryService>::get_validator_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 = GetValidatorInfoSvc(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)
}
"/penumbra.core.component.stake.v1.QueryService/ValidatorInfo" => {
#[allow(non_camel_case_types)]
struct ValidatorInfoSvc<T: QueryService>(pub Arc<T>);
impl<
T: QueryService,
> tonic::server::ServerStreamingService<super::ValidatorInfoRequest>
for ValidatorInfoSvc<T> {
type Response = super::ValidatorInfoResponse;
type ResponseStream = T::ValidatorInfoStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ValidatorInfoRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as QueryService>::validator_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 = ValidatorInfoSvc(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.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/penumbra.core.component.stake.v1.QueryService/ValidatorStatus" => {
#[allow(non_camel_case_types)]
struct ValidatorStatusSvc<T: QueryService>(pub Arc<T>);
impl<
T: QueryService,
> tonic::server::UnaryService<super::ValidatorStatusRequest>
for ValidatorStatusSvc<T> {
type Response = super::ValidatorStatusResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ValidatorStatusRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as QueryService>::validator_status(&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 = ValidatorStatusSvc(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)
}
"/penumbra.core.component.stake.v1.QueryService/ValidatorPenalty" => {
#[allow(non_camel_case_types)]
struct ValidatorPenaltySvc<T: QueryService>(pub Arc<T>);
impl<
T: QueryService,
> tonic::server::UnaryService<super::ValidatorPenaltyRequest>
for ValidatorPenaltySvc<T> {
type Response = super::ValidatorPenaltyResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ValidatorPenaltyRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as QueryService>::validator_penalty(&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 = ValidatorPenaltySvc(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)
}
"/penumbra.core.component.stake.v1.QueryService/CurrentValidatorRate" => {
#[allow(non_camel_case_types)]
struct CurrentValidatorRateSvc<T: QueryService>(pub Arc<T>);
impl<
T: QueryService,
> tonic::server::UnaryService<super::CurrentValidatorRateRequest>
for CurrentValidatorRateSvc<T> {
type Response = super::CurrentValidatorRateResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CurrentValidatorRateRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as QueryService>::current_validator_rate(&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 = CurrentValidatorRateSvc(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)
}
"/penumbra.core.component.stake.v1.QueryService/ValidatorUptime" => {
#[allow(non_camel_case_types)]
struct ValidatorUptimeSvc<T: QueryService>(pub Arc<T>);
impl<
T: QueryService,
> tonic::server::UnaryService<super::ValidatorUptimeRequest>
for ValidatorUptimeSvc<T> {
type Response = super::ValidatorUptimeResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ValidatorUptimeRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as QueryService>::validator_uptime(&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 = ValidatorUptimeSvc(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: QueryService> Clone for QueryServiceServer<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: QueryService> 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: QueryService> tonic::server::NamedService for QueryServiceServer<T> {
const NAME: &'static str = "penumbra.core.component.stake.v1.QueryService";
}
}