Skip to content

Commit

Permalink
Generate 0.46.4 proto files (#35)
Browse files Browse the repository at this point in the history
* Generate 0.46.4 proto files

* Add changelog entry

* Bump minor version and move changelog entry to `breaking-changes`

* Correctly bump minor version
  • Loading branch information
seanchen1991 authored Nov 4, 2022
1 parent ae2f745 commit 4bcd41c
Show file tree
Hide file tree
Showing 8 changed files with 379 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Update protobufs for Cosmos SDK to v0.46.4
- Adds the `module_account_by_name` method to the `Query` trait
- ([#2776](https://github.com/informalsystems/hermes/2776))
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ibc-proto"
version = "0.21.0"
version = "0.22.0"
authors = ["Informal Systems <hello@informal.systems>"]
edition = "2021"
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/COSMOS_SDK_COMMIT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
252c6736161e51342bb7dd6af984082a2b064742
eb1e3ebf6fcfd56e1f1d8f4c0a6192740bd8a6c1
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ pub mod cosmos {
include_proto!("cosmos.base.kv.v1beta1.rs");
}
}
pub mod node {
pub mod v1beta1 {
include_proto!("cosmos.base.node.v1beta1.rs");
}
}
pub mod query {
pub mod v1beta1 {
include_proto!("cosmos.base.query.v1beta1.rs");
Expand Down
126 changes: 111 additions & 15 deletions src/prost/cosmos.auth.v1beta1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,6 @@ pub struct QueryAccountRequest {
#[prost(string, tag="1")]
pub address: ::prost::alloc::string::String,
}
/// QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method.
///
/// Since: cosmos-sdk 0.46
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryModuleAccountsRequest {
}
/// QueryParamsResponse is the response type for the Query/Params RPC method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryParamsResponse {
/// params defines the parameters of the module.
#[prost(message, optional, tag="1")]
pub params: ::core::option::Option<Params>,
}
/// QueryAccountResponse is the response type for the Query/Account RPC method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryAccountResponse {
Expand All @@ -88,6 +75,19 @@ pub struct QueryAccountResponse {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryParamsRequest {
}
/// QueryParamsResponse is the response type for the Query/Params RPC method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryParamsResponse {
/// params defines the parameters of the module.
#[prost(message, optional, tag="1")]
pub params: ::core::option::Option<Params>,
}
/// QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method.
///
/// Since: cosmos-sdk 0.46
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryModuleAccountsRequest {
}
/// QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method.
///
/// Since: cosmos-sdk 0.46
Expand All @@ -96,6 +96,18 @@ pub struct QueryModuleAccountsResponse {
#[prost(message, repeated, tag="1")]
pub accounts: ::prost::alloc::vec::Vec<super::super::super::google::protobuf::Any>,
}
/// QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryModuleAccountByNameRequest {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
}
/// QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryModuleAccountByNameResponse {
#[prost(message, optional, tag="1")]
pub account: ::core::option::Option<super::super::super::google::protobuf::Any>,
}
/// Bech32PrefixRequest is the request type for Bech32Prefix rpc method.
///
/// Since: cosmos-sdk 0.46
Expand Down Expand Up @@ -143,12 +155,19 @@ pub struct AddressStringToBytesResponse {
pub address_bytes: ::prost::alloc::vec::Vec<u8>,
}
/// QueryAccountAddressByIDRequest is the request type for AccountAddressByID rpc method
///
/// Since: cosmos-sdk 0.46.2
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryAccountAddressByIdRequest {
/// id is the account number of the address to be queried. This field
/// should have been an uint64 (like all account numbers), and will be
/// updated to uint64 in a future version of the auth query.
#[prost(int64, tag="1")]
pub id: i64,
}
/// QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method
///
/// Since: cosmos-sdk 0.46.2
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryAccountAddressByIdResponse {
#[prost(string, tag="1")]
Expand Down Expand Up @@ -267,7 +286,9 @@ pub mod query_client {
);
self.inner.unary(request.into_request(), path, codec).await
}
/// AccountAddressByID returns account address based on account id
/// AccountAddressByID returns account address based on account number.
///
/// Since: cosmos-sdk 0.46.2
pub async fn account_address_by_id(
&mut self,
request: impl tonic::IntoRequest<super::QueryAccountAddressByIdRequest>,
Expand Down Expand Up @@ -332,6 +353,29 @@ pub mod query_client {
);
self.inner.unary(request.into_request(), path, codec).await
}
/// ModuleAccountByName returns the module account info by module name
pub async fn module_account_by_name(
&mut self,
request: impl tonic::IntoRequest<super::QueryModuleAccountByNameRequest>,
) -> 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",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Bech32Prefix queries bech32Prefix
///
/// Since: cosmos-sdk 0.46
Expand Down Expand Up @@ -426,7 +470,9 @@ pub mod query_server {
&self,
request: tonic::Request<super::QueryAccountRequest>,
) -> Result<tonic::Response<super::QueryAccountResponse>, tonic::Status>;
/// AccountAddressByID returns account address based on account id
/// AccountAddressByID returns account address based on account number.
///
/// Since: cosmos-sdk 0.46.2
async fn account_address_by_id(
&self,
request: tonic::Request<super::QueryAccountAddressByIdRequest>,
Expand All @@ -446,6 +492,14 @@ pub mod query_server {
&self,
request: tonic::Request<super::QueryModuleAccountsRequest>,
) -> Result<tonic::Response<super::QueryModuleAccountsResponse>, tonic::Status>;
/// ModuleAccountByName returns the module account info by module name
async fn module_account_by_name(
&self,
request: tonic::Request<super::QueryModuleAccountByNameRequest>,
) -> Result<
tonic::Response<super::QueryModuleAccountByNameResponse>,
tonic::Status,
>;
/// Bech32Prefix queries bech32Prefix
///
/// Since: cosmos-sdk 0.46
Expand Down Expand Up @@ -722,6 +776,48 @@ pub mod query_server {
};
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 = self.0.clone();
let fut = async move {
(*inner).module_account_by_name(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 = 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,
);
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>);
Expand Down
Loading

0 comments on commit 4bcd41c

Please sign in to comment.