terra_proto_rs/models/
pob.builder.v1.rs

1/// GenesisState defines the genesis state of the x/builder module.
2#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct GenesisState {
5    #[prost(message, optional, tag = "1")]
6    pub params: ::core::option::Option<Params>,
7}
8/// Params defines the parameters of the x/builder module.
9#[allow(clippy::derive_partial_eq_without_eq)]
10#[derive(Clone, PartialEq, ::prost::Message)]
11pub struct Params {
12    /// max_bundle_size is the maximum number of transactions that can be bundled
13    /// in a single bundle.
14    #[prost(uint32, tag = "1")]
15    pub max_bundle_size: u32,
16    /// escrow_account_address is the address of the account that will receive a
17    /// portion of the bid proceeds.
18    #[prost(bytes = "vec", tag = "2")]
19    pub escrow_account_address: ::prost::alloc::vec::Vec<u8>,
20    /// reserve_fee specifies the bid floor for the auction.
21    #[prost(message, optional, tag = "3")]
22    pub reserve_fee: ::core::option::Option<super::super::super::cosmos::base::v1beta1::Coin>,
23    /// min_bid_increment specifies the minimum amount that the next bid must be
24    /// greater than the previous bid.
25    #[prost(message, optional, tag = "4")]
26    pub min_bid_increment: ::core::option::Option<super::super::super::cosmos::base::v1beta1::Coin>,
27    /// front_running_protection specifies whether front running and sandwich
28    /// attack protection is enabled.
29    #[prost(bool, tag = "5")]
30    pub front_running_protection: bool,
31    /// proposer_fee defines the portion of the winning bid that goes to the block
32    /// proposer that proposed the block.
33    #[prost(string, tag = "6")]
34    pub proposer_fee: ::prost::alloc::string::String,
35}
36/// MsgAuctionBid defines a request type for sending bids to the x/builder
37/// module.
38#[allow(clippy::derive_partial_eq_without_eq)]
39#[derive(Clone, PartialEq, ::prost::Message)]
40pub struct MsgAuctionBid {
41    /// bidder is the address of the account that is submitting a bid to the
42    /// auction.
43    #[prost(string, tag = "1")]
44    pub bidder: ::prost::alloc::string::String,
45    /// bid is the amount of coins that the bidder is bidding to participate in the
46    /// auction.
47    #[prost(message, optional, tag = "2")]
48    pub bid: ::core::option::Option<super::super::super::cosmos::base::v1beta1::Coin>,
49    /// transactions are the bytes of the transactions that the bidder wants to
50    /// bundle together.
51    #[prost(bytes = "vec", repeated, tag = "3")]
52    pub transactions: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
53}
54/// MsgAuctionBidResponse defines the Msg/AuctionBid response type.
55#[allow(clippy::derive_partial_eq_without_eq)]
56#[derive(Clone, PartialEq, ::prost::Message)]
57pub struct MsgAuctionBidResponse {}
58/// MsgUpdateParams defines a request type for updating the x/builder module
59/// parameters.
60#[allow(clippy::derive_partial_eq_without_eq)]
61#[derive(Clone, PartialEq, ::prost::Message)]
62pub struct MsgUpdateParams {
63    /// authority is the address of the account that is authorized to update the
64    /// x/builder module parameters.
65    #[prost(string, tag = "1")]
66    pub authority: ::prost::alloc::string::String,
67    /// params is the new parameters for the x/builder module.
68    #[prost(message, optional, tag = "2")]
69    pub params: ::core::option::Option<Params>,
70}
71/// MsgUpdateParamsResponse defines the Msg/UpdateParams response type.
72#[allow(clippy::derive_partial_eq_without_eq)]
73#[derive(Clone, PartialEq, ::prost::Message)]
74pub struct MsgUpdateParamsResponse {}
75/// Generated client implementations.
76#[cfg(feature = "grpc")]
77#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
78pub mod msg_client {
79    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
80    use tonic::codegen::http::Uri;
81    use tonic::codegen::*;
82    /// Msg defines the x/builder Msg service.
83    #[derive(Debug, Clone)]
84    pub struct MsgClient<T> {
85        inner: tonic::client::Grpc<T>,
86    }
87    #[cfg(feature = "grpc-transport")]
88    #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))]
89    impl MsgClient<tonic::transport::Channel> {
90        /// Attempt to create a new client by connecting to a given endpoint.
91        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
92        where
93            D: std::convert::TryInto<tonic::transport::Endpoint>,
94            D::Error: Into<StdError>,
95        {
96            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
97            Ok(Self::new(conn))
98        }
99    }
100    impl<T> MsgClient<T>
101    where
102        T: tonic::client::GrpcService<tonic::body::BoxBody>,
103        T::Error: Into<StdError>,
104        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
105        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
106    {
107        pub fn new(inner: T) -> Self {
108            let inner = tonic::client::Grpc::new(inner);
109            Self { inner }
110        }
111        pub fn with_origin(inner: T, origin: Uri) -> Self {
112            let inner = tonic::client::Grpc::with_origin(inner, origin);
113            Self { inner }
114        }
115        pub fn with_interceptor<F>(inner: T, interceptor: F) -> MsgClient<InterceptedService<T, F>>
116        where
117            F: tonic::service::Interceptor,
118            T::ResponseBody: Default,
119            T: tonic::codegen::Service<
120                http::Request<tonic::body::BoxBody>,
121                Response = http::Response<
122                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
123                >,
124            >,
125            <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
126                Into<StdError> + Send + Sync,
127        {
128            MsgClient::new(InterceptedService::new(inner, interceptor))
129        }
130        /// Compress requests with the given encoding.
131        ///
132        /// This requires the server to support it otherwise it might respond with an
133        /// error.
134        #[must_use]
135        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
136            self.inner = self.inner.send_compressed(encoding);
137            self
138        }
139        /// Enable decompressing responses.
140        #[must_use]
141        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
142            self.inner = self.inner.accept_compressed(encoding);
143            self
144        }
145        /// AuctionBid defines a method for sending bids to the x/builder module.
146        pub async fn auction_bid(
147            &mut self,
148            request: impl tonic::IntoRequest<super::MsgAuctionBid>,
149        ) -> Result<tonic::Response<super::MsgAuctionBidResponse>, tonic::Status> {
150            self.inner.ready().await.map_err(|e| {
151                tonic::Status::new(
152                    tonic::Code::Unknown,
153                    format!("Service was not ready: {}", e.into()),
154                )
155            })?;
156            let codec = tonic::codec::ProstCodec::default();
157            let path = http::uri::PathAndQuery::from_static("/pob.builder.v1.Msg/AuctionBid");
158            self.inner.unary(request.into_request(), path, codec).await
159        }
160        /// UpdateParams defines a governance operation for updating the x/builder
161        /// module parameters. The authority is hard-coded to the x/gov module account.
162        pub async fn update_params(
163            &mut self,
164            request: impl tonic::IntoRequest<super::MsgUpdateParams>,
165        ) -> Result<tonic::Response<super::MsgUpdateParamsResponse>, tonic::Status> {
166            self.inner.ready().await.map_err(|e| {
167                tonic::Status::new(
168                    tonic::Code::Unknown,
169                    format!("Service was not ready: {}", e.into()),
170                )
171            })?;
172            let codec = tonic::codec::ProstCodec::default();
173            let path = http::uri::PathAndQuery::from_static("/pob.builder.v1.Msg/UpdateParams");
174            self.inner.unary(request.into_request(), path, codec).await
175        }
176    }
177}
178/// Generated server implementations.
179#[cfg(feature = "grpc")]
180#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
181pub mod msg_server {
182    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
183    use tonic::codegen::*;
184    /// Generated trait containing gRPC methods that should be implemented for use with MsgServer.
185    #[async_trait]
186    pub trait Msg: Send + Sync + 'static {
187        /// AuctionBid defines a method for sending bids to the x/builder module.
188        async fn auction_bid(
189            &self,
190            request: tonic::Request<super::MsgAuctionBid>,
191        ) -> Result<tonic::Response<super::MsgAuctionBidResponse>, tonic::Status>;
192        /// UpdateParams defines a governance operation for updating the x/builder
193        /// module parameters. The authority is hard-coded to the x/gov module account.
194        async fn update_params(
195            &self,
196            request: tonic::Request<super::MsgUpdateParams>,
197        ) -> Result<tonic::Response<super::MsgUpdateParamsResponse>, tonic::Status>;
198    }
199    /// Msg defines the x/builder Msg service.
200    #[derive(Debug)]
201    pub struct MsgServer<T: Msg> {
202        inner: _Inner<T>,
203        accept_compression_encodings: EnabledCompressionEncodings,
204        send_compression_encodings: EnabledCompressionEncodings,
205    }
206    struct _Inner<T>(Arc<T>);
207    impl<T: Msg> MsgServer<T> {
208        pub fn new(inner: T) -> Self {
209            Self::from_arc(Arc::new(inner))
210        }
211        pub fn from_arc(inner: Arc<T>) -> Self {
212            let inner = _Inner(inner);
213            Self {
214                inner,
215                accept_compression_encodings: Default::default(),
216                send_compression_encodings: Default::default(),
217            }
218        }
219        pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
220        where
221            F: tonic::service::Interceptor,
222        {
223            InterceptedService::new(Self::new(inner), interceptor)
224        }
225        /// Enable decompressing requests with the given encoding.
226        #[must_use]
227        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
228            self.accept_compression_encodings.enable(encoding);
229            self
230        }
231        /// Compress responses with the given encoding, if the client supports it.
232        #[must_use]
233        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
234            self.send_compression_encodings.enable(encoding);
235            self
236        }
237    }
238    impl<T, B> tonic::codegen::Service<http::Request<B>> for MsgServer<T>
239    where
240        T: Msg,
241        B: Body + Send + 'static,
242        B::Error: Into<StdError> + Send + 'static,
243    {
244        type Response = http::Response<tonic::body::BoxBody>;
245        type Error = std::convert::Infallible;
246        type Future = BoxFuture<Self::Response, Self::Error>;
247        fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
248            Poll::Ready(Ok(()))
249        }
250        fn call(&mut self, req: http::Request<B>) -> Self::Future {
251            let inner = self.inner.clone();
252            match req.uri().path() {
253                "/pob.builder.v1.Msg/AuctionBid" => {
254                    #[allow(non_camel_case_types)]
255                    struct AuctionBidSvc<T: Msg>(pub Arc<T>);
256                    impl<T: Msg> tonic::server::UnaryService<super::MsgAuctionBid> for AuctionBidSvc<T> {
257                        type Response = super::MsgAuctionBidResponse;
258                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
259                        fn call(
260                            &mut self,
261                            request: tonic::Request<super::MsgAuctionBid>,
262                        ) -> Self::Future {
263                            let inner = self.0.clone();
264                            let fut = async move { (*inner).auction_bid(request).await };
265                            Box::pin(fut)
266                        }
267                    }
268                    let accept_compression_encodings = self.accept_compression_encodings;
269                    let send_compression_encodings = self.send_compression_encodings;
270                    let inner = self.inner.clone();
271                    let fut = async move {
272                        let inner = inner.0;
273                        let method = AuctionBidSvc(inner);
274                        let codec = tonic::codec::ProstCodec::default();
275                        let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
276                            accept_compression_encodings,
277                            send_compression_encodings,
278                        );
279                        let res = grpc.unary(method, req).await;
280                        Ok(res)
281                    };
282                    Box::pin(fut)
283                }
284                "/pob.builder.v1.Msg/UpdateParams" => {
285                    #[allow(non_camel_case_types)]
286                    struct UpdateParamsSvc<T: Msg>(pub Arc<T>);
287                    impl<T: Msg> tonic::server::UnaryService<super::MsgUpdateParams> for UpdateParamsSvc<T> {
288                        type Response = super::MsgUpdateParamsResponse;
289                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
290                        fn call(
291                            &mut self,
292                            request: tonic::Request<super::MsgUpdateParams>,
293                        ) -> Self::Future {
294                            let inner = self.0.clone();
295                            let fut = async move { (*inner).update_params(request).await };
296                            Box::pin(fut)
297                        }
298                    }
299                    let accept_compression_encodings = self.accept_compression_encodings;
300                    let send_compression_encodings = self.send_compression_encodings;
301                    let inner = self.inner.clone();
302                    let fut = async move {
303                        let inner = inner.0;
304                        let method = UpdateParamsSvc(inner);
305                        let codec = tonic::codec::ProstCodec::default();
306                        let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
307                            accept_compression_encodings,
308                            send_compression_encodings,
309                        );
310                        let res = grpc.unary(method, req).await;
311                        Ok(res)
312                    };
313                    Box::pin(fut)
314                }
315                _ => Box::pin(async move {
316                    Ok(http::Response::builder()
317                        .status(200)
318                        .header("grpc-status", "12")
319                        .header("content-type", "application/grpc")
320                        .body(empty_body())
321                        .unwrap())
322                }),
323            }
324        }
325    }
326    impl<T: Msg> Clone for MsgServer<T> {
327        fn clone(&self) -> Self {
328            let inner = self.inner.clone();
329            Self {
330                inner,
331                accept_compression_encodings: self.accept_compression_encodings,
332                send_compression_encodings: self.send_compression_encodings,
333            }
334        }
335    }
336    impl<T: Msg> Clone for _Inner<T> {
337        fn clone(&self) -> Self {
338            Self(self.0.clone())
339        }
340    }
341    impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
342        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
343            write!(f, "{:?}", self.0)
344        }
345    }
346    impl<T: Msg> tonic::server::NamedService for MsgServer<T> {
347        const NAME: &'static str = "pob.builder.v1.Msg";
348    }
349}