penumbra_sdk_proto/gen/
penumbra.core.component.funding.v1.rs

1// This file is @generated by prost-build.
2/// Request if a nullifier is already used in a specific epoch.
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct LqtCheckNullifierRequest {
5    /// The epoch index in which to check for nullifier usage.
6    #[prost(uint64, tag = "1")]
7    pub epoch_index: u64,
8    /// The nullifier whose voting status is being queried.
9    #[prost(message, optional, tag = "2")]
10    pub nullifier: ::core::option::Option<super::super::sct::v1::Nullifier>,
11}
12impl ::prost::Name for LqtCheckNullifierRequest {
13    const NAME: &'static str = "LqtCheckNullifierRequest";
14    const PACKAGE: &'static str = "penumbra.core.component.funding.v1";
15    fn full_name() -> ::prost::alloc::string::String {
16        "penumbra.core.component.funding.v1.LqtCheckNullifierRequest".into()
17    }
18    fn type_url() -> ::prost::alloc::string::String {
19        "/penumbra.core.component.funding.v1.LqtCheckNullifierRequest".into()
20    }
21}
22/// Response indicating whether the nullifier was already used.
23#[derive(Clone, PartialEq, ::prost::Message)]
24pub struct LqtCheckNullifierResponse {
25    /// The transaction ID of the vote, if the nullifier has been used.
26    /// This field is always present if `already_voted` is true.
27    #[prost(message, optional, tag = "1")]
28    pub transaction: ::core::option::Option<
29        super::super::super::txhash::v1::TransactionId,
30    >,
31    /// Indicates whether the nullifier has already been used for voting in the given epoch.
32    #[prost(bool, tag = "2")]
33    pub already_voted: bool,
34    /// The epoch index in which the nullifier was checked.
35    #[prost(uint64, tag = "3")]
36    pub epoch_index: u64,
37}
38impl ::prost::Name for LqtCheckNullifierResponse {
39    const NAME: &'static str = "LqtCheckNullifierResponse";
40    const PACKAGE: &'static str = "penumbra.core.component.funding.v1";
41    fn full_name() -> ::prost::alloc::string::String {
42        "penumbra.core.component.funding.v1.LqtCheckNullifierResponse".into()
43    }
44    fn type_url() -> ::prost::alloc::string::String {
45        "/penumbra.core.component.funding.v1.LqtCheckNullifierResponse".into()
46    }
47}
48/// Funding component configuration data.
49#[derive(Clone, Copy, PartialEq, ::prost::Message)]
50pub struct FundingParameters {
51    /// The parameters governing the funding of the liquidity tournament.
52    #[prost(message, optional, tag = "1")]
53    pub liquidity_tournament: ::core::option::Option<
54        funding_parameters::LiquidityTournament,
55    >,
56}
57/// Nested message and enum types in `FundingParameters`.
58pub mod funding_parameters {
59    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
60    pub struct LiquidityTournament {
61        /// The fraction of gauge votes that an asset must pass to get any rewards.
62        ///
63        /// Takes a value in \[0, 100\].
64        #[prost(uint64, tag = "1")]
65        pub gauge_threshold_percent: u64,
66        /// The maximum number of liquidity positions that can receive rewards.
67        ///
68        /// This avoids potential DoS vectors with processing a large number of small positions.
69        #[prost(uint64, tag = "2")]
70        pub max_positions: u64,
71        /// The maximum number of delegators that can be rewarded.
72        ///
73        /// Also avoids potential DoS vectors
74        #[prost(uint64, tag = "3")]
75        pub max_delegators: u64,
76        /// The share of rewards which will go to delegators, opposed with positions.
77        ///
78        /// Takes a value in \[0, 100\].
79        #[prost(uint64, tag = "4")]
80        pub delegator_share_percent: u64,
81    }
82    impl ::prost::Name for LiquidityTournament {
83        const NAME: &'static str = "LiquidityTournament";
84        const PACKAGE: &'static str = "penumbra.core.component.funding.v1";
85        fn full_name() -> ::prost::alloc::string::String {
86            "penumbra.core.component.funding.v1.FundingParameters.LiquidityTournament"
87                .into()
88        }
89        fn type_url() -> ::prost::alloc::string::String {
90            "/penumbra.core.component.funding.v1.FundingParameters.LiquidityTournament"
91                .into()
92        }
93    }
94}
95impl ::prost::Name for FundingParameters {
96    const NAME: &'static str = "FundingParameters";
97    const PACKAGE: &'static str = "penumbra.core.component.funding.v1";
98    fn full_name() -> ::prost::alloc::string::String {
99        "penumbra.core.component.funding.v1.FundingParameters".into()
100    }
101    fn type_url() -> ::prost::alloc::string::String {
102        "/penumbra.core.component.funding.v1.FundingParameters".into()
103    }
104}
105/// Genesis data for the funding component.
106#[derive(Clone, Copy, PartialEq, ::prost::Message)]
107pub struct GenesisContent {
108    #[prost(message, optional, tag = "1")]
109    pub funding_params: ::core::option::Option<FundingParameters>,
110}
111impl ::prost::Name for GenesisContent {
112    const NAME: &'static str = "GenesisContent";
113    const PACKAGE: &'static str = "penumbra.core.component.funding.v1";
114    fn full_name() -> ::prost::alloc::string::String {
115        "penumbra.core.component.funding.v1.GenesisContent".into()
116    }
117    fn type_url() -> ::prost::alloc::string::String {
118        "/penumbra.core.component.funding.v1.GenesisContent".into()
119    }
120}
121/// Indicates that a funding stream reward was paid.
122#[derive(Clone, PartialEq, ::prost::Message)]
123pub struct EventFundingStreamReward {
124    /// The recipient of the funding stream reward.
125    /// This is a string value for future extensibility.
126    /// Currently it will be either "community-pool"
127    /// or an address.
128    #[prost(string, tag = "1")]
129    pub recipient: ::prost::alloc::string::String,
130    /// The epoch for which the reward was paid.
131    #[prost(uint64, tag = "2")]
132    pub epoch_index: u64,
133    /// The amount of the reward, in staking tokens.
134    #[prost(message, optional, tag = "3")]
135    pub reward_amount: ::core::option::Option<super::super::super::num::v1::Amount>,
136}
137impl ::prost::Name for EventFundingStreamReward {
138    const NAME: &'static str = "EventFundingStreamReward";
139    const PACKAGE: &'static str = "penumbra.core.component.funding.v1";
140    fn full_name() -> ::prost::alloc::string::String {
141        "penumbra.core.component.funding.v1.EventFundingStreamReward".into()
142    }
143    fn type_url() -> ::prost::alloc::string::String {
144        "/penumbra.core.component.funding.v1.EventFundingStreamReward".into()
145    }
146}
147/// An action for voting in a liquidity tournament.
148#[derive(Clone, PartialEq, ::prost::Message)]
149pub struct ActionLiquidityTournamentVote {
150    /// The effectful data signalling user intent, and the validity of this intent.
151    #[prost(message, optional, tag = "1")]
152    pub body: ::core::option::Option<LiquidityTournamentVoteBody>,
153    /// An authorization from the user over this body.
154    #[prost(message, optional, tag = "2")]
155    pub auth_sig: ::core::option::Option<
156        super::super::super::super::crypto::decaf377_rdsa::v1::SpendAuthSignature,
157    >,
158    /// A ZK proof that it was correctly constructed from private user state.
159    #[prost(message, optional, tag = "3")]
160    pub proof: ::core::option::Option<ZkLiquidityTournamentVoteProof>,
161}
162impl ::prost::Name for ActionLiquidityTournamentVote {
163    const NAME: &'static str = "ActionLiquidityTournamentVote";
164    const PACKAGE: &'static str = "penumbra.core.component.funding.v1";
165    fn full_name() -> ::prost::alloc::string::String {
166        "penumbra.core.component.funding.v1.ActionLiquidityTournamentVote".into()
167    }
168    fn type_url() -> ::prost::alloc::string::String {
169        "/penumbra.core.component.funding.v1.ActionLiquidityTournamentVote".into()
170    }
171}
172#[derive(Clone, PartialEq, ::prost::Message)]
173pub struct LiquidityTournamentVoteBody {
174    /// Which asset should be incentivized.
175    #[prost(message, optional, tag = "1")]
176    pub incentivized: ::core::option::Option<super::super::super::asset::v1::Denom>,
177    /// Where to send any rewards for participating in the tournament.
178    #[prost(message, optional, tag = "2")]
179    pub rewards_recipient: ::core::option::Option<
180        super::super::super::keys::v1::Address,
181    >,
182    /// The start position of the tournament
183    #[prost(uint64, tag = "3")]
184    pub start_position: u64,
185    /// The value being voted with.
186    ///
187    /// This should be some amount of a validator's delegation token.
188    #[prost(message, optional, tag = "4")]
189    pub value: ::core::option::Option<super::super::super::asset::v1::Value>,
190    /// The nullifier associated with the note being spent.
191    #[prost(message, optional, tag = "5")]
192    pub nullifier: ::core::option::Option<super::super::sct::v1::Nullifier>,
193    /// A randomized verification key with which to check the auth signature.
194    #[prost(message, optional, tag = "6")]
195    pub rk: ::core::option::Option<
196        super::super::super::super::crypto::decaf377_rdsa::v1::SpendVerificationKey,
197    >,
198}
199impl ::prost::Name for LiquidityTournamentVoteBody {
200    const NAME: &'static str = "LiquidityTournamentVoteBody";
201    const PACKAGE: &'static str = "penumbra.core.component.funding.v1";
202    fn full_name() -> ::prost::alloc::string::String {
203        "penumbra.core.component.funding.v1.LiquidityTournamentVoteBody".into()
204    }
205    fn type_url() -> ::prost::alloc::string::String {
206        "/penumbra.core.component.funding.v1.LiquidityTournamentVoteBody".into()
207    }
208}
209/// The plan associated with a `ActionLiquidityTournamentVote`.
210#[derive(Clone, PartialEq, ::prost::Message)]
211pub struct ActionLiquidityTournamentVotePlan {
212    /// The asset the user wants to vote for.
213    #[prost(message, optional, tag = "1")]
214    pub incentivized: ::core::option::Option<super::super::super::asset::v1::Denom>,
215    /// Where to send any rewards for participating in the tournament.
216    #[prost(message, optional, tag = "2")]
217    pub rewards_recipient: ::core::option::Option<
218        super::super::super::keys::v1::Address,
219    >,
220    /// The note containing the staked note used for voting.
221    #[prost(message, optional, tag = "3")]
222    pub staked_note: ::core::option::Option<super::super::shielded_pool::v1::Note>,
223    /// The position of the staked note.
224    #[prost(uint64, tag = "4")]
225    pub staked_note_position: u64,
226    /// The start position of the tournament.
227    #[prost(uint64, tag = "5")]
228    pub start_position: u64,
229    /// Randomizer for proof of spend capability.
230    #[prost(bytes = "vec", tag = "6")]
231    pub randomizer: ::prost::alloc::vec::Vec<u8>,
232    #[prost(bytes = "vec", tag = "7")]
233    pub proof_blinding_r: ::prost::alloc::vec::Vec<u8>,
234    #[prost(bytes = "vec", tag = "8")]
235    pub proof_blinding_s: ::prost::alloc::vec::Vec<u8>,
236}
237impl ::prost::Name for ActionLiquidityTournamentVotePlan {
238    const NAME: &'static str = "ActionLiquidityTournamentVotePlan";
239    const PACKAGE: &'static str = "penumbra.core.component.funding.v1";
240    fn full_name() -> ::prost::alloc::string::String {
241        "penumbra.core.component.funding.v1.ActionLiquidityTournamentVotePlan".into()
242    }
243    fn type_url() -> ::prost::alloc::string::String {
244        "/penumbra.core.component.funding.v1.ActionLiquidityTournamentVotePlan".into()
245    }
246}
247/// A proof of the validity of a liquidity vote, wrt private state.
248#[derive(Clone, PartialEq, ::prost::Message)]
249pub struct ZkLiquidityTournamentVoteProof {
250    #[prost(bytes = "vec", tag = "1")]
251    pub inner: ::prost::alloc::vec::Vec<u8>,
252}
253impl ::prost::Name for ZkLiquidityTournamentVoteProof {
254    const NAME: &'static str = "ZKLiquidityTournamentVoteProof";
255    const PACKAGE: &'static str = "penumbra.core.component.funding.v1";
256    fn full_name() -> ::prost::alloc::string::String {
257        "penumbra.core.component.funding.v1.ZKLiquidityTournamentVoteProof".into()
258    }
259    fn type_url() -> ::prost::alloc::string::String {
260        "/penumbra.core.component.funding.v1.ZKLiquidityTournamentVoteProof".into()
261    }
262}
263#[derive(Clone, PartialEq, ::prost::Message)]
264pub struct ActionLiquidityTournamentVoteView {
265    #[prost(
266        oneof = "action_liquidity_tournament_vote_view::LiquidityTournamentVote",
267        tags = "1, 2"
268    )]
269    pub liquidity_tournament_vote: ::core::option::Option<
270        action_liquidity_tournament_vote_view::LiquidityTournamentVote,
271    >,
272}
273/// Nested message and enum types in `ActionLiquidityTournamentVoteView`.
274pub mod action_liquidity_tournament_vote_view {
275    /// If we initiated the vote, we should know the note that we spent.
276    #[derive(Clone, PartialEq, ::prost::Message)]
277    pub struct Visible {
278        #[prost(message, optional, tag = "1")]
279        pub vote: ::core::option::Option<super::ActionLiquidityTournamentVote>,
280        #[prost(message, optional, tag = "2")]
281        pub note: ::core::option::Option<
282            super::super::super::shielded_pool::v1::NoteView,
283        >,
284    }
285    impl ::prost::Name for Visible {
286        const NAME: &'static str = "Visible";
287        const PACKAGE: &'static str = "penumbra.core.component.funding.v1";
288        fn full_name() -> ::prost::alloc::string::String {
289            "penumbra.core.component.funding.v1.ActionLiquidityTournamentVoteView.Visible"
290                .into()
291        }
292        fn type_url() -> ::prost::alloc::string::String {
293            "/penumbra.core.component.funding.v1.ActionLiquidityTournamentVoteView.Visible"
294                .into()
295        }
296    }
297    #[derive(Clone, PartialEq, ::prost::Message)]
298    pub struct Opaque {
299        #[prost(message, optional, tag = "1")]
300        pub vote: ::core::option::Option<super::ActionLiquidityTournamentVote>,
301    }
302    impl ::prost::Name for Opaque {
303        const NAME: &'static str = "Opaque";
304        const PACKAGE: &'static str = "penumbra.core.component.funding.v1";
305        fn full_name() -> ::prost::alloc::string::String {
306            "penumbra.core.component.funding.v1.ActionLiquidityTournamentVoteView.Opaque"
307                .into()
308        }
309        fn type_url() -> ::prost::alloc::string::String {
310            "/penumbra.core.component.funding.v1.ActionLiquidityTournamentVoteView.Opaque"
311                .into()
312        }
313    }
314    #[derive(Clone, PartialEq, ::prost::Oneof)]
315    pub enum LiquidityTournamentVote {
316        #[prost(message, tag = "1")]
317        Visible(Visible),
318        #[prost(message, tag = "2")]
319        Opaque(Opaque),
320    }
321}
322impl ::prost::Name for ActionLiquidityTournamentVoteView {
323    const NAME: &'static str = "ActionLiquidityTournamentVoteView";
324    const PACKAGE: &'static str = "penumbra.core.component.funding.v1";
325    fn full_name() -> ::prost::alloc::string::String {
326        "penumbra.core.component.funding.v1.ActionLiquidityTournamentVoteView".into()
327    }
328    fn type_url() -> ::prost::alloc::string::String {
329        "/penumbra.core.component.funding.v1.ActionLiquidityTournamentVoteView".into()
330    }
331}
332#[derive(Clone, PartialEq, ::prost::Message)]
333pub struct EventLqtDelegatorReward {
334    /// The epoch for which the reward was paid.
335    #[prost(uint64, tag = "1")]
336    pub epoch_index: u64,
337    /// The amount of reward, in staking tokens.
338    #[prost(message, optional, tag = "2")]
339    pub reward_amount: ::core::option::Option<super::super::super::num::v1::Amount>,
340    /// The amount of reward, in delegation tokens.
341    #[prost(message, optional, tag = "3")]
342    pub delegation_tokens: ::core::option::Option<super::super::super::asset::v1::Value>,
343    /// The recipient of the reward
344    #[prost(message, optional, tag = "4")]
345    pub address: ::core::option::Option<super::super::super::keys::v1::Address>,
346    /// The incentivized asset.
347    #[prost(message, optional, tag = "5")]
348    pub incentivized_asset_id: ::core::option::Option<
349        super::super::super::asset::v1::AssetId,
350    >,
351}
352impl ::prost::Name for EventLqtDelegatorReward {
353    const NAME: &'static str = "EventLqtDelegatorReward";
354    const PACKAGE: &'static str = "penumbra.core.component.funding.v1";
355    fn full_name() -> ::prost::alloc::string::String {
356        "penumbra.core.component.funding.v1.EventLqtDelegatorReward".into()
357    }
358    fn type_url() -> ::prost::alloc::string::String {
359        "/penumbra.core.component.funding.v1.EventLqtDelegatorReward".into()
360    }
361}
362#[derive(Clone, PartialEq, ::prost::Message)]
363pub struct EventLqtPositionReward {
364    /// The epoch for which the reward was paid.
365    #[prost(uint64, tag = "1")]
366    pub epoch_index: u64,
367    /// The amount of the reward, in staking tokens.
368    #[prost(message, optional, tag = "2")]
369    pub reward_amount: ::core::option::Option<super::super::super::num::v1::Amount>,
370    /// The liquidity position receiving the reward
371    #[prost(message, optional, tag = "3")]
372    pub position_id: ::core::option::Option<super::super::dex::v1::PositionId>,
373    /// The incentivized asset.
374    #[prost(message, optional, tag = "4")]
375    pub incentivized_asset_id: ::core::option::Option<
376        super::super::super::asset::v1::AssetId,
377    >,
378    /// The total volume for the pair during the tournament, in staking tokens.
379    #[prost(message, optional, tag = "10")]
380    pub tournament_volume: ::core::option::Option<super::super::super::num::v1::Amount>,
381    /// The cumulative volume for the LP, in staking tokens.
382    #[prost(message, optional, tag = "11")]
383    pub position_volume: ::core::option::Option<super::super::super::num::v1::Amount>,
384}
385impl ::prost::Name for EventLqtPositionReward {
386    const NAME: &'static str = "EventLqtPositionReward";
387    const PACKAGE: &'static str = "penumbra.core.component.funding.v1";
388    fn full_name() -> ::prost::alloc::string::String {
389        "penumbra.core.component.funding.v1.EventLqtPositionReward".into()
390    }
391    fn type_url() -> ::prost::alloc::string::String {
392        "/penumbra.core.component.funding.v1.EventLqtPositionReward".into()
393    }
394}
395#[derive(Clone, PartialEq, ::prost::Message)]
396pub struct EventLqtVote {
397    /// The tournament for which the vote was cast.
398    #[prost(uint64, tag = "1")]
399    pub epoch_index: u64,
400    /// The amount of voting power this vote carries.
401    #[prost(message, optional, tag = "2")]
402    pub voting_power: ::core::option::Option<super::super::super::num::v1::Amount>,
403    /// The asset id of the asset being voted on.
404    #[prost(message, optional, tag = "3")]
405    pub incentivized_asset_id: ::core::option::Option<
406        super::super::super::asset::v1::AssetId,
407    >,
408    /// The denom string of the asset being voted on.
409    #[prost(message, optional, tag = "4")]
410    pub incentivized: ::core::option::Option<super::super::super::asset::v1::Denom>,
411    /// The beneficiary of the rewards this vote might receive.
412    #[prost(message, optional, tag = "5")]
413    pub rewards_recipient: ::core::option::Option<
414        super::super::super::keys::v1::Address,
415    >,
416    /// The transaction ID of the vote.
417    #[prost(message, optional, tag = "6")]
418    pub tx_id: ::core::option::Option<super::super::super::txhash::v1::TransactionId>,
419}
420impl ::prost::Name for EventLqtVote {
421    const NAME: &'static str = "EventLqtVote";
422    const PACKAGE: &'static str = "penumbra.core.component.funding.v1";
423    fn full_name() -> ::prost::alloc::string::String {
424        "penumbra.core.component.funding.v1.EventLqtVote".into()
425    }
426    fn type_url() -> ::prost::alloc::string::String {
427        "/penumbra.core.component.funding.v1.EventLqtVote".into()
428    }
429}
430/// Generated client implementations.
431#[cfg(feature = "rpc")]
432pub mod funding_service_client {
433    #![allow(
434        unused_variables,
435        dead_code,
436        missing_docs,
437        clippy::wildcard_imports,
438        clippy::let_unit_value,
439    )]
440    use tonic::codegen::*;
441    use tonic::codegen::http::Uri;
442    /// Query operations for the funding component.
443    #[derive(Debug, Clone)]
444    pub struct FundingServiceClient<T> {
445        inner: tonic::client::Grpc<T>,
446    }
447    impl FundingServiceClient<tonic::transport::Channel> {
448        /// Attempt to create a new client by connecting to a given endpoint.
449        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
450        where
451            D: TryInto<tonic::transport::Endpoint>,
452            D::Error: Into<StdError>,
453        {
454            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
455            Ok(Self::new(conn))
456        }
457    }
458    impl<T> FundingServiceClient<T>
459    where
460        T: tonic::client::GrpcService<tonic::body::BoxBody>,
461        T::Error: Into<StdError>,
462        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
463        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
464    {
465        pub fn new(inner: T) -> Self {
466            let inner = tonic::client::Grpc::new(inner);
467            Self { inner }
468        }
469        pub fn with_origin(inner: T, origin: Uri) -> Self {
470            let inner = tonic::client::Grpc::with_origin(inner, origin);
471            Self { inner }
472        }
473        pub fn with_interceptor<F>(
474            inner: T,
475            interceptor: F,
476        ) -> FundingServiceClient<InterceptedService<T, F>>
477        where
478            F: tonic::service::Interceptor,
479            T::ResponseBody: Default,
480            T: tonic::codegen::Service<
481                http::Request<tonic::body::BoxBody>,
482                Response = http::Response<
483                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
484                >,
485            >,
486            <T as tonic::codegen::Service<
487                http::Request<tonic::body::BoxBody>,
488            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
489        {
490            FundingServiceClient::new(InterceptedService::new(inner, interceptor))
491        }
492        /// Compress requests with the given encoding.
493        ///
494        /// This requires the server to support it otherwise it might respond with an
495        /// error.
496        #[must_use]
497        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
498            self.inner = self.inner.send_compressed(encoding);
499            self
500        }
501        /// Enable decompressing responses.
502        #[must_use]
503        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
504            self.inner = self.inner.accept_compressed(encoding);
505            self
506        }
507        /// Limits the maximum size of a decoded message.
508        ///
509        /// Default: `4MB`
510        #[must_use]
511        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
512            self.inner = self.inner.max_decoding_message_size(limit);
513            self
514        }
515        /// Limits the maximum size of an encoded message.
516        ///
517        /// Default: `usize::MAX`
518        #[must_use]
519        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
520            self.inner = self.inner.max_encoding_message_size(limit);
521            self
522        }
523        /// Checks if a particular nullifier has already been used in the current epoch.
524        pub async fn lqt_check_nullifier(
525            &mut self,
526            request: impl tonic::IntoRequest<super::LqtCheckNullifierRequest>,
527        ) -> std::result::Result<
528            tonic::Response<super::LqtCheckNullifierResponse>,
529            tonic::Status,
530        > {
531            self.inner
532                .ready()
533                .await
534                .map_err(|e| {
535                    tonic::Status::unknown(
536                        format!("Service was not ready: {}", e.into()),
537                    )
538                })?;
539            let codec = tonic::codec::ProstCodec::default();
540            let path = http::uri::PathAndQuery::from_static(
541                "/penumbra.core.component.funding.v1.FundingService/LqtCheckNullifier",
542            );
543            let mut req = request.into_request();
544            req.extensions_mut()
545                .insert(
546                    GrpcMethod::new(
547                        "penumbra.core.component.funding.v1.FundingService",
548                        "LqtCheckNullifier",
549                    ),
550                );
551            self.inner.unary(req, path, codec).await
552        }
553    }
554}
555/// Generated server implementations.
556#[cfg(feature = "rpc")]
557pub mod funding_service_server {
558    #![allow(
559        unused_variables,
560        dead_code,
561        missing_docs,
562        clippy::wildcard_imports,
563        clippy::let_unit_value,
564    )]
565    use tonic::codegen::*;
566    /// Generated trait containing gRPC methods that should be implemented for use with FundingServiceServer.
567    #[async_trait]
568    pub trait FundingService: std::marker::Send + std::marker::Sync + 'static {
569        /// Checks if a particular nullifier has already been used in the current epoch.
570        async fn lqt_check_nullifier(
571            &self,
572            request: tonic::Request<super::LqtCheckNullifierRequest>,
573        ) -> std::result::Result<
574            tonic::Response<super::LqtCheckNullifierResponse>,
575            tonic::Status,
576        >;
577    }
578    /// Query operations for the funding component.
579    #[derive(Debug)]
580    pub struct FundingServiceServer<T> {
581        inner: Arc<T>,
582        accept_compression_encodings: EnabledCompressionEncodings,
583        send_compression_encodings: EnabledCompressionEncodings,
584        max_decoding_message_size: Option<usize>,
585        max_encoding_message_size: Option<usize>,
586    }
587    impl<T> FundingServiceServer<T> {
588        pub fn new(inner: T) -> Self {
589            Self::from_arc(Arc::new(inner))
590        }
591        pub fn from_arc(inner: Arc<T>) -> Self {
592            Self {
593                inner,
594                accept_compression_encodings: Default::default(),
595                send_compression_encodings: Default::default(),
596                max_decoding_message_size: None,
597                max_encoding_message_size: None,
598            }
599        }
600        pub fn with_interceptor<F>(
601            inner: T,
602            interceptor: F,
603        ) -> InterceptedService<Self, F>
604        where
605            F: tonic::service::Interceptor,
606        {
607            InterceptedService::new(Self::new(inner), interceptor)
608        }
609        /// Enable decompressing requests with the given encoding.
610        #[must_use]
611        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
612            self.accept_compression_encodings.enable(encoding);
613            self
614        }
615        /// Compress responses with the given encoding, if the client supports it.
616        #[must_use]
617        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
618            self.send_compression_encodings.enable(encoding);
619            self
620        }
621        /// Limits the maximum size of a decoded message.
622        ///
623        /// Default: `4MB`
624        #[must_use]
625        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
626            self.max_decoding_message_size = Some(limit);
627            self
628        }
629        /// Limits the maximum size of an encoded message.
630        ///
631        /// Default: `usize::MAX`
632        #[must_use]
633        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
634            self.max_encoding_message_size = Some(limit);
635            self
636        }
637    }
638    impl<T, B> tonic::codegen::Service<http::Request<B>> for FundingServiceServer<T>
639    where
640        T: FundingService,
641        B: Body + std::marker::Send + 'static,
642        B::Error: Into<StdError> + std::marker::Send + 'static,
643    {
644        type Response = http::Response<tonic::body::BoxBody>;
645        type Error = std::convert::Infallible;
646        type Future = BoxFuture<Self::Response, Self::Error>;
647        fn poll_ready(
648            &mut self,
649            _cx: &mut Context<'_>,
650        ) -> Poll<std::result::Result<(), Self::Error>> {
651            Poll::Ready(Ok(()))
652        }
653        fn call(&mut self, req: http::Request<B>) -> Self::Future {
654            match req.uri().path() {
655                "/penumbra.core.component.funding.v1.FundingService/LqtCheckNullifier" => {
656                    #[allow(non_camel_case_types)]
657                    struct LqtCheckNullifierSvc<T: FundingService>(pub Arc<T>);
658                    impl<
659                        T: FundingService,
660                    > tonic::server::UnaryService<super::LqtCheckNullifierRequest>
661                    for LqtCheckNullifierSvc<T> {
662                        type Response = super::LqtCheckNullifierResponse;
663                        type Future = BoxFuture<
664                            tonic::Response<Self::Response>,
665                            tonic::Status,
666                        >;
667                        fn call(
668                            &mut self,
669                            request: tonic::Request<super::LqtCheckNullifierRequest>,
670                        ) -> Self::Future {
671                            let inner = Arc::clone(&self.0);
672                            let fut = async move {
673                                <T as FundingService>::lqt_check_nullifier(&inner, request)
674                                    .await
675                            };
676                            Box::pin(fut)
677                        }
678                    }
679                    let accept_compression_encodings = self.accept_compression_encodings;
680                    let send_compression_encodings = self.send_compression_encodings;
681                    let max_decoding_message_size = self.max_decoding_message_size;
682                    let max_encoding_message_size = self.max_encoding_message_size;
683                    let inner = self.inner.clone();
684                    let fut = async move {
685                        let method = LqtCheckNullifierSvc(inner);
686                        let codec = tonic::codec::ProstCodec::default();
687                        let mut grpc = tonic::server::Grpc::new(codec)
688                            .apply_compression_config(
689                                accept_compression_encodings,
690                                send_compression_encodings,
691                            )
692                            .apply_max_message_size_config(
693                                max_decoding_message_size,
694                                max_encoding_message_size,
695                            );
696                        let res = grpc.unary(method, req).await;
697                        Ok(res)
698                    };
699                    Box::pin(fut)
700                }
701                _ => {
702                    Box::pin(async move {
703                        let mut response = http::Response::new(empty_body());
704                        let headers = response.headers_mut();
705                        headers
706                            .insert(
707                                tonic::Status::GRPC_STATUS,
708                                (tonic::Code::Unimplemented as i32).into(),
709                            );
710                        headers
711                            .insert(
712                                http::header::CONTENT_TYPE,
713                                tonic::metadata::GRPC_CONTENT_TYPE,
714                            );
715                        Ok(response)
716                    })
717                }
718            }
719        }
720    }
721    impl<T> Clone for FundingServiceServer<T> {
722        fn clone(&self) -> Self {
723            let inner = self.inner.clone();
724            Self {
725                inner,
726                accept_compression_encodings: self.accept_compression_encodings,
727                send_compression_encodings: self.send_compression_encodings,
728                max_decoding_message_size: self.max_decoding_message_size,
729                max_encoding_message_size: self.max_encoding_message_size,
730            }
731        }
732    }
733    /// Generated gRPC service name
734    pub const SERVICE_NAME: &str = "penumbra.core.component.funding.v1.FundingService";
735    impl<T> tonic::server::NamedService for FundingServiceServer<T> {
736        const NAME: &'static str = SERVICE_NAME;
737    }
738}