#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BaseAccount {
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub pub_key: ::core::option::Option<super::super::super::google::protobuf::Any>,
#[prost(uint64, tag = "3")]
pub account_number: u64,
#[prost(uint64, tag = "4")]
pub sequence: u64,
}
impl ::prost::Name for BaseAccount {
const NAME: &'static str = "BaseAccount";
const PACKAGE: &'static str = "cosmos.auth.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
"cosmos.auth.v1beta1.BaseAccount".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/cosmos.auth.v1beta1.BaseAccount".into()
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ModuleAccount {
#[prost(message, optional, tag = "1")]
pub base_account: ::core::option::Option<BaseAccount>,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "3")]
pub permissions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
impl ::prost::Name for ModuleAccount {
const NAME: &'static str = "ModuleAccount";
const PACKAGE: &'static str = "cosmos.auth.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
"cosmos.auth.v1beta1.ModuleAccount".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/cosmos.auth.v1beta1.ModuleAccount".into()
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ModuleCredential {
#[prost(string, tag = "1")]
pub module_name: ::prost::alloc::string::String,
#[prost(bytes = "vec", repeated, tag = "2")]
pub derivation_keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
}
impl ::prost::Name for ModuleCredential {
const NAME: &'static str = "ModuleCredential";
const PACKAGE: &'static str = "cosmos.auth.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
"cosmos.auth.v1beta1.ModuleCredential".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/cosmos.auth.v1beta1.ModuleCredential".into()
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Params {
#[prost(uint64, tag = "1")]
pub max_memo_characters: u64,
#[prost(uint64, tag = "2")]
pub tx_sig_limit: u64,
#[prost(uint64, tag = "3")]
pub tx_size_cost_per_byte: u64,
#[prost(uint64, tag = "4")]
pub sig_verify_cost_ed25519: u64,
#[prost(uint64, tag = "5")]
pub sig_verify_cost_secp256k1: u64,
}
impl ::prost::Name for Params {
const NAME: &'static str = "Params";
const PACKAGE: &'static str = "cosmos.auth.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
"cosmos.auth.v1beta1.Params".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/cosmos.auth.v1beta1.Params".into()
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgUpdateParams {
#[prost(string, tag = "1")]
pub authority: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub params: ::core::option::Option<Params>,
}
impl ::prost::Name for MsgUpdateParams {
const NAME: &'static str = "MsgUpdateParams";
const PACKAGE: &'static str = "cosmos.auth.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
"cosmos.auth.v1beta1.MsgUpdateParams".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/cosmos.auth.v1beta1.MsgUpdateParams".into()
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgUpdateParamsResponse {}
impl ::prost::Name for MsgUpdateParamsResponse {
const NAME: &'static str = "MsgUpdateParamsResponse";
const PACKAGE: &'static str = "cosmos.auth.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
"cosmos.auth.v1beta1.MsgUpdateParamsResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/cosmos.auth.v1beta1.MsgUpdateParamsResponse".into()
}
}
#[cfg(feature = "client")]
pub mod msg_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct MsgClient<T> {
inner: tonic::client::Grpc<T>,
}
impl MsgClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> MsgClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> MsgClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
MsgClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn update_params(
&mut self,
request: impl tonic::IntoRequest<super::MsgUpdateParams>,
) -> std::result::Result<
tonic::Response<super::MsgUpdateParamsResponse>,
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.auth.v1beta1.Msg/UpdateParams",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("cosmos.auth.v1beta1.Msg", "UpdateParams"));
self.inner.unary(req, path, codec).await
}
}
}
#[cfg(feature = "server")]
pub mod msg_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[async_trait]
pub trait Msg: Send + Sync + 'static {
async fn update_params(
&self,
request: tonic::Request<super::MsgUpdateParams>,
) -> std::result::Result<
tonic::Response<super::MsgUpdateParamsResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct MsgServer<T: Msg> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
struct _Inner<T>(Arc<T>);
impl<T: Msg> MsgServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
let inner = _Inner(inner);
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for MsgServer<T>
where
T: Msg,
B: Body + Send + 'static,
B::Error: Into<StdError> + Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
let inner = self.inner.clone();
match req.uri().path() {
"/cosmos.auth.v1beta1.Msg/UpdateParams" => {
#[allow(non_camel_case_types)]
struct UpdateParamsSvc<T: Msg>(pub Arc<T>);
impl<T: Msg> tonic::server::UnaryService<super::MsgUpdateParams>
for UpdateParamsSvc<T> {
type Response = super::MsgUpdateParamsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::MsgUpdateParams>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Msg>::update_params(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = UpdateParamsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
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<T: Msg> Clone for MsgServer<T> {
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,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
impl<T: Msg> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(Arc::clone(&self.0))
}
}
impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.0)
}
}
impl<T: Msg> tonic::server::NamedService for MsgServer<T> {
const NAME: &'static str = "cosmos.auth.v1beta1.Msg";
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryAccountsRequest {
#[prost(message, optional, tag = "1")]
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageRequest,
>,
}
impl ::prost::Name for QueryAccountsRequest {
const NAME: &'static str = "QueryAccountsRequest";
const PACKAGE: &'static str = "cosmos.auth.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
"cosmos.auth.v1beta1.QueryAccountsRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/cosmos.auth.v1beta1.QueryAccountsRequest".into()
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryAccountsResponse {
#[prost(message, repeated, tag = "1")]
pub accounts: ::prost::alloc::vec::Vec<super::super::super::google::protobuf::Any>,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageResponse,
>,
}
impl ::prost::Name for QueryAccountsResponse {
const NAME: &'static str = "QueryAccountsResponse";
const PACKAGE: &'static str = "cosmos.auth.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
"cosmos.auth.v1beta1.QueryAccountsResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/cosmos.auth.v1beta1.QueryAccountsResponse".into()
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryAccountRequest {
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
}
impl ::prost::Name for QueryAccountRequest {
const NAME: &'static str = "QueryAccountRequest";
const PACKAGE: &'static str = "cosmos.auth.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
"cosmos.auth.v1beta1.QueryAccountRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/cosmos.auth.v1beta1.QueryAccountRequest".into()
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryAccountResponse {
#[prost(message, optional, tag = "1")]
pub account: ::core::option::Option<super::super::super::google::protobuf::Any>,
}
impl ::prost::Name for QueryAccountResponse {
const NAME: &'static str = "QueryAccountResponse";
const PACKAGE: &'static str = "cosmos.auth.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
"cosmos.auth.v1beta1.QueryAccountResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/cosmos.auth.v1beta1.QueryAccountResponse".into()
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryParamsRequest {}
impl ::prost::Name for QueryParamsRequest {
const NAME: &'static str = "QueryParamsRequest";
const PACKAGE: &'static str = "cosmos.auth.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
"cosmos.auth.v1beta1.QueryParamsRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/cosmos.auth.v1beta1.QueryParamsRequest".into()
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryParamsResponse {
#[prost(message, optional, tag = "1")]
pub params: ::core::option::Option<Params>,
}
impl ::prost::Name for QueryParamsResponse {
const NAME: &'static str = "QueryParamsResponse";
const PACKAGE: &'static str = "cosmos.auth.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
"cosmos.auth.v1beta1.QueryParamsResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/cosmos.auth.v1beta1.QueryParamsResponse".into()
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryModuleAccountsRequest {}
impl ::prost::Name for QueryModuleAccountsRequest {
const NAME: &'static str = "QueryModuleAccountsRequest";
const PACKAGE: &'static str = "cosmos.auth.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
"cosmos.auth.v1beta1.QueryModuleAccountsRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/cosmos.auth.v1beta1.QueryModuleAccountsRequest".into()
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryModuleAccountsResponse {
#[prost(message, repeated, tag = "1")]
pub accounts: ::prost::alloc::vec::Vec<super::super::super::google::protobuf::Any>,
}
impl ::prost::Name for QueryModuleAccountsResponse {
const NAME: &'static str = "QueryModuleAccountsResponse";
const PACKAGE: &'static str = "cosmos.auth.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
"cosmos.auth.v1beta1.QueryModuleAccountsResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/cosmos.auth.v1beta1.QueryModuleAccountsResponse".into()
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryModuleAccountByNameRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
impl ::prost::Name for QueryModuleAccountByNameRequest {
const NAME: &'static str = "QueryModuleAccountByNameRequest";
const PACKAGE: &'static str = "cosmos.auth.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
"cosmos.auth.v1beta1.QueryModuleAccountByNameRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/cosmos.auth.v1beta1.QueryModuleAccountByNameRequest".into()
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryModuleAccountByNameResponse {
#[prost(message, optional, tag = "1")]
pub account: ::core::option::Option<super::super::super::google::protobuf::Any>,
}
impl ::prost::Name for QueryModuleAccountByNameResponse {
const NAME: &'static str = "QueryModuleAccountByNameResponse";
const PACKAGE: &'static str = "cosmos.auth.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
"cosmos.auth.v1beta1.QueryModuleAccountByNameResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/cosmos.auth.v1beta1.QueryModuleAccountByNameResponse".into()
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Bech32PrefixRequest {}
impl ::prost::Name for Bech32PrefixRequest {
const NAME: &'static str = "Bech32PrefixRequest";
const PACKAGE: &'static str = "cosmos.auth.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
"cosmos.auth.v1beta1.Bech32PrefixRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/cosmos.auth.v1beta1.Bech32PrefixRequest".into()
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Bech32PrefixResponse {
#[prost(string, tag = "1")]
pub bech32_prefix: ::prost::alloc::string::String,
}
impl ::prost::Name for Bech32PrefixResponse {
const NAME: &'static str = "Bech32PrefixResponse";
const PACKAGE: &'static str = "cosmos.auth.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
"cosmos.auth.v1beta1.Bech32PrefixResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/cosmos.auth.v1beta1.Bech32PrefixResponse".into()
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AddressBytesToStringRequest {
#[prost(bytes = "vec", tag = "1")]
pub address_bytes: ::prost::alloc::vec::Vec<u8>,
}
impl ::prost::Name for AddressBytesToStringRequest {
const NAME: &'static str = "AddressBytesToStringRequest";
const PACKAGE: &'static str = "cosmos.auth.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
"cosmos.auth.v1beta1.AddressBytesToStringRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/cosmos.auth.v1beta1.AddressBytesToStringRequest".into()
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AddressBytesToStringResponse {
#[prost(string, tag = "1")]
pub address_string: ::prost::alloc::string::String,
}
impl ::prost::Name for AddressBytesToStringResponse {
const NAME: &'static str = "AddressBytesToStringResponse";
const PACKAGE: &'static str = "cosmos.auth.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
"cosmos.auth.v1beta1.AddressBytesToStringResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/cosmos.auth.v1beta1.AddressBytesToStringResponse".into()
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AddressStringToBytesRequest {
#[prost(string, tag = "1")]
pub address_string: ::prost::alloc::string::String,
}
impl ::prost::Name for AddressStringToBytesRequest {
const NAME: &'static str = "AddressStringToBytesRequest";
const PACKAGE: &'static str = "cosmos.auth.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
"cosmos.auth.v1beta1.AddressStringToBytesRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/cosmos.auth.v1beta1.AddressStringToBytesRequest".into()
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AddressStringToBytesResponse {
#[prost(bytes = "vec", tag = "1")]
pub address_bytes: ::prost::alloc::vec::Vec<u8>,
}
impl ::prost::Name for AddressStringToBytesResponse {
const NAME: &'static str = "AddressStringToBytesResponse";
const PACKAGE: &'static str = "cosmos.auth.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
"cosmos.auth.v1beta1.AddressStringToBytesResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/cosmos.auth.v1beta1.AddressStringToBytesResponse".into()
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryAccountAddressByIdRequest {
#[deprecated]
#[prost(int64, tag = "1")]
pub id: i64,
#[prost(uint64, tag = "2")]
pub account_id: u64,
}
impl ::prost::Name for QueryAccountAddressByIdRequest {
const NAME: &'static str = "QueryAccountAddressByIDRequest";
const PACKAGE: &'static str = "cosmos.auth.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
"cosmos.auth.v1beta1.QueryAccountAddressByIDRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/cosmos.auth.v1beta1.QueryAccountAddressByIDRequest".into()
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryAccountAddressByIdResponse {
#[prost(string, tag = "1")]
pub account_address: ::prost::alloc::string::String,
}
impl ::prost::Name for QueryAccountAddressByIdResponse {
const NAME: &'static str = "QueryAccountAddressByIDResponse";
const PACKAGE: &'static str = "cosmos.auth.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
"cosmos.auth.v1beta1.QueryAccountAddressByIDResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/cosmos.auth.v1beta1.QueryAccountAddressByIDResponse".into()
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryAccountInfoRequest {
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
}
impl ::prost::Name for QueryAccountInfoRequest {
const NAME: &'static str = "QueryAccountInfoRequest";
const PACKAGE: &'static str = "cosmos.auth.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
"cosmos.auth.v1beta1.QueryAccountInfoRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/cosmos.auth.v1beta1.QueryAccountInfoRequest".into()
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryAccountInfoResponse {
#[prost(message, optional, tag = "1")]
pub info: ::core::option::Option<BaseAccount>,
}
impl ::prost::Name for QueryAccountInfoResponse {
const NAME: &'static str = "QueryAccountInfoResponse";
const PACKAGE: &'static str = "cosmos.auth.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
"cosmos.auth.v1beta1.QueryAccountInfoResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/cosmos.auth.v1beta1.QueryAccountInfoResponse".into()
}
}
#[cfg(feature = "client")]
pub mod query_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct QueryClient<T> {
inner: tonic::client::Grpc<T>,
}
impl QueryClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> QueryClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> QueryClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
QueryClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn accounts(
&mut self,
request: impl tonic::IntoRequest<super::QueryAccountsRequest>,
) -> std::result::Result<
tonic::Response<super::QueryAccountsResponse>,
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.auth.v1beta1.Query/Accounts",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("cosmos.auth.v1beta1.Query", "Accounts"));
self.inner.unary(req, path, codec).await
}
pub async fn account(
&mut self,
request: impl tonic::IntoRequest<super::QueryAccountRequest>,
) -> std::result::Result<
tonic::Response<super::QueryAccountResponse>,
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.auth.v1beta1.Query/Account",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("cosmos.auth.v1beta1.Query", "Account"));
self.inner.unary(req, path, codec).await
}
pub async fn account_address_by_id(
&mut self,
request: impl tonic::IntoRequest<super::QueryAccountAddressByIdRequest>,
) -> std::result::Result<
tonic::Response<super::QueryAccountAddressByIdResponse>,
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.auth.v1beta1.Query/AccountAddressByID",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("cosmos.auth.v1beta1.Query", "AccountAddressByID"),
);
self.inner.unary(req, path, codec).await
}
pub async fn params(
&mut self,
request: impl tonic::IntoRequest<super::QueryParamsRequest>,
) -> std::result::Result<
tonic::Response<super::QueryParamsResponse>,
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.auth.v1beta1.Query/Params",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("cosmos.auth.v1beta1.Query", "Params"));
self.inner.unary(req, path, codec).await
}
pub async fn module_accounts(
&mut self,
request: impl tonic::IntoRequest<super::QueryModuleAccountsRequest>,
) -> std::result::Result<
tonic::Response<super::QueryModuleAccountsResponse>,
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.auth.v1beta1.Query/ModuleAccounts",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("cosmos.auth.v1beta1.Query", "ModuleAccounts"));
self.inner.unary(req, path, codec).await
}
pub async fn module_account_by_name(
&mut self,
request: impl tonic::IntoRequest<super::QueryModuleAccountByNameRequest>,
) -> std::result::Result<
tonic::Response<super::QueryModuleAccountByNameResponse>,
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.auth.v1beta1.Query/ModuleAccountByName",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("cosmos.auth.v1beta1.Query", "ModuleAccountByName"),
);
self.inner.unary(req, path, codec).await
}
pub async fn bech32_prefix(
&mut self,
request: impl tonic::IntoRequest<super::Bech32PrefixRequest>,
) -> std::result::Result<
tonic::Response<super::Bech32PrefixResponse>,
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.auth.v1beta1.Query/Bech32Prefix",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("cosmos.auth.v1beta1.Query", "Bech32Prefix"));
self.inner.unary(req, path, codec).await
}
pub async fn address_bytes_to_string(
&mut self,
request: impl tonic::IntoRequest<super::AddressBytesToStringRequest>,
) -> std::result::Result<
tonic::Response<super::AddressBytesToStringResponse>,
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.auth.v1beta1.Query/AddressBytesToString",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("cosmos.auth.v1beta1.Query", "AddressBytesToString"),
);
self.inner.unary(req, path, codec).await
}
pub async fn address_string_to_bytes(
&mut self,
request: impl tonic::IntoRequest<super::AddressStringToBytesRequest>,
) -> std::result::Result<
tonic::Response<super::AddressStringToBytesResponse>,
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.auth.v1beta1.Query/AddressStringToBytes",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("cosmos.auth.v1beta1.Query", "AddressStringToBytes"),
);
self.inner.unary(req, path, codec).await
}
pub async fn account_info(
&mut self,
request: impl tonic::IntoRequest<super::QueryAccountInfoRequest>,
) -> std::result::Result<
tonic::Response<super::QueryAccountInfoResponse>,
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.auth.v1beta1.Query/AccountInfo",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("cosmos.auth.v1beta1.Query", "AccountInfo"));
self.inner.unary(req, path, codec).await
}
}
}
#[cfg(feature = "server")]
pub mod query_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[async_trait]
pub trait Query: Send + Sync + 'static {
async fn accounts(
&self,
request: tonic::Request<super::QueryAccountsRequest>,
) -> std::result::Result<
tonic::Response<super::QueryAccountsResponse>,
tonic::Status,
>;
async fn account(
&self,
request: tonic::Request<super::QueryAccountRequest>,
) -> std::result::Result<
tonic::Response<super::QueryAccountResponse>,
tonic::Status,
>;
async fn account_address_by_id(
&self,
request: tonic::Request<super::QueryAccountAddressByIdRequest>,
) -> std::result::Result<
tonic::Response<super::QueryAccountAddressByIdResponse>,
tonic::Status,
>;
async fn params(
&self,
request: tonic::Request<super::QueryParamsRequest>,
) -> std::result::Result<
tonic::Response<super::QueryParamsResponse>,
tonic::Status,
>;
async fn module_accounts(
&self,
request: tonic::Request<super::QueryModuleAccountsRequest>,
) -> std::result::Result<
tonic::Response<super::QueryModuleAccountsResponse>,
tonic::Status,
>;
async fn module_account_by_name(
&self,
request: tonic::Request<super::QueryModuleAccountByNameRequest>,
) -> std::result::Result<
tonic::Response<super::QueryModuleAccountByNameResponse>,
tonic::Status,
>;
async fn bech32_prefix(
&self,
request: tonic::Request<super::Bech32PrefixRequest>,
) -> std::result::Result<
tonic::Response<super::Bech32PrefixResponse>,
tonic::Status,
>;
async fn address_bytes_to_string(
&self,
request: tonic::Request<super::AddressBytesToStringRequest>,
) -> std::result::Result<
tonic::Response<super::AddressBytesToStringResponse>,
tonic::Status,
>;
async fn address_string_to_bytes(
&self,
request: tonic::Request<super::AddressStringToBytesRequest>,
) -> std::result::Result<
tonic::Response<super::AddressStringToBytesResponse>,
tonic::Status,
>;
async fn account_info(
&self,
request: tonic::Request<super::QueryAccountInfoRequest>,
) -> std::result::Result<
tonic::Response<super::QueryAccountInfoResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct QueryServer<T: Query> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
struct _Inner<T>(Arc<T>);
impl<T: Query> QueryServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
let inner = _Inner(inner);
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for QueryServer<T>
where
T: Query,
B: Body + Send + 'static,
B::Error: Into<StdError> + Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
let inner = self.inner.clone();
match req.uri().path() {
"/cosmos.auth.v1beta1.Query/Accounts" => {
#[allow(non_camel_case_types)]
struct AccountsSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QueryAccountsRequest>
for AccountsSvc<T> {
type Response = super::QueryAccountsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryAccountsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::accounts(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
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,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.auth.v1beta1.Query/Account" => {
#[allow(non_camel_case_types)]
struct AccountSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QueryAccountRequest>
for AccountSvc<T> {
type Response = super::QueryAccountResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryAccountRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::account(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
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,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.auth.v1beta1.Query/AccountAddressByID" => {
#[allow(non_camel_case_types)]
struct AccountAddressByIDSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QueryAccountAddressByIdRequest>
for AccountAddressByIDSvc<T> {
type Response = super::QueryAccountAddressByIdResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::QueryAccountAddressByIdRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::account_address_by_id(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = AccountAddressByIDSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.auth.v1beta1.Query/Params" => {
#[allow(non_camel_case_types)]
struct ParamsSvc<T: Query>(pub Arc<T>);
impl<T: Query> tonic::server::UnaryService<super::QueryParamsRequest>
for ParamsSvc<T> {
type Response = super::QueryParamsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryParamsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::params(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
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,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.auth.v1beta1.Query/ModuleAccounts" => {
#[allow(non_camel_case_types)]
struct ModuleAccountsSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QueryModuleAccountsRequest>
for ModuleAccountsSvc<T> {
type Response = super::QueryModuleAccountsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryModuleAccountsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::module_accounts(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = ModuleAccountsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.auth.v1beta1.Query/ModuleAccountByName" => {
#[allow(non_camel_case_types)]
struct ModuleAccountByNameSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QueryModuleAccountByNameRequest>
for ModuleAccountByNameSvc<T> {
type Response = super::QueryModuleAccountByNameResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::QueryModuleAccountByNameRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::module_account_by_name(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = ModuleAccountByNameSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.auth.v1beta1.Query/Bech32Prefix" => {
#[allow(non_camel_case_types)]
struct Bech32PrefixSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::Bech32PrefixRequest>
for Bech32PrefixSvc<T> {
type Response = super::Bech32PrefixResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::Bech32PrefixRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::bech32_prefix(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = Bech32PrefixSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.auth.v1beta1.Query/AddressBytesToString" => {
#[allow(non_camel_case_types)]
struct AddressBytesToStringSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::AddressBytesToStringRequest>
for AddressBytesToStringSvc<T> {
type Response = super::AddressBytesToStringResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::AddressBytesToStringRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::address_bytes_to_string(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = AddressBytesToStringSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.auth.v1beta1.Query/AddressStringToBytes" => {
#[allow(non_camel_case_types)]
struct AddressStringToBytesSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::AddressStringToBytesRequest>
for AddressStringToBytesSvc<T> {
type Response = super::AddressStringToBytesResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::AddressStringToBytesRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::address_string_to_bytes(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = AddressStringToBytesSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.auth.v1beta1.Query/AccountInfo" => {
#[allow(non_camel_case_types)]
struct AccountInfoSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QueryAccountInfoRequest>
for AccountInfoSvc<T> {
type Response = super::QueryAccountInfoResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryAccountInfoRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::account_info(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = AccountInfoSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
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<T: Query> Clone for QueryServer<T> {
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,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
impl<T: Query> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(Arc::clone(&self.0))
}
}
impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.0)
}
}
impl<T: Query> tonic::server::NamedService for QueryServer<T> {
const NAME: &'static str = "cosmos.auth.v1beta1.Query";
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenesisState {
#[prost(message, optional, tag = "1")]
pub params: ::core::option::Option<Params>,
#[prost(message, repeated, tag = "2")]
pub accounts: ::prost::alloc::vec::Vec<super::super::super::google::protobuf::Any>,
}
impl ::prost::Name for GenesisState {
const NAME: &'static str = "GenesisState";
const PACKAGE: &'static str = "cosmos.auth.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
"cosmos.auth.v1beta1.GenesisState".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/cosmos.auth.v1beta1.GenesisState".into()
}
}