1#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct ZkUndelegateClaimProof {
5 #[prost(bytes = "vec", tag = "1")]
6 pub inner: ::prost::alloc::vec::Vec<u8>,
7}
8impl ::prost::Name for ZkUndelegateClaimProof {
9 const NAME: &'static str = "ZKUndelegateClaimProof";
10 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
11 fn full_name() -> ::prost::alloc::string::String {
12 "penumbra.core.component.stake.v1.ZKUndelegateClaimProof".into()
13 }
14 fn type_url() -> ::prost::alloc::string::String {
15 "/penumbra.core.component.stake.v1.ZKUndelegateClaimProof".into()
16 }
17}
18#[derive(Clone, PartialEq, ::prost::Message)]
20pub struct Validator {
21 #[prost(message, optional, tag = "1")]
23 pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
24 #[prost(bytes = "vec", tag = "2")]
26 pub consensus_key: ::prost::alloc::vec::Vec<u8>,
27 #[prost(string, tag = "3")]
29 pub name: ::prost::alloc::string::String,
30 #[prost(string, tag = "4")]
32 pub website: ::prost::alloc::string::String,
33 #[prost(string, tag = "5")]
35 pub description: ::prost::alloc::string::String,
36 #[prost(bool, tag = "8")]
40 pub enabled: bool,
41 #[prost(message, repeated, tag = "6")]
43 pub funding_streams: ::prost::alloc::vec::Vec<FundingStream>,
44 #[prost(uint32, tag = "7")]
48 pub sequence_number: u32,
49 #[prost(message, optional, tag = "9")]
51 pub governance_key: ::core::option::Option<
52 super::super::super::keys::v1::GovernanceKey,
53 >,
54}
55impl ::prost::Name for Validator {
56 const NAME: &'static str = "Validator";
57 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
58 fn full_name() -> ::prost::alloc::string::String {
59 "penumbra.core.component.stake.v1.Validator".into()
60 }
61 fn type_url() -> ::prost::alloc::string::String {
62 "/penumbra.core.component.stake.v1.Validator".into()
63 }
64}
65#[derive(Clone, PartialEq, ::prost::Message)]
67pub struct ValidatorList {
68 #[prost(message, repeated, tag = "1")]
69 pub validator_keys: ::prost::alloc::vec::Vec<
70 super::super::super::keys::v1::IdentityKey,
71 >,
72}
73impl ::prost::Name for ValidatorList {
74 const NAME: &'static str = "ValidatorList";
75 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
76 fn full_name() -> ::prost::alloc::string::String {
77 "penumbra.core.component.stake.v1.ValidatorList".into()
78 }
79 fn type_url() -> ::prost::alloc::string::String {
80 "/penumbra.core.component.stake.v1.ValidatorList".into()
81 }
82}
83#[derive(Clone, PartialEq, ::prost::Message)]
85pub struct FundingStream {
86 #[prost(oneof = "funding_stream::Recipient", tags = "1, 2")]
88 pub recipient: ::core::option::Option<funding_stream::Recipient>,
89}
90pub mod funding_stream {
92 #[derive(Clone, PartialEq, ::prost::Message)]
93 pub struct ToAddress {
94 #[prost(string, tag = "1")]
96 pub address: ::prost::alloc::string::String,
97 #[prost(uint32, tag = "2")]
100 pub rate_bps: u32,
101 }
102 impl ::prost::Name for ToAddress {
103 const NAME: &'static str = "ToAddress";
104 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
105 fn full_name() -> ::prost::alloc::string::String {
106 "penumbra.core.component.stake.v1.FundingStream.ToAddress".into()
107 }
108 fn type_url() -> ::prost::alloc::string::String {
109 "/penumbra.core.component.stake.v1.FundingStream.ToAddress".into()
110 }
111 }
112 #[derive(Clone, Copy, PartialEq, ::prost::Message)]
113 pub struct ToCommunityPool {
114 #[prost(uint32, tag = "2")]
117 pub rate_bps: u32,
118 }
119 impl ::prost::Name for ToCommunityPool {
120 const NAME: &'static str = "ToCommunityPool";
121 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
122 fn full_name() -> ::prost::alloc::string::String {
123 "penumbra.core.component.stake.v1.FundingStream.ToCommunityPool".into()
124 }
125 fn type_url() -> ::prost::alloc::string::String {
126 "/penumbra.core.component.stake.v1.FundingStream.ToCommunityPool".into()
127 }
128 }
129 #[derive(Clone, PartialEq, ::prost::Oneof)]
131 pub enum Recipient {
132 #[prost(message, tag = "1")]
133 ToAddress(ToAddress),
134 #[prost(message, tag = "2")]
135 ToCommunityPool(ToCommunityPool),
136 }
137}
138impl ::prost::Name for FundingStream {
139 const NAME: &'static str = "FundingStream";
140 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
141 fn full_name() -> ::prost::alloc::string::String {
142 "penumbra.core.component.stake.v1.FundingStream".into()
143 }
144 fn type_url() -> ::prost::alloc::string::String {
145 "/penumbra.core.component.stake.v1.FundingStream".into()
146 }
147}
148#[derive(Clone, PartialEq, ::prost::Message)]
150pub struct RateData {
151 #[prost(message, optional, tag = "1")]
152 pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
153 #[deprecated]
154 #[prost(uint64, tag = "2")]
155 pub epoch_index: u64,
156 #[prost(message, optional, tag = "4")]
157 pub validator_reward_rate: ::core::option::Option<
158 super::super::super::num::v1::Amount,
159 >,
160 #[prost(message, optional, tag = "5")]
165 pub validator_exchange_rate: ::core::option::Option<
166 super::super::super::num::v1::Amount,
167 >,
168}
169impl ::prost::Name for RateData {
170 const NAME: &'static str = "RateData";
171 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
172 fn full_name() -> ::prost::alloc::string::String {
173 "penumbra.core.component.stake.v1.RateData".into()
174 }
175 fn type_url() -> ::prost::alloc::string::String {
176 "/penumbra.core.component.stake.v1.RateData".into()
177 }
178}
179#[derive(Clone, Copy, PartialEq, ::prost::Message)]
181pub struct BaseRateData {
182 #[prost(uint64, tag = "1")]
183 pub epoch_index: u64,
184 #[prost(message, optional, tag = "2")]
185 pub base_reward_rate: ::core::option::Option<super::super::super::num::v1::Amount>,
186 #[prost(message, optional, tag = "3")]
187 pub base_exchange_rate: ::core::option::Option<super::super::super::num::v1::Amount>,
188}
189impl ::prost::Name for BaseRateData {
190 const NAME: &'static str = "BaseRateData";
191 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
192 fn full_name() -> ::prost::alloc::string::String {
193 "penumbra.core.component.stake.v1.BaseRateData".into()
194 }
195 fn type_url() -> ::prost::alloc::string::String {
196 "/penumbra.core.component.stake.v1.BaseRateData".into()
197 }
198}
199#[derive(Clone, PartialEq, ::prost::Message)]
201pub struct ValidatorStatus {
202 #[prost(message, optional, tag = "1")]
203 pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
204 #[prost(message, optional, tag = "2")]
205 pub state: ::core::option::Option<ValidatorState>,
206 #[prost(message, optional, tag = "3")]
207 pub voting_power: ::core::option::Option<super::super::super::num::v1::Amount>,
208 #[prost(message, optional, tag = "4")]
209 pub bonding_state: ::core::option::Option<BondingState>,
210}
211impl ::prost::Name for ValidatorStatus {
212 const NAME: &'static str = "ValidatorStatus";
213 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
214 fn full_name() -> ::prost::alloc::string::String {
215 "penumbra.core.component.stake.v1.ValidatorStatus".into()
216 }
217 fn type_url() -> ::prost::alloc::string::String {
218 "/penumbra.core.component.stake.v1.ValidatorStatus".into()
219 }
220}
221#[derive(Clone, Copy, PartialEq, ::prost::Message)]
223pub struct BondingState {
224 #[prost(enumeration = "bonding_state::BondingStateEnum", tag = "1")]
225 pub state: i32,
226 #[deprecated]
227 #[prost(uint64, tag = "2")]
228 pub unbonds_at_epoch: u64,
229 #[prost(uint64, tag = "3")]
230 pub unbonds_at_height: u64,
231}
232pub mod bonding_state {
234 #[derive(
235 Clone,
236 Copy,
237 Debug,
238 PartialEq,
239 Eq,
240 Hash,
241 PartialOrd,
242 Ord,
243 ::prost::Enumeration
244 )]
245 #[repr(i32)]
246 pub enum BondingStateEnum {
247 Unspecified = 0,
248 Bonded = 1,
249 Unbonding = 2,
250 Unbonded = 3,
251 }
252 impl BondingStateEnum {
253 pub fn as_str_name(&self) -> &'static str {
258 match self {
259 Self::Unspecified => "BONDING_STATE_ENUM_UNSPECIFIED",
260 Self::Bonded => "BONDING_STATE_ENUM_BONDED",
261 Self::Unbonding => "BONDING_STATE_ENUM_UNBONDING",
262 Self::Unbonded => "BONDING_STATE_ENUM_UNBONDED",
263 }
264 }
265 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
267 match value {
268 "BONDING_STATE_ENUM_UNSPECIFIED" => Some(Self::Unspecified),
269 "BONDING_STATE_ENUM_BONDED" => Some(Self::Bonded),
270 "BONDING_STATE_ENUM_UNBONDING" => Some(Self::Unbonding),
271 "BONDING_STATE_ENUM_UNBONDED" => Some(Self::Unbonded),
272 _ => None,
273 }
274 }
275 }
276}
277impl ::prost::Name for BondingState {
278 const NAME: &'static str = "BondingState";
279 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
280 fn full_name() -> ::prost::alloc::string::String {
281 "penumbra.core.component.stake.v1.BondingState".into()
282 }
283 fn type_url() -> ::prost::alloc::string::String {
284 "/penumbra.core.component.stake.v1.BondingState".into()
285 }
286}
287#[derive(Clone, Copy, PartialEq, ::prost::Message)]
289pub struct ValidatorState {
290 #[prost(enumeration = "validator_state::ValidatorStateEnum", tag = "1")]
291 pub state: i32,
292}
293pub mod validator_state {
295 #[derive(
296 Clone,
297 Copy,
298 Debug,
299 PartialEq,
300 Eq,
301 Hash,
302 PartialOrd,
303 Ord,
304 ::prost::Enumeration
305 )]
306 #[repr(i32)]
307 pub enum ValidatorStateEnum {
308 Unspecified = 0,
309 Defined = 1,
310 Inactive = 2,
311 Active = 3,
312 Jailed = 4,
313 Tombstoned = 5,
314 Disabled = 6,
315 }
316 impl ValidatorStateEnum {
317 pub fn as_str_name(&self) -> &'static str {
322 match self {
323 Self::Unspecified => "VALIDATOR_STATE_ENUM_UNSPECIFIED",
324 Self::Defined => "VALIDATOR_STATE_ENUM_DEFINED",
325 Self::Inactive => "VALIDATOR_STATE_ENUM_INACTIVE",
326 Self::Active => "VALIDATOR_STATE_ENUM_ACTIVE",
327 Self::Jailed => "VALIDATOR_STATE_ENUM_JAILED",
328 Self::Tombstoned => "VALIDATOR_STATE_ENUM_TOMBSTONED",
329 Self::Disabled => "VALIDATOR_STATE_ENUM_DISABLED",
330 }
331 }
332 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
334 match value {
335 "VALIDATOR_STATE_ENUM_UNSPECIFIED" => Some(Self::Unspecified),
336 "VALIDATOR_STATE_ENUM_DEFINED" => Some(Self::Defined),
337 "VALIDATOR_STATE_ENUM_INACTIVE" => Some(Self::Inactive),
338 "VALIDATOR_STATE_ENUM_ACTIVE" => Some(Self::Active),
339 "VALIDATOR_STATE_ENUM_JAILED" => Some(Self::Jailed),
340 "VALIDATOR_STATE_ENUM_TOMBSTONED" => Some(Self::Tombstoned),
341 "VALIDATOR_STATE_ENUM_DISABLED" => Some(Self::Disabled),
342 _ => None,
343 }
344 }
345 }
346}
347impl ::prost::Name for ValidatorState {
348 const NAME: &'static str = "ValidatorState";
349 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
350 fn full_name() -> ::prost::alloc::string::String {
351 "penumbra.core.component.stake.v1.ValidatorState".into()
352 }
353 fn type_url() -> ::prost::alloc::string::String {
354 "/penumbra.core.component.stake.v1.ValidatorState".into()
355 }
356}
357#[derive(Clone, PartialEq, ::prost::Message)]
359pub struct ValidatorInfo {
360 #[prost(message, optional, tag = "1")]
361 pub validator: ::core::option::Option<Validator>,
362 #[prost(message, optional, tag = "2")]
363 pub status: ::core::option::Option<ValidatorStatus>,
364 #[prost(message, optional, tag = "3")]
365 pub rate_data: ::core::option::Option<RateData>,
366}
367impl ::prost::Name for ValidatorInfo {
368 const NAME: &'static str = "ValidatorInfo";
369 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
370 fn full_name() -> ::prost::alloc::string::String {
371 "penumbra.core.component.stake.v1.ValidatorInfo".into()
372 }
373 fn type_url() -> ::prost::alloc::string::String {
374 "/penumbra.core.component.stake.v1.ValidatorInfo".into()
375 }
376}
377#[derive(Clone, PartialEq, ::prost::Message)]
379pub struct ValidatorDefinition {
380 #[prost(message, optional, tag = "1")]
382 pub validator: ::core::option::Option<Validator>,
383 #[prost(bytes = "vec", tag = "2")]
385 pub auth_sig: ::prost::alloc::vec::Vec<u8>,
386}
387impl ::prost::Name for ValidatorDefinition {
388 const NAME: &'static str = "ValidatorDefinition";
389 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
390 fn full_name() -> ::prost::alloc::string::String {
391 "penumbra.core.component.stake.v1.ValidatorDefinition".into()
392 }
393 fn type_url() -> ::prost::alloc::string::String {
394 "/penumbra.core.component.stake.v1.ValidatorDefinition".into()
395 }
396}
397#[derive(Clone, PartialEq, ::prost::Message)]
399pub struct Delegate {
400 #[prost(message, optional, tag = "1")]
402 pub validator_identity: ::core::option::Option<
403 super::super::super::keys::v1::IdentityKey,
404 >,
405 #[prost(uint64, tag = "2")]
408 pub epoch_index: u64,
409 #[prost(message, optional, tag = "3")]
412 pub unbonded_amount: ::core::option::Option<super::super::super::num::v1::Amount>,
413 #[prost(message, optional, tag = "4")]
419 pub delegation_amount: ::core::option::Option<super::super::super::num::v1::Amount>,
420}
421impl ::prost::Name for Delegate {
422 const NAME: &'static str = "Delegate";
423 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
424 fn full_name() -> ::prost::alloc::string::String {
425 "penumbra.core.component.stake.v1.Delegate".into()
426 }
427 fn type_url() -> ::prost::alloc::string::String {
428 "/penumbra.core.component.stake.v1.Delegate".into()
429 }
430}
431#[derive(Clone, PartialEq, ::prost::Message)]
433pub struct Undelegate {
434 #[prost(message, optional, tag = "1")]
436 pub validator_identity: ::core::option::Option<
437 super::super::super::keys::v1::IdentityKey,
438 >,
439 #[deprecated]
441 #[prost(uint64, tag = "2")]
442 pub start_epoch_index: u64,
443 #[prost(message, optional, tag = "3")]
445 pub unbonded_amount: ::core::option::Option<super::super::super::num::v1::Amount>,
446 #[prost(message, optional, tag = "4")]
452 pub delegation_amount: ::core::option::Option<super::super::super::num::v1::Amount>,
453 #[prost(message, optional, tag = "5")]
455 pub from_epoch: ::core::option::Option<super::super::sct::v1::Epoch>,
456}
457impl ::prost::Name for Undelegate {
458 const NAME: &'static str = "Undelegate";
459 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
460 fn full_name() -> ::prost::alloc::string::String {
461 "penumbra.core.component.stake.v1.Undelegate".into()
462 }
463 fn type_url() -> ::prost::alloc::string::String {
464 "/penumbra.core.component.stake.v1.Undelegate".into()
465 }
466}
467#[derive(Clone, PartialEq, ::prost::Message)]
470pub struct UndelegateClaim {
471 #[prost(message, optional, tag = "1")]
472 pub body: ::core::option::Option<UndelegateClaimBody>,
473 #[prost(bytes = "vec", tag = "2")]
474 pub proof: ::prost::alloc::vec::Vec<u8>,
475}
476impl ::prost::Name for UndelegateClaim {
477 const NAME: &'static str = "UndelegateClaim";
478 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
479 fn full_name() -> ::prost::alloc::string::String {
480 "penumbra.core.component.stake.v1.UndelegateClaim".into()
481 }
482 fn type_url() -> ::prost::alloc::string::String {
483 "/penumbra.core.component.stake.v1.UndelegateClaim".into()
484 }
485}
486#[derive(Clone, PartialEq, ::prost::Message)]
487pub struct UndelegateClaimBody {
488 #[prost(message, optional, tag = "1")]
490 pub validator_identity: ::core::option::Option<
491 super::super::super::keys::v1::IdentityKey,
492 >,
493 #[deprecated]
495 #[prost(uint64, tag = "2")]
496 pub start_epoch_index: u64,
497 #[prost(message, optional, tag = "3")]
500 pub penalty: ::core::option::Option<Penalty>,
501 #[prost(message, optional, tag = "4")]
503 pub balance_commitment: ::core::option::Option<
504 super::super::super::asset::v1::BalanceCommitment,
505 >,
506 #[prost(uint64, tag = "5")]
508 pub unbonding_start_height: u64,
509}
510impl ::prost::Name for UndelegateClaimBody {
511 const NAME: &'static str = "UndelegateClaimBody";
512 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
513 fn full_name() -> ::prost::alloc::string::String {
514 "penumbra.core.component.stake.v1.UndelegateClaimBody".into()
515 }
516 fn type_url() -> ::prost::alloc::string::String {
517 "/penumbra.core.component.stake.v1.UndelegateClaimBody".into()
518 }
519}
520#[derive(Clone, PartialEq, ::prost::Message)]
521pub struct UndelegateClaimPlan {
522 #[prost(message, optional, tag = "1")]
524 pub validator_identity: ::core::option::Option<
525 super::super::super::keys::v1::IdentityKey,
526 >,
527 #[deprecated]
529 #[prost(uint64, tag = "2")]
530 pub start_epoch_index: u64,
531 #[prost(message, optional, tag = "4")]
534 pub penalty: ::core::option::Option<Penalty>,
535 #[prost(message, optional, tag = "5")]
538 pub unbonding_amount: ::core::option::Option<super::super::super::num::v1::Amount>,
539 #[prost(bytes = "vec", tag = "6")]
541 pub balance_blinding: ::prost::alloc::vec::Vec<u8>,
542 #[prost(bytes = "vec", tag = "7")]
544 pub proof_blinding_r: ::prost::alloc::vec::Vec<u8>,
545 #[prost(bytes = "vec", tag = "8")]
547 pub proof_blinding_s: ::prost::alloc::vec::Vec<u8>,
548 #[prost(uint64, tag = "9")]
550 pub unbonding_start_height: u64,
551}
552impl ::prost::Name for UndelegateClaimPlan {
553 const NAME: &'static str = "UndelegateClaimPlan";
554 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
555 fn full_name() -> ::prost::alloc::string::String {
556 "penumbra.core.component.stake.v1.UndelegateClaimPlan".into()
557 }
558 fn type_url() -> ::prost::alloc::string::String {
559 "/penumbra.core.component.stake.v1.UndelegateClaimPlan".into()
560 }
561}
562#[derive(Clone, PartialEq, ::prost::Message)]
564pub struct DelegationChanges {
565 #[prost(message, repeated, tag = "1")]
566 pub delegations: ::prost::alloc::vec::Vec<Delegate>,
567 #[prost(message, repeated, tag = "2")]
568 pub undelegations: ::prost::alloc::vec::Vec<Undelegate>,
569}
570impl ::prost::Name for DelegationChanges {
571 const NAME: &'static str = "DelegationChanges";
572 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
573 fn full_name() -> ::prost::alloc::string::String {
574 "penumbra.core.component.stake.v1.DelegationChanges".into()
575 }
576 fn type_url() -> ::prost::alloc::string::String {
577 "/penumbra.core.component.stake.v1.DelegationChanges".into()
578 }
579}
580#[derive(Clone, PartialEq, ::prost::Message)]
582pub struct Uptime {
583 #[prost(uint64, tag = "1")]
584 pub as_of_block_height: u64,
585 #[prost(uint32, tag = "2")]
586 pub window_len: u32,
587 #[prost(bytes = "vec", tag = "3")]
588 pub bitvec: ::prost::alloc::vec::Vec<u8>,
589}
590impl ::prost::Name for Uptime {
591 const NAME: &'static str = "Uptime";
592 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
593 fn full_name() -> ::prost::alloc::string::String {
594 "penumbra.core.component.stake.v1.Uptime".into()
595 }
596 fn type_url() -> ::prost::alloc::string::String {
597 "/penumbra.core.component.stake.v1.Uptime".into()
598 }
599}
600#[derive(Clone, PartialEq, ::prost::Message)]
603pub struct CurrentConsensusKeys {
604 #[prost(message, repeated, tag = "1")]
605 pub consensus_keys: ::prost::alloc::vec::Vec<
606 super::super::super::keys::v1::ConsensusKey,
607 >,
608}
609impl ::prost::Name for CurrentConsensusKeys {
610 const NAME: &'static str = "CurrentConsensusKeys";
611 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
612 fn full_name() -> ::prost::alloc::string::String {
613 "penumbra.core.component.stake.v1.CurrentConsensusKeys".into()
614 }
615 fn type_url() -> ::prost::alloc::string::String {
616 "/penumbra.core.component.stake.v1.CurrentConsensusKeys".into()
617 }
618}
619#[derive(Clone, PartialEq, ::prost::Message)]
621pub struct Penalty {
622 #[prost(bytes = "vec", tag = "1")]
623 pub inner: ::prost::alloc::vec::Vec<u8>,
624}
625impl ::prost::Name for Penalty {
626 const NAME: &'static str = "Penalty";
627 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
628 fn full_name() -> ::prost::alloc::string::String {
629 "penumbra.core.component.stake.v1.Penalty".into()
630 }
631 fn type_url() -> ::prost::alloc::string::String {
632 "/penumbra.core.component.stake.v1.Penalty".into()
633 }
634}
635#[derive(Clone, PartialEq, ::prost::Message)]
637pub struct GetValidatorInfoRequest {
638 #[prost(message, optional, tag = "2")]
640 pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
641}
642impl ::prost::Name for GetValidatorInfoRequest {
643 const NAME: &'static str = "GetValidatorInfoRequest";
644 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
645 fn full_name() -> ::prost::alloc::string::String {
646 "penumbra.core.component.stake.v1.GetValidatorInfoRequest".into()
647 }
648 fn type_url() -> ::prost::alloc::string::String {
649 "/penumbra.core.component.stake.v1.GetValidatorInfoRequest".into()
650 }
651}
652#[derive(Clone, PartialEq, ::prost::Message)]
653pub struct GetValidatorInfoResponse {
654 #[prost(message, optional, tag = "1")]
655 pub validator_info: ::core::option::Option<ValidatorInfo>,
656}
657impl ::prost::Name for GetValidatorInfoResponse {
658 const NAME: &'static str = "GetValidatorInfoResponse";
659 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
660 fn full_name() -> ::prost::alloc::string::String {
661 "penumbra.core.component.stake.v1.GetValidatorInfoResponse".into()
662 }
663 fn type_url() -> ::prost::alloc::string::String {
664 "/penumbra.core.component.stake.v1.GetValidatorInfoResponse".into()
665 }
666}
667#[derive(Clone, Copy, PartialEq, ::prost::Message)]
669pub struct ValidatorInfoRequest {
670 #[prost(bool, tag = "2")]
672 pub show_inactive: bool,
673}
674impl ::prost::Name for ValidatorInfoRequest {
675 const NAME: &'static str = "ValidatorInfoRequest";
676 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
677 fn full_name() -> ::prost::alloc::string::String {
678 "penumbra.core.component.stake.v1.ValidatorInfoRequest".into()
679 }
680 fn type_url() -> ::prost::alloc::string::String {
681 "/penumbra.core.component.stake.v1.ValidatorInfoRequest".into()
682 }
683}
684#[derive(Clone, PartialEq, ::prost::Message)]
685pub struct ValidatorInfoResponse {
686 #[prost(message, optional, tag = "1")]
687 pub validator_info: ::core::option::Option<ValidatorInfo>,
688}
689impl ::prost::Name for ValidatorInfoResponse {
690 const NAME: &'static str = "ValidatorInfoResponse";
691 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
692 fn full_name() -> ::prost::alloc::string::String {
693 "penumbra.core.component.stake.v1.ValidatorInfoResponse".into()
694 }
695 fn type_url() -> ::prost::alloc::string::String {
696 "/penumbra.core.component.stake.v1.ValidatorInfoResponse".into()
697 }
698}
699#[derive(Clone, PartialEq, ::prost::Message)]
700pub struct ValidatorStatusRequest {
701 #[prost(message, optional, tag = "2")]
702 pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
703}
704impl ::prost::Name for ValidatorStatusRequest {
705 const NAME: &'static str = "ValidatorStatusRequest";
706 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
707 fn full_name() -> ::prost::alloc::string::String {
708 "penumbra.core.component.stake.v1.ValidatorStatusRequest".into()
709 }
710 fn type_url() -> ::prost::alloc::string::String {
711 "/penumbra.core.component.stake.v1.ValidatorStatusRequest".into()
712 }
713}
714#[derive(Clone, PartialEq, ::prost::Message)]
715pub struct ValidatorStatusResponse {
716 #[prost(message, optional, tag = "1")]
717 pub status: ::core::option::Option<ValidatorStatus>,
718}
719impl ::prost::Name for ValidatorStatusResponse {
720 const NAME: &'static str = "ValidatorStatusResponse";
721 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
722 fn full_name() -> ::prost::alloc::string::String {
723 "penumbra.core.component.stake.v1.ValidatorStatusResponse".into()
724 }
725 fn type_url() -> ::prost::alloc::string::String {
726 "/penumbra.core.component.stake.v1.ValidatorStatusResponse".into()
727 }
728}
729#[derive(Clone, PartialEq, ::prost::Message)]
731pub struct ValidatorPenaltyRequest {
732 #[prost(message, optional, tag = "2")]
733 pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
734 #[prost(uint64, tag = "3")]
735 pub start_epoch_index: u64,
736 #[prost(uint64, tag = "4")]
737 pub end_epoch_index: u64,
738}
739impl ::prost::Name for ValidatorPenaltyRequest {
740 const NAME: &'static str = "ValidatorPenaltyRequest";
741 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
742 fn full_name() -> ::prost::alloc::string::String {
743 "penumbra.core.component.stake.v1.ValidatorPenaltyRequest".into()
744 }
745 fn type_url() -> ::prost::alloc::string::String {
746 "/penumbra.core.component.stake.v1.ValidatorPenaltyRequest".into()
747 }
748}
749#[derive(Clone, PartialEq, ::prost::Message)]
750pub struct ValidatorPenaltyResponse {
751 #[prost(message, optional, tag = "1")]
752 pub penalty: ::core::option::Option<Penalty>,
753}
754impl ::prost::Name for ValidatorPenaltyResponse {
755 const NAME: &'static str = "ValidatorPenaltyResponse";
756 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
757 fn full_name() -> ::prost::alloc::string::String {
758 "penumbra.core.component.stake.v1.ValidatorPenaltyResponse".into()
759 }
760 fn type_url() -> ::prost::alloc::string::String {
761 "/penumbra.core.component.stake.v1.ValidatorPenaltyResponse".into()
762 }
763}
764#[derive(Clone, PartialEq, ::prost::Message)]
765pub struct CurrentValidatorRateRequest {
766 #[prost(message, optional, tag = "2")]
767 pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
768}
769impl ::prost::Name for CurrentValidatorRateRequest {
770 const NAME: &'static str = "CurrentValidatorRateRequest";
771 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
772 fn full_name() -> ::prost::alloc::string::String {
773 "penumbra.core.component.stake.v1.CurrentValidatorRateRequest".into()
774 }
775 fn type_url() -> ::prost::alloc::string::String {
776 "/penumbra.core.component.stake.v1.CurrentValidatorRateRequest".into()
777 }
778}
779#[derive(Clone, PartialEq, ::prost::Message)]
780pub struct CurrentValidatorRateResponse {
781 #[prost(message, optional, tag = "1")]
782 pub data: ::core::option::Option<RateData>,
783}
784impl ::prost::Name for CurrentValidatorRateResponse {
785 const NAME: &'static str = "CurrentValidatorRateResponse";
786 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
787 fn full_name() -> ::prost::alloc::string::String {
788 "penumbra.core.component.stake.v1.CurrentValidatorRateResponse".into()
789 }
790 fn type_url() -> ::prost::alloc::string::String {
791 "/penumbra.core.component.stake.v1.CurrentValidatorRateResponse".into()
792 }
793}
794#[derive(Clone, PartialEq, ::prost::Message)]
795pub struct ValidatorUptimeRequest {
796 #[prost(message, optional, tag = "2")]
797 pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
798}
799impl ::prost::Name for ValidatorUptimeRequest {
800 const NAME: &'static str = "ValidatorUptimeRequest";
801 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
802 fn full_name() -> ::prost::alloc::string::String {
803 "penumbra.core.component.stake.v1.ValidatorUptimeRequest".into()
804 }
805 fn type_url() -> ::prost::alloc::string::String {
806 "/penumbra.core.component.stake.v1.ValidatorUptimeRequest".into()
807 }
808}
809#[derive(Clone, PartialEq, ::prost::Message)]
810pub struct ValidatorUptimeResponse {
811 #[prost(message, optional, tag = "1")]
812 pub uptime: ::core::option::Option<Uptime>,
813}
814impl ::prost::Name for ValidatorUptimeResponse {
815 const NAME: &'static str = "ValidatorUptimeResponse";
816 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
817 fn full_name() -> ::prost::alloc::string::String {
818 "penumbra.core.component.stake.v1.ValidatorUptimeResponse".into()
819 }
820 fn type_url() -> ::prost::alloc::string::String {
821 "/penumbra.core.component.stake.v1.ValidatorUptimeResponse".into()
822 }
823}
824#[derive(Clone, Copy, PartialEq, ::prost::Message)]
826pub struct StakeParameters {
827 #[deprecated]
829 #[prost(uint64, tag = "1")]
830 pub unbonding_epochs: u64,
831 #[prost(uint64, tag = "2")]
833 pub active_validator_limit: u64,
834 #[deprecated]
836 #[prost(uint64, tag = "3")]
837 pub base_reward_rate: u64,
838 #[prost(uint64, tag = "4")]
840 pub slashing_penalty_misbehavior: u64,
841 #[prost(uint64, tag = "5")]
843 pub slashing_penalty_downtime: u64,
844 #[prost(uint64, tag = "6")]
846 pub signed_blocks_window_len: u64,
847 #[prost(uint64, tag = "7")]
849 pub missed_blocks_maximum: u64,
850 #[prost(message, optional, tag = "8")]
852 pub min_validator_stake: ::core::option::Option<
853 super::super::super::num::v1::Amount,
854 >,
855 #[prost(uint64, tag = "9")]
857 pub unbonding_delay: u64,
858}
859impl ::prost::Name for StakeParameters {
860 const NAME: &'static str = "StakeParameters";
861 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
862 fn full_name() -> ::prost::alloc::string::String {
863 "penumbra.core.component.stake.v1.StakeParameters".into()
864 }
865 fn type_url() -> ::prost::alloc::string::String {
866 "/penumbra.core.component.stake.v1.StakeParameters".into()
867 }
868}
869#[derive(Clone, PartialEq, ::prost::Message)]
871pub struct GenesisContent {
872 #[prost(message, optional, tag = "1")]
874 pub stake_params: ::core::option::Option<StakeParameters>,
875 #[prost(message, repeated, tag = "2")]
877 pub validators: ::prost::alloc::vec::Vec<Validator>,
878}
879impl ::prost::Name for GenesisContent {
880 const NAME: &'static str = "GenesisContent";
881 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
882 fn full_name() -> ::prost::alloc::string::String {
883 "penumbra.core.component.stake.v1.GenesisContent".into()
884 }
885 fn type_url() -> ::prost::alloc::string::String {
886 "/penumbra.core.component.stake.v1.GenesisContent".into()
887 }
888}
889#[derive(Clone, PartialEq, ::prost::Message)]
890pub struct EventTombstoneValidator {
891 #[prost(uint64, tag = "1")]
893 pub evidence_height: u64,
894 #[prost(uint64, tag = "2")]
896 pub current_height: u64,
897 #[prost(message, optional, tag = "4")]
899 pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
900 #[prost(bytes = "vec", tag = "5")]
902 pub address: ::prost::alloc::vec::Vec<u8>,
903 #[prost(uint64, tag = "6")]
905 pub voting_power: u64,
906}
907impl ::prost::Name for EventTombstoneValidator {
908 const NAME: &'static str = "EventTombstoneValidator";
909 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
910 fn full_name() -> ::prost::alloc::string::String {
911 "penumbra.core.component.stake.v1.EventTombstoneValidator".into()
912 }
913 fn type_url() -> ::prost::alloc::string::String {
914 "/penumbra.core.component.stake.v1.EventTombstoneValidator".into()
915 }
916}
917#[derive(Clone, PartialEq, ::prost::Message)]
918pub struct EventValidatorStateChange {
919 #[prost(message, optional, tag = "1")]
921 pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
922 #[prost(message, optional, tag = "2")]
924 pub state: ::core::option::Option<ValidatorState>,
925}
926impl ::prost::Name for EventValidatorStateChange {
927 const NAME: &'static str = "EventValidatorStateChange";
928 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
929 fn full_name() -> ::prost::alloc::string::String {
930 "penumbra.core.component.stake.v1.EventValidatorStateChange".into()
931 }
932 fn type_url() -> ::prost::alloc::string::String {
933 "/penumbra.core.component.stake.v1.EventValidatorStateChange".into()
934 }
935}
936#[derive(Clone, PartialEq, ::prost::Message)]
937pub struct EventValidatorVotingPowerChange {
938 #[prost(message, optional, tag = "1")]
940 pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
941 #[prost(message, optional, tag = "2")]
943 pub voting_power: ::core::option::Option<super::super::super::num::v1::Amount>,
944}
945impl ::prost::Name for EventValidatorVotingPowerChange {
946 const NAME: &'static str = "EventValidatorVotingPowerChange";
947 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
948 fn full_name() -> ::prost::alloc::string::String {
949 "penumbra.core.component.stake.v1.EventValidatorVotingPowerChange".into()
950 }
951 fn type_url() -> ::prost::alloc::string::String {
952 "/penumbra.core.component.stake.v1.EventValidatorVotingPowerChange".into()
953 }
954}
955#[derive(Clone, PartialEq, ::prost::Message)]
956pub struct EventValidatorBondingStateChange {
957 #[prost(message, optional, tag = "1")]
959 pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
960 #[prost(message, optional, tag = "2")]
962 pub bonding_state: ::core::option::Option<BondingState>,
963}
964impl ::prost::Name for EventValidatorBondingStateChange {
965 const NAME: &'static str = "EventValidatorBondingStateChange";
966 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
967 fn full_name() -> ::prost::alloc::string::String {
968 "penumbra.core.component.stake.v1.EventValidatorBondingStateChange".into()
969 }
970 fn type_url() -> ::prost::alloc::string::String {
971 "/penumbra.core.component.stake.v1.EventValidatorBondingStateChange".into()
972 }
973}
974#[derive(Clone, PartialEq, ::prost::Message)]
975pub struct EventRateDataChange {
976 #[prost(message, optional, tag = "1")]
978 pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
979 #[prost(message, optional, tag = "2")]
981 pub rate_data: ::core::option::Option<RateData>,
982}
983impl ::prost::Name for EventRateDataChange {
984 const NAME: &'static str = "EventRateDataChange";
985 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
986 fn full_name() -> ::prost::alloc::string::String {
987 "penumbra.core.component.stake.v1.EventRateDataChange".into()
988 }
989 fn type_url() -> ::prost::alloc::string::String {
990 "/penumbra.core.component.stake.v1.EventRateDataChange".into()
991 }
992}
993#[derive(Clone, PartialEq, ::prost::Message)]
994pub struct EventValidatorDefinitionUpload {
995 #[prost(message, optional, tag = "1")]
997 pub validator: ::core::option::Option<Validator>,
998}
999impl ::prost::Name for EventValidatorDefinitionUpload {
1000 const NAME: &'static str = "EventValidatorDefinitionUpload";
1001 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
1002 fn full_name() -> ::prost::alloc::string::String {
1003 "penumbra.core.component.stake.v1.EventValidatorDefinitionUpload".into()
1004 }
1005 fn type_url() -> ::prost::alloc::string::String {
1006 "/penumbra.core.component.stake.v1.EventValidatorDefinitionUpload".into()
1007 }
1008}
1009#[derive(Clone, PartialEq, ::prost::Message)]
1010pub struct EventValidatorMissedBlock {
1011 #[prost(message, optional, tag = "1")]
1013 pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
1014}
1015impl ::prost::Name for EventValidatorMissedBlock {
1016 const NAME: &'static str = "EventValidatorMissedBlock";
1017 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
1018 fn full_name() -> ::prost::alloc::string::String {
1019 "penumbra.core.component.stake.v1.EventValidatorMissedBlock".into()
1020 }
1021 fn type_url() -> ::prost::alloc::string::String {
1022 "/penumbra.core.component.stake.v1.EventValidatorMissedBlock".into()
1023 }
1024}
1025#[derive(Clone, PartialEq, ::prost::Message)]
1026pub struct EventDelegate {
1027 #[prost(message, optional, tag = "1")]
1029 pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
1030 #[prost(message, optional, tag = "3")]
1032 pub amount: ::core::option::Option<super::super::super::num::v1::Amount>,
1033}
1034impl ::prost::Name for EventDelegate {
1035 const NAME: &'static str = "EventDelegate";
1036 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
1037 fn full_name() -> ::prost::alloc::string::String {
1038 "penumbra.core.component.stake.v1.EventDelegate".into()
1039 }
1040 fn type_url() -> ::prost::alloc::string::String {
1041 "/penumbra.core.component.stake.v1.EventDelegate".into()
1042 }
1043}
1044#[derive(Clone, PartialEq, ::prost::Message)]
1045pub struct EventUndelegate {
1046 #[prost(message, optional, tag = "1")]
1048 pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
1049 #[prost(message, optional, tag = "3")]
1051 pub amount: ::core::option::Option<super::super::super::num::v1::Amount>,
1052}
1053impl ::prost::Name for EventUndelegate {
1054 const NAME: &'static str = "EventUndelegate";
1055 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
1056 fn full_name() -> ::prost::alloc::string::String {
1057 "penumbra.core.component.stake.v1.EventUndelegate".into()
1058 }
1059 fn type_url() -> ::prost::alloc::string::String {
1060 "/penumbra.core.component.stake.v1.EventUndelegate".into()
1061 }
1062}
1063#[derive(Clone, PartialEq, ::prost::Message)]
1065pub struct EventSlashingPenaltyApplied {
1066 #[prost(message, optional, tag = "1")]
1068 pub identity_key: ::core::option::Option<super::super::super::keys::v1::IdentityKey>,
1069 #[prost(uint64, tag = "2")]
1071 pub epoch_index: u64,
1072 #[prost(message, optional, tag = "3")]
1074 pub new_penalty: ::core::option::Option<Penalty>,
1075}
1076impl ::prost::Name for EventSlashingPenaltyApplied {
1077 const NAME: &'static str = "EventSlashingPenaltyApplied";
1078 const PACKAGE: &'static str = "penumbra.core.component.stake.v1";
1079 fn full_name() -> ::prost::alloc::string::String {
1080 "penumbra.core.component.stake.v1.EventSlashingPenaltyApplied".into()
1081 }
1082 fn type_url() -> ::prost::alloc::string::String {
1083 "/penumbra.core.component.stake.v1.EventSlashingPenaltyApplied".into()
1084 }
1085}
1086#[cfg(feature = "rpc")]
1088pub mod query_service_client {
1089 #![allow(
1090 unused_variables,
1091 dead_code,
1092 missing_docs,
1093 clippy::wildcard_imports,
1094 clippy::let_unit_value,
1095 )]
1096 use tonic::codegen::*;
1097 use tonic::codegen::http::Uri;
1098 #[derive(Debug, Clone)]
1100 pub struct QueryServiceClient<T> {
1101 inner: tonic::client::Grpc<T>,
1102 }
1103 impl QueryServiceClient<tonic::transport::Channel> {
1104 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1106 where
1107 D: TryInto<tonic::transport::Endpoint>,
1108 D::Error: Into<StdError>,
1109 {
1110 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1111 Ok(Self::new(conn))
1112 }
1113 }
1114 impl<T> QueryServiceClient<T>
1115 where
1116 T: tonic::client::GrpcService<tonic::body::BoxBody>,
1117 T::Error: Into<StdError>,
1118 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1119 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1120 {
1121 pub fn new(inner: T) -> Self {
1122 let inner = tonic::client::Grpc::new(inner);
1123 Self { inner }
1124 }
1125 pub fn with_origin(inner: T, origin: Uri) -> Self {
1126 let inner = tonic::client::Grpc::with_origin(inner, origin);
1127 Self { inner }
1128 }
1129 pub fn with_interceptor<F>(
1130 inner: T,
1131 interceptor: F,
1132 ) -> QueryServiceClient<InterceptedService<T, F>>
1133 where
1134 F: tonic::service::Interceptor,
1135 T::ResponseBody: Default,
1136 T: tonic::codegen::Service<
1137 http::Request<tonic::body::BoxBody>,
1138 Response = http::Response<
1139 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
1140 >,
1141 >,
1142 <T as tonic::codegen::Service<
1143 http::Request<tonic::body::BoxBody>,
1144 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1145 {
1146 QueryServiceClient::new(InterceptedService::new(inner, interceptor))
1147 }
1148 #[must_use]
1153 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1154 self.inner = self.inner.send_compressed(encoding);
1155 self
1156 }
1157 #[must_use]
1159 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1160 self.inner = self.inner.accept_compressed(encoding);
1161 self
1162 }
1163 #[must_use]
1167 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1168 self.inner = self.inner.max_decoding_message_size(limit);
1169 self
1170 }
1171 #[must_use]
1175 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1176 self.inner = self.inner.max_encoding_message_size(limit);
1177 self
1178 }
1179 pub async fn get_validator_info(
1181 &mut self,
1182 request: impl tonic::IntoRequest<super::GetValidatorInfoRequest>,
1183 ) -> std::result::Result<
1184 tonic::Response<super::GetValidatorInfoResponse>,
1185 tonic::Status,
1186 > {
1187 self.inner
1188 .ready()
1189 .await
1190 .map_err(|e| {
1191 tonic::Status::unknown(
1192 format!("Service was not ready: {}", e.into()),
1193 )
1194 })?;
1195 let codec = tonic::codec::ProstCodec::default();
1196 let path = http::uri::PathAndQuery::from_static(
1197 "/penumbra.core.component.stake.v1.QueryService/GetValidatorInfo",
1198 );
1199 let mut req = request.into_request();
1200 req.extensions_mut()
1201 .insert(
1202 GrpcMethod::new(
1203 "penumbra.core.component.stake.v1.QueryService",
1204 "GetValidatorInfo",
1205 ),
1206 );
1207 self.inner.unary(req, path, codec).await
1208 }
1209 pub async fn validator_info(
1211 &mut self,
1212 request: impl tonic::IntoRequest<super::ValidatorInfoRequest>,
1213 ) -> std::result::Result<
1214 tonic::Response<tonic::codec::Streaming<super::ValidatorInfoResponse>>,
1215 tonic::Status,
1216 > {
1217 self.inner
1218 .ready()
1219 .await
1220 .map_err(|e| {
1221 tonic::Status::unknown(
1222 format!("Service was not ready: {}", e.into()),
1223 )
1224 })?;
1225 let codec = tonic::codec::ProstCodec::default();
1226 let path = http::uri::PathAndQuery::from_static(
1227 "/penumbra.core.component.stake.v1.QueryService/ValidatorInfo",
1228 );
1229 let mut req = request.into_request();
1230 req.extensions_mut()
1231 .insert(
1232 GrpcMethod::new(
1233 "penumbra.core.component.stake.v1.QueryService",
1234 "ValidatorInfo",
1235 ),
1236 );
1237 self.inner.server_streaming(req, path, codec).await
1238 }
1239 pub async fn validator_status(
1240 &mut self,
1241 request: impl tonic::IntoRequest<super::ValidatorStatusRequest>,
1242 ) -> std::result::Result<
1243 tonic::Response<super::ValidatorStatusResponse>,
1244 tonic::Status,
1245 > {
1246 self.inner
1247 .ready()
1248 .await
1249 .map_err(|e| {
1250 tonic::Status::unknown(
1251 format!("Service was not ready: {}", e.into()),
1252 )
1253 })?;
1254 let codec = tonic::codec::ProstCodec::default();
1255 let path = http::uri::PathAndQuery::from_static(
1256 "/penumbra.core.component.stake.v1.QueryService/ValidatorStatus",
1257 );
1258 let mut req = request.into_request();
1259 req.extensions_mut()
1260 .insert(
1261 GrpcMethod::new(
1262 "penumbra.core.component.stake.v1.QueryService",
1263 "ValidatorStatus",
1264 ),
1265 );
1266 self.inner.unary(req, path, codec).await
1267 }
1268 pub async fn validator_penalty(
1269 &mut self,
1270 request: impl tonic::IntoRequest<super::ValidatorPenaltyRequest>,
1271 ) -> std::result::Result<
1272 tonic::Response<super::ValidatorPenaltyResponse>,
1273 tonic::Status,
1274 > {
1275 self.inner
1276 .ready()
1277 .await
1278 .map_err(|e| {
1279 tonic::Status::unknown(
1280 format!("Service was not ready: {}", e.into()),
1281 )
1282 })?;
1283 let codec = tonic::codec::ProstCodec::default();
1284 let path = http::uri::PathAndQuery::from_static(
1285 "/penumbra.core.component.stake.v1.QueryService/ValidatorPenalty",
1286 );
1287 let mut req = request.into_request();
1288 req.extensions_mut()
1289 .insert(
1290 GrpcMethod::new(
1291 "penumbra.core.component.stake.v1.QueryService",
1292 "ValidatorPenalty",
1293 ),
1294 );
1295 self.inner.unary(req, path, codec).await
1296 }
1297 pub async fn current_validator_rate(
1298 &mut self,
1299 request: impl tonic::IntoRequest<super::CurrentValidatorRateRequest>,
1300 ) -> std::result::Result<
1301 tonic::Response<super::CurrentValidatorRateResponse>,
1302 tonic::Status,
1303 > {
1304 self.inner
1305 .ready()
1306 .await
1307 .map_err(|e| {
1308 tonic::Status::unknown(
1309 format!("Service was not ready: {}", e.into()),
1310 )
1311 })?;
1312 let codec = tonic::codec::ProstCodec::default();
1313 let path = http::uri::PathAndQuery::from_static(
1314 "/penumbra.core.component.stake.v1.QueryService/CurrentValidatorRate",
1315 );
1316 let mut req = request.into_request();
1317 req.extensions_mut()
1318 .insert(
1319 GrpcMethod::new(
1320 "penumbra.core.component.stake.v1.QueryService",
1321 "CurrentValidatorRate",
1322 ),
1323 );
1324 self.inner.unary(req, path, codec).await
1325 }
1326 pub async fn validator_uptime(
1327 &mut self,
1328 request: impl tonic::IntoRequest<super::ValidatorUptimeRequest>,
1329 ) -> std::result::Result<
1330 tonic::Response<super::ValidatorUptimeResponse>,
1331 tonic::Status,
1332 > {
1333 self.inner
1334 .ready()
1335 .await
1336 .map_err(|e| {
1337 tonic::Status::unknown(
1338 format!("Service was not ready: {}", e.into()),
1339 )
1340 })?;
1341 let codec = tonic::codec::ProstCodec::default();
1342 let path = http::uri::PathAndQuery::from_static(
1343 "/penumbra.core.component.stake.v1.QueryService/ValidatorUptime",
1344 );
1345 let mut req = request.into_request();
1346 req.extensions_mut()
1347 .insert(
1348 GrpcMethod::new(
1349 "penumbra.core.component.stake.v1.QueryService",
1350 "ValidatorUptime",
1351 ),
1352 );
1353 self.inner.unary(req, path, codec).await
1354 }
1355 }
1356}
1357#[cfg(feature = "rpc")]
1359pub mod query_service_server {
1360 #![allow(
1361 unused_variables,
1362 dead_code,
1363 missing_docs,
1364 clippy::wildcard_imports,
1365 clippy::let_unit_value,
1366 )]
1367 use tonic::codegen::*;
1368 #[async_trait]
1370 pub trait QueryService: std::marker::Send + std::marker::Sync + 'static {
1371 async fn get_validator_info(
1373 &self,
1374 request: tonic::Request<super::GetValidatorInfoRequest>,
1375 ) -> std::result::Result<
1376 tonic::Response<super::GetValidatorInfoResponse>,
1377 tonic::Status,
1378 >;
1379 type ValidatorInfoStream: tonic::codegen::tokio_stream::Stream<
1381 Item = std::result::Result<super::ValidatorInfoResponse, tonic::Status>,
1382 >
1383 + std::marker::Send
1384 + 'static;
1385 async fn validator_info(
1387 &self,
1388 request: tonic::Request<super::ValidatorInfoRequest>,
1389 ) -> std::result::Result<
1390 tonic::Response<Self::ValidatorInfoStream>,
1391 tonic::Status,
1392 >;
1393 async fn validator_status(
1394 &self,
1395 request: tonic::Request<super::ValidatorStatusRequest>,
1396 ) -> std::result::Result<
1397 tonic::Response<super::ValidatorStatusResponse>,
1398 tonic::Status,
1399 >;
1400 async fn validator_penalty(
1401 &self,
1402 request: tonic::Request<super::ValidatorPenaltyRequest>,
1403 ) -> std::result::Result<
1404 tonic::Response<super::ValidatorPenaltyResponse>,
1405 tonic::Status,
1406 >;
1407 async fn current_validator_rate(
1408 &self,
1409 request: tonic::Request<super::CurrentValidatorRateRequest>,
1410 ) -> std::result::Result<
1411 tonic::Response<super::CurrentValidatorRateResponse>,
1412 tonic::Status,
1413 >;
1414 async fn validator_uptime(
1415 &self,
1416 request: tonic::Request<super::ValidatorUptimeRequest>,
1417 ) -> std::result::Result<
1418 tonic::Response<super::ValidatorUptimeResponse>,
1419 tonic::Status,
1420 >;
1421 }
1422 #[derive(Debug)]
1424 pub struct QueryServiceServer<T> {
1425 inner: Arc<T>,
1426 accept_compression_encodings: EnabledCompressionEncodings,
1427 send_compression_encodings: EnabledCompressionEncodings,
1428 max_decoding_message_size: Option<usize>,
1429 max_encoding_message_size: Option<usize>,
1430 }
1431 impl<T> QueryServiceServer<T> {
1432 pub fn new(inner: T) -> Self {
1433 Self::from_arc(Arc::new(inner))
1434 }
1435 pub fn from_arc(inner: Arc<T>) -> Self {
1436 Self {
1437 inner,
1438 accept_compression_encodings: Default::default(),
1439 send_compression_encodings: Default::default(),
1440 max_decoding_message_size: None,
1441 max_encoding_message_size: None,
1442 }
1443 }
1444 pub fn with_interceptor<F>(
1445 inner: T,
1446 interceptor: F,
1447 ) -> InterceptedService<Self, F>
1448 where
1449 F: tonic::service::Interceptor,
1450 {
1451 InterceptedService::new(Self::new(inner), interceptor)
1452 }
1453 #[must_use]
1455 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1456 self.accept_compression_encodings.enable(encoding);
1457 self
1458 }
1459 #[must_use]
1461 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1462 self.send_compression_encodings.enable(encoding);
1463 self
1464 }
1465 #[must_use]
1469 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1470 self.max_decoding_message_size = Some(limit);
1471 self
1472 }
1473 #[must_use]
1477 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1478 self.max_encoding_message_size = Some(limit);
1479 self
1480 }
1481 }
1482 impl<T, B> tonic::codegen::Service<http::Request<B>> for QueryServiceServer<T>
1483 where
1484 T: QueryService,
1485 B: Body + std::marker::Send + 'static,
1486 B::Error: Into<StdError> + std::marker::Send + 'static,
1487 {
1488 type Response = http::Response<tonic::body::BoxBody>;
1489 type Error = std::convert::Infallible;
1490 type Future = BoxFuture<Self::Response, Self::Error>;
1491 fn poll_ready(
1492 &mut self,
1493 _cx: &mut Context<'_>,
1494 ) -> Poll<std::result::Result<(), Self::Error>> {
1495 Poll::Ready(Ok(()))
1496 }
1497 fn call(&mut self, req: http::Request<B>) -> Self::Future {
1498 match req.uri().path() {
1499 "/penumbra.core.component.stake.v1.QueryService/GetValidatorInfo" => {
1500 #[allow(non_camel_case_types)]
1501 struct GetValidatorInfoSvc<T: QueryService>(pub Arc<T>);
1502 impl<
1503 T: QueryService,
1504 > tonic::server::UnaryService<super::GetValidatorInfoRequest>
1505 for GetValidatorInfoSvc<T> {
1506 type Response = super::GetValidatorInfoResponse;
1507 type Future = BoxFuture<
1508 tonic::Response<Self::Response>,
1509 tonic::Status,
1510 >;
1511 fn call(
1512 &mut self,
1513 request: tonic::Request<super::GetValidatorInfoRequest>,
1514 ) -> Self::Future {
1515 let inner = Arc::clone(&self.0);
1516 let fut = async move {
1517 <T as QueryService>::get_validator_info(&inner, request)
1518 .await
1519 };
1520 Box::pin(fut)
1521 }
1522 }
1523 let accept_compression_encodings = self.accept_compression_encodings;
1524 let send_compression_encodings = self.send_compression_encodings;
1525 let max_decoding_message_size = self.max_decoding_message_size;
1526 let max_encoding_message_size = self.max_encoding_message_size;
1527 let inner = self.inner.clone();
1528 let fut = async move {
1529 let method = GetValidatorInfoSvc(inner);
1530 let codec = tonic::codec::ProstCodec::default();
1531 let mut grpc = tonic::server::Grpc::new(codec)
1532 .apply_compression_config(
1533 accept_compression_encodings,
1534 send_compression_encodings,
1535 )
1536 .apply_max_message_size_config(
1537 max_decoding_message_size,
1538 max_encoding_message_size,
1539 );
1540 let res = grpc.unary(method, req).await;
1541 Ok(res)
1542 };
1543 Box::pin(fut)
1544 }
1545 "/penumbra.core.component.stake.v1.QueryService/ValidatorInfo" => {
1546 #[allow(non_camel_case_types)]
1547 struct ValidatorInfoSvc<T: QueryService>(pub Arc<T>);
1548 impl<
1549 T: QueryService,
1550 > tonic::server::ServerStreamingService<super::ValidatorInfoRequest>
1551 for ValidatorInfoSvc<T> {
1552 type Response = super::ValidatorInfoResponse;
1553 type ResponseStream = T::ValidatorInfoStream;
1554 type Future = BoxFuture<
1555 tonic::Response<Self::ResponseStream>,
1556 tonic::Status,
1557 >;
1558 fn call(
1559 &mut self,
1560 request: tonic::Request<super::ValidatorInfoRequest>,
1561 ) -> Self::Future {
1562 let inner = Arc::clone(&self.0);
1563 let fut = async move {
1564 <T as QueryService>::validator_info(&inner, request).await
1565 };
1566 Box::pin(fut)
1567 }
1568 }
1569 let accept_compression_encodings = self.accept_compression_encodings;
1570 let send_compression_encodings = self.send_compression_encodings;
1571 let max_decoding_message_size = self.max_decoding_message_size;
1572 let max_encoding_message_size = self.max_encoding_message_size;
1573 let inner = self.inner.clone();
1574 let fut = async move {
1575 let method = ValidatorInfoSvc(inner);
1576 let codec = tonic::codec::ProstCodec::default();
1577 let mut grpc = tonic::server::Grpc::new(codec)
1578 .apply_compression_config(
1579 accept_compression_encodings,
1580 send_compression_encodings,
1581 )
1582 .apply_max_message_size_config(
1583 max_decoding_message_size,
1584 max_encoding_message_size,
1585 );
1586 let res = grpc.server_streaming(method, req).await;
1587 Ok(res)
1588 };
1589 Box::pin(fut)
1590 }
1591 "/penumbra.core.component.stake.v1.QueryService/ValidatorStatus" => {
1592 #[allow(non_camel_case_types)]
1593 struct ValidatorStatusSvc<T: QueryService>(pub Arc<T>);
1594 impl<
1595 T: QueryService,
1596 > tonic::server::UnaryService<super::ValidatorStatusRequest>
1597 for ValidatorStatusSvc<T> {
1598 type Response = super::ValidatorStatusResponse;
1599 type Future = BoxFuture<
1600 tonic::Response<Self::Response>,
1601 tonic::Status,
1602 >;
1603 fn call(
1604 &mut self,
1605 request: tonic::Request<super::ValidatorStatusRequest>,
1606 ) -> Self::Future {
1607 let inner = Arc::clone(&self.0);
1608 let fut = async move {
1609 <T as QueryService>::validator_status(&inner, request).await
1610 };
1611 Box::pin(fut)
1612 }
1613 }
1614 let accept_compression_encodings = self.accept_compression_encodings;
1615 let send_compression_encodings = self.send_compression_encodings;
1616 let max_decoding_message_size = self.max_decoding_message_size;
1617 let max_encoding_message_size = self.max_encoding_message_size;
1618 let inner = self.inner.clone();
1619 let fut = async move {
1620 let method = ValidatorStatusSvc(inner);
1621 let codec = tonic::codec::ProstCodec::default();
1622 let mut grpc = tonic::server::Grpc::new(codec)
1623 .apply_compression_config(
1624 accept_compression_encodings,
1625 send_compression_encodings,
1626 )
1627 .apply_max_message_size_config(
1628 max_decoding_message_size,
1629 max_encoding_message_size,
1630 );
1631 let res = grpc.unary(method, req).await;
1632 Ok(res)
1633 };
1634 Box::pin(fut)
1635 }
1636 "/penumbra.core.component.stake.v1.QueryService/ValidatorPenalty" => {
1637 #[allow(non_camel_case_types)]
1638 struct ValidatorPenaltySvc<T: QueryService>(pub Arc<T>);
1639 impl<
1640 T: QueryService,
1641 > tonic::server::UnaryService<super::ValidatorPenaltyRequest>
1642 for ValidatorPenaltySvc<T> {
1643 type Response = super::ValidatorPenaltyResponse;
1644 type Future = BoxFuture<
1645 tonic::Response<Self::Response>,
1646 tonic::Status,
1647 >;
1648 fn call(
1649 &mut self,
1650 request: tonic::Request<super::ValidatorPenaltyRequest>,
1651 ) -> Self::Future {
1652 let inner = Arc::clone(&self.0);
1653 let fut = async move {
1654 <T as QueryService>::validator_penalty(&inner, request)
1655 .await
1656 };
1657 Box::pin(fut)
1658 }
1659 }
1660 let accept_compression_encodings = self.accept_compression_encodings;
1661 let send_compression_encodings = self.send_compression_encodings;
1662 let max_decoding_message_size = self.max_decoding_message_size;
1663 let max_encoding_message_size = self.max_encoding_message_size;
1664 let inner = self.inner.clone();
1665 let fut = async move {
1666 let method = ValidatorPenaltySvc(inner);
1667 let codec = tonic::codec::ProstCodec::default();
1668 let mut grpc = tonic::server::Grpc::new(codec)
1669 .apply_compression_config(
1670 accept_compression_encodings,
1671 send_compression_encodings,
1672 )
1673 .apply_max_message_size_config(
1674 max_decoding_message_size,
1675 max_encoding_message_size,
1676 );
1677 let res = grpc.unary(method, req).await;
1678 Ok(res)
1679 };
1680 Box::pin(fut)
1681 }
1682 "/penumbra.core.component.stake.v1.QueryService/CurrentValidatorRate" => {
1683 #[allow(non_camel_case_types)]
1684 struct CurrentValidatorRateSvc<T: QueryService>(pub Arc<T>);
1685 impl<
1686 T: QueryService,
1687 > tonic::server::UnaryService<super::CurrentValidatorRateRequest>
1688 for CurrentValidatorRateSvc<T> {
1689 type Response = super::CurrentValidatorRateResponse;
1690 type Future = BoxFuture<
1691 tonic::Response<Self::Response>,
1692 tonic::Status,
1693 >;
1694 fn call(
1695 &mut self,
1696 request: tonic::Request<super::CurrentValidatorRateRequest>,
1697 ) -> Self::Future {
1698 let inner = Arc::clone(&self.0);
1699 let fut = async move {
1700 <T as QueryService>::current_validator_rate(&inner, request)
1701 .await
1702 };
1703 Box::pin(fut)
1704 }
1705 }
1706 let accept_compression_encodings = self.accept_compression_encodings;
1707 let send_compression_encodings = self.send_compression_encodings;
1708 let max_decoding_message_size = self.max_decoding_message_size;
1709 let max_encoding_message_size = self.max_encoding_message_size;
1710 let inner = self.inner.clone();
1711 let fut = async move {
1712 let method = CurrentValidatorRateSvc(inner);
1713 let codec = tonic::codec::ProstCodec::default();
1714 let mut grpc = tonic::server::Grpc::new(codec)
1715 .apply_compression_config(
1716 accept_compression_encodings,
1717 send_compression_encodings,
1718 )
1719 .apply_max_message_size_config(
1720 max_decoding_message_size,
1721 max_encoding_message_size,
1722 );
1723 let res = grpc.unary(method, req).await;
1724 Ok(res)
1725 };
1726 Box::pin(fut)
1727 }
1728 "/penumbra.core.component.stake.v1.QueryService/ValidatorUptime" => {
1729 #[allow(non_camel_case_types)]
1730 struct ValidatorUptimeSvc<T: QueryService>(pub Arc<T>);
1731 impl<
1732 T: QueryService,
1733 > tonic::server::UnaryService<super::ValidatorUptimeRequest>
1734 for ValidatorUptimeSvc<T> {
1735 type Response = super::ValidatorUptimeResponse;
1736 type Future = BoxFuture<
1737 tonic::Response<Self::Response>,
1738 tonic::Status,
1739 >;
1740 fn call(
1741 &mut self,
1742 request: tonic::Request<super::ValidatorUptimeRequest>,
1743 ) -> Self::Future {
1744 let inner = Arc::clone(&self.0);
1745 let fut = async move {
1746 <T as QueryService>::validator_uptime(&inner, request).await
1747 };
1748 Box::pin(fut)
1749 }
1750 }
1751 let accept_compression_encodings = self.accept_compression_encodings;
1752 let send_compression_encodings = self.send_compression_encodings;
1753 let max_decoding_message_size = self.max_decoding_message_size;
1754 let max_encoding_message_size = self.max_encoding_message_size;
1755 let inner = self.inner.clone();
1756 let fut = async move {
1757 let method = ValidatorUptimeSvc(inner);
1758 let codec = tonic::codec::ProstCodec::default();
1759 let mut grpc = tonic::server::Grpc::new(codec)
1760 .apply_compression_config(
1761 accept_compression_encodings,
1762 send_compression_encodings,
1763 )
1764 .apply_max_message_size_config(
1765 max_decoding_message_size,
1766 max_encoding_message_size,
1767 );
1768 let res = grpc.unary(method, req).await;
1769 Ok(res)
1770 };
1771 Box::pin(fut)
1772 }
1773 _ => {
1774 Box::pin(async move {
1775 let mut response = http::Response::new(empty_body());
1776 let headers = response.headers_mut();
1777 headers
1778 .insert(
1779 tonic::Status::GRPC_STATUS,
1780 (tonic::Code::Unimplemented as i32).into(),
1781 );
1782 headers
1783 .insert(
1784 http::header::CONTENT_TYPE,
1785 tonic::metadata::GRPC_CONTENT_TYPE,
1786 );
1787 Ok(response)
1788 })
1789 }
1790 }
1791 }
1792 }
1793 impl<T> Clone for QueryServiceServer<T> {
1794 fn clone(&self) -> Self {
1795 let inner = self.inner.clone();
1796 Self {
1797 inner,
1798 accept_compression_encodings: self.accept_compression_encodings,
1799 send_compression_encodings: self.send_compression_encodings,
1800 max_decoding_message_size: self.max_decoding_message_size,
1801 max_encoding_message_size: self.max_encoding_message_size,
1802 }
1803 }
1804 }
1805 pub const SERVICE_NAME: &str = "penumbra.core.component.stake.v1.QueryService";
1807 impl<T> tonic::server::NamedService for QueryServiceServer<T> {
1808 const NAME: &'static str = SERVICE_NAME;
1809 }
1810}