Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add authz, feegrant + bump to sdk v0.45.1, ibc v2.0.3, wasmd v0.23.0 #177

Merged
merged 4 commits into from
Mar 9, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
# OS
.DS_Store
*.swp
*.swo
*.swl
*.swm
*.swn
*.pyc

target/
Cargo.lock

# IDE
.idea
*.iml
.dir-locals.el
.vscode
2 changes: 1 addition & 1 deletion cosmos-sdk-proto/src/prost/COSMOS_SDK_COMMIT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.44.1
v0.45.1
2 changes: 1 addition & 1 deletion cosmos-sdk-proto/src/prost/IBC_COMMIT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.2.0
v2.0.3
2 changes: 1 addition & 1 deletion cosmos-sdk-proto/src/prost/WASMD_COMMIT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.21.0
v0.23.0
325 changes: 325 additions & 0 deletions cosmos-sdk-proto/src/prost/cosmos.authz.v1beta1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,325 @@
/// GenericAuthorization gives the grantee unrestricted permissions to execute
/// the provided method on behalf of the granter's account.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenericAuthorization {
/// Msg, identified by it's type URL, to grant unrestricted permissions to execute
#[prost(string, tag = "1")]
pub msg: ::prost::alloc::string::String,
}
/// Grant gives permissions to execute
/// the provide method with expiration time.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Grant {
#[prost(message, optional, tag = "1")]
pub authorization: ::core::option::Option<::prost_types::Any>,
#[prost(message, optional, tag = "2")]
pub expiration: ::core::option::Option<::prost_types::Timestamp>,
}
/// MsgGrant is a request type for Grant method. It declares authorization to the grantee
/// on behalf of the granter with the provided expiration time.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgGrant {
#[prost(string, tag = "1")]
pub granter: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub grantee: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub grant: ::core::option::Option<Grant>,
}
/// MsgExecResponse defines the Msg/MsgExecResponse response type.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgExecResponse {
#[prost(bytes = "vec", repeated, tag = "1")]
pub results: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
}
/// MsgExec 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.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgExec {
#[prost(string, tag = "1")]
pub grantee: ::prost::alloc::string::String,
/// Authorization Msg requests to execute. Each msg must implement Authorization interface
/// The x/authz will try to find a grant matching (msg.signers\[0\], grantee, MsgTypeURL(msg))
/// triple and validate it.
#[prost(message, repeated, tag = "2")]
pub msgs: ::prost::alloc::vec::Vec<::prost_types::Any>,
}
/// MsgGrantResponse defines the Msg/MsgGrant response type.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgGrantResponse {}
/// MsgRevoke revokes any authorization with the provided sdk.Msg type on the
/// granter's account with that has been granted to the grantee.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgRevoke {
#[prost(string, tag = "1")]
pub granter: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub grantee: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub msg_type_url: ::prost::alloc::string::String,
}
/// MsgRevokeResponse defines the Msg/MsgRevokeResponse response type.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgRevokeResponse {}
#[cfg(feature = "grpc")]
#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
#[doc = r" Generated client implementations."]
pub mod msg_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " Msg defines the authz Msg service."]
#[derive(Debug, Clone)]
pub struct MsgClient<T> {
inner: tonic::client::Grpc<T>,
}
impl MsgClient<tonic::transport::Channel> {
#[doc = r" Attempt to create a new client by connecting to a given endpoint."]
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::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::ResponseBody: Body + Send + 'static,
T::Error: Into<StdError>,
<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_interceptor<F>(inner: T, interceptor: F) -> MsgClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
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))
}
#[doc = r" Compress requests with `gzip`."]
#[doc = r""]
#[doc = r" This requires the server to support it otherwise it might respond with an"]
#[doc = r" error."]
pub fn send_gzip(mut self) -> Self {
self.inner = self.inner.send_gzip();
self
}
#[doc = r" Enable decompressing responses with `gzip`."]
pub fn accept_gzip(mut self) -> Self {
self.inner = self.inner.accept_gzip();
self
}
#[doc = " Grant grants the provided authorization to the grantee on the granter's"]
#[doc = " account with the provided expiration time. If there is already a grant"]
#[doc = " for the given (granter, grantee, Authorization) triple, then the grant"]
#[doc = " will be overwritten."]
pub async fn grant(
&mut self,
request: impl tonic::IntoRequest<super::MsgGrant>,
) -> Result<tonic::Response<super::MsgGrantResponse>, 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.authz.v1beta1.Msg/Grant");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Exec attempts to execute the provided messages using"]
#[doc = " authorizations granted to the grantee. Each message should have only"]
#[doc = " one signer corresponding to the granter of the authorization."]
pub async fn exec(
&mut self,
request: impl tonic::IntoRequest<super::MsgExec>,
) -> Result<tonic::Response<super::MsgExecResponse>, 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.authz.v1beta1.Msg/Exec");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Revoke revokes any authorization corresponding to the provided method name on the"]
#[doc = " granter's account that has been granted to the grantee."]
pub async fn revoke(
&mut self,
request: impl tonic::IntoRequest<super::MsgRevoke>,
) -> Result<tonic::Response<super::MsgRevokeResponse>, 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.authz.v1beta1.Msg/Revoke");
self.inner.unary(request.into_request(), path, codec).await
}
}
}
/// QueryGrantsRequest is the request type for the Query/Grants RPC method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryGrantsRequest {
#[prost(string, tag = "1")]
pub granter: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub grantee: ::prost::alloc::string::String,
/// Optional, msg_type_url, when set, will query only grants matching given msg type.
#[prost(string, tag = "3")]
pub msg_type_url: ::prost::alloc::string::String,
/// pagination defines an pagination for the request.
#[prost(message, optional, tag = "4")]
pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
}
/// QueryGrantsResponse is the response type for the Query/Authorizations RPC method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryGrantsResponse {
/// authorizations is a list of grants granted for grantee by granter.
#[prost(message, repeated, tag = "1")]
pub grants: ::prost::alloc::vec::Vec<Grant>,
/// pagination defines an pagination for the response.
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
}
#[cfg(feature = "grpc")]
#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
#[doc = r" Generated client implementations."]
pub mod query_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " Query defines the gRPC querier service."]
#[derive(Debug, Clone)]
pub struct QueryClient<T> {
inner: tonic::client::Grpc<T>,
}
impl QueryClient<tonic::transport::Channel> {
#[doc = r" Attempt to create a new client by connecting to a given endpoint."]
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::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::ResponseBody: Body + Send + 'static,
T::Error: Into<StdError>,
<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_interceptor<F>(
inner: T,
interceptor: F,
) -> QueryClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
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))
}
#[doc = r" Compress requests with `gzip`."]
#[doc = r""]
#[doc = r" This requires the server to support it otherwise it might respond with an"]
#[doc = r" error."]
pub fn send_gzip(mut self) -> Self {
self.inner = self.inner.send_gzip();
self
}
#[doc = r" Enable decompressing responses with `gzip`."]
pub fn accept_gzip(mut self) -> Self {
self.inner = self.inner.accept_gzip();
self
}
#[doc = " Returns list of `Authorization`, granted to the grantee by the granter."]
pub async fn grants(
&mut self,
request: impl tonic::IntoRequest<super::QueryGrantsRequest>,
) -> Result<tonic::Response<super::QueryGrantsResponse>, 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.authz.v1beta1.Query/Grants");
self.inner.unary(request.into_request(), path, codec).await
}
}
}
/// EventGrant is emitted on Msg/Grant
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventGrant {
/// Msg type URL for which an autorization is granted
#[prost(string, tag = "2")]
pub msg_type_url: ::prost::alloc::string::String,
/// Granter account address
#[prost(string, tag = "3")]
pub granter: ::prost::alloc::string::String,
/// Grantee account address
#[prost(string, tag = "4")]
pub grantee: ::prost::alloc::string::String,
}
/// EventRevoke is emitted on Msg/Revoke
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventRevoke {
/// Msg type URL for which an autorization is revoked
#[prost(string, tag = "2")]
pub msg_type_url: ::prost::alloc::string::String,
/// Granter account address
#[prost(string, tag = "3")]
pub granter: ::prost::alloc::string::String,
/// Grantee account address
#[prost(string, tag = "4")]
pub grantee: ::prost::alloc::string::String,
}
/// GenesisState defines the authz module's genesis state.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenesisState {
#[prost(message, repeated, tag = "1")]
pub authorization: ::prost::alloc::vec::Vec<GrantAuthorization>,
}
/// GrantAuthorization defines the GenesisState/GrantAuthorization type.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GrantAuthorization {
#[prost(string, tag = "1")]
pub granter: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub grantee: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub authorization: ::core::option::Option<::prost_types::Any>,
#[prost(message, optional, tag = "4")]
pub expiration: ::core::option::Option<::prost_types::Timestamp>,
}
5 changes: 5 additions & 0 deletions cosmos-sdk-proto/src/prost/cosmos.base.query.v1beta1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ pub struct PageRequest {
/// is set.
#[prost(bool, tag = "4")]
pub count_total: bool,
/// reverse is set to true if results are to be returned in the descending order.
///
/// Since: cosmos-sdk 0.43
#[prost(bool, tag = "5")]
pub reverse: bool,
}
/// PageResponse is to be embedded in gRPC response messages where the
/// corresponding request message has used PageRequest.
Expand Down
Loading