diff --git a/.github/workflows/cosmos-sdk-proto.yml b/.github/workflows/cosmos-sdk-proto.yml index 18c6c5f9..2daf4fc7 100644 --- a/.github/workflows/cosmos-sdk-proto.yml +++ b/.github/workflows/cosmos-sdk-proto.yml @@ -22,7 +22,7 @@ jobs: strategy: matrix: rust: - - 1.56.0 # MSRV + - 1.57.0 # MSRV - stable target: - x86_64-unknown-linux-gnu @@ -43,7 +43,7 @@ jobs: strategy: matrix: rust: - - 1.56.0 # MSRV + - 1.57.0 # MSRV - stable steps: - uses: actions/checkout@v1 diff --git a/.github/workflows/cosmrs.yml b/.github/workflows/cosmrs.yml index 5b6e8513..651f2313 100644 --- a/.github/workflows/cosmrs.yml +++ b/.github/workflows/cosmrs.yml @@ -24,7 +24,7 @@ jobs: strategy: matrix: rust: - - 1.56.0 # MSRV + - 1.57.0 # MSRV - stable target: - x86_64-unknown-linux-gnu @@ -44,7 +44,7 @@ jobs: strategy: matrix: rust: - - 1.56.0 # MSRV + - 1.57.0 # MSRV - stable steps: - uses: actions/checkout@v1 diff --git a/.github/workflows/rebuild-protos.yml b/.github/workflows/rebuild-protos.yml index a966c4eb..db72a7a9 100644 --- a/.github/workflows/rebuild-protos.yml +++ b/.github/workflows/rebuild-protos.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: 1.56.0 # MSRV + toolchain: 1.57.0 # MSRV components: rustfmt override: true profile: minimal diff --git a/.github/workflows/workspace.yml b/.github/workflows/workspace.yml index 323fb483..f0e6f0ec 100644 --- a/.github/workflows/workspace.yml +++ b/.github/workflows/workspace.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: 1.56.0 # MSRV + toolchain: 1.57.0 # MSRV components: rustfmt override: true profile: minimal @@ -35,7 +35,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: 1.56.0 # MSRV + toolchain: 1.57.0 # MSRV components: clippy override: true profile: minimal diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.v1beta1.rs index 95dcbad4..13080a49 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.v1beta1.rs @@ -215,6 +215,234 @@ pub mod query_client { } } } +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + /// Accounts returns all the existing accounts + /// + /// Since: cosmos-sdk 0.43 + async fn accounts( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// Account returns account details based on address. + async fn account( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// Params queries all parameters. + async fn params( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + /// Query defines the gRPC querier service. + #[derive(Debug)] + pub struct QueryServer { + inner: _Inner, + accept_compression_encodings: (), + send_compression_encodings: (), + } + struct _Inner(Arc); + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.auth.v1beta1.Query/Accounts" => { + #[allow(non_camel_case_types)] + struct AccountsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for AccountsSvc { + type Response = super::QueryAccountsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).accounts(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AccountsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.auth.v1beta1.Query/Account" => { + #[allow(non_camel_case_types)] + struct AccountSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for AccountSvc { + type Response = super::QueryAccountResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).account(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AccountSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.auth.v1beta1.Query/Params" => { + #[allow(non_camel_case_types)] + struct ParamsSvc(pub Arc); + impl tonic::server::UnaryService + for ParamsSvc { + type Response = super::QueryParamsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).params(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl tonic::transport::NamedService for QueryServer { + const NAME: &'static str = "cosmos.auth.v1beta1.Query"; + } +} /// GenesisState defines the auth module's genesis state. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.v1beta1.rs index 8cef03ad..d9033a67 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.v1beta1.rs @@ -216,6 +216,234 @@ pub mod msg_client { } } } +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + /// Grant grants the provided authorization to the grantee on the granter's + /// account with the provided expiration time. If there is already a grant + /// for the given (granter, grantee, Authorization) triple, then the grant + /// will be overwritten. + async fn grant( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// Exec attempts to execute the provided messages using + /// authorizations granted to the grantee. Each message should have only + /// one signer corresponding to the granter of the authorization. + async fn exec( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// Revoke revokes any authorization corresponding to the provided method name on the + /// granter's account that has been granted to the grantee. + async fn revoke( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + /// Msg defines the authz Msg service. + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: (), + send_compression_encodings: (), + } + struct _Inner(Arc); + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.authz.v1beta1.Msg/Grant" => { + #[allow(non_camel_case_types)] + struct GrantSvc(pub Arc); + impl tonic::server::UnaryService + for GrantSvc { + type Response = super::MsgGrantResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).grant(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GrantSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.authz.v1beta1.Msg/Exec" => { + #[allow(non_camel_case_types)] + struct ExecSvc(pub Arc); + impl tonic::server::UnaryService + for ExecSvc { + type Response = super::MsgExecResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).exec(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ExecSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.authz.v1beta1.Msg/Revoke" => { + #[allow(non_camel_case_types)] + struct RevokeSvc(pub Arc); + impl tonic::server::UnaryService + for RevokeSvc { + type Response = super::MsgRevokeResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).revoke(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = RevokeSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl tonic::transport::NamedService for MsgServer { + const NAME: &'static str = "cosmos.authz.v1beta1.Msg"; + } +} /// QueryGrantsRequest is the request type for the Query/Grants RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGrantsRequest { @@ -413,6 +641,240 @@ pub mod query_client { } } } +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + /// Returns list of `Authorization`, granted to the grantee by the granter. + async fn grants( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// GranterGrants returns list of `GrantAuthorization`, granted by granter. + /// + /// Since: cosmos-sdk 0.45.2 + async fn granter_grants( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// GranteeGrants returns a list of `GrantAuthorization` by grantee. + /// + /// Since: cosmos-sdk 0.45.2 + async fn grantee_grants( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + /// Query defines the gRPC querier service. + #[derive(Debug)] + pub struct QueryServer { + inner: _Inner, + accept_compression_encodings: (), + send_compression_encodings: (), + } + struct _Inner(Arc); + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.authz.v1beta1.Query/Grants" => { + #[allow(non_camel_case_types)] + struct GrantsSvc(pub Arc); + impl tonic::server::UnaryService + for GrantsSvc { + type Response = super::QueryGrantsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).grants(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GrantsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.authz.v1beta1.Query/GranterGrants" => { + #[allow(non_camel_case_types)] + struct GranterGrantsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for GranterGrantsSvc { + type Response = super::QueryGranterGrantsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).granter_grants(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GranterGrantsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.authz.v1beta1.Query/GranteeGrants" => { + #[allow(non_camel_case_types)] + struct GranteeGrantsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for GranteeGrantsSvc { + type Response = super::QueryGranteeGrantsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).grantee_grants(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GranteeGrantsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl tonic::transport::NamedService for QueryServer { + const NAME: &'static str = "cosmos.authz.v1beta1.Query"; + } +} /// EventGrant is emitted on Msg/Grant #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventGrant { diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.rs index ef5f383d..7503a957 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.rs @@ -222,6 +222,187 @@ pub mod msg_client { } } } +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + /// Send defines a method for sending coins from one account to another account. + async fn send( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// MultiSend defines a method for sending coins from some accounts to other accounts. + async fn multi_send( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + /// Msg defines the bank Msg service. + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: (), + send_compression_encodings: (), + } + struct _Inner(Arc); + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.bank.v1beta1.Msg/Send" => { + #[allow(non_camel_case_types)] + struct SendSvc(pub Arc); + impl tonic::server::UnaryService + for SendSvc { + type Response = super::MsgSendResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).send(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SendSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.bank.v1beta1.Msg/MultiSend" => { + #[allow(non_camel_case_types)] + struct MultiSendSvc(pub Arc); + impl tonic::server::UnaryService + for MultiSendSvc { + type Response = super::MsgMultiSendResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).multi_send(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = MultiSendSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl tonic::transport::NamedService for MsgServer { + const NAME: &'static str = "cosmos.bank.v1beta1.Msg"; + } +} /// QueryBalanceRequest is the request type for the Query/Balance RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryBalanceRequest { @@ -477,9 +658,9 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -597,6 +778,461 @@ pub mod query_client { } } } +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + /// Balance queries the balance of a single coin for a single account. + async fn balance( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// AllBalances queries the balance of all coins for a single account. + async fn all_balances( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// SpendableBalances queries the spenable balance of all coins for a single + /// account. + async fn spendable_balances( + &self, + request: tonic::Request, + ) -> Result< + tonic::Response, + tonic::Status, + >; + /// TotalSupply queries the total supply of all coins. + async fn total_supply( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// SupplyOf queries the supply of a single coin. + async fn supply_of( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// Params queries the parameters of x/bank module. + async fn params( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// DenomsMetadata queries the client metadata of a given coin denomination. + async fn denom_metadata( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// DenomsMetadata queries the client metadata for all registered coin denominations. + async fn denoms_metadata( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + /// Query defines the gRPC querier service. + #[derive(Debug)] + pub struct QueryServer { + inner: _Inner, + accept_compression_encodings: (), + send_compression_encodings: (), + } + struct _Inner(Arc); + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.bank.v1beta1.Query/Balance" => { + #[allow(non_camel_case_types)] + struct BalanceSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for BalanceSvc { + type Response = super::QueryBalanceResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).balance(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = BalanceSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.bank.v1beta1.Query/AllBalances" => { + #[allow(non_camel_case_types)] + struct AllBalancesSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for AllBalancesSvc { + type Response = super::QueryAllBalancesResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).all_balances(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AllBalancesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.bank.v1beta1.Query/SpendableBalances" => { + #[allow(non_camel_case_types)] + struct SpendableBalancesSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for SpendableBalancesSvc { + type Response = super::QuerySpendableBalancesResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).spendable_balances(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SpendableBalancesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.bank.v1beta1.Query/TotalSupply" => { + #[allow(non_camel_case_types)] + struct TotalSupplySvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for TotalSupplySvc { + type Response = super::QueryTotalSupplyResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).total_supply(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = TotalSupplySvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.bank.v1beta1.Query/SupplyOf" => { + #[allow(non_camel_case_types)] + struct SupplyOfSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for SupplyOfSvc { + type Response = super::QuerySupplyOfResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).supply_of(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SupplyOfSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.bank.v1beta1.Query/Params" => { + #[allow(non_camel_case_types)] + struct ParamsSvc(pub Arc); + impl tonic::server::UnaryService + for ParamsSvc { + type Response = super::QueryParamsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).params(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.bank.v1beta1.Query/DenomMetadata" => { + #[allow(non_camel_case_types)] + struct DenomMetadataSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for DenomMetadataSvc { + type Response = super::QueryDenomMetadataResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).denom_metadata(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DenomMetadataSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.bank.v1beta1.Query/DenomsMetadata" => { + #[allow(non_camel_case_types)] + struct DenomsMetadataSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for DenomsMetadataSvc { + type Response = super::QueryDenomsMetadataResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).denoms_metadata(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DenomsMetadataSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl tonic::transport::NamedService for QueryServer { + const NAME: &'static str = "cosmos.bank.v1beta1.Query"; + } +} /// SendAuthorization allows the grantee to spend up to spend_limit coins from /// the granter's account. /// diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v1beta1.rs index a34bb73b..d85332cf 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v1beta1.rs @@ -137,3 +137,195 @@ pub mod reflection_service_client { } } } +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod reflection_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with ReflectionServiceServer. + #[async_trait] + pub trait ReflectionService: Send + Sync + 'static { + /// ListAllInterfaces lists all the interfaces registered in the interface + /// registry. + async fn list_all_interfaces( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// ListImplementations list all the concrete types that implement a given + /// interface. + async fn list_implementations( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + /// ReflectionService defines a service for interface reflection. + #[derive(Debug)] + pub struct ReflectionServiceServer { + inner: _Inner, + accept_compression_encodings: (), + send_compression_encodings: (), + } + struct _Inner(Arc); + impl ReflectionServiceServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + } + impl tonic::codegen::Service> for ReflectionServiceServer + where + T: ReflectionService, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.base.reflection.v1beta1.ReflectionService/ListAllInterfaces" => { + #[allow(non_camel_case_types)] + struct ListAllInterfacesSvc(pub Arc); + impl< + T: ReflectionService, + > tonic::server::UnaryService + for ListAllInterfacesSvc { + type Response = super::ListAllInterfacesResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).list_all_interfaces(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ListAllInterfacesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.base.reflection.v1beta1.ReflectionService/ListImplementations" => { + #[allow(non_camel_case_types)] + struct ListImplementationsSvc(pub Arc); + impl< + T: ReflectionService, + > tonic::server::UnaryService + for ListImplementationsSvc { + type Response = super::ListImplementationsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).list_implementations(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ListImplementationsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for ReflectionServiceServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl tonic::transport::NamedService + for ReflectionServiceServer { + const NAME: &'static str = "cosmos.base.reflection.v1beta1.ReflectionService"; + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v2alpha1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v2alpha1.rs index de38c8d9..6c9c2425 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v2alpha1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v2alpha1.rs @@ -362,9 +362,9 @@ pub mod reflection_service_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -385,9 +385,9 @@ pub mod reflection_service_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -425,3 +425,391 @@ pub mod reflection_service_client { } } } +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod reflection_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with ReflectionServiceServer. + #[async_trait] + pub trait ReflectionService: Send + Sync + 'static { + /// GetAuthnDescriptor returns information on how to authenticate transactions in the application + /// NOTE: this RPC is still experimental and might be subject to breaking changes or removal in + /// future releases of the cosmos-sdk. + async fn get_authn_descriptor( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// GetChainDescriptor returns the description of the chain + async fn get_chain_descriptor( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// GetCodecDescriptor returns the descriptor of the codec of the application + async fn get_codec_descriptor( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// GetConfigurationDescriptor returns the descriptor for the sdk.Config of the application + async fn get_configuration_descriptor( + &self, + request: tonic::Request, + ) -> Result< + tonic::Response, + tonic::Status, + >; + /// GetQueryServicesDescriptor returns the available gRPC queryable services of the application + async fn get_query_services_descriptor( + &self, + request: tonic::Request, + ) -> Result< + tonic::Response, + tonic::Status, + >; + /// GetTxDescriptor returns information on the used transaction object and available msgs that can be used + async fn get_tx_descriptor( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + /// ReflectionService defines a service for application reflection. + #[derive(Debug)] + pub struct ReflectionServiceServer { + inner: _Inner, + accept_compression_encodings: (), + send_compression_encodings: (), + } + struct _Inner(Arc); + impl ReflectionServiceServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + } + impl tonic::codegen::Service> for ReflectionServiceServer + where + T: ReflectionService, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.base.reflection.v2alpha1.ReflectionService/GetAuthnDescriptor" => { + #[allow(non_camel_case_types)] + struct GetAuthnDescriptorSvc(pub Arc); + impl< + T: ReflectionService, + > tonic::server::UnaryService + for GetAuthnDescriptorSvc { + type Response = super::GetAuthnDescriptorResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).get_authn_descriptor(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetAuthnDescriptorSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.base.reflection.v2alpha1.ReflectionService/GetChainDescriptor" => { + #[allow(non_camel_case_types)] + struct GetChainDescriptorSvc(pub Arc); + impl< + T: ReflectionService, + > tonic::server::UnaryService + for GetChainDescriptorSvc { + type Response = super::GetChainDescriptorResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).get_chain_descriptor(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetChainDescriptorSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.base.reflection.v2alpha1.ReflectionService/GetCodecDescriptor" => { + #[allow(non_camel_case_types)] + struct GetCodecDescriptorSvc(pub Arc); + impl< + T: ReflectionService, + > tonic::server::UnaryService + for GetCodecDescriptorSvc { + type Response = super::GetCodecDescriptorResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).get_codec_descriptor(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetCodecDescriptorSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.base.reflection.v2alpha1.ReflectionService/GetConfigurationDescriptor" => { + #[allow(non_camel_case_types)] + struct GetConfigurationDescriptorSvc( + pub Arc, + ); + impl< + T: ReflectionService, + > tonic::server::UnaryService< + super::GetConfigurationDescriptorRequest, + > for GetConfigurationDescriptorSvc { + type Response = super::GetConfigurationDescriptorResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::GetConfigurationDescriptorRequest, + >, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).get_configuration_descriptor(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetConfigurationDescriptorSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.base.reflection.v2alpha1.ReflectionService/GetQueryServicesDescriptor" => { + #[allow(non_camel_case_types)] + struct GetQueryServicesDescriptorSvc( + pub Arc, + ); + impl< + T: ReflectionService, + > tonic::server::UnaryService< + super::GetQueryServicesDescriptorRequest, + > for GetQueryServicesDescriptorSvc { + type Response = super::GetQueryServicesDescriptorResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::GetQueryServicesDescriptorRequest, + >, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).get_query_services_descriptor(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetQueryServicesDescriptorSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.base.reflection.v2alpha1.ReflectionService/GetTxDescriptor" => { + #[allow(non_camel_case_types)] + struct GetTxDescriptorSvc(pub Arc); + impl< + T: ReflectionService, + > tonic::server::UnaryService + for GetTxDescriptorSvc { + type Response = super::GetTxDescriptorResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).get_tx_descriptor(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetTxDescriptorSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for ReflectionServiceServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl tonic::transport::NamedService + for ReflectionServiceServer { + const NAME: &'static str = "cosmos.base.reflection.v2alpha1.ReflectionService"; + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.tendermint.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.tendermint.v1beta1.rs index 43840bcc..01e1479f 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.tendermint.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.tendermint.v1beta1.rs @@ -284,9 +284,9 @@ pub mod service_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -307,9 +307,9 @@ pub mod service_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -327,3 +327,378 @@ pub mod service_client { } } } +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with ServiceServer. + #[async_trait] + pub trait Service: Send + Sync + 'static { + /// GetNodeInfo queries the current node info. + async fn get_node_info( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// GetSyncing queries node syncing. + async fn get_syncing( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// GetLatestBlock returns the latest block. + async fn get_latest_block( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// GetBlockByHeight queries block for given height. + async fn get_block_by_height( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// GetLatestValidatorSet queries latest validator-set. + async fn get_latest_validator_set( + &self, + request: tonic::Request, + ) -> Result< + tonic::Response, + tonic::Status, + >; + /// GetValidatorSetByHeight queries validator-set at a given height. + async fn get_validator_set_by_height( + &self, + request: tonic::Request, + ) -> Result< + tonic::Response, + tonic::Status, + >; + } + /// Service defines the gRPC querier service for tendermint queries. + #[derive(Debug)] + pub struct ServiceServer { + inner: _Inner, + accept_compression_encodings: (), + send_compression_encodings: (), + } + struct _Inner(Arc); + impl ServiceServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + } + impl tonic::codegen::Service> for ServiceServer + where + T: Service, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.base.tendermint.v1beta1.Service/GetNodeInfo" => { + #[allow(non_camel_case_types)] + struct GetNodeInfoSvc(pub Arc); + impl< + T: Service, + > tonic::server::UnaryService + for GetNodeInfoSvc { + type Response = super::GetNodeInfoResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).get_node_info(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetNodeInfoSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.base.tendermint.v1beta1.Service/GetSyncing" => { + #[allow(non_camel_case_types)] + struct GetSyncingSvc(pub Arc); + impl< + T: Service, + > tonic::server::UnaryService + for GetSyncingSvc { + type Response = super::GetSyncingResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).get_syncing(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetSyncingSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.base.tendermint.v1beta1.Service/GetLatestBlock" => { + #[allow(non_camel_case_types)] + struct GetLatestBlockSvc(pub Arc); + impl< + T: Service, + > tonic::server::UnaryService + for GetLatestBlockSvc { + type Response = super::GetLatestBlockResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).get_latest_block(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetLatestBlockSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.base.tendermint.v1beta1.Service/GetBlockByHeight" => { + #[allow(non_camel_case_types)] + struct GetBlockByHeightSvc(pub Arc); + impl< + T: Service, + > tonic::server::UnaryService + for GetBlockByHeightSvc { + type Response = super::GetBlockByHeightResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).get_block_by_height(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetBlockByHeightSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.base.tendermint.v1beta1.Service/GetLatestValidatorSet" => { + #[allow(non_camel_case_types)] + struct GetLatestValidatorSetSvc(pub Arc); + impl< + T: Service, + > tonic::server::UnaryService + for GetLatestValidatorSetSvc { + type Response = super::GetLatestValidatorSetResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).get_latest_validator_set(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetLatestValidatorSetSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.base.tendermint.v1beta1.Service/GetValidatorSetByHeight" => { + #[allow(non_camel_case_types)] + struct GetValidatorSetByHeightSvc(pub Arc); + impl< + T: Service, + > tonic::server::UnaryService + for GetValidatorSetByHeightSvc { + type Response = super::GetValidatorSetByHeightResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::GetValidatorSetByHeightRequest, + >, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).get_validator_set_by_height(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetValidatorSetByHeightSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for ServiceServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl tonic::transport::NamedService for ServiceServer { + const NAME: &'static str = "cosmos.base.tendermint.v1beta1.Service"; + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.v1beta1.rs index 89cb1a31..730358c7 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.v1beta1.rs @@ -103,6 +103,148 @@ pub mod msg_client { } } } +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + /// VerifyInvariant defines a method to verify a particular invariance. + async fn verify_invariant( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + /// Msg defines the bank Msg service. + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: (), + send_compression_encodings: (), + } + struct _Inner(Arc); + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.crisis.v1beta1.Msg/VerifyInvariant" => { + #[allow(non_camel_case_types)] + struct VerifyInvariantSvc(pub Arc); + impl tonic::server::UnaryService + for VerifyInvariantSvc { + type Response = super::MsgVerifyInvariantResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).verify_invariant(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = VerifyInvariantSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl tonic::transport::NamedService for MsgServer { + const NAME: &'static str = "cosmos.crisis.v1beta1.Msg"; + } +} /// GenesisState defines the crisis module's genesis state. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.rs index d93451ae..7acd3355 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.rs @@ -123,9 +123,9 @@ pub mod msg_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -147,9 +147,9 @@ pub mod msg_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -171,9 +171,9 @@ pub mod msg_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -195,9 +195,9 @@ pub mod msg_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -215,6 +215,298 @@ pub mod msg_client { } } } +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + /// SetWithdrawAddress defines a method to change the withdraw address + /// for a delegator (or validator self-delegation). + async fn set_withdraw_address( + &self, + request: tonic::Request, + ) -> Result< + tonic::Response, + tonic::Status, + >; + /// WithdrawDelegatorReward defines a method to withdraw rewards of delegator + /// from a single validator. + async fn withdraw_delegator_reward( + &self, + request: tonic::Request, + ) -> Result< + tonic::Response, + tonic::Status, + >; + /// WithdrawValidatorCommission defines a method to withdraw the + /// full commission to the validator address. + async fn withdraw_validator_commission( + &self, + request: tonic::Request, + ) -> Result< + tonic::Response, + tonic::Status, + >; + /// FundCommunityPool defines a method to allow an account to directly + /// fund the community pool. + async fn fund_community_pool( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + /// Msg defines the distribution Msg service. + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: (), + send_compression_encodings: (), + } + struct _Inner(Arc); + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.distribution.v1beta1.Msg/SetWithdrawAddress" => { + #[allow(non_camel_case_types)] + struct SetWithdrawAddressSvc(pub Arc); + impl< + T: Msg, + > tonic::server::UnaryService + for SetWithdrawAddressSvc { + type Response = super::MsgSetWithdrawAddressResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).set_withdraw_address(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SetWithdrawAddressSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.distribution.v1beta1.Msg/WithdrawDelegatorReward" => { + #[allow(non_camel_case_types)] + struct WithdrawDelegatorRewardSvc(pub Arc); + impl< + T: Msg, + > tonic::server::UnaryService + for WithdrawDelegatorRewardSvc { + type Response = super::MsgWithdrawDelegatorRewardResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).withdraw_delegator_reward(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = WithdrawDelegatorRewardSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.distribution.v1beta1.Msg/WithdrawValidatorCommission" => { + #[allow(non_camel_case_types)] + struct WithdrawValidatorCommissionSvc(pub Arc); + impl< + T: Msg, + > tonic::server::UnaryService + for WithdrawValidatorCommissionSvc { + type Response = super::MsgWithdrawValidatorCommissionResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::MsgWithdrawValidatorCommission, + >, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).withdraw_validator_commission(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = WithdrawValidatorCommissionSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.distribution.v1beta1.Msg/FundCommunityPool" => { + #[allow(non_camel_case_types)] + struct FundCommunityPoolSvc(pub Arc); + impl tonic::server::UnaryService + for FundCommunityPoolSvc { + type Response = super::MsgFundCommunityPoolResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).fund_community_pool(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = FundCommunityPoolSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl tonic::transport::NamedService for MsgServer { + const NAME: &'static str = "cosmos.distribution.v1beta1.Msg"; + } +} /// Params defines the set of params for the distribution module. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -595,9 +887,9 @@ pub mod query_client { super::QueryValidatorOutstandingRewardsRequest, >, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -618,9 +910,9 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -641,9 +933,9 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -664,9 +956,9 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -688,9 +980,9 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -711,9 +1003,9 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -734,9 +1026,9 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -774,6 +1066,541 @@ pub mod query_client { } } } +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + /// Params queries params of the distribution module. + async fn params( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// ValidatorOutstandingRewards queries rewards of a validator address. + async fn validator_outstanding_rewards( + &self, + request: tonic::Request, + ) -> Result< + tonic::Response, + tonic::Status, + >; + /// ValidatorCommission queries accumulated commission for a validator. + async fn validator_commission( + &self, + request: tonic::Request, + ) -> Result< + tonic::Response, + tonic::Status, + >; + /// ValidatorSlashes queries slash events of a validator. + async fn validator_slashes( + &self, + request: tonic::Request, + ) -> Result< + tonic::Response, + tonic::Status, + >; + /// DelegationRewards queries the total rewards accrued by a delegation. + async fn delegation_rewards( + &self, + request: tonic::Request, + ) -> Result< + tonic::Response, + tonic::Status, + >; + /// DelegationTotalRewards queries the total rewards accrued by a each + /// validator. + async fn delegation_total_rewards( + &self, + request: tonic::Request, + ) -> Result< + tonic::Response, + tonic::Status, + >; + /// DelegatorValidators queries the validators of a delegator. + async fn delegator_validators( + &self, + request: tonic::Request, + ) -> Result< + tonic::Response, + tonic::Status, + >; + /// DelegatorWithdrawAddress queries withdraw address of a delegator. + async fn delegator_withdraw_address( + &self, + request: tonic::Request, + ) -> Result< + tonic::Response, + tonic::Status, + >; + /// CommunityPool queries the community pool coins. + async fn community_pool( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + /// Query defines the gRPC querier service for distribution module. + #[derive(Debug)] + pub struct QueryServer { + inner: _Inner, + accept_compression_encodings: (), + send_compression_encodings: (), + } + struct _Inner(Arc); + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.distribution.v1beta1.Query/Params" => { + #[allow(non_camel_case_types)] + struct ParamsSvc(pub Arc); + impl tonic::server::UnaryService + for ParamsSvc { + type Response = super::QueryParamsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).params(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.distribution.v1beta1.Query/ValidatorOutstandingRewards" => { + #[allow(non_camel_case_types)] + struct ValidatorOutstandingRewardsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService< + super::QueryValidatorOutstandingRewardsRequest, + > for ValidatorOutstandingRewardsSvc { + type Response = super::QueryValidatorOutstandingRewardsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::QueryValidatorOutstandingRewardsRequest, + >, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).validator_outstanding_rewards(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ValidatorOutstandingRewardsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.distribution.v1beta1.Query/ValidatorCommission" => { + #[allow(non_camel_case_types)] + struct ValidatorCommissionSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ValidatorCommissionSvc { + type Response = super::QueryValidatorCommissionResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::QueryValidatorCommissionRequest, + >, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).validator_commission(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ValidatorCommissionSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.distribution.v1beta1.Query/ValidatorSlashes" => { + #[allow(non_camel_case_types)] + struct ValidatorSlashesSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ValidatorSlashesSvc { + type Response = super::QueryValidatorSlashesResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).validator_slashes(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ValidatorSlashesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.distribution.v1beta1.Query/DelegationRewards" => { + #[allow(non_camel_case_types)] + struct DelegationRewardsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for DelegationRewardsSvc { + type Response = super::QueryDelegationRewardsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).delegation_rewards(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DelegationRewardsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.distribution.v1beta1.Query/DelegationTotalRewards" => { + #[allow(non_camel_case_types)] + struct DelegationTotalRewardsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService< + super::QueryDelegationTotalRewardsRequest, + > for DelegationTotalRewardsSvc { + type Response = super::QueryDelegationTotalRewardsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::QueryDelegationTotalRewardsRequest, + >, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).delegation_total_rewards(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DelegationTotalRewardsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.distribution.v1beta1.Query/DelegatorValidators" => { + #[allow(non_camel_case_types)] + struct DelegatorValidatorsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for DelegatorValidatorsSvc { + type Response = super::QueryDelegatorValidatorsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::QueryDelegatorValidatorsRequest, + >, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).delegator_validators(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DelegatorValidatorsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.distribution.v1beta1.Query/DelegatorWithdrawAddress" => { + #[allow(non_camel_case_types)] + struct DelegatorWithdrawAddressSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService< + super::QueryDelegatorWithdrawAddressRequest, + > for DelegatorWithdrawAddressSvc { + type Response = super::QueryDelegatorWithdrawAddressResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::QueryDelegatorWithdrawAddressRequest, + >, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).delegator_withdraw_address(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DelegatorWithdrawAddressSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.distribution.v1beta1.Query/CommunityPool" => { + #[allow(non_camel_case_types)] + struct CommunityPoolSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for CommunityPoolSvc { + type Response = super::QueryCommunityPoolResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).community_pool(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CommunityPoolSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl tonic::transport::NamedService for QueryServer { + const NAME: &'static str = "cosmos.distribution.v1beta1.Query"; + } +} /// DelegatorWithdrawInfo is the address for where distributions rewards are /// withdrawn to by default this struct is only used at genesis to feed in /// default withdraw addresses. diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.v1beta1.rs index 0c8ca09b..54222905 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.v1beta1.rs @@ -106,6 +106,149 @@ pub mod msg_client { } } } +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + /// SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or + /// counterfactual signing. + async fn submit_evidence( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + /// Msg defines the evidence Msg service. + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: (), + send_compression_encodings: (), + } + struct _Inner(Arc); + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.evidence.v1beta1.Msg/SubmitEvidence" => { + #[allow(non_camel_case_types)] + struct SubmitEvidenceSvc(pub Arc); + impl tonic::server::UnaryService + for SubmitEvidenceSvc { + type Response = super::MsgSubmitEvidenceResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).submit_evidence(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SubmitEvidenceSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl tonic::transport::NamedService for MsgServer { + const NAME: &'static str = "cosmos.evidence.v1beta1.Msg"; + } +} /// Equivocation implements the Evidence interface and defines evidence of double /// signing misbehavior. #[derive(Clone, PartialEq, ::prost::Message)] @@ -263,6 +406,193 @@ pub mod query_client { } } } +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + /// Evidence queries evidence based on evidence hash. + async fn evidence( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// AllEvidence queries all evidence. + async fn all_evidence( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + /// Query defines the gRPC querier service. + #[derive(Debug)] + pub struct QueryServer { + inner: _Inner, + accept_compression_encodings: (), + send_compression_encodings: (), + } + struct _Inner(Arc); + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.evidence.v1beta1.Query/Evidence" => { + #[allow(non_camel_case_types)] + struct EvidenceSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for EvidenceSvc { + type Response = super::QueryEvidenceResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).evidence(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = EvidenceSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.evidence.v1beta1.Query/AllEvidence" => { + #[allow(non_camel_case_types)] + struct AllEvidenceSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for AllEvidenceSvc { + type Response = super::QueryAllEvidenceResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).all_evidence(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AllEvidenceSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl tonic::transport::NamedService for QueryServer { + const NAME: &'static str = "cosmos.evidence.v1beta1.Query"; + } +} /// GenesisState defines the evidence module's genesis state. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.v1beta1.rs index 578e4911..7d9188a6 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.v1beta1.rs @@ -143,6 +143,193 @@ pub mod msg_client { } } } +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + /// GrantAllowance grants fee allowance to the grantee on the granter's + /// account with the provided expiration time. + async fn grant_allowance( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// RevokeAllowance revokes any fee allowance of granter's account that + /// has been granted to the grantee. + async fn revoke_allowance( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + /// Msg defines the feegrant msg service. + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: (), + send_compression_encodings: (), + } + struct _Inner(Arc); + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.feegrant.v1beta1.Msg/GrantAllowance" => { + #[allow(non_camel_case_types)] + struct GrantAllowanceSvc(pub Arc); + impl tonic::server::UnaryService + for GrantAllowanceSvc { + type Response = super::MsgGrantAllowanceResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).grant_allowance(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GrantAllowanceSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.feegrant.v1beta1.Msg/RevokeAllowance" => { + #[allow(non_camel_case_types)] + struct RevokeAllowanceSvc(pub Arc); + impl tonic::server::UnaryService + for RevokeAllowanceSvc { + type Response = super::MsgRevokeAllowanceResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).revoke_allowance(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = RevokeAllowanceSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl tonic::transport::NamedService for MsgServer { + const NAME: &'static str = "cosmos.feegrant.v1beta1.Msg"; + } +} /// BasicAllowance implements Allowance with a one-time grant of tokens /// that optionally expires. The grantee can use up to SpendLimit to cover fees. #[derive(Clone, PartialEq, ::prost::Message)] @@ -350,6 +537,191 @@ pub mod query_client { } } } +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + /// Allowance returns fee granted to the grantee by the granter. + async fn allowance( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// Allowances returns all the grants for address. + async fn allowances( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + /// Query defines the gRPC querier service. + #[derive(Debug)] + pub struct QueryServer { + inner: _Inner, + accept_compression_encodings: (), + send_compression_encodings: (), + } + struct _Inner(Arc); + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.feegrant.v1beta1.Query/Allowance" => { + #[allow(non_camel_case_types)] + struct AllowanceSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for AllowanceSvc { + type Response = super::QueryAllowanceResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).allowance(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AllowanceSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.feegrant.v1beta1.Query/Allowances" => { + #[allow(non_camel_case_types)] + struct AllowancesSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for AllowancesSvc { + type Response = super::QueryAllowancesResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).allowances(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AllowancesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl tonic::transport::NamedService for QueryServer { + const NAME: &'static str = "cosmos.feegrant.v1beta1.Query"; + } +} /// GenesisState contains a set of fee allowances, persisted from the store #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1beta1.rs index 98ad63f5..ca48cc86 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1beta1.rs @@ -366,6 +366,275 @@ pub mod msg_client { } } } +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + /// SubmitProposal defines a method to create new proposal given a content. + async fn submit_proposal( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// Vote defines a method to add a vote on a specific proposal. + async fn vote( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// VoteWeighted defines a method to add a weighted vote on a specific proposal. + /// + /// Since: cosmos-sdk 0.43 + async fn vote_weighted( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// Deposit defines a method to add deposit on a specific proposal. + async fn deposit( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + /// Msg defines the bank Msg service. + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: (), + send_compression_encodings: (), + } + struct _Inner(Arc); + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.gov.v1beta1.Msg/SubmitProposal" => { + #[allow(non_camel_case_types)] + struct SubmitProposalSvc(pub Arc); + impl tonic::server::UnaryService + for SubmitProposalSvc { + type Response = super::MsgSubmitProposalResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).submit_proposal(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SubmitProposalSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.gov.v1beta1.Msg/Vote" => { + #[allow(non_camel_case_types)] + struct VoteSvc(pub Arc); + impl tonic::server::UnaryService + for VoteSvc { + type Response = super::MsgVoteResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).vote(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = VoteSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.gov.v1beta1.Msg/VoteWeighted" => { + #[allow(non_camel_case_types)] + struct VoteWeightedSvc(pub Arc); + impl tonic::server::UnaryService + for VoteWeightedSvc { + type Response = super::MsgVoteWeightedResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).vote_weighted(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = VoteWeightedSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.gov.v1beta1.Msg/Deposit" => { + #[allow(non_camel_case_types)] + struct DepositSvc(pub Arc); + impl tonic::server::UnaryService + for DepositSvc { + type Response = super::MsgDepositResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).deposit(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DepositSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl tonic::transport::NamedService for MsgServer { + const NAME: &'static str = "cosmos.gov.v1beta1.Msg"; + } +} /// QueryProposalRequest is the request type for the Query/Proposal RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalRequest { @@ -744,6 +1013,445 @@ pub mod query_client { } } } +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + /// Proposal queries proposal details based on ProposalID. + async fn proposal( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// Proposals queries all proposals based on given status. + async fn proposals( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// Vote queries voted information based on proposalID, voterAddr. + async fn vote( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// Votes queries votes of a given proposal. + async fn votes( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// Params queries all parameters of the gov module. + async fn params( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// Deposit queries single deposit information based proposalID, depositAddr. + async fn deposit( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// Deposits queries all deposits of a single proposal. + async fn deposits( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// TallyResult queries the tally of a proposal vote. + async fn tally_result( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + /// Query defines the gRPC querier service for gov module + #[derive(Debug)] + pub struct QueryServer { + inner: _Inner, + accept_compression_encodings: (), + send_compression_encodings: (), + } + struct _Inner(Arc); + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.gov.v1beta1.Query/Proposal" => { + #[allow(non_camel_case_types)] + struct ProposalSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ProposalSvc { + type Response = super::QueryProposalResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).proposal(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ProposalSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.gov.v1beta1.Query/Proposals" => { + #[allow(non_camel_case_types)] + struct ProposalsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ProposalsSvc { + type Response = super::QueryProposalsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).proposals(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ProposalsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.gov.v1beta1.Query/Vote" => { + #[allow(non_camel_case_types)] + struct VoteSvc(pub Arc); + impl tonic::server::UnaryService + for VoteSvc { + type Response = super::QueryVoteResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).vote(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = VoteSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.gov.v1beta1.Query/Votes" => { + #[allow(non_camel_case_types)] + struct VotesSvc(pub Arc); + impl tonic::server::UnaryService + for VotesSvc { + type Response = super::QueryVotesResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).votes(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = VotesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.gov.v1beta1.Query/Params" => { + #[allow(non_camel_case_types)] + struct ParamsSvc(pub Arc); + impl tonic::server::UnaryService + for ParamsSvc { + type Response = super::QueryParamsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).params(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.gov.v1beta1.Query/Deposit" => { + #[allow(non_camel_case_types)] + struct DepositSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for DepositSvc { + type Response = super::QueryDepositResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).deposit(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DepositSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.gov.v1beta1.Query/Deposits" => { + #[allow(non_camel_case_types)] + struct DepositsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for DepositsSvc { + type Response = super::QueryDepositsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).deposits(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DepositsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.gov.v1beta1.Query/TallyResult" => { + #[allow(non_camel_case_types)] + struct TallyResultSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for TallyResultSvc { + type Response = super::QueryTallyResultResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).tally_result(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = TallyResultSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl tonic::transport::NamedService for QueryServer { + const NAME: &'static str = "cosmos.gov.v1beta1.Query"; + } +} /// GenesisState defines the gov module's genesis state. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.v1beta1.rs index 3978c14f..6cd6a48d 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.v1beta1.rs @@ -180,9 +180,9 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -200,6 +200,237 @@ pub mod query_client { } } } +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + /// Params returns the total set of minting parameters. + async fn params( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// Inflation returns the current minting inflation value. + async fn inflation( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// AnnualProvisions current minting annual provisions value. + async fn annual_provisions( + &self, + request: tonic::Request, + ) -> Result< + tonic::Response, + tonic::Status, + >; + } + /// Query provides defines the gRPC querier service. + #[derive(Debug)] + pub struct QueryServer { + inner: _Inner, + accept_compression_encodings: (), + send_compression_encodings: (), + } + struct _Inner(Arc); + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.mint.v1beta1.Query/Params" => { + #[allow(non_camel_case_types)] + struct ParamsSvc(pub Arc); + impl tonic::server::UnaryService + for ParamsSvc { + type Response = super::QueryParamsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).params(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.mint.v1beta1.Query/Inflation" => { + #[allow(non_camel_case_types)] + struct InflationSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for InflationSvc { + type Response = super::QueryInflationResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).inflation(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = InflationSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.mint.v1beta1.Query/AnnualProvisions" => { + #[allow(non_camel_case_types)] + struct AnnualProvisionsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for AnnualProvisionsSvc { + type Response = super::QueryAnnualProvisionsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).annual_provisions(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AnnualProvisionsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl tonic::transport::NamedService for QueryServer { + const NAME: &'static str = "cosmos.mint.v1beta1.Query"; + } +} /// GenesisState defines the mint module's genesis state. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.params.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.params.v1beta1.rs index 8e0ce965..5aae92d9 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.params.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.params.v1beta1.rs @@ -128,3 +128,144 @@ pub mod query_client { } } } +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + /// Params queries a specific parameter of a module, given its subspace and + /// key. + async fn params( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + /// Query defines the gRPC querier service. + #[derive(Debug)] + pub struct QueryServer { + inner: _Inner, + accept_compression_encodings: (), + send_compression_encodings: (), + } + struct _Inner(Arc); + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.params.v1beta1.Query/Params" => { + #[allow(non_camel_case_types)] + struct ParamsSvc(pub Arc); + impl tonic::server::UnaryService + for ParamsSvc { + type Response = super::QueryParamsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).params(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl tonic::transport::NamedService for QueryServer { + const NAME: &'static str = "cosmos.params.v1beta1.Query"; + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.v1beta1.rs index ea11aa93..8580b91c 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.v1beta1.rs @@ -101,6 +101,148 @@ pub mod msg_client { } } } +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + /// Unjail defines a method for unjailing a jailed validator, thus returning + /// them into the bonded validator set, so they can begin receiving provisions + /// and rewards again. + async fn unjail( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + /// Msg defines the slashing Msg service. + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: (), + send_compression_encodings: (), + } + struct _Inner(Arc); + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.slashing.v1beta1.Msg/Unjail" => { + #[allow(non_camel_case_types)] + struct UnjailSvc(pub Arc); + impl tonic::server::UnaryService + for UnjailSvc { + type Response = super::MsgUnjailResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).unjail(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UnjailSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl tonic::transport::NamedService for MsgServer { + const NAME: &'static str = "cosmos.slashing.v1beta1.Msg"; + } +} /// ValidatorSigningInfo defines a validator's signing info for monitoring their /// liveness activity. #[derive(Clone, PartialEq, ::prost::Message)] @@ -315,6 +457,236 @@ pub mod query_client { } } } +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + /// Params queries the parameters of slashing module + async fn params( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// SigningInfo queries the signing info of given cons address + async fn signing_info( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// SigningInfos queries signing info of all validators + async fn signing_infos( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + /// Query provides defines the gRPC querier service + #[derive(Debug)] + pub struct QueryServer { + inner: _Inner, + accept_compression_encodings: (), + send_compression_encodings: (), + } + struct _Inner(Arc); + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.slashing.v1beta1.Query/Params" => { + #[allow(non_camel_case_types)] + struct ParamsSvc(pub Arc); + impl tonic::server::UnaryService + for ParamsSvc { + type Response = super::QueryParamsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).params(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.slashing.v1beta1.Query/SigningInfo" => { + #[allow(non_camel_case_types)] + struct SigningInfoSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for SigningInfoSvc { + type Response = super::QuerySigningInfoResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).signing_info(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SigningInfoSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.slashing.v1beta1.Query/SigningInfos" => { + #[allow(non_camel_case_types)] + struct SigningInfosSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for SigningInfosSvc { + type Response = super::QuerySigningInfosResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).signing_infos(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SigningInfosSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl tonic::transport::NamedService for QueryServer { + const NAME: &'static str = "cosmos.slashing.v1beta1.Query"; + } +} /// GenesisState defines the slashing module's genesis state. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.rs index ae5463e7..312943c2 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.rs @@ -4,9 +4,9 @@ /// (`n` is set by the staking module's `historical_entries` parameter). #[derive(Clone, PartialEq, ::prost::Message)] pub struct HistoricalInfo { - #[prost(message, optional, tag = "1")] + #[prost(message, optional, tag="1")] pub header: ::core::option::Option<::tendermint_proto::types::Header>, - #[prost(message, repeated, tag = "2")] + #[prost(message, repeated, tag="2")] pub valset: ::prost::alloc::vec::Vec, } /// CommissionRates defines the initial commission rates to be used for creating @@ -14,42 +14,42 @@ pub struct HistoricalInfo { #[derive(Clone, PartialEq, ::prost::Message)] pub struct CommissionRates { /// rate is the commission rate charged to delegators, as a fraction. - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub rate: ::prost::alloc::string::String, /// max_rate defines the maximum commission rate which validator can ever charge, as a fraction. - #[prost(string, tag = "2")] + #[prost(string, tag="2")] pub max_rate: ::prost::alloc::string::String, /// max_change_rate defines the maximum daily increase of the validator commission, as a fraction. - #[prost(string, tag = "3")] + #[prost(string, tag="3")] pub max_change_rate: ::prost::alloc::string::String, } /// Commission defines commission parameters for a given validator. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Commission { /// commission_rates defines the initial commission rates to be used for creating a validator. - #[prost(message, optional, tag = "1")] + #[prost(message, optional, tag="1")] pub commission_rates: ::core::option::Option, /// update_time is the last time the commission rate was changed. - #[prost(message, optional, tag = "2")] + #[prost(message, optional, tag="2")] pub update_time: ::core::option::Option<::prost_types::Timestamp>, } /// Description defines a validator description. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Description { /// moniker defines a human-readable name for the validator. - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub moniker: ::prost::alloc::string::String, /// identity defines an optional identity signature (ex. UPort or Keybase). - #[prost(string, tag = "2")] + #[prost(string, tag="2")] pub identity: ::prost::alloc::string::String, /// website defines an optional website link. - #[prost(string, tag = "3")] + #[prost(string, tag="3")] pub website: ::prost::alloc::string::String, /// security_contact defines an optional email for security contact. - #[prost(string, tag = "4")] + #[prost(string, tag="4")] pub security_contact: ::prost::alloc::string::String, /// details define other optional details. - #[prost(string, tag = "5")] + #[prost(string, tag="5")] pub details: ::prost::alloc::string::String, } /// Validator defines a validator, together with the total amount of the @@ -63,43 +63,43 @@ pub struct Description { #[derive(Clone, PartialEq, ::prost::Message)] pub struct Validator { /// operator_address defines the address of the validator's operator; bech encoded in JSON. - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub operator_address: ::prost::alloc::string::String, /// consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. - #[prost(message, optional, tag = "2")] + #[prost(message, optional, tag="2")] pub consensus_pubkey: ::core::option::Option<::prost_types::Any>, /// jailed defined whether the validator has been jailed from bonded status or not. - #[prost(bool, tag = "3")] + #[prost(bool, tag="3")] pub jailed: bool, /// status is the validator status (bonded/unbonding/unbonded). - #[prost(enumeration = "BondStatus", tag = "4")] + #[prost(enumeration="BondStatus", tag="4")] pub status: i32, /// tokens define the delegated tokens (incl. self-delegation). - #[prost(string, tag = "5")] + #[prost(string, tag="5")] pub tokens: ::prost::alloc::string::String, /// delegator_shares defines total shares issued to a validator's delegators. - #[prost(string, tag = "6")] + #[prost(string, tag="6")] pub delegator_shares: ::prost::alloc::string::String, /// description defines the description terms for the validator. - #[prost(message, optional, tag = "7")] + #[prost(message, optional, tag="7")] pub description: ::core::option::Option, /// unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. - #[prost(int64, tag = "8")] + #[prost(int64, tag="8")] pub unbonding_height: i64, /// unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. - #[prost(message, optional, tag = "9")] + #[prost(message, optional, tag="9")] pub unbonding_time: ::core::option::Option<::prost_types::Timestamp>, /// commission defines the commission parameters. - #[prost(message, optional, tag = "10")] + #[prost(message, optional, tag="10")] pub commission: ::core::option::Option, /// min_self_delegation is the validator's self declared minimum self delegation. - #[prost(string, tag = "11")] + #[prost(string, tag="11")] pub min_self_delegation: ::prost::alloc::string::String, } /// ValAddresses defines a repeated set of validator addresses. #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValAddresses { - #[prost(string, repeated, tag = "1")] + #[prost(string, repeated, tag="1")] pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } /// DVPair is struct that just has a delegator-validator pair with no other data. @@ -107,15 +107,15 @@ pub struct ValAddresses { /// be used to construct the key to getting an UnbondingDelegation from state. #[derive(Clone, PartialEq, ::prost::Message)] pub struct DvPair { - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub delegator_address: ::prost::alloc::string::String, - #[prost(string, tag = "2")] + #[prost(string, tag="2")] pub validator_address: ::prost::alloc::string::String, } /// DVPairs defines an array of DVPair objects. #[derive(Clone, PartialEq, ::prost::Message)] pub struct DvPairs { - #[prost(message, repeated, tag = "1")] + #[prost(message, repeated, tag="1")] pub pairs: ::prost::alloc::vec::Vec, } /// DVVTriplet is struct that just has a delegator-validator-validator triplet @@ -124,17 +124,17 @@ pub struct DvPairs { /// Redelegation from state. #[derive(Clone, PartialEq, ::prost::Message)] pub struct DvvTriplet { - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub delegator_address: ::prost::alloc::string::String, - #[prost(string, tag = "2")] + #[prost(string, tag="2")] pub validator_src_address: ::prost::alloc::string::String, - #[prost(string, tag = "3")] + #[prost(string, tag="3")] pub validator_dst_address: ::prost::alloc::string::String, } /// DVVTriplets defines an array of DVVTriplet objects. #[derive(Clone, PartialEq, ::prost::Message)] pub struct DvvTriplets { - #[prost(message, repeated, tag = "1")] + #[prost(message, repeated, tag="1")] pub triplets: ::prost::alloc::vec::Vec, } /// Delegation represents the bond with tokens held by an account. It is @@ -143,13 +143,13 @@ pub struct DvvTriplets { #[derive(Clone, PartialEq, ::prost::Message)] pub struct Delegation { /// delegator_address is the bech32-encoded address of the delegator. - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub delegator_address: ::prost::alloc::string::String, /// validator_address is the bech32-encoded address of the validator. - #[prost(string, tag = "2")] + #[prost(string, tag="2")] pub validator_address: ::prost::alloc::string::String, /// shares define the delegation shares received. - #[prost(string, tag = "3")] + #[prost(string, tag="3")] pub shares: ::prost::alloc::string::String, } /// UnbondingDelegation stores all of a single delegator's unbonding bonds @@ -157,47 +157,47 @@ pub struct Delegation { #[derive(Clone, PartialEq, ::prost::Message)] pub struct UnbondingDelegation { /// delegator_address is the bech32-encoded address of the delegator. - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub delegator_address: ::prost::alloc::string::String, /// validator_address is the bech32-encoded address of the validator. - #[prost(string, tag = "2")] + #[prost(string, tag="2")] pub validator_address: ::prost::alloc::string::String, /// entries are the unbonding delegation entries. /// /// unbonding delegation entries - #[prost(message, repeated, tag = "3")] + #[prost(message, repeated, tag="3")] pub entries: ::prost::alloc::vec::Vec, } /// UnbondingDelegationEntry defines an unbonding object with relevant metadata. #[derive(Clone, PartialEq, ::prost::Message)] pub struct UnbondingDelegationEntry { /// creation_height is the height which the unbonding took place. - #[prost(int64, tag = "1")] + #[prost(int64, tag="1")] pub creation_height: i64, /// completion_time is the unix time for unbonding completion. - #[prost(message, optional, tag = "2")] + #[prost(message, optional, tag="2")] pub completion_time: ::core::option::Option<::prost_types::Timestamp>, /// initial_balance defines the tokens initially scheduled to receive at completion. - #[prost(string, tag = "3")] + #[prost(string, tag="3")] pub initial_balance: ::prost::alloc::string::String, /// balance defines the tokens to receive at completion. - #[prost(string, tag = "4")] + #[prost(string, tag="4")] pub balance: ::prost::alloc::string::String, } /// RedelegationEntry defines a redelegation object with relevant metadata. #[derive(Clone, PartialEq, ::prost::Message)] pub struct RedelegationEntry { /// creation_height defines the height which the redelegation took place. - #[prost(int64, tag = "1")] + #[prost(int64, tag="1")] pub creation_height: i64, /// completion_time defines the unix time for redelegation completion. - #[prost(message, optional, tag = "2")] + #[prost(message, optional, tag="2")] pub completion_time: ::core::option::Option<::prost_types::Timestamp>, /// initial_balance defines the initial balance when redelegation started. - #[prost(string, tag = "3")] + #[prost(string, tag="3")] pub initial_balance: ::prost::alloc::string::String, /// shares_dst is the amount of destination-validator shares created by redelegation. - #[prost(string, tag = "4")] + #[prost(string, tag="4")] pub shares_dst: ::prost::alloc::string::String, } /// Redelegation contains the list of a particular delegator's redelegating bonds @@ -205,46 +205,46 @@ pub struct RedelegationEntry { #[derive(Clone, PartialEq, ::prost::Message)] pub struct Redelegation { /// delegator_address is the bech32-encoded address of the delegator. - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub delegator_address: ::prost::alloc::string::String, /// validator_src_address is the validator redelegation source operator address. - #[prost(string, tag = "2")] + #[prost(string, tag="2")] pub validator_src_address: ::prost::alloc::string::String, /// validator_dst_address is the validator redelegation destination operator address. - #[prost(string, tag = "3")] + #[prost(string, tag="3")] pub validator_dst_address: ::prost::alloc::string::String, /// entries are the redelegation entries. /// /// redelegation entries - #[prost(message, repeated, tag = "4")] + #[prost(message, repeated, tag="4")] pub entries: ::prost::alloc::vec::Vec, } /// Params defines the parameters for the staking module. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { /// unbonding_time is the time duration of unbonding. - #[prost(message, optional, tag = "1")] + #[prost(message, optional, tag="1")] pub unbonding_time: ::core::option::Option<::prost_types::Duration>, /// max_validators is the maximum number of validators. - #[prost(uint32, tag = "2")] + #[prost(uint32, tag="2")] pub max_validators: u32, /// max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). - #[prost(uint32, tag = "3")] + #[prost(uint32, tag="3")] pub max_entries: u32, /// historical_entries is the number of historical entries to persist. - #[prost(uint32, tag = "4")] + #[prost(uint32, tag="4")] pub historical_entries: u32, /// bond_denom defines the bondable coin denomination. - #[prost(string, tag = "5")] + #[prost(string, tag="5")] pub bond_denom: ::prost::alloc::string::String, } /// DelegationResponse is equivalent to Delegation except that it contains a /// balance in addition to shares which is more suitable for client responses. #[derive(Clone, PartialEq, ::prost::Message)] pub struct DelegationResponse { - #[prost(message, optional, tag = "1")] + #[prost(message, optional, tag="1")] pub delegation: ::core::option::Option, - #[prost(message, optional, tag = "2")] + #[prost(message, optional, tag="2")] pub balance: ::core::option::Option, } /// RedelegationEntryResponse is equivalent to a RedelegationEntry except that it @@ -252,9 +252,9 @@ pub struct DelegationResponse { /// responses. #[derive(Clone, PartialEq, ::prost::Message)] pub struct RedelegationEntryResponse { - #[prost(message, optional, tag = "1")] + #[prost(message, optional, tag="1")] pub redelegation_entry: ::core::option::Option, - #[prost(string, tag = "4")] + #[prost(string, tag="4")] pub balance: ::prost::alloc::string::String, } /// RedelegationResponse is equivalent to a Redelegation except that its entries @@ -262,18 +262,18 @@ pub struct RedelegationEntryResponse { /// responses. #[derive(Clone, PartialEq, ::prost::Message)] pub struct RedelegationResponse { - #[prost(message, optional, tag = "1")] + #[prost(message, optional, tag="1")] pub redelegation: ::core::option::Option, - #[prost(message, repeated, tag = "2")] + #[prost(message, repeated, tag="2")] pub entries: ::prost::alloc::vec::Vec, } /// Pool is used for tracking bonded and not-bonded token supply of the bond /// denomination. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Pool { - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub not_bonded_tokens: ::prost::alloc::string::String, - #[prost(string, tag = "2")] + #[prost(string, tag="2")] pub bonded_tokens: ::prost::alloc::string::String, } /// BondStatus is the status of a validator. @@ -292,91 +292,94 @@ pub enum BondStatus { /// MsgCreateValidator defines a SDK message for creating a new validator. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateValidator { - #[prost(message, optional, tag = "1")] + #[prost(message, optional, tag="1")] pub description: ::core::option::Option, - #[prost(message, optional, tag = "2")] + #[prost(message, optional, tag="2")] pub commission: ::core::option::Option, - #[prost(string, tag = "3")] + #[prost(string, tag="3")] pub min_self_delegation: ::prost::alloc::string::String, - #[prost(string, tag = "4")] + #[prost(string, tag="4")] pub delegator_address: ::prost::alloc::string::String, - #[prost(string, tag = "5")] + #[prost(string, tag="5")] pub validator_address: ::prost::alloc::string::String, - #[prost(message, optional, tag = "6")] + #[prost(message, optional, tag="6")] pub pubkey: ::core::option::Option<::prost_types::Any>, - #[prost(message, optional, tag = "7")] + #[prost(message, optional, tag="7")] pub value: ::core::option::Option, } /// MsgCreateValidatorResponse defines the Msg/CreateValidator response type. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgCreateValidatorResponse {} +pub struct MsgCreateValidatorResponse { +} /// MsgEditValidator defines a SDK message for editing an existing validator. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgEditValidator { - #[prost(message, optional, tag = "1")] + #[prost(message, optional, tag="1")] pub description: ::core::option::Option, - #[prost(string, tag = "2")] + #[prost(string, tag="2")] pub validator_address: ::prost::alloc::string::String, /// We pass a reference to the new commission rate and min self delegation as /// it's not mandatory to update. If not updated, the deserialized rate will be /// zero with no way to distinguish if an update was intended. /// REF: #2373 - #[prost(string, tag = "3")] + #[prost(string, tag="3")] pub commission_rate: ::prost::alloc::string::String, - #[prost(string, tag = "4")] + #[prost(string, tag="4")] pub min_self_delegation: ::prost::alloc::string::String, } /// MsgEditValidatorResponse defines the Msg/EditValidator response type. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgEditValidatorResponse {} +pub struct MsgEditValidatorResponse { +} /// MsgDelegate defines a SDK message for performing a delegation of coins /// from a delegator to a validator. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgDelegate { - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub delegator_address: ::prost::alloc::string::String, - #[prost(string, tag = "2")] + #[prost(string, tag="2")] pub validator_address: ::prost::alloc::string::String, - #[prost(message, optional, tag = "3")] + #[prost(message, optional, tag="3")] pub amount: ::core::option::Option, } /// MsgDelegateResponse defines the Msg/Delegate response type. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgDelegateResponse {} +pub struct MsgDelegateResponse { +} /// MsgBeginRedelegate defines a SDK message for performing a redelegation /// of coins from a delegator and source validator to a destination validator. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgBeginRedelegate { - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub delegator_address: ::prost::alloc::string::String, - #[prost(string, tag = "2")] + #[prost(string, tag="2")] pub validator_src_address: ::prost::alloc::string::String, - #[prost(string, tag = "3")] + #[prost(string, tag="3")] pub validator_dst_address: ::prost::alloc::string::String, - #[prost(message, optional, tag = "4")] + #[prost(message, optional, tag="4")] pub amount: ::core::option::Option, } /// MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgBeginRedelegateResponse { - #[prost(message, optional, tag = "1")] + #[prost(message, optional, tag="1")] pub completion_time: ::core::option::Option<::prost_types::Timestamp>, } /// MsgUndelegate defines a SDK message for performing an undelegation from a /// delegate and a validator. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUndelegate { - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub delegator_address: ::prost::alloc::string::String, - #[prost(string, tag = "2")] + #[prost(string, tag="2")] pub validator_address: ::prost::alloc::string::String, - #[prost(message, optional, tag = "3")] + #[prost(message, optional, tag="3")] pub amount: ::core::option::Option, } /// MsgUndelegateResponse defines the Msg/Undelegate response type. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUndelegateResponse { - #[prost(message, optional, tag = "1")] + #[prost(message, optional, tag="1")] pub completion_time: ::core::option::Option<::prost_types::Timestamp>, } /// Generated client implementations. @@ -414,7 +417,10 @@ pub mod msg_client { let inner = tonic::client::Grpc::new(inner); Self { inner } } - pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> MsgClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -424,8 +430,9 @@ pub mod msg_client { >::ResponseBody, >, >, - >>::Error: - Into + Send + Sync, + , + >>::Error: Into + Send + Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -449,15 +456,19 @@ pub mod msg_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/cosmos.staking.v1beta1.Msg/CreateValidator"); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.staking.v1beta1.Msg/CreateValidator", + ); self.inner.unary(request.into_request(), path, codec).await } /// EditValidator defines a method for editing an existing validator. @@ -465,15 +476,19 @@ pub mod msg_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/cosmos.staking.v1beta1.Msg/EditValidator"); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.staking.v1beta1.Msg/EditValidator", + ); self.inner.unary(request.into_request(), path, codec).await } /// Delegate defines a method for performing a delegation of coins @@ -482,14 +497,19 @@ pub mod msg_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/cosmos.staking.v1beta1.Msg/Delegate"); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.staking.v1beta1.Msg/Delegate", + ); self.inner.unary(request.into_request(), path, codec).await } /// BeginRedelegate defines a method for performing a redelegation @@ -498,15 +518,19 @@ pub mod msg_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/cosmos.staking.v1beta1.Msg/BeginRedelegate"); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.staking.v1beta1.Msg/BeginRedelegate", + ); self.inner.unary(request.into_request(), path, codec).await } /// Undelegate defines a method for performing an undelegation from a @@ -515,51 +539,368 @@ pub mod msg_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/cosmos.staking.v1beta1.Msg/Undelegate"); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.staking.v1beta1.Msg/Undelegate", + ); self.inner.unary(request.into_request(), path, codec).await } } } +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + /// CreateValidator defines a method for creating a new validator. + async fn create_validator( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// EditValidator defines a method for editing an existing validator. + async fn edit_validator( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// Delegate defines a method for performing a delegation of coins + /// from a delegator to a validator. + async fn delegate( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// BeginRedelegate defines a method for performing a redelegation + /// of coins from a delegator and source validator to a destination validator. + async fn begin_redelegate( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// Undelegate defines a method for performing an undelegation from a + /// delegate and a validator. + async fn undelegate( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + /// Msg defines the staking Msg service. + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: (), + send_compression_encodings: (), + } + struct _Inner(Arc); + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.staking.v1beta1.Msg/CreateValidator" => { + #[allow(non_camel_case_types)] + struct CreateValidatorSvc(pub Arc); + impl tonic::server::UnaryService + for CreateValidatorSvc { + type Response = super::MsgCreateValidatorResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).create_validator(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CreateValidatorSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.staking.v1beta1.Msg/EditValidator" => { + #[allow(non_camel_case_types)] + struct EditValidatorSvc(pub Arc); + impl tonic::server::UnaryService + for EditValidatorSvc { + type Response = super::MsgEditValidatorResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).edit_validator(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = EditValidatorSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.staking.v1beta1.Msg/Delegate" => { + #[allow(non_camel_case_types)] + struct DelegateSvc(pub Arc); + impl tonic::server::UnaryService + for DelegateSvc { + type Response = super::MsgDelegateResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).delegate(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DelegateSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.staking.v1beta1.Msg/BeginRedelegate" => { + #[allow(non_camel_case_types)] + struct BeginRedelegateSvc(pub Arc); + impl tonic::server::UnaryService + for BeginRedelegateSvc { + type Response = super::MsgBeginRedelegateResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).begin_redelegate(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = BeginRedelegateSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.staking.v1beta1.Msg/Undelegate" => { + #[allow(non_camel_case_types)] + struct UndelegateSvc(pub Arc); + impl tonic::server::UnaryService + for UndelegateSvc { + type Response = super::MsgUndelegateResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).undelegate(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UndelegateSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl tonic::transport::NamedService for MsgServer { + const NAME: &'static str = "cosmos.staking.v1beta1.Msg"; + } +} /// QueryValidatorsRequest is request type for Query/Validators RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorsRequest { /// status enables to query for validators matching a given status. - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub status: ::prost::alloc::string::String, /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] + #[prost(message, optional, tag="2")] pub pagination: ::core::option::Option, } /// QueryValidatorsResponse is response type for the Query/Validators RPC method #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorsResponse { /// validators contains all the queried validators. - #[prost(message, repeated, tag = "1")] + #[prost(message, repeated, tag="1")] pub validators: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] + #[prost(message, optional, tag="2")] pub pagination: ::core::option::Option, } /// QueryValidatorRequest is response type for the Query/Validator RPC method #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorRequest { /// validator_addr defines the validator address to query for. - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub validator_addr: ::prost::alloc::string::String, } /// QueryValidatorResponse is response type for the Query/Validator RPC method #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorResponse { /// validator defines the the validator info. - #[prost(message, optional, tag = "1")] + #[prost(message, optional, tag="1")] pub validator: ::core::option::Option, } /// QueryValidatorDelegationsRequest is request type for the @@ -567,20 +908,20 @@ pub struct QueryValidatorResponse { #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorDelegationsRequest { /// validator_addr defines the validator address to query for. - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub validator_addr: ::prost::alloc::string::String, /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] + #[prost(message, optional, tag="2")] pub pagination: ::core::option::Option, } /// QueryValidatorDelegationsResponse is response type for the /// Query/ValidatorDelegations RPC method #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorDelegationsResponse { - #[prost(message, repeated, tag = "1")] + #[prost(message, repeated, tag="1")] pub delegation_responses: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] + #[prost(message, optional, tag="2")] pub pagination: ::core::option::Option, } /// QueryValidatorUnbondingDelegationsRequest is required type for the @@ -588,37 +929,37 @@ pub struct QueryValidatorDelegationsResponse { #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorUnbondingDelegationsRequest { /// validator_addr defines the validator address to query for. - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub validator_addr: ::prost::alloc::string::String, /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] + #[prost(message, optional, tag="2")] pub pagination: ::core::option::Option, } /// QueryValidatorUnbondingDelegationsResponse is response type for the /// Query/ValidatorUnbondingDelegations RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorUnbondingDelegationsResponse { - #[prost(message, repeated, tag = "1")] + #[prost(message, repeated, tag="1")] pub unbonding_responses: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] + #[prost(message, optional, tag="2")] pub pagination: ::core::option::Option, } /// QueryDelegationRequest is request type for the Query/Delegation RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegationRequest { /// delegator_addr defines the delegator address to query for. - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub delegator_addr: ::prost::alloc::string::String, /// validator_addr defines the validator address to query for. - #[prost(string, tag = "2")] + #[prost(string, tag="2")] pub validator_addr: ::prost::alloc::string::String, } /// QueryDelegationResponse is response type for the Query/Delegation RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegationResponse { /// delegation_responses defines the delegation info of a delegation. - #[prost(message, optional, tag = "1")] + #[prost(message, optional, tag="1")] pub delegation_response: ::core::option::Option, } /// QueryUnbondingDelegationRequest is request type for the @@ -626,10 +967,10 @@ pub struct QueryDelegationResponse { #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUnbondingDelegationRequest { /// delegator_addr defines the delegator address to query for. - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub delegator_addr: ::prost::alloc::string::String, /// validator_addr defines the validator address to query for. - #[prost(string, tag = "2")] + #[prost(string, tag="2")] pub validator_addr: ::prost::alloc::string::String, } /// QueryDelegationResponse is response type for the Query/UnbondingDelegation @@ -637,7 +978,7 @@ pub struct QueryUnbondingDelegationRequest { #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUnbondingDelegationResponse { /// unbond defines the unbonding information of a delegation. - #[prost(message, optional, tag = "1")] + #[prost(message, optional, tag="1")] pub unbond: ::core::option::Option, } /// QueryDelegatorDelegationsRequest is request type for the @@ -645,10 +986,10 @@ pub struct QueryUnbondingDelegationResponse { #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorDelegationsRequest { /// delegator_addr defines the delegator address to query for. - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub delegator_addr: ::prost::alloc::string::String, /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] + #[prost(message, optional, tag="2")] pub pagination: ::core::option::Option, } /// QueryDelegatorDelegationsResponse is response type for the @@ -656,10 +997,10 @@ pub struct QueryDelegatorDelegationsRequest { #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorDelegationsResponse { /// delegation_responses defines all the delegations' info of a delegator. - #[prost(message, repeated, tag = "1")] + #[prost(message, repeated, tag="1")] pub delegation_responses: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] + #[prost(message, optional, tag="2")] pub pagination: ::core::option::Option, } /// QueryDelegatorUnbondingDelegationsRequest is request type for the @@ -667,20 +1008,20 @@ pub struct QueryDelegatorDelegationsResponse { #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorUnbondingDelegationsRequest { /// delegator_addr defines the delegator address to query for. - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub delegator_addr: ::prost::alloc::string::String, /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] + #[prost(message, optional, tag="2")] pub pagination: ::core::option::Option, } /// QueryUnbondingDelegatorDelegationsResponse is response type for the /// Query/UnbondingDelegatorDelegations RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorUnbondingDelegationsResponse { - #[prost(message, repeated, tag = "1")] + #[prost(message, repeated, tag="1")] pub unbonding_responses: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] + #[prost(message, optional, tag="2")] pub pagination: ::core::option::Option, } /// QueryRedelegationsRequest is request type for the Query/Redelegations RPC @@ -688,26 +1029,26 @@ pub struct QueryDelegatorUnbondingDelegationsResponse { #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryRedelegationsRequest { /// delegator_addr defines the delegator address to query for. - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub delegator_addr: ::prost::alloc::string::String, /// src_validator_addr defines the validator address to redelegate from. - #[prost(string, tag = "2")] + #[prost(string, tag="2")] pub src_validator_addr: ::prost::alloc::string::String, /// dst_validator_addr defines the validator address to redelegate to. - #[prost(string, tag = "3")] + #[prost(string, tag="3")] pub dst_validator_addr: ::prost::alloc::string::String, /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "4")] + #[prost(message, optional, tag="4")] pub pagination: ::core::option::Option, } /// QueryRedelegationsResponse is response type for the Query/Redelegations RPC /// method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryRedelegationsResponse { - #[prost(message, repeated, tag = "1")] + #[prost(message, repeated, tag="1")] pub redelegation_responses: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] + #[prost(message, optional, tag="2")] pub pagination: ::core::option::Option, } /// QueryDelegatorValidatorsRequest is request type for the @@ -715,10 +1056,10 @@ pub struct QueryRedelegationsResponse { #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorValidatorsRequest { /// delegator_addr defines the delegator address to query for. - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub delegator_addr: ::prost::alloc::string::String, /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] + #[prost(message, optional, tag="2")] pub pagination: ::core::option::Option, } /// QueryDelegatorValidatorsResponse is response type for the @@ -726,10 +1067,10 @@ pub struct QueryDelegatorValidatorsRequest { #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorValidatorsResponse { /// validators defines the the validators' info of a delegator. - #[prost(message, repeated, tag = "1")] + #[prost(message, repeated, tag="1")] pub validators: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] + #[prost(message, optional, tag="2")] pub pagination: ::core::option::Option, } /// QueryDelegatorValidatorRequest is request type for the @@ -737,10 +1078,10 @@ pub struct QueryDelegatorValidatorsResponse { #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorValidatorRequest { /// delegator_addr defines the delegator address to query for. - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub delegator_addr: ::prost::alloc::string::String, /// validator_addr defines the validator address to query for. - #[prost(string, tag = "2")] + #[prost(string, tag="2")] pub validator_addr: ::prost::alloc::string::String, } /// QueryDelegatorValidatorResponse response type for the @@ -748,7 +1089,7 @@ pub struct QueryDelegatorValidatorRequest { #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorValidatorResponse { /// validator defines the the validator info. - #[prost(message, optional, tag = "1")] + #[prost(message, optional, tag="1")] pub validator: ::core::option::Option, } /// QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC @@ -756,7 +1097,7 @@ pub struct QueryDelegatorValidatorResponse { #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryHistoricalInfoRequest { /// height defines at which height to query the historical info. - #[prost(int64, tag = "1")] + #[prost(int64, tag="1")] pub height: i64, } /// QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC @@ -764,27 +1105,29 @@ pub struct QueryHistoricalInfoRequest { #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryHistoricalInfoResponse { /// hist defines the historical info at the given height. - #[prost(message, optional, tag = "1")] + #[prost(message, optional, tag="1")] pub hist: ::core::option::Option, } /// QueryPoolRequest is request type for the Query/Pool RPC method. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPoolRequest {} +pub struct QueryPoolRequest { +} /// QueryPoolResponse is response type for the Query/Pool RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPoolResponse { /// pool defines the pool info. - #[prost(message, optional, tag = "1")] + #[prost(message, optional, tag="1")] pub pool: ::core::option::Option, } /// QueryParamsRequest is request type for the Query/Params RPC method. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryParamsRequest {} +pub struct QueryParamsRequest { +} /// QueryParamsResponse is response type for the Query/Params RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { /// params holds all the parameters of this module. - #[prost(message, optional, tag = "1")] + #[prost(message, optional, tag="1")] pub params: ::core::option::Option, } /// Generated client implementations. @@ -835,8 +1178,9 @@ pub mod query_client { >::ResponseBody, >, >, - >>::Error: - Into + Send + Sync, + , + >>::Error: Into + Send + Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -860,15 +1204,19 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/cosmos.staking.v1beta1.Query/Validators"); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.staking.v1beta1.Query/Validators", + ); self.inner.unary(request.into_request(), path, codec).await } /// Validator queries validator info for given validator address. @@ -876,29 +1224,38 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/cosmos.staking.v1beta1.Query/Validator"); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.staking.v1beta1.Query/Validator", + ); self.inner.unary(request.into_request(), path, codec).await } /// ValidatorDelegations queries delegate info for given validator. pub async fn validator_delegations( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/cosmos.staking.v1beta1.Query/ValidatorDelegations", @@ -908,15 +1265,22 @@ pub mod query_client { /// ValidatorUnbondingDelegations queries unbonding delegations of a validator. pub async fn validator_unbonding_delegations( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + request: impl tonic::IntoRequest< + super::QueryValidatorUnbondingDelegationsRequest, + >, + ) -> Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/cosmos.staking.v1beta1.Query/ValidatorUnbondingDelegations", @@ -928,15 +1292,19 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/cosmos.staking.v1beta1.Query/Delegation"); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.staking.v1beta1.Query/Delegation", + ); self.inner.unary(request.into_request(), path, codec).await } /// UnbondingDelegation queries unbonding info for given validator delegator @@ -944,14 +1312,19 @@ pub mod query_client { pub async fn unbonding_delegation( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/cosmos.staking.v1beta1.Query/UnbondingDelegation", @@ -962,14 +1335,19 @@ pub mod query_client { pub async fn delegator_delegations( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/cosmos.staking.v1beta1.Query/DelegatorDelegations", @@ -980,15 +1358,22 @@ pub mod query_client { /// delegator address. pub async fn delegator_unbonding_delegations( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + request: impl tonic::IntoRequest< + super::QueryDelegatorUnbondingDelegationsRequest, + >, + ) -> Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/cosmos.staking.v1beta1.Query/DelegatorUnbondingDelegations", @@ -1000,15 +1385,19 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/cosmos.staking.v1beta1.Query/Redelegations"); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.staking.v1beta1.Query/Redelegations", + ); self.inner.unary(request.into_request(), path, codec).await } /// DelegatorValidators queries all validators info for given delegator @@ -1016,14 +1405,19 @@ pub mod query_client { pub async fn delegator_validators( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/cosmos.staking.v1beta1.Query/DelegatorValidators", @@ -1035,14 +1429,19 @@ pub mod query_client { pub async fn delegator_validator( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/cosmos.staking.v1beta1.Query/DelegatorValidator", @@ -1054,12 +1453,15 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/cosmos.staking.v1beta1.Query/HistoricalInfo", @@ -1071,14 +1473,19 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/cosmos.staking.v1beta1.Query/Pool"); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.staking.v1beta1.Query/Pool", + ); self.inner.unary(request.into_request(), path, codec).await } /// Parameters queries the staking parameters. @@ -1086,18 +1493,781 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/cosmos.staking.v1beta1.Query/Params"); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.staking.v1beta1.Query/Params", + ); self.inner.unary(request.into_request(), path, codec).await } } } +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + /// Validators queries all validators that match the given status. + async fn validators( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// Validator queries validator info for given validator address. + async fn validator( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// ValidatorDelegations queries delegate info for given validator. + async fn validator_delegations( + &self, + request: tonic::Request, + ) -> Result< + tonic::Response, + tonic::Status, + >; + /// ValidatorUnbondingDelegations queries unbonding delegations of a validator. + async fn validator_unbonding_delegations( + &self, + request: tonic::Request, + ) -> Result< + tonic::Response, + tonic::Status, + >; + /// Delegation queries delegate info for given validator delegator pair. + async fn delegation( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// UnbondingDelegation queries unbonding info for given validator delegator + /// pair. + async fn unbonding_delegation( + &self, + request: tonic::Request, + ) -> Result< + tonic::Response, + tonic::Status, + >; + /// DelegatorDelegations queries all delegations of a given delegator address. + async fn delegator_delegations( + &self, + request: tonic::Request, + ) -> Result< + tonic::Response, + tonic::Status, + >; + /// DelegatorUnbondingDelegations queries all unbonding delegations of a given + /// delegator address. + async fn delegator_unbonding_delegations( + &self, + request: tonic::Request, + ) -> Result< + tonic::Response, + tonic::Status, + >; + /// Redelegations queries redelegations of given address. + async fn redelegations( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// DelegatorValidators queries all validators info for given delegator + /// address. + async fn delegator_validators( + &self, + request: tonic::Request, + ) -> Result< + tonic::Response, + tonic::Status, + >; + /// DelegatorValidator queries validator info for given delegator validator + /// pair. + async fn delegator_validator( + &self, + request: tonic::Request, + ) -> Result< + tonic::Response, + tonic::Status, + >; + /// HistoricalInfo queries the historical info for given height. + async fn historical_info( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// Pool queries the pool info. + async fn pool( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// Parameters queries the staking parameters. + async fn params( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + /// Query defines the gRPC querier service. + #[derive(Debug)] + pub struct QueryServer { + inner: _Inner, + accept_compression_encodings: (), + send_compression_encodings: (), + } + struct _Inner(Arc); + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.staking.v1beta1.Query/Validators" => { + #[allow(non_camel_case_types)] + struct ValidatorsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ValidatorsSvc { + type Response = super::QueryValidatorsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).validators(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ValidatorsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.staking.v1beta1.Query/Validator" => { + #[allow(non_camel_case_types)] + struct ValidatorSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ValidatorSvc { + type Response = super::QueryValidatorResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).validator(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ValidatorSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.staking.v1beta1.Query/ValidatorDelegations" => { + #[allow(non_camel_case_types)] + struct ValidatorDelegationsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService< + super::QueryValidatorDelegationsRequest, + > for ValidatorDelegationsSvc { + type Response = super::QueryValidatorDelegationsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::QueryValidatorDelegationsRequest, + >, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).validator_delegations(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ValidatorDelegationsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.staking.v1beta1.Query/ValidatorUnbondingDelegations" => { + #[allow(non_camel_case_types)] + struct ValidatorUnbondingDelegationsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService< + super::QueryValidatorUnbondingDelegationsRequest, + > for ValidatorUnbondingDelegationsSvc { + type Response = super::QueryValidatorUnbondingDelegationsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::QueryValidatorUnbondingDelegationsRequest, + >, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).validator_unbonding_delegations(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ValidatorUnbondingDelegationsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.staking.v1beta1.Query/Delegation" => { + #[allow(non_camel_case_types)] + struct DelegationSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for DelegationSvc { + type Response = super::QueryDelegationResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).delegation(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DelegationSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.staking.v1beta1.Query/UnbondingDelegation" => { + #[allow(non_camel_case_types)] + struct UnbondingDelegationSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for UnbondingDelegationSvc { + type Response = super::QueryUnbondingDelegationResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::QueryUnbondingDelegationRequest, + >, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).unbonding_delegation(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UnbondingDelegationSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.staking.v1beta1.Query/DelegatorDelegations" => { + #[allow(non_camel_case_types)] + struct DelegatorDelegationsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService< + super::QueryDelegatorDelegationsRequest, + > for DelegatorDelegationsSvc { + type Response = super::QueryDelegatorDelegationsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::QueryDelegatorDelegationsRequest, + >, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).delegator_delegations(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DelegatorDelegationsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.staking.v1beta1.Query/DelegatorUnbondingDelegations" => { + #[allow(non_camel_case_types)] + struct DelegatorUnbondingDelegationsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService< + super::QueryDelegatorUnbondingDelegationsRequest, + > for DelegatorUnbondingDelegationsSvc { + type Response = super::QueryDelegatorUnbondingDelegationsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::QueryDelegatorUnbondingDelegationsRequest, + >, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).delegator_unbonding_delegations(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DelegatorUnbondingDelegationsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.staking.v1beta1.Query/Redelegations" => { + #[allow(non_camel_case_types)] + struct RedelegationsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for RedelegationsSvc { + type Response = super::QueryRedelegationsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).redelegations(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = RedelegationsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.staking.v1beta1.Query/DelegatorValidators" => { + #[allow(non_camel_case_types)] + struct DelegatorValidatorsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for DelegatorValidatorsSvc { + type Response = super::QueryDelegatorValidatorsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::QueryDelegatorValidatorsRequest, + >, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).delegator_validators(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DelegatorValidatorsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.staking.v1beta1.Query/DelegatorValidator" => { + #[allow(non_camel_case_types)] + struct DelegatorValidatorSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for DelegatorValidatorSvc { + type Response = super::QueryDelegatorValidatorResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::QueryDelegatorValidatorRequest, + >, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).delegator_validator(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DelegatorValidatorSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.staking.v1beta1.Query/HistoricalInfo" => { + #[allow(non_camel_case_types)] + struct HistoricalInfoSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for HistoricalInfoSvc { + type Response = super::QueryHistoricalInfoResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).historical_info(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = HistoricalInfoSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.staking.v1beta1.Query/Pool" => { + #[allow(non_camel_case_types)] + struct PoolSvc(pub Arc); + impl tonic::server::UnaryService + for PoolSvc { + type Response = super::QueryPoolResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).pool(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = PoolSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.staking.v1beta1.Query/Params" => { + #[allow(non_camel_case_types)] + struct ParamsSvc(pub Arc); + impl tonic::server::UnaryService + for ParamsSvc { + type Response = super::QueryParamsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).params(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl tonic::transport::NamedService for QueryServer { + const NAME: &'static str = "cosmos.staking.v1beta1.Query"; + } +} /// StakeAuthorization defines authorization for delegate/undelegate/redelegate. /// /// Since: cosmos-sdk 0.43 @@ -1105,16 +2275,13 @@ pub mod query_client { pub struct StakeAuthorization { /// max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is /// empty, there is no spend limit and any amount of coins can be delegated. - #[prost(message, optional, tag = "1")] + #[prost(message, optional, tag="1")] pub max_tokens: ::core::option::Option, /// authorization_type defines one of AuthorizationType. - #[prost(enumeration = "AuthorizationType", tag = "4")] + #[prost(enumeration="AuthorizationType", tag="4")] pub authorization_type: i32, /// validators is the oneof that represents either allow_list or deny_list - #[prost( - oneof = "stake_authorization::IsStakeAuthorizationValidators", - tags = "2, 3" - )] + #[prost(oneof="stake_authorization::IsStakeAuthorizationValidators", tags="2, 3")] pub validators: ::core::option::Option, } /// Nested message and enum types in `StakeAuthorization`. @@ -1122,7 +2289,7 @@ pub mod stake_authorization { /// Validators defines list of validator addresses. #[derive(Clone, PartialEq, ::prost::Message)] pub struct StakeAuthorizationValidators { - #[prost(string, repeated, tag = "1")] + #[prost(string, repeated, tag="1")] pub address: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } /// validators is the oneof that represents either allow_list or deny_list @@ -1130,10 +2297,10 @@ pub mod stake_authorization { pub enum IsStakeAuthorizationValidators { /// allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's /// account. - #[prost(message, tag = "2")] + #[prost(message, tag="2")] AllowList(StakeAuthorizationValidators), /// deny_list specifies list of validator addresses to whom grantee can not delegate tokens. - #[prost(message, tag = "3")] + #[prost(message, tag="3")] DenyList(StakeAuthorizationValidators), } } @@ -1156,38 +2323,38 @@ pub enum AuthorizationType { #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { /// params defines all the paramaters of related to deposit. - #[prost(message, optional, tag = "1")] + #[prost(message, optional, tag="1")] pub params: ::core::option::Option, /// last_total_power tracks the total amounts of bonded tokens recorded during /// the previous end block. - #[prost(bytes = "vec", tag = "2")] + #[prost(bytes="vec", tag="2")] pub last_total_power: ::prost::alloc::vec::Vec, /// last_validator_powers is a special index that provides a historical list /// of the last-block's bonded validators. - #[prost(message, repeated, tag = "3")] + #[prost(message, repeated, tag="3")] pub last_validator_powers: ::prost::alloc::vec::Vec, /// delegations defines the validator set at genesis. - #[prost(message, repeated, tag = "4")] + #[prost(message, repeated, tag="4")] pub validators: ::prost::alloc::vec::Vec, /// delegations defines the delegations active at genesis. - #[prost(message, repeated, tag = "5")] + #[prost(message, repeated, tag="5")] pub delegations: ::prost::alloc::vec::Vec, /// unbonding_delegations defines the unbonding delegations active at genesis. - #[prost(message, repeated, tag = "6")] + #[prost(message, repeated, tag="6")] pub unbonding_delegations: ::prost::alloc::vec::Vec, /// redelegations defines the redelegations active at genesis. - #[prost(message, repeated, tag = "7")] + #[prost(message, repeated, tag="7")] pub redelegations: ::prost::alloc::vec::Vec, - #[prost(bool, tag = "8")] + #[prost(bool, tag="8")] pub exported: bool, } /// LastValidatorPower required for validator set update logic. #[derive(Clone, PartialEq, ::prost::Message)] pub struct LastValidatorPower { /// address is the address of the validator. - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub address: ::prost::alloc::string::String, /// power defines the power of the validator. - #[prost(int64, tag = "2")] + #[prost(int64, tag="2")] pub power: i64, } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.rs index d7c171a0..ec2481a6 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.rs @@ -506,3 +506,321 @@ pub mod service_client { } } } +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with ServiceServer. + #[async_trait] + pub trait Service: Send + Sync + 'static { + /// Simulate simulates executing a transaction for estimating gas usage. + async fn simulate( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// GetTx fetches a tx by hash. + async fn get_tx( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// BroadcastTx broadcast transaction. + async fn broadcast_tx( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// GetTxsEvent fetches txs by event. + async fn get_txs_event( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// GetBlockWithTxs fetches a block with decoded txs. + /// + /// Since: cosmos-sdk 0.45.2 + async fn get_block_with_txs( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + /// Service defines a gRPC service for interacting with transactions. + #[derive(Debug)] + pub struct ServiceServer { + inner: _Inner, + accept_compression_encodings: (), + send_compression_encodings: (), + } + struct _Inner(Arc); + impl ServiceServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + } + impl tonic::codegen::Service> for ServiceServer + where + T: Service, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.tx.v1beta1.Service/Simulate" => { + #[allow(non_camel_case_types)] + struct SimulateSvc(pub Arc); + impl tonic::server::UnaryService + for SimulateSvc { + type Response = super::SimulateResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).simulate(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SimulateSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.tx.v1beta1.Service/GetTx" => { + #[allow(non_camel_case_types)] + struct GetTxSvc(pub Arc); + impl tonic::server::UnaryService + for GetTxSvc { + type Response = super::GetTxResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).get_tx(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetTxSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.tx.v1beta1.Service/BroadcastTx" => { + #[allow(non_camel_case_types)] + struct BroadcastTxSvc(pub Arc); + impl< + T: Service, + > tonic::server::UnaryService + for BroadcastTxSvc { + type Response = super::BroadcastTxResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).broadcast_tx(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = BroadcastTxSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.tx.v1beta1.Service/GetTxsEvent" => { + #[allow(non_camel_case_types)] + struct GetTxsEventSvc(pub Arc); + impl< + T: Service, + > tonic::server::UnaryService + for GetTxsEventSvc { + type Response = super::GetTxsEventResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).get_txs_event(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetTxsEventSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.tx.v1beta1.Service/GetBlockWithTxs" => { + #[allow(non_camel_case_types)] + struct GetBlockWithTxsSvc(pub Arc); + impl< + T: Service, + > tonic::server::UnaryService + for GetBlockWithTxsSvc { + type Response = super::GetBlockWithTxsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).get_block_with_txs(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetBlockWithTxsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for ServiceServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl tonic::transport::NamedService for ServiceServer { + const NAME: &'static str = "cosmos.tx.v1beta1.Service"; + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.upgrade.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.upgrade.v1beta1.rs index 3d6988aa..0c687c1b 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.upgrade.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.upgrade.v1beta1.rs @@ -250,9 +250,9 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -292,3 +292,295 @@ pub mod query_client { } } } +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + /// CurrentPlan queries the current upgrade plan. + async fn current_plan( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// AppliedPlan queries a previously applied upgrade plan by its name. + async fn applied_plan( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// UpgradedConsensusState queries the consensus state that will serve + /// as a trusted kernel for the next version of this chain. It will only be + /// stored at the last height of this chain. + /// UpgradedConsensusState RPC not supported with legacy querier + /// This rpc is deprecated now that IBC has its own replacement + /// (https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) + async fn upgraded_consensus_state( + &self, + request: tonic::Request, + ) -> Result< + tonic::Response, + tonic::Status, + >; + /// ModuleVersions queries the list of module versions from state. + /// + /// Since: cosmos-sdk 0.43 + async fn module_versions( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + /// Query defines the gRPC upgrade querier service. + #[derive(Debug)] + pub struct QueryServer { + inner: _Inner, + accept_compression_encodings: (), + send_compression_encodings: (), + } + struct _Inner(Arc); + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.upgrade.v1beta1.Query/CurrentPlan" => { + #[allow(non_camel_case_types)] + struct CurrentPlanSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for CurrentPlanSvc { + type Response = super::QueryCurrentPlanResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).current_plan(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CurrentPlanSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.upgrade.v1beta1.Query/AppliedPlan" => { + #[allow(non_camel_case_types)] + struct AppliedPlanSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for AppliedPlanSvc { + type Response = super::QueryAppliedPlanResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).applied_plan(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AppliedPlanSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.upgrade.v1beta1.Query/UpgradedConsensusState" => { + #[allow(non_camel_case_types)] + struct UpgradedConsensusStateSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService< + super::QueryUpgradedConsensusStateRequest, + > for UpgradedConsensusStateSvc { + type Response = super::QueryUpgradedConsensusStateResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::QueryUpgradedConsensusStateRequest, + >, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).upgraded_consensus_state(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpgradedConsensusStateSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.upgrade.v1beta1.Query/ModuleVersions" => { + #[allow(non_camel_case_types)] + struct ModuleVersionsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ModuleVersionsSvc { + type Response = super::QueryModuleVersionsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).module_versions(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ModuleVersionsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl tonic::transport::NamedService for QueryServer { + const NAME: &'static str = "cosmos.upgrade.v1beta1.Query"; + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.v1beta1.rs index ca9d4f3e..45a18a75 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.v1beta1.rs @@ -92,9 +92,9 @@ pub mod msg_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -112,6 +112,154 @@ pub mod msg_client { } } } +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + /// CreateVestingAccount defines a method that enables creating a vesting + /// account. + async fn create_vesting_account( + &self, + request: tonic::Request, + ) -> Result< + tonic::Response, + tonic::Status, + >; + } + /// Msg defines the bank Msg service. + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: (), + send_compression_encodings: (), + } + struct _Inner(Arc); + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.vesting.v1beta1.Msg/CreateVestingAccount" => { + #[allow(non_camel_case_types)] + struct CreateVestingAccountSvc(pub Arc); + impl< + T: Msg, + > tonic::server::UnaryService + for CreateVestingAccountSvc { + type Response = super::MsgCreateVestingAccountResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).create_vesting_account(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CreateVestingAccountSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl tonic::transport::NamedService for MsgServer { + const NAME: &'static str = "cosmos.vesting.v1beta1.Msg"; + } +} /// BaseVestingAccount implements the VestingAccount interface. It contains all /// the necessary fields needed for any vesting account implementation. #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.channel.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.channel.v1.rs index 08205cc3..3c23622d 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.channel.v1.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.channel.v1.rs @@ -507,9 +507,9 @@ pub mod msg_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -551,9 +551,9 @@ pub mod msg_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -1114,9 +1114,9 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -1138,9 +1138,9 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -1162,9 +1162,9 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -1185,9 +1185,9 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -1209,9 +1209,9 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -1253,9 +1253,9 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -1277,9 +1277,9 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -1301,9 +1301,9 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -1345,9 +1345,9 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.client.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.client.v1.rs index 4d602cf2..01d4456c 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.client.v1.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.client.v1.rs @@ -313,9 +313,9 @@ pub mod msg_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -620,9 +620,9 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -683,9 +683,9 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -706,9 +706,9 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.connection.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.connection.v1.rs index e4afc63a..53b2656f 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.connection.v1.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.connection.v1.rs @@ -302,9 +302,9 @@ pub mod msg_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -325,9 +325,9 @@ pub mod msg_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -348,9 +348,9 @@ pub mod msg_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -372,9 +372,9 @@ pub mod msg_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -624,9 +624,9 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -648,9 +648,9 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -672,9 +672,9 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await diff --git a/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.rs b/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.rs index 4c35bd92..94f50aae 100644 --- a/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.rs +++ b/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.rs @@ -350,9 +350,9 @@ pub mod msg_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -723,9 +723,9 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -746,9 +746,9 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -769,9 +769,9 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -792,9 +792,9 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -815,9 +815,9 @@ pub mod query_client { &mut self, request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, - tonic::Status, - > { + tonic::Response, + tonic::Status, + > { self.inner .ready() .await diff --git a/proto-build/src/main.rs b/proto-build/src/main.rs index 489a92c6..f62be962 100644 --- a/proto-build/src/main.rs +++ b/proto-build/src/main.rs @@ -216,7 +216,7 @@ fn compile_sdk_protos_and_services(out_dir: &Path) { info!("Compiling proto definitions and clients for GRPC services!"); tonic_build::configure() .build_client(true) - .build_server(false) + .build_server(true) .out_dir(out_dir) .extern_path(".tendermint", "::tendermint_proto") .compile(&protos, &includes) @@ -371,12 +371,19 @@ fn copy_and_patch(src: impl AsRef, dest: impl AsRef) -> io::Result<( #[cfg(feature = \"grpc\")]\n\ #[cfg_attr(docsrs, doc(cfg(feature = \"grpc\")))]", ), - // Feature-gate gRPC client impls which use `tonic::transport` + // Feature-gate gRPC impls which use `tonic::transport` ( - "impl (.+)Client", + "impl(.+)tonic::transport(.+)", "#[cfg(feature = \"grpc-transport\")]\n \ #[cfg_attr(docsrs, doc(cfg(feature = \"grpc-transport\")))]\n \ - impl ${1}Client", + impl${1}tonic::transport${2}", + ), + // Feature-gate gRPC server modules + ( + "/// Generated server implementations.", + "/// Generated server implementations.\n\ + #[cfg(feature = \"grpc\")]\n\ + #[cfg_attr(docsrs, doc(cfg(feature = \"grpc\")))]", ), ]; diff --git a/rust-toolchain b/rust-toolchain index 3ebf789f..373aea97 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.56.0 +1.57.0