cosmos_sdk_proto_althea/prost/
cosmos.slashing.v1beta1.rs

1// This file is @generated by prost-build.
2/// ValidatorSigningInfo defines a validator's signing info for monitoring their
3/// liveness activity.
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct ValidatorSigningInfo {
6    #[prost(string, tag = "1")]
7    pub address: ::prost::alloc::string::String,
8    /// Height at which validator was first a candidate OR was un-jailed
9    #[prost(int64, tag = "2")]
10    pub start_height: i64,
11    /// Index which is incremented every time a validator is bonded in a block and
12    /// _may_ have signed a pre-commit or not. This in conjunction with the
13    /// signed_blocks_window param determines the index in the missed block bitmap.
14    #[prost(int64, tag = "3")]
15    pub index_offset: i64,
16    /// Timestamp until which the validator is jailed due to liveness downtime.
17    #[prost(message, optional, tag = "4")]
18    pub jailed_until: ::core::option::Option<::prost_types::Timestamp>,
19    /// Whether or not a validator has been tombstoned (killed out of validator
20    /// set). It is set once the validator commits an equivocation or for any other
21    /// configured misbehavior.
22    #[prost(bool, tag = "5")]
23    pub tombstoned: bool,
24    /// A counter of missed (unsigned) blocks. It is used to avoid unnecessary
25    /// reads in the missed block bitmap.
26    #[prost(int64, tag = "6")]
27    pub missed_blocks_counter: i64,
28}
29/// Params represents the parameters used for by the slashing module.
30#[derive(Clone, PartialEq, ::prost::Message)]
31pub struct Params {
32    #[prost(int64, tag = "1")]
33    pub signed_blocks_window: i64,
34    #[prost(bytes = "vec", tag = "2")]
35    pub min_signed_per_window: ::prost::alloc::vec::Vec<u8>,
36    #[prost(message, optional, tag = "3")]
37    pub downtime_jail_duration: ::core::option::Option<::prost_types::Duration>,
38    #[prost(bytes = "vec", tag = "4")]
39    pub slash_fraction_double_sign: ::prost::alloc::vec::Vec<u8>,
40    #[prost(bytes = "vec", tag = "5")]
41    pub slash_fraction_downtime: ::prost::alloc::vec::Vec<u8>,
42}
43/// GenesisState defines the slashing module's genesis state.
44#[derive(Clone, PartialEq, ::prost::Message)]
45pub struct GenesisState {
46    /// params defines all the parameters of the module.
47    #[prost(message, optional, tag = "1")]
48    pub params: ::core::option::Option<Params>,
49    /// signing_infos represents a map between validator addresses and their
50    /// signing infos.
51    #[prost(message, repeated, tag = "2")]
52    pub signing_infos: ::prost::alloc::vec::Vec<SigningInfo>,
53    /// missed_blocks represents a map between validator addresses and their
54    /// missed blocks.
55    #[prost(message, repeated, tag = "3")]
56    pub missed_blocks: ::prost::alloc::vec::Vec<ValidatorMissedBlocks>,
57}
58/// SigningInfo stores validator signing info of corresponding address.
59#[derive(Clone, PartialEq, ::prost::Message)]
60pub struct SigningInfo {
61    /// address is the validator address.
62    #[prost(string, tag = "1")]
63    pub address: ::prost::alloc::string::String,
64    /// validator_signing_info represents the signing info of this validator.
65    #[prost(message, optional, tag = "2")]
66    pub validator_signing_info: ::core::option::Option<ValidatorSigningInfo>,
67}
68/// ValidatorMissedBlocks contains array of missed blocks of corresponding
69/// address.
70#[derive(Clone, PartialEq, ::prost::Message)]
71pub struct ValidatorMissedBlocks {
72    /// address is the validator address.
73    #[prost(string, tag = "1")]
74    pub address: ::prost::alloc::string::String,
75    /// missed_blocks is an array of missed blocks by the validator.
76    #[prost(message, repeated, tag = "2")]
77    pub missed_blocks: ::prost::alloc::vec::Vec<MissedBlock>,
78}
79/// MissedBlock contains height and missed status as boolean.
80#[derive(Clone, Copy, PartialEq, ::prost::Message)]
81pub struct MissedBlock {
82    /// index is the height at which the block was missed.
83    #[prost(int64, tag = "1")]
84    pub index: i64,
85    /// missed is the missed status.
86    #[prost(bool, tag = "2")]
87    pub missed: bool,
88}
89/// QueryParamsRequest is the request type for the Query/Params RPC method
90#[derive(Clone, Copy, PartialEq, ::prost::Message)]
91pub struct QueryParamsRequest {}
92/// QueryParamsResponse is the response type for the Query/Params RPC method
93#[derive(Clone, PartialEq, ::prost::Message)]
94pub struct QueryParamsResponse {
95    #[prost(message, optional, tag = "1")]
96    pub params: ::core::option::Option<Params>,
97}
98/// QuerySigningInfoRequest is the request type for the Query/SigningInfo RPC
99/// method
100#[derive(Clone, PartialEq, ::prost::Message)]
101pub struct QuerySigningInfoRequest {
102    /// cons_address is the address to query signing info of
103    #[prost(string, tag = "1")]
104    pub cons_address: ::prost::alloc::string::String,
105}
106/// QuerySigningInfoResponse is the response type for the Query/SigningInfo RPC
107/// method
108#[derive(Clone, PartialEq, ::prost::Message)]
109pub struct QuerySigningInfoResponse {
110    /// val_signing_info is the signing info of requested val cons address
111    #[prost(message, optional, tag = "1")]
112    pub val_signing_info: ::core::option::Option<ValidatorSigningInfo>,
113}
114/// QuerySigningInfosRequest is the request type for the Query/SigningInfos RPC
115/// method
116#[derive(Clone, PartialEq, ::prost::Message)]
117pub struct QuerySigningInfosRequest {
118    #[prost(message, optional, tag = "1")]
119    pub pagination: ::core::option::Option<
120        super::super::base::query::v1beta1::PageRequest,
121    >,
122}
123/// QuerySigningInfosResponse is the response type for the Query/SigningInfos RPC
124/// method
125#[derive(Clone, PartialEq, ::prost::Message)]
126pub struct QuerySigningInfosResponse {
127    /// info is the signing info of all validators
128    #[prost(message, repeated, tag = "1")]
129    pub info: ::prost::alloc::vec::Vec<ValidatorSigningInfo>,
130    #[prost(message, optional, tag = "2")]
131    pub pagination: ::core::option::Option<
132        super::super::base::query::v1beta1::PageResponse,
133    >,
134}
135/// Generated client implementations.
136pub mod query_client {
137    #![allow(
138        unused_variables,
139        dead_code,
140        missing_docs,
141        clippy::wildcard_imports,
142        clippy::let_unit_value,
143    )]
144    use tonic::codegen::*;
145    use tonic::codegen::http::Uri;
146    /// Query provides defines the gRPC querier service
147    #[derive(Debug, Clone)]
148    pub struct QueryClient<T> {
149        inner: tonic::client::Grpc<T>,
150    }
151    impl QueryClient<tonic::transport::Channel> {
152        /// Attempt to create a new client by connecting to a given endpoint.
153        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
154        where
155            D: TryInto<tonic::transport::Endpoint>,
156            D::Error: Into<StdError>,
157        {
158            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
159            Ok(Self::new(conn))
160        }
161    }
162    impl<T> QueryClient<T>
163    where
164        T: tonic::client::GrpcService<tonic::body::BoxBody>,
165        T::Error: Into<StdError>,
166        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
167        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
168    {
169        pub fn new(inner: T) -> Self {
170            let inner = tonic::client::Grpc::new(inner);
171            Self { inner }
172        }
173        pub fn with_origin(inner: T, origin: Uri) -> Self {
174            let inner = tonic::client::Grpc::with_origin(inner, origin);
175            Self { inner }
176        }
177        pub fn with_interceptor<F>(
178            inner: T,
179            interceptor: F,
180        ) -> QueryClient<InterceptedService<T, F>>
181        where
182            F: tonic::service::Interceptor,
183            T::ResponseBody: Default,
184            T: tonic::codegen::Service<
185                http::Request<tonic::body::BoxBody>,
186                Response = http::Response<
187                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
188                >,
189            >,
190            <T as tonic::codegen::Service<
191                http::Request<tonic::body::BoxBody>,
192            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
193        {
194            QueryClient::new(InterceptedService::new(inner, interceptor))
195        }
196        /// Compress requests with the given encoding.
197        ///
198        /// This requires the server to support it otherwise it might respond with an
199        /// error.
200        #[must_use]
201        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
202            self.inner = self.inner.send_compressed(encoding);
203            self
204        }
205        /// Enable decompressing responses.
206        #[must_use]
207        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
208            self.inner = self.inner.accept_compressed(encoding);
209            self
210        }
211        /// Limits the maximum size of a decoded message.
212        ///
213        /// Default: `4MB`
214        #[must_use]
215        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
216            self.inner = self.inner.max_decoding_message_size(limit);
217            self
218        }
219        /// Limits the maximum size of an encoded message.
220        ///
221        /// Default: `usize::MAX`
222        #[must_use]
223        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
224            self.inner = self.inner.max_encoding_message_size(limit);
225            self
226        }
227        /// Params queries the parameters of slashing module
228        pub async fn params(
229            &mut self,
230            request: impl tonic::IntoRequest<super::QueryParamsRequest>,
231        ) -> std::result::Result<
232            tonic::Response<super::QueryParamsResponse>,
233            tonic::Status,
234        > {
235            self.inner
236                .ready()
237                .await
238                .map_err(|e| {
239                    tonic::Status::unknown(
240                        format!("Service was not ready: {}", e.into()),
241                    )
242                })?;
243            let codec = tonic::codec::ProstCodec::default();
244            let path = http::uri::PathAndQuery::from_static(
245                "/cosmos.slashing.v1beta1.Query/Params",
246            );
247            let mut req = request.into_request();
248            req.extensions_mut()
249                .insert(GrpcMethod::new("cosmos.slashing.v1beta1.Query", "Params"));
250            self.inner.unary(req, path, codec).await
251        }
252        /// SigningInfo queries the signing info of given cons address
253        pub async fn signing_info(
254            &mut self,
255            request: impl tonic::IntoRequest<super::QuerySigningInfoRequest>,
256        ) -> std::result::Result<
257            tonic::Response<super::QuerySigningInfoResponse>,
258            tonic::Status,
259        > {
260            self.inner
261                .ready()
262                .await
263                .map_err(|e| {
264                    tonic::Status::unknown(
265                        format!("Service was not ready: {}", e.into()),
266                    )
267                })?;
268            let codec = tonic::codec::ProstCodec::default();
269            let path = http::uri::PathAndQuery::from_static(
270                "/cosmos.slashing.v1beta1.Query/SigningInfo",
271            );
272            let mut req = request.into_request();
273            req.extensions_mut()
274                .insert(GrpcMethod::new("cosmos.slashing.v1beta1.Query", "SigningInfo"));
275            self.inner.unary(req, path, codec).await
276        }
277        /// SigningInfos queries signing info of all validators
278        pub async fn signing_infos(
279            &mut self,
280            request: impl tonic::IntoRequest<super::QuerySigningInfosRequest>,
281        ) -> std::result::Result<
282            tonic::Response<super::QuerySigningInfosResponse>,
283            tonic::Status,
284        > {
285            self.inner
286                .ready()
287                .await
288                .map_err(|e| {
289                    tonic::Status::unknown(
290                        format!("Service was not ready: {}", e.into()),
291                    )
292                })?;
293            let codec = tonic::codec::ProstCodec::default();
294            let path = http::uri::PathAndQuery::from_static(
295                "/cosmos.slashing.v1beta1.Query/SigningInfos",
296            );
297            let mut req = request.into_request();
298            req.extensions_mut()
299                .insert(
300                    GrpcMethod::new("cosmos.slashing.v1beta1.Query", "SigningInfos"),
301                );
302            self.inner.unary(req, path, codec).await
303        }
304    }
305}
306/// MsgUnjail defines the Msg/Unjail request type
307#[derive(Clone, PartialEq, ::prost::Message)]
308pub struct MsgUnjail {
309    #[prost(string, tag = "1")]
310    pub validator_addr: ::prost::alloc::string::String,
311}
312/// MsgUnjailResponse defines the Msg/Unjail response type
313#[derive(Clone, Copy, PartialEq, ::prost::Message)]
314pub struct MsgUnjailResponse {}
315/// MsgUpdateParams is the Msg/UpdateParams request type.
316///
317/// Since: cosmos-sdk 0.47
318#[derive(Clone, PartialEq, ::prost::Message)]
319pub struct MsgUpdateParams {
320    /// authority is the address that controls the module (defaults to x/gov unless overwritten).
321    #[prost(string, tag = "1")]
322    pub authority: ::prost::alloc::string::String,
323    /// params defines the x/slashing parameters to update.
324    ///
325    /// NOTE: All parameters must be supplied.
326    #[prost(message, optional, tag = "2")]
327    pub params: ::core::option::Option<Params>,
328}
329/// MsgUpdateParamsResponse defines the response structure for executing a
330/// MsgUpdateParams message.
331///
332/// Since: cosmos-sdk 0.47
333#[derive(Clone, Copy, PartialEq, ::prost::Message)]
334pub struct MsgUpdateParamsResponse {}
335/// Generated client implementations.
336pub mod msg_client {
337    #![allow(
338        unused_variables,
339        dead_code,
340        missing_docs,
341        clippy::wildcard_imports,
342        clippy::let_unit_value,
343    )]
344    use tonic::codegen::*;
345    use tonic::codegen::http::Uri;
346    /// Msg defines the slashing Msg service.
347    #[derive(Debug, Clone)]
348    pub struct MsgClient<T> {
349        inner: tonic::client::Grpc<T>,
350    }
351    impl MsgClient<tonic::transport::Channel> {
352        /// Attempt to create a new client by connecting to a given endpoint.
353        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
354        where
355            D: TryInto<tonic::transport::Endpoint>,
356            D::Error: Into<StdError>,
357        {
358            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
359            Ok(Self::new(conn))
360        }
361    }
362    impl<T> MsgClient<T>
363    where
364        T: tonic::client::GrpcService<tonic::body::BoxBody>,
365        T::Error: Into<StdError>,
366        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
367        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
368    {
369        pub fn new(inner: T) -> Self {
370            let inner = tonic::client::Grpc::new(inner);
371            Self { inner }
372        }
373        pub fn with_origin(inner: T, origin: Uri) -> Self {
374            let inner = tonic::client::Grpc::with_origin(inner, origin);
375            Self { inner }
376        }
377        pub fn with_interceptor<F>(
378            inner: T,
379            interceptor: F,
380        ) -> MsgClient<InterceptedService<T, F>>
381        where
382            F: tonic::service::Interceptor,
383            T::ResponseBody: Default,
384            T: tonic::codegen::Service<
385                http::Request<tonic::body::BoxBody>,
386                Response = http::Response<
387                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
388                >,
389            >,
390            <T as tonic::codegen::Service<
391                http::Request<tonic::body::BoxBody>,
392            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
393        {
394            MsgClient::new(InterceptedService::new(inner, interceptor))
395        }
396        /// Compress requests with the given encoding.
397        ///
398        /// This requires the server to support it otherwise it might respond with an
399        /// error.
400        #[must_use]
401        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
402            self.inner = self.inner.send_compressed(encoding);
403            self
404        }
405        /// Enable decompressing responses.
406        #[must_use]
407        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
408            self.inner = self.inner.accept_compressed(encoding);
409            self
410        }
411        /// Limits the maximum size of a decoded message.
412        ///
413        /// Default: `4MB`
414        #[must_use]
415        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
416            self.inner = self.inner.max_decoding_message_size(limit);
417            self
418        }
419        /// Limits the maximum size of an encoded message.
420        ///
421        /// Default: `usize::MAX`
422        #[must_use]
423        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
424            self.inner = self.inner.max_encoding_message_size(limit);
425            self
426        }
427        /// Unjail defines a method for unjailing a jailed validator, thus returning
428        /// them into the bonded validator set, so they can begin receiving provisions
429        /// and rewards again.
430        pub async fn unjail(
431            &mut self,
432            request: impl tonic::IntoRequest<super::MsgUnjail>,
433        ) -> std::result::Result<
434            tonic::Response<super::MsgUnjailResponse>,
435            tonic::Status,
436        > {
437            self.inner
438                .ready()
439                .await
440                .map_err(|e| {
441                    tonic::Status::unknown(
442                        format!("Service was not ready: {}", e.into()),
443                    )
444                })?;
445            let codec = tonic::codec::ProstCodec::default();
446            let path = http::uri::PathAndQuery::from_static(
447                "/cosmos.slashing.v1beta1.Msg/Unjail",
448            );
449            let mut req = request.into_request();
450            req.extensions_mut()
451                .insert(GrpcMethod::new("cosmos.slashing.v1beta1.Msg", "Unjail"));
452            self.inner.unary(req, path, codec).await
453        }
454        /// UpdateParams defines a governance operation for updating the x/slashing module
455        /// parameters. The authority defaults to the x/gov module account.
456        ///
457        /// Since: cosmos-sdk 0.47
458        pub async fn update_params(
459            &mut self,
460            request: impl tonic::IntoRequest<super::MsgUpdateParams>,
461        ) -> std::result::Result<
462            tonic::Response<super::MsgUpdateParamsResponse>,
463            tonic::Status,
464        > {
465            self.inner
466                .ready()
467                .await
468                .map_err(|e| {
469                    tonic::Status::unknown(
470                        format!("Service was not ready: {}", e.into()),
471                    )
472                })?;
473            let codec = tonic::codec::ProstCodec::default();
474            let path = http::uri::PathAndQuery::from_static(
475                "/cosmos.slashing.v1beta1.Msg/UpdateParams",
476            );
477            let mut req = request.into_request();
478            req.extensions_mut()
479                .insert(GrpcMethod::new("cosmos.slashing.v1beta1.Msg", "UpdateParams"));
480            self.inner.unary(req, path, codec).await
481        }
482    }
483}