From 1efd19f6082de53aacb7392bd098cef76a117c6f Mon Sep 17 00:00:00 2001 From: Devashish Dixit Date: Thu, 12 May 2022 10:12:38 +0800 Subject: [PATCH] Fix proto generation for missing query client in v0.12.0 The root cause is that `third_party` protos in `ibc-go` includes contains `auth.proto` (which does not contain query client). The generated `.rs` file from `cosmos-sdk` was being overwritten by the one generated by `ibc-go`. Fixes #219 --- cosmos-sdk-go | 2 +- cosmos-sdk-proto/src/lib.rs | 96 +- .../prost/{ => cosmos-sdk}/COSMOS_SDK_COMMIT | 0 .../prost/cosmos-sdk/cosmos.auth.v1beta1.rs | 225 +++ .../{ => cosmos-sdk}/cosmos.authz.v1beta1.rs | 266 ++-- .../{ => cosmos-sdk}/cosmos.bank.v1beta1.rs | 282 ++-- .../cosmos.base.abci.v1beta1.rs | 0 .../cosmos.base.kv.v1beta1.rs | 0 .../cosmos.base.query.v1beta1.rs | 0 .../cosmos.base.reflection.v1beta1.rs | 0 .../cosmos.base.reflection.v2alpha1.rs | 0 .../cosmos.base.snapshots.v1beta1.rs | 0 .../cosmos.base.store.v1beta1.rs | 0 .../cosmos.base.tendermint.v1beta1.rs | 0 .../{ => cosmos-sdk}/cosmos.base.v1beta1.rs | 0 .../cosmos.capability.v1beta1.rs | 0 .../{ => cosmos-sdk}/cosmos.crisis.v1beta1.rs | 0 .../{ => cosmos-sdk}/cosmos.crypto.ed25519.rs | 0 .../cosmos.crypto.multisig.rs | 0 .../cosmos.crypto.multisig.v1beta1.rs | 0 .../cosmos.crypto.secp256k1.rs | 0 .../cosmos.crypto.secp256r1.rs | 0 .../cosmos.distribution.v1beta1.rs | 430 +++--- .../cosmos.evidence.v1beta1.rs | 190 +-- .../cosmos.feegrant.v1beta1.rs | 244 ++-- .../cosmos.genutil.v1beta1.rs | 0 .../{ => cosmos-sdk}/cosmos.gov.v1beta1.rs | 428 +++--- .../{ => cosmos-sdk}/cosmos.mint.v1beta1.rs | 0 .../{ => cosmos-sdk}/cosmos.params.v1beta1.rs | 0 .../cosmos.slashing.v1beta1.rs | 202 +-- .../cosmos.staking.v1beta1.rs | 1120 ++++++++------- .../cosmos.tx.signing.v1beta1.rs | 0 .../{ => cosmos-sdk}/cosmos.tx.v1beta1.rs | 0 .../cosmos-sdk/cosmos.upgrade.v1beta1.rs | 292 ++++ .../cosmos.vesting.v1beta1.rs | 122 +- .../src/prost/cosmos-sdk/cosmos_proto.rs | 0 .../src/prost/{ => ibc-go}/IBC_COMMIT | 0 .../prost/{ => ibc-go}/cosmos.auth.v1beta1.rs | 0 .../prost/ibc-go/cosmos.base.query.v1beta1.rs | 48 + .../src/prost/ibc-go/cosmos.base.v1beta1.rs | 34 + .../{ => ibc-go}/cosmos.upgrade.v1beta1.rs | 0 .../src/prost/ibc-go/cosmos_proto.rs | 0 ...tions.interchain_accounts.controller.v1.rs | 0 ...pplications.interchain_accounts.host.v1.rs | 0 ...ibc.applications.interchain_accounts.v1.rs | 68 +- .../ibc.applications.transfer.v1.rs | 244 ++-- .../ibc.applications.transfer.v2.rs | 0 .../prost/{ => ibc-go}/ibc.core.channel.v1.rs | 1252 ++++++++--------- .../prost/{ => ibc-go}/ibc.core.client.v1.rs | 470 +++---- .../{ => ibc-go}/ibc.core.commitment.v1.rs | 0 .../{ => ibc-go}/ibc.core.connection.v1.rs | 526 +++---- .../prost/{ => ibc-go}/ibc.core.types.v1.rs | 0 .../ibc.lightclients.localhost.v1.rs | 0 .../ibc.lightclients.solomachine.v1.rs | 0 .../ibc.lightclients.solomachine.v2.rs | 0 .../ibc.lightclients.tendermint.v1.rs | 0 .../src/prost/{ => ibc-go}/ics23.rs | 0 .../src/prost/{ => wasmd}/WASMD_COMMIT | 0 .../prost/wasmd/cosmos.base.query.v1beta1.rs | 53 + .../src/prost/wasmd/cosmos.base.v1beta1.rs | 34 + .../src/prost/wasmd/cosmos_proto.rs | 0 .../src/prost/{ => wasmd}/cosmwasm.wasm.v1.rs | 0 proto-build/src/main.rs | 29 +- 63 files changed, 3724 insertions(+), 2933 deletions(-) rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/COSMOS_SDK_COMMIT (100%) create mode 100644 cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.v1beta1.rs rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.authz.v1beta1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.bank.v1beta1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.base.abci.v1beta1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.base.kv.v1beta1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.base.query.v1beta1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.base.reflection.v1beta1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.base.reflection.v2alpha1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.base.snapshots.v1beta1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.base.store.v1beta1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.base.tendermint.v1beta1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.base.v1beta1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.capability.v1beta1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.crisis.v1beta1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.crypto.ed25519.rs (100%) rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.crypto.multisig.rs (100%) rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.crypto.multisig.v1beta1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.crypto.secp256k1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.crypto.secp256r1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.distribution.v1beta1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.evidence.v1beta1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.feegrant.v1beta1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.genutil.v1beta1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.gov.v1beta1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.mint.v1beta1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.params.v1beta1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.slashing.v1beta1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.staking.v1beta1.rs (74%) rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.tx.signing.v1beta1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.tx.v1beta1.rs (100%) create mode 100644 cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.upgrade.v1beta1.rs rename cosmos-sdk-proto/src/prost/{ => cosmos-sdk}/cosmos.vesting.v1beta1.rs (100%) create mode 100644 cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos_proto.rs rename cosmos-sdk-proto/src/prost/{ => ibc-go}/IBC_COMMIT (100%) rename cosmos-sdk-proto/src/prost/{ => ibc-go}/cosmos.auth.v1beta1.rs (100%) create mode 100644 cosmos-sdk-proto/src/prost/ibc-go/cosmos.base.query.v1beta1.rs create mode 100644 cosmos-sdk-proto/src/prost/ibc-go/cosmos.base.v1beta1.rs rename cosmos-sdk-proto/src/prost/{ => ibc-go}/cosmos.upgrade.v1beta1.rs (100%) create mode 100644 cosmos-sdk-proto/src/prost/ibc-go/cosmos_proto.rs rename cosmos-sdk-proto/src/prost/{ => ibc-go}/ibc.applications.interchain_accounts.controller.v1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => ibc-go}/ibc.applications.interchain_accounts.host.v1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => ibc-go}/ibc.applications.interchain_accounts.v1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => ibc-go}/ibc.applications.transfer.v1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => ibc-go}/ibc.applications.transfer.v2.rs (100%) rename cosmos-sdk-proto/src/prost/{ => ibc-go}/ibc.core.channel.v1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => ibc-go}/ibc.core.client.v1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => ibc-go}/ibc.core.commitment.v1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => ibc-go}/ibc.core.connection.v1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => ibc-go}/ibc.core.types.v1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => ibc-go}/ibc.lightclients.localhost.v1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => ibc-go}/ibc.lightclients.solomachine.v1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => ibc-go}/ibc.lightclients.solomachine.v2.rs (100%) rename cosmos-sdk-proto/src/prost/{ => ibc-go}/ibc.lightclients.tendermint.v1.rs (100%) rename cosmos-sdk-proto/src/prost/{ => ibc-go}/ics23.rs (100%) rename cosmos-sdk-proto/src/prost/{ => wasmd}/WASMD_COMMIT (100%) create mode 100644 cosmos-sdk-proto/src/prost/wasmd/cosmos.base.query.v1beta1.rs create mode 100644 cosmos-sdk-proto/src/prost/wasmd/cosmos.base.v1beta1.rs create mode 100644 cosmos-sdk-proto/src/prost/wasmd/cosmos_proto.rs rename cosmos-sdk-proto/src/prost/{ => wasmd}/cosmwasm.wasm.v1.rs (100%) diff --git a/cosmos-sdk-go b/cosmos-sdk-go index 9494992b..ad9e5620 160000 --- a/cosmos-sdk-go +++ b/cosmos-sdk-go @@ -1 +1 @@ -Subproject commit 9494992bd0ea487ef56984167b355e5ac770c506 +Subproject commit ad9e5620fb3445c716e9de45cfcdb56e8f1745bf diff --git a/cosmos-sdk-proto/src/lib.rs b/cosmos-sdk-proto/src/lib.rs index 2ee3ad92..6169343c 100644 --- a/cosmos-sdk-proto/src/lib.rs +++ b/cosmos-sdk-proto/src/lib.rs @@ -9,28 +9,28 @@ pub use tendermint_proto as tendermint; /// The version (commit hash) of the Cosmos SDK used when generating this library. -pub const COSMOS_SDK_VERSION: &str = include_str!("prost/COSMOS_SDK_COMMIT"); +pub const COSMOS_SDK_VERSION: &str = include_str!("prost/cosmos-sdk/COSMOS_SDK_COMMIT"); /// Cosmos protobuf definitions. pub mod cosmos { /// Authentication of accounts and transactions. pub mod auth { pub mod v1beta1 { - include!("prost/cosmos.auth.v1beta1.rs"); + include!("prost/cosmos-sdk/cosmos.auth.v1beta1.rs"); } } /// Granting of arbitrary privileges from one account to another. pub mod authz { pub mod v1beta1 { - include!("prost/cosmos.authz.v1beta1.rs"); + include!("prost/cosmos-sdk/cosmos.authz.v1beta1.rs"); } } /// Balances. pub mod bank { pub mod v1beta1 { - include!("prost/cosmos.bank.v1beta1.rs"); + include!("prost/cosmos-sdk/cosmos.bank.v1beta1.rs"); } } @@ -42,56 +42,56 @@ pub mod cosmos { /// (the blockchain), and the state machine (the application). pub mod abci { pub mod v1beta1 { - include!("prost/cosmos.base.abci.v1beta1.rs"); + include!("prost/cosmos-sdk/cosmos.base.abci.v1beta1.rs"); } } /// Key-value pairs. pub mod kv { pub mod v1beta1 { - include!("prost/cosmos.base.kv.v1beta1.rs"); + include!("prost/cosmos-sdk/cosmos.base.kv.v1beta1.rs"); } } /// Query support. pub mod query { pub mod v1beta1 { - include!("prost/cosmos.base.query.v1beta1.rs"); + include!("prost/cosmos-sdk/cosmos.base.query.v1beta1.rs"); } } /// Reflection support. pub mod reflection { pub mod v1beta1 { - include!("prost/cosmos.base.reflection.v1beta1.rs"); + include!("prost/cosmos-sdk/cosmos.base.reflection.v1beta1.rs"); } pub mod v2alpha1 { - include!("prost/cosmos.base.reflection.v2alpha1.rs"); + include!("prost/cosmos-sdk/cosmos.base.reflection.v2alpha1.rs"); } } /// Snapshots containing Tendermint state sync info. pub mod snapshots { pub mod v1beta1 { - include!("prost/cosmos.base.snapshots.v1beta1.rs"); + include!("prost/cosmos-sdk/cosmos.base.snapshots.v1beta1.rs"); } } /// Data structure that holds the state of the application. pub mod store { pub mod v1beta1 { - include!("prost/cosmos.base.store.v1beta1.rs"); + include!("prost/cosmos-sdk/cosmos.base.store.v1beta1.rs"); } } pub mod v1beta1 { - include!("prost/cosmos.base.v1beta1.rs"); + include!("prost/cosmos-sdk/cosmos.base.v1beta1.rs"); } pub mod tendermint { pub mod v1beta1 { - include!("prost/cosmos.base.tendermint.v1beta1.rs"); + include!("prost/cosmos-sdk/cosmos.base.tendermint.v1beta1.rs"); } } } @@ -99,7 +99,7 @@ pub mod cosmos { /// Crisis handling pub mod crisis { pub mod v1beta1 { - include!("prost/cosmos.crisis.v1beta1.rs"); + include!("prost/cosmos-sdk/cosmos.crisis.v1beta1.rs"); } } @@ -107,82 +107,82 @@ pub mod cosmos { pub mod crypto { /// Multi-signature support. pub mod multisig { - include!("prost/cosmos.crypto.multisig.rs"); + include!("prost/cosmos-sdk/cosmos.crypto.multisig.rs"); pub mod v1beta1 { - include!("prost/cosmos.crypto.multisig.v1beta1.rs"); + include!("prost/cosmos-sdk/cosmos.crypto.multisig.v1beta1.rs"); } } pub mod ed25519 { - include!("prost/cosmos.crypto.ed25519.rs"); + include!("prost/cosmos-sdk/cosmos.crypto.ed25519.rs"); } pub mod secp256k1 { - include!("prost/cosmos.crypto.secp256k1.rs"); + include!("prost/cosmos-sdk/cosmos.crypto.secp256k1.rs"); } pub mod secp256r1 { - include!("prost/cosmos.crypto.secp256r1.rs"); + include!("prost/cosmos-sdk/cosmos.crypto.secp256r1.rs"); } } /// Messages and services handling token distribution pub mod distribution { pub mod v1beta1 { - include!("prost/cosmos.distribution.v1beta1.rs"); + include!("prost/cosmos-sdk/cosmos.distribution.v1beta1.rs"); } } /// Messages and services handling evidence pub mod evidence { pub mod v1beta1 { - include!("prost/cosmos.evidence.v1beta1.rs"); + include!("prost/cosmos-sdk/cosmos.evidence.v1beta1.rs"); } } /// Allows accounts to grant fee allowances and to use fees from their accounts. pub mod feegrant { pub mod v1beta1 { - include!("prost/cosmos.feegrant.v1beta1.rs"); + include!("prost/cosmos-sdk/cosmos.feegrant.v1beta1.rs"); } } /// Messages and services handling gentx's pub mod genutil { pub mod v1beta1 { - include!("prost/cosmos.genutil.v1beta1.rs"); + include!("prost/cosmos-sdk/cosmos.genutil.v1beta1.rs"); } } /// Messages and services handling governance pub mod gov { pub mod v1beta1 { - include!("prost/cosmos.gov.v1beta1.rs"); + include!("prost/cosmos-sdk/cosmos.gov.v1beta1.rs"); } } /// Messages and services handling minting pub mod mint { pub mod v1beta1 { - include!("prost/cosmos.mint.v1beta1.rs"); + include!("prost/cosmos-sdk/cosmos.mint.v1beta1.rs"); } } /// Messages and services handling chain parameters pub mod params { pub mod v1beta1 { - include!("prost/cosmos.params.v1beta1.rs"); + include!("prost/cosmos-sdk/cosmos.params.v1beta1.rs"); } } /// Handling slashing parameters and unjailing pub mod slashing { pub mod v1beta1 { - include!("prost/cosmos.slashing.v1beta1.rs"); + include!("prost/cosmos-sdk/cosmos.slashing.v1beta1.rs"); } } /// Proof-of-Stake layer for public blockchains. pub mod staking { pub mod v1beta1 { - include!("prost/cosmos.staking.v1beta1.rs"); + include!("prost/cosmos-sdk/cosmos.staking.v1beta1.rs"); } } @@ -191,26 +191,26 @@ pub mod cosmos { /// Transaction signing support. pub mod signing { pub mod v1beta1 { - include!("prost/cosmos.tx.signing.v1beta1.rs"); + include!("prost/cosmos-sdk/cosmos.tx.signing.v1beta1.rs"); } } pub mod v1beta1 { - include!("prost/cosmos.tx.v1beta1.rs"); + include!("prost/cosmos-sdk/cosmos.tx.v1beta1.rs"); } } /// Services for the upgrade module. pub mod upgrade { pub mod v1beta1 { - include!("prost/cosmos.upgrade.v1beta1.rs"); + include!("prost/cosmos-sdk/cosmos.upgrade.v1beta1.rs"); } } /// Services and tx's for the vesting module. pub mod vesting { pub mod v1beta1 { - include!("prost/cosmos.vesting.v1beta1.rs"); + include!("prost/cosmos-sdk/cosmos.vesting.v1beta1.rs"); } } } @@ -222,7 +222,7 @@ pub mod cosmwasm { /// Messages and services handling CosmWasm. pub mod wasm { pub mod v1 { - include!("prost/cosmwasm.wasm.v1.rs"); + include!("prost/wasmd/cosmwasm.wasm.v1.rs"); } } } @@ -235,29 +235,29 @@ pub mod ibc { pub mod interchain_accounts { pub mod controller { pub mod v1 { - include!("prost/ibc.applications.interchain_accounts.controller.v1.rs"); + include!("prost/ibc-go/ibc.applications.interchain_accounts.controller.v1.rs"); } } pub mod host { pub mod v1 { - include!("prost/ibc.applications.interchain_accounts.host.v1.rs"); + include!("prost/ibc-go/ibc.applications.interchain_accounts.host.v1.rs"); } } pub mod v1 { - include!("prost/ibc.applications.interchain_accounts.v1.rs"); + include!("prost/ibc-go/ibc.applications.interchain_accounts.v1.rs"); } } /// Transfer support. pub mod transfer { pub mod v1 { - include!("prost/ibc.applications.transfer.v1.rs"); + include!("prost/ibc-go/ibc.applications.transfer.v1.rs"); } pub mod v2 { - include!("prost/ibc.applications.transfer.v2.rs"); + include!("prost/ibc-go/ibc.applications.transfer.v2.rs"); } } } @@ -267,35 +267,35 @@ pub mod ibc { /// IBC channels. pub mod channel { pub mod v1 { - include!("prost/ibc.core.channel.v1.rs"); + include!("prost/ibc-go/ibc.core.channel.v1.rs"); } } /// IBC client. pub mod client { pub mod v1 { - include!("prost/ibc.core.client.v1.rs"); + include!("prost/ibc-go/ibc.core.client.v1.rs"); } } /// IBC commitments. pub mod commitment { pub mod v1 { - include!("prost/ibc.core.commitment.v1.rs"); + include!("prost/ibc-go/ibc.core.commitment.v1.rs"); } } /// IBC connections. pub mod connection { pub mod v1 { - include!("prost/ibc.core.connection.v1.rs"); + include!("prost/ibc-go/ibc.core.connection.v1.rs"); } } /// IBC types. pub mod types { pub mod v1 { - include!("prost/ibc.core.types.v1.rs"); + include!("prost/ibc-go/ibc.core.types.v1.rs"); } } } @@ -304,21 +304,21 @@ pub mod ibc { pub mod lightclients { pub mod localhost { pub mod v1 { - include!("prost/ibc.lightclients.localhost.v1.rs"); + include!("prost/ibc-go/ibc.lightclients.localhost.v1.rs"); } } pub mod solomachine { pub mod v1 { - include!("prost/ibc.lightclients.solomachine.v1.rs"); + include!("prost/ibc-go/ibc.lightclients.solomachine.v1.rs"); } pub mod v2 { - include!("prost/ibc.lightclients.solomachine.v2.rs"); + include!("prost/ibc-go/ibc.lightclients.solomachine.v2.rs"); } } pub mod tendermint { pub mod v1 { - include!("prost/ibc.lightclients.tendermint.v1.rs"); + include!("prost/ibc-go/ibc.lightclients.tendermint.v1.rs"); } } } @@ -326,5 +326,5 @@ pub mod ibc { /// ICS23 protobuf definitions. pub mod ics23 { - include!("prost/ics23.rs"); + include!("prost/ibc-go/ics23.rs"); } diff --git a/cosmos-sdk-proto/src/prost/COSMOS_SDK_COMMIT b/cosmos-sdk-proto/src/prost/cosmos-sdk/COSMOS_SDK_COMMIT similarity index 100% rename from cosmos-sdk-proto/src/prost/COSMOS_SDK_COMMIT rename to cosmos-sdk-proto/src/prost/cosmos-sdk/COSMOS_SDK_COMMIT 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 new file mode 100644 index 00000000..040f4819 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.v1beta1.rs @@ -0,0 +1,225 @@ +/// BaseAccount defines a base account type. It contains all the necessary fields +/// for basic account functionality. Any custom account type should extend this +/// type for additional functionality (e.g. vesting). +#[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<::prost_types::Any>, + #[prost(uint64, tag="3")] + pub account_number: u64, + #[prost(uint64, tag="4")] + pub sequence: u64, +} +/// ModuleAccount defines an account for modules that holds coins on a pool. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ModuleAccount { + #[prost(message, optional, tag="1")] + pub base_account: ::core::option::Option, + #[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>, +} +/// Params defines the parameters for the auth module. +#[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, +} +/// QueryAccountsRequest is the request type for the Query/Accounts RPC method. +/// +/// Since: cosmos-sdk 0.43 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAccountsRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag="1")] + pub pagination: ::core::option::Option, +} +/// QueryAccountsResponse is the response type for the Query/Accounts RPC method. +/// +/// Since: cosmos-sdk 0.43 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAccountsResponse { + /// accounts are the existing accounts + #[prost(message, repeated, tag="1")] + pub accounts: ::prost::alloc::vec::Vec<::prost_types::Any>, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag="2")] + pub pagination: ::core::option::Option, +} +/// QueryAccountRequest is the request type for the Query/Account RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAccountRequest { + /// address defines the address to query for. + #[prost(string, tag="1")] + pub address: ::prost::alloc::string::String, +} +/// QueryAccountResponse is the response type for the Query/Account RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAccountResponse { + /// account defines the account of the corresponding address. + #[prost(message, optional, tag="1")] + pub account: ::core::option::Option<::prost_types::Any>, +} +/// QueryParamsRequest is the request type for the Query/Params RPC method. +#[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, +} +/// Generated client implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod query_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Query defines the gRPC querier service. + #[derive(Debug, Clone)] + pub struct QueryClient { + inner: tonic::client::Grpc, + } + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: std::convert::TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl QueryClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> QueryClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + QueryClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with `gzip`. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_gzip(mut self) -> Self { + self.inner = self.inner.send_gzip(); + self + } + /// Enable decompressing responses with `gzip`. + #[must_use] + pub fn accept_gzip(mut self) -> Self { + self.inner = self.inner.accept_gzip(); + self + } + /// Accounts returns all the existing accounts + /// + /// Since: cosmos-sdk 0.43 + pub async fn accounts( + &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()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.auth.v1beta1.Query/Accounts", + ); + self.inner.unary(request.into_request(), path, codec).await + } + /// Account returns account details based on address. + pub async fn account( + &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()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.auth.v1beta1.Query/Account", + ); + self.inner.unary(request.into_request(), path, codec).await + } + /// Params queries all parameters. + pub async fn params( + &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()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.auth.v1beta1.Query/Params", + ); + self.inner.unary(request.into_request(), path, codec).await + } + } +} +/// GenesisState defines the auth module's genesis state. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + /// params defines all the paramaters of the module. + #[prost(message, optional, tag="1")] + pub params: ::core::option::Option, + /// accounts are the accounts present at genesis. + #[prost(message, repeated, tag="2")] + pub accounts: ::prost::alloc::vec::Vec<::prost_types::Any>, +} diff --git a/cosmos-sdk-proto/src/prost/cosmos.authz.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.v1beta1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.authz.v1beta1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.v1beta1.rs index e38dd8b0..34c3a489 100644 --- a/cosmos-sdk-proto/src/prost/cosmos.authz.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.v1beta1.rs @@ -30,67 +30,80 @@ pub struct GrantAuthorization { #[prost(message, optional, tag="4")] 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. +/// QueryGrantsRequest is the request type for the Query/Grants RPC method. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgGrant { +pub struct QueryGrantsRequest { #[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, + /// 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, } -/// MsgExecResponse defines the Msg/MsgExecResponse response type. +/// QueryGrantsResponse is the response type for the Query/Authorizations RPC method. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgExecResponse { - #[prost(bytes="vec", repeated, tag="1")] - pub results: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +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, + /// pagination defines an pagination for the response. + #[prost(message, optional, tag="2")] + pub pagination: ::core::option::Option, } -/// 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. +/// QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgExec { +pub struct QueryGranterGrantsRequest { #[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>, + pub granter: ::prost::alloc::string::String, + /// pagination defines an pagination for the request. + #[prost(message, optional, tag="2")] + pub pagination: ::core::option::Option, } -/// MsgGrantResponse defines the Msg/MsgGrant response type. +/// QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgGrantResponse { +pub struct QueryGranterGrantsResponse { + /// grants is a list of grants granted by the granter. + #[prost(message, repeated, tag="1")] + pub grants: ::prost::alloc::vec::Vec, + /// pagination defines an pagination for the response. + #[prost(message, optional, tag="2")] + pub pagination: ::core::option::Option, } -/// MsgRevoke revokes any authorization with the provided sdk.Msg type on the -/// granter's account with that has been granted to the grantee. +/// QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgRevoke { +pub struct QueryGranteeGrantsRequest { #[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, + /// pagination defines an pagination for the request. + #[prost(message, optional, tag="2")] + pub pagination: ::core::option::Option, } -/// MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. +/// QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgRevokeResponse { +pub struct QueryGranteeGrantsResponse { + /// grants is a list of grants granted to the grantee. + #[prost(message, repeated, tag="1")] + pub grants: ::prost::alloc::vec::Vec, + /// pagination defines an pagination for the response. + #[prost(message, optional, tag="2")] + pub pagination: ::core::option::Option, } /// Generated client implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] -pub mod msg_client { +pub mod query_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - /// Msg defines the authz Msg service. + /// Query defines the gRPC querier service. #[derive(Debug, Clone)] - pub struct MsgClient { + pub struct QueryClient { inner: tonic::client::Grpc, } - impl MsgClient { + impl QueryClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -101,7 +114,7 @@ pub mod msg_client { Ok(Self::new(conn)) } } - impl MsgClient + impl QueryClient where T: tonic::client::GrpcService, T::Error: Into, @@ -115,7 +128,7 @@ pub mod msg_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> MsgClient> + ) -> QueryClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -129,7 +142,7 @@ pub mod msg_client { http::Request, >>::Error: Into + Send + Sync, { - MsgClient::new(InterceptedService::new(inner, interceptor)) + QueryClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with `gzip`. /// @@ -146,14 +159,11 @@ pub mod msg_client { self.inner = self.inner.accept_gzip(); self } - /// 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. - pub async fn grant( + /// Returns list of `Authorization`, granted to the grantee by the granter. + pub async fn grants( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { self.inner .ready() .await @@ -165,17 +175,17 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.authz.v1beta1.Msg/Grant", + "/cosmos.authz.v1beta1.Query/Grants", ); self.inner.unary(request.into_request(), path, codec).await } - /// 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. - pub async fn exec( + /// GranterGrants returns list of `GrantAuthorization`, granted by granter. + /// + /// Since: cosmos-sdk 0.45.2 + pub async fn granter_grants( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { self.inner .ready() .await @@ -187,16 +197,17 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.authz.v1beta1.Msg/Exec", + "/cosmos.authz.v1beta1.Query/GranterGrants", ); self.inner.unary(request.into_request(), path, codec).await } - /// Revoke revokes any authorization corresponding to the provided method name on the - /// granter's account that has been granted to the grantee. - pub async fn revoke( + /// GranteeGrants returns a list of `GrantAuthorization` by grantee. + /// + /// Since: cosmos-sdk 0.45.2 + pub async fn grantee_grants( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { self.inner .ready() .await @@ -208,86 +219,73 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.authz.v1beta1.Msg/Revoke", + "/cosmos.authz.v1beta1.Query/GranteeGrants", ); self.inner.unary(request.into_request(), path, codec).await } } } -/// QueryGrantsRequest is the request type for the Query/Grants RPC method. +/// 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 QueryGrantsRequest { +pub struct MsgGrant { #[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, + #[prost(message, optional, tag="3")] + pub grant: ::core::option::Option, } -/// QueryGrantsResponse is the response type for the Query/Authorizations RPC method. +/// MsgExecResponse defines the Msg/MsgExecResponse response type. #[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, - /// pagination defines an pagination for the response. - #[prost(message, optional, tag="2")] - pub pagination: ::core::option::Option, +pub struct MsgExecResponse { + #[prost(bytes="vec", repeated, tag="1")] + pub results: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, } -/// QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. +/// 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 QueryGranterGrantsRequest { +pub struct MsgExec { #[prost(string, tag="1")] - pub granter: ::prost::alloc::string::String, - /// pagination defines an pagination for the request. - #[prost(message, optional, tag="2")] - pub pagination: ::core::option::Option, + 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>, } -/// QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. +/// MsgGrantResponse defines the Msg/MsgGrant response type. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryGranterGrantsResponse { - /// grants is a list of grants granted by the granter. - #[prost(message, repeated, tag="1")] - pub grants: ::prost::alloc::vec::Vec, - /// pagination defines an pagination for the response. - #[prost(message, optional, tag="2")] - pub pagination: ::core::option::Option, +pub struct MsgGrantResponse { } -/// QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. +/// 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 QueryGranteeGrantsRequest { +pub struct MsgRevoke { #[prost(string, tag="1")] + pub granter: ::prost::alloc::string::String, + #[prost(string, tag="2")] pub grantee: ::prost::alloc::string::String, - /// pagination defines an pagination for the request. - #[prost(message, optional, tag="2")] - pub pagination: ::core::option::Option, + #[prost(string, tag="3")] + pub msg_type_url: ::prost::alloc::string::String, } -/// QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. +/// MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryGranteeGrantsResponse { - /// grants is a list of grants granted to the grantee. - #[prost(message, repeated, tag="1")] - pub grants: ::prost::alloc::vec::Vec, - /// pagination defines an pagination for the response. - #[prost(message, optional, tag="2")] - pub pagination: ::core::option::Option, +pub struct MsgRevokeResponse { } /// Generated client implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] -pub mod query_client { +pub mod msg_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - /// Query defines the gRPC querier service. + /// Msg defines the authz Msg service. #[derive(Debug, Clone)] - pub struct QueryClient { + pub struct MsgClient { inner: tonic::client::Grpc, } - impl QueryClient { + impl MsgClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -298,7 +296,7 @@ pub mod query_client { Ok(Self::new(conn)) } } - impl QueryClient + impl MsgClient where T: tonic::client::GrpcService, T::Error: Into, @@ -312,7 +310,7 @@ pub mod query_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> QueryClient> + ) -> MsgClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -326,7 +324,7 @@ pub mod query_client { http::Request, >>::Error: Into + Send + Sync, { - QueryClient::new(InterceptedService::new(inner, interceptor)) + MsgClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with `gzip`. /// @@ -343,11 +341,14 @@ pub mod query_client { self.inner = self.inner.accept_gzip(); self } - /// Returns list of `Authorization`, granted to the grantee by the granter. - pub async fn grants( + /// 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. + pub async fn grant( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { self.inner .ready() .await @@ -359,17 +360,17 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.authz.v1beta1.Query/Grants", + "/cosmos.authz.v1beta1.Msg/Grant", ); self.inner.unary(request.into_request(), path, codec).await } - /// GranterGrants returns list of `GrantAuthorization`, granted by granter. - /// - /// Since: cosmos-sdk 0.45.2 - pub async fn granter_grants( + /// 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. + pub async fn exec( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { self.inner .ready() .await @@ -381,17 +382,16 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.authz.v1beta1.Query/GranterGrants", + "/cosmos.authz.v1beta1.Msg/Exec", ); self.inner.unary(request.into_request(), path, codec).await } - /// GranteeGrants returns a list of `GrantAuthorization` by grantee. - /// - /// Since: cosmos-sdk 0.45.2 - pub async fn grantee_grants( + /// Revoke revokes any authorization corresponding to the provided method name on the + /// granter's account that has been granted to the grantee. + pub async fn revoke( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { self.inner .ready() .await @@ -403,12 +403,18 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.authz.v1beta1.Query/GranteeGrants", + "/cosmos.authz.v1beta1.Msg/Revoke", ); self.inner.unary(request.into_request(), path, codec).await } } } +/// 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, +} /// EventGrant is emitted on Msg/Grant #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventGrant { @@ -435,9 +441,3 @@ pub struct EventRevoke { #[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, -} diff --git a/cosmos-sdk-proto/src/prost/cosmos.bank.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.bank.v1beta1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.rs index 6de3d80b..e426e711 100644 --- a/cosmos-sdk-proto/src/prost/cosmos.bank.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.rs @@ -1,3 +1,12 @@ +/// SendAuthorization allows the grantee to spend up to spend_limit coins from +/// the granter's account. +/// +/// Since: cosmos-sdk 0.43 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SendAuthorization { + #[prost(message, repeated, tag="1")] + pub spend_limit: ::prost::alloc::vec::Vec, +} /// Params defines the parameters for the bank module. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -85,141 +94,6 @@ pub struct Metadata { #[prost(string, tag="6")] pub symbol: ::prost::alloc::string::String, } -/// MsgSend represents a message to send coins from one account to another. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSend { - #[prost(string, tag="1")] - pub from_address: ::prost::alloc::string::String, - #[prost(string, tag="2")] - pub to_address: ::prost::alloc::string::String, - #[prost(message, repeated, tag="3")] - pub amount: ::prost::alloc::vec::Vec, -} -/// MsgSendResponse defines the Msg/Send response type. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSendResponse { -} -/// MsgMultiSend represents an arbitrary multi-in, multi-out send message. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgMultiSend { - #[prost(message, repeated, tag="1")] - pub inputs: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="2")] - pub outputs: ::prost::alloc::vec::Vec, -} -/// MsgMultiSendResponse defines the Msg/MultiSend response type. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgMultiSendResponse { -} -/// Generated client implementations. -#[cfg(feature = "grpc")] -#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] -pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Msg defines the bank Msg service. - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, - } - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: std::convert::TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl MsgClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> MsgClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + Send + Sync, - { - MsgClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with `gzip`. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_gzip(mut self) -> Self { - self.inner = self.inner.send_gzip(); - self - } - /// Enable decompressing responses with `gzip`. - #[must_use] - pub fn accept_gzip(mut self) -> Self { - self.inner = self.inner.accept_gzip(); - self - } - /// Send defines a method for sending coins from one account to another account. - pub async fn send( - &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()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.bank.v1beta1.Msg/Send", - ); - self.inner.unary(request.into_request(), path, codec).await - } - /// MultiSend defines a method for sending coins from some accounts to other accounts. - pub async fn multi_send( - &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()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.bank.v1beta1.Msg/MultiSend", - ); - self.inner.unary(request.into_request(), path, codec).await - } - } -} /// QueryBalanceRequest is the request type for the Query/Balance RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryBalanceRequest { @@ -593,14 +467,140 @@ pub mod query_client { } } } -/// SendAuthorization allows the grantee to spend up to spend_limit coins from -/// the granter's account. -/// -/// Since: cosmos-sdk 0.43 +/// MsgSend represents a message to send coins from one account to another. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct SendAuthorization { +pub struct MsgSend { + #[prost(string, tag="1")] + pub from_address: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub to_address: ::prost::alloc::string::String, + #[prost(message, repeated, tag="3")] + pub amount: ::prost::alloc::vec::Vec, +} +/// MsgSendResponse defines the Msg/Send response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSendResponse { +} +/// MsgMultiSend represents an arbitrary multi-in, multi-out send message. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgMultiSend { #[prost(message, repeated, tag="1")] - pub spend_limit: ::prost::alloc::vec::Vec, + pub inputs: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="2")] + pub outputs: ::prost::alloc::vec::Vec, +} +/// MsgMultiSendResponse defines the Msg/MultiSend response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgMultiSendResponse { +} +/// Generated client implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod msg_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Msg defines the bank Msg service. + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: std::convert::TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl MsgClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> MsgClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + MsgClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with `gzip`. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_gzip(mut self) -> Self { + self.inner = self.inner.send_gzip(); + self + } + /// Enable decompressing responses with `gzip`. + #[must_use] + pub fn accept_gzip(mut self) -> Self { + self.inner = self.inner.accept_gzip(); + self + } + /// Send defines a method for sending coins from one account to another account. + pub async fn send( + &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()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.bank.v1beta1.Msg/Send", + ); + self.inner.unary(request.into_request(), path, codec).await + } + /// MultiSend defines a method for sending coins from some accounts to other accounts. + pub async fn multi_send( + &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()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.bank.v1beta1.Msg/MultiSend", + ); + self.inner.unary(request.into_request(), path, codec).await + } + } } /// GenesisState defines the bank module's genesis state. #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/cosmos-sdk-proto/src/prost/cosmos.base.abci.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.abci.v1beta1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.base.abci.v1beta1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.abci.v1beta1.rs diff --git a/cosmos-sdk-proto/src/prost/cosmos.base.kv.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.kv.v1beta1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.base.kv.v1beta1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.kv.v1beta1.rs diff --git a/cosmos-sdk-proto/src/prost/cosmos.base.query.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.query.v1beta1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.base.query.v1beta1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.query.v1beta1.rs diff --git a/cosmos-sdk-proto/src/prost/cosmos.base.reflection.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v1beta1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.base.reflection.v1beta1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v1beta1.rs diff --git a/cosmos-sdk-proto/src/prost/cosmos.base.reflection.v2alpha1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v2alpha1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.base.reflection.v2alpha1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v2alpha1.rs diff --git a/cosmos-sdk-proto/src/prost/cosmos.base.snapshots.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.snapshots.v1beta1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.base.snapshots.v1beta1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.snapshots.v1beta1.rs diff --git a/cosmos-sdk-proto/src/prost/cosmos.base.store.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.store.v1beta1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.base.store.v1beta1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.store.v1beta1.rs diff --git a/cosmos-sdk-proto/src/prost/cosmos.base.tendermint.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.tendermint.v1beta1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.base.tendermint.v1beta1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.tendermint.v1beta1.rs diff --git a/cosmos-sdk-proto/src/prost/cosmos.base.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.v1beta1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.base.v1beta1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.v1beta1.rs diff --git a/cosmos-sdk-proto/src/prost/cosmos.capability.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.capability.v1beta1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.capability.v1beta1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.capability.v1beta1.rs diff --git a/cosmos-sdk-proto/src/prost/cosmos.crisis.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.v1beta1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.crisis.v1beta1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.v1beta1.rs diff --git a/cosmos-sdk-proto/src/prost/cosmos.crypto.ed25519.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.ed25519.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.crypto.ed25519.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.ed25519.rs diff --git a/cosmos-sdk-proto/src/prost/cosmos.crypto.multisig.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.multisig.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.crypto.multisig.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.multisig.rs diff --git a/cosmos-sdk-proto/src/prost/cosmos.crypto.multisig.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.multisig.v1beta1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.crypto.multisig.v1beta1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.multisig.v1beta1.rs diff --git a/cosmos-sdk-proto/src/prost/cosmos.crypto.secp256k1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.secp256k1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.crypto.secp256k1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.secp256k1.rs diff --git a/cosmos-sdk-proto/src/prost/cosmos.crypto.secp256r1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.secp256r1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.crypto.secp256r1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.secp256r1.rs diff --git a/cosmos-sdk-proto/src/prost/cosmos.distribution.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.distribution.v1beta1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.rs index a32077a1..647b80fe 100644 --- a/cosmos-sdk-proto/src/prost/cosmos.distribution.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.rs @@ -1,218 +1,3 @@ -/// MsgSetWithdrawAddress sets the withdraw address for -/// a delegator (or validator self-delegation). -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSetWithdrawAddress { - #[prost(string, tag="1")] - pub delegator_address: ::prost::alloc::string::String, - #[prost(string, tag="2")] - pub withdraw_address: ::prost::alloc::string::String, -} -/// MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSetWithdrawAddressResponse { -} -/// MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator -/// from a single validator. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgWithdrawDelegatorReward { - #[prost(string, tag="1")] - pub delegator_address: ::prost::alloc::string::String, - #[prost(string, tag="2")] - pub validator_address: ::prost::alloc::string::String, -} -/// MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgWithdrawDelegatorRewardResponse { -} -/// MsgWithdrawValidatorCommission withdraws the full commission to the validator -/// address. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgWithdrawValidatorCommission { - #[prost(string, tag="1")] - pub validator_address: ::prost::alloc::string::String, -} -/// MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgWithdrawValidatorCommissionResponse { -} -/// MsgFundCommunityPool allows an account to directly -/// fund the community pool. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgFundCommunityPool { - #[prost(message, repeated, tag="1")] - pub amount: ::prost::alloc::vec::Vec, - #[prost(string, tag="2")] - pub depositor: ::prost::alloc::string::String, -} -/// MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgFundCommunityPoolResponse { -} -/// Generated client implementations. -#[cfg(feature = "grpc")] -#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] -pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Msg defines the distribution Msg service. - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, - } - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: std::convert::TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl MsgClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> MsgClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + Send + Sync, - { - MsgClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with `gzip`. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_gzip(mut self) -> Self { - self.inner = self.inner.send_gzip(); - self - } - /// Enable decompressing responses with `gzip`. - #[must_use] - pub fn accept_gzip(mut self) -> Self { - self.inner = self.inner.accept_gzip(); - self - } - /// SetWithdrawAddress defines a method to change the withdraw address - /// for a delegator (or validator self-delegation). - pub async fn set_withdraw_address( - &mut self, - request: impl tonic::IntoRequest, - ) -> 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.distribution.v1beta1.Msg/SetWithdrawAddress", - ); - self.inner.unary(request.into_request(), path, codec).await - } - /// WithdrawDelegatorReward defines a method to withdraw rewards of delegator - /// from a single validator. - pub async fn withdraw_delegator_reward( - &mut self, - request: impl tonic::IntoRequest, - ) -> 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.distribution.v1beta1.Msg/WithdrawDelegatorReward", - ); - self.inner.unary(request.into_request(), path, codec).await - } - /// WithdrawValidatorCommission defines a method to withdraw the - /// full commission to the validator address. - pub async fn withdraw_validator_commission( - &mut self, - request: impl tonic::IntoRequest, - ) -> 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.distribution.v1beta1.Msg/WithdrawValidatorCommission", - ); - self.inner.unary(request.into_request(), path, codec).await - } - /// FundCommunityPool defines a method to allow an account to directly - /// fund the community pool. - pub async fn fund_community_pool( - &mut self, - request: impl tonic::IntoRequest, - ) -> 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.distribution.v1beta1.Msg/FundCommunityPool", - ); - self.inner.unary(request.into_request(), path, codec).await - } - } -} /// Params defines the set of params for the distribution module. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -770,6 +555,221 @@ pub mod query_client { } } } +/// MsgSetWithdrawAddress sets the withdraw address for +/// a delegator (or validator self-delegation). +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSetWithdrawAddress { + #[prost(string, tag="1")] + pub delegator_address: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub withdraw_address: ::prost::alloc::string::String, +} +/// MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSetWithdrawAddressResponse { +} +/// MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator +/// from a single validator. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgWithdrawDelegatorReward { + #[prost(string, tag="1")] + pub delegator_address: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub validator_address: ::prost::alloc::string::String, +} +/// MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgWithdrawDelegatorRewardResponse { +} +/// MsgWithdrawValidatorCommission withdraws the full commission to the validator +/// address. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgWithdrawValidatorCommission { + #[prost(string, tag="1")] + pub validator_address: ::prost::alloc::string::String, +} +/// MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgWithdrawValidatorCommissionResponse { +} +/// MsgFundCommunityPool allows an account to directly +/// fund the community pool. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgFundCommunityPool { + #[prost(message, repeated, tag="1")] + pub amount: ::prost::alloc::vec::Vec, + #[prost(string, tag="2")] + pub depositor: ::prost::alloc::string::String, +} +/// MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgFundCommunityPoolResponse { +} +/// Generated client implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod msg_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Msg defines the distribution Msg service. + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: std::convert::TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl MsgClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> MsgClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + MsgClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with `gzip`. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_gzip(mut self) -> Self { + self.inner = self.inner.send_gzip(); + self + } + /// Enable decompressing responses with `gzip`. + #[must_use] + pub fn accept_gzip(mut self) -> Self { + self.inner = self.inner.accept_gzip(); + self + } + /// SetWithdrawAddress defines a method to change the withdraw address + /// for a delegator (or validator self-delegation). + pub async fn set_withdraw_address( + &mut self, + request: impl tonic::IntoRequest, + ) -> 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.distribution.v1beta1.Msg/SetWithdrawAddress", + ); + self.inner.unary(request.into_request(), path, codec).await + } + /// WithdrawDelegatorReward defines a method to withdraw rewards of delegator + /// from a single validator. + pub async fn withdraw_delegator_reward( + &mut self, + request: impl tonic::IntoRequest, + ) -> 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.distribution.v1beta1.Msg/WithdrawDelegatorReward", + ); + self.inner.unary(request.into_request(), path, codec).await + } + /// WithdrawValidatorCommission defines a method to withdraw the + /// full commission to the validator address. + pub async fn withdraw_validator_commission( + &mut self, + request: impl tonic::IntoRequest, + ) -> 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.distribution.v1beta1.Msg/WithdrawValidatorCommission", + ); + self.inner.unary(request.into_request(), path, codec).await + } + /// FundCommunityPool defines a method to allow an account to directly + /// fund the community pool. + pub async fn fund_community_pool( + &mut self, + request: impl tonic::IntoRequest, + ) -> 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.distribution.v1beta1.Msg/FundCommunityPool", + ); + self.inner.unary(request.into_request(), path, codec).await + } + } +} /// 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.evidence.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.v1beta1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.evidence.v1beta1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.v1beta1.rs index d500f9a7..415a28aa 100644 --- a/cosmos-sdk-proto/src/prost/cosmos.evidence.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.v1beta1.rs @@ -1,31 +1,61 @@ -/// MsgSubmitEvidence represents a message that supports submitting arbitrary -/// Evidence of misbehavior such as equivocation or counterfactual signing. +/// Equivocation implements the Evidence interface and defines evidence of double +/// signing misbehavior. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSubmitEvidence { - #[prost(string, tag="1")] - pub submitter: ::prost::alloc::string::String, +pub struct Equivocation { + #[prost(int64, tag="1")] + pub height: i64, #[prost(message, optional, tag="2")] + pub time: ::core::option::Option<::prost_types::Timestamp>, + #[prost(int64, tag="3")] + pub power: i64, + #[prost(string, tag="4")] + pub consensus_address: ::prost::alloc::string::String, +} +/// QueryEvidenceRequest is the request type for the Query/Evidence RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryEvidenceRequest { + /// evidence_hash defines the hash of the requested evidence. + #[prost(bytes="vec", tag="1")] + pub evidence_hash: ::prost::alloc::vec::Vec, +} +/// QueryEvidenceResponse is the response type for the Query/Evidence RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryEvidenceResponse { + /// evidence returns the requested evidence. + #[prost(message, optional, tag="1")] pub evidence: ::core::option::Option<::prost_types::Any>, } -/// MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. +/// QueryEvidenceRequest is the request type for the Query/AllEvidence RPC +/// method. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSubmitEvidenceResponse { - /// hash defines the hash of the evidence. - #[prost(bytes="vec", tag="4")] - pub hash: ::prost::alloc::vec::Vec, +pub struct QueryAllEvidenceRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag="1")] + pub pagination: ::core::option::Option, +} +/// QueryAllEvidenceResponse is the response type for the Query/AllEvidence RPC +/// method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAllEvidenceResponse { + /// evidence returns all evidences. + #[prost(message, repeated, tag="1")] + pub evidence: ::prost::alloc::vec::Vec<::prost_types::Any>, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag="2")] + pub pagination: ::core::option::Option, } /// Generated client implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] -pub mod msg_client { +pub mod query_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - /// Msg defines the evidence Msg service. + /// Query defines the gRPC querier service. #[derive(Debug, Clone)] - pub struct MsgClient { + pub struct QueryClient { inner: tonic::client::Grpc, } - impl MsgClient { + impl QueryClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -36,7 +66,7 @@ pub mod msg_client { Ok(Self::new(conn)) } } - impl MsgClient + impl QueryClient where T: tonic::client::GrpcService, T::Error: Into, @@ -50,7 +80,7 @@ pub mod msg_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> MsgClient> + ) -> QueryClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -64,7 +94,7 @@ pub mod msg_client { http::Request, >>::Error: Into + Send + Sync, { - MsgClient::new(InterceptedService::new(inner, interceptor)) + QueryClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with `gzip`. /// @@ -81,12 +111,11 @@ pub mod msg_client { self.inner = self.inner.accept_gzip(); self } - /// SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or - /// counterfactual signing. - pub async fn submit_evidence( + /// Evidence queries evidence based on evidence hash. + pub async fn evidence( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { self.inner .ready() .await @@ -98,70 +127,60 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.evidence.v1beta1.Msg/SubmitEvidence", + "/cosmos.evidence.v1beta1.Query/Evidence", + ); + self.inner.unary(request.into_request(), path, codec).await + } + /// AllEvidence queries all evidence. + pub async fn all_evidence( + &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()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.evidence.v1beta1.Query/AllEvidence", ); self.inner.unary(request.into_request(), path, codec).await } } } -/// Equivocation implements the Evidence interface and defines evidence of double -/// signing misbehavior. +/// MsgSubmitEvidence represents a message that supports submitting arbitrary +/// Evidence of misbehavior such as equivocation or counterfactual signing. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct Equivocation { - #[prost(int64, tag="1")] - pub height: i64, +pub struct MsgSubmitEvidence { + #[prost(string, tag="1")] + pub submitter: ::prost::alloc::string::String, #[prost(message, optional, tag="2")] - pub time: ::core::option::Option<::prost_types::Timestamp>, - #[prost(int64, tag="3")] - pub power: i64, - #[prost(string, tag="4")] - pub consensus_address: ::prost::alloc::string::String, -} -/// QueryEvidenceRequest is the request type for the Query/Evidence RPC method. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryEvidenceRequest { - /// evidence_hash defines the hash of the requested evidence. - #[prost(bytes="vec", tag="1")] - pub evidence_hash: ::prost::alloc::vec::Vec, -} -/// QueryEvidenceResponse is the response type for the Query/Evidence RPC method. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryEvidenceResponse { - /// evidence returns the requested evidence. - #[prost(message, optional, tag="1")] pub evidence: ::core::option::Option<::prost_types::Any>, } -/// QueryEvidenceRequest is the request type for the Query/AllEvidence RPC -/// method. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryAllEvidenceRequest { - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag="1")] - pub pagination: ::core::option::Option, -} -/// QueryAllEvidenceResponse is the response type for the Query/AllEvidence RPC -/// method. +/// MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryAllEvidenceResponse { - /// evidence returns all evidences. - #[prost(message, repeated, tag="1")] - pub evidence: ::prost::alloc::vec::Vec<::prost_types::Any>, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag="2")] - pub pagination: ::core::option::Option, +pub struct MsgSubmitEvidenceResponse { + /// hash defines the hash of the evidence. + #[prost(bytes="vec", tag="4")] + pub hash: ::prost::alloc::vec::Vec, } /// Generated client implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] -pub mod query_client { +pub mod msg_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - /// Query defines the gRPC querier service. + /// Msg defines the evidence Msg service. #[derive(Debug, Clone)] - pub struct QueryClient { + pub struct MsgClient { inner: tonic::client::Grpc, } - impl QueryClient { + impl MsgClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -172,7 +191,7 @@ pub mod query_client { Ok(Self::new(conn)) } } - impl QueryClient + impl MsgClient where T: tonic::client::GrpcService, T::Error: Into, @@ -186,7 +205,7 @@ pub mod query_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> QueryClient> + ) -> MsgClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -200,7 +219,7 @@ pub mod query_client { http::Request, >>::Error: Into + Send + Sync, { - QueryClient::new(InterceptedService::new(inner, interceptor)) + MsgClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with `gzip`. /// @@ -217,31 +236,12 @@ pub mod query_client { self.inner = self.inner.accept_gzip(); self } - /// Evidence queries evidence based on evidence hash. - pub async fn evidence( - &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()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.evidence.v1beta1.Query/Evidence", - ); - self.inner.unary(request.into_request(), path, codec).await - } - /// AllEvidence queries all evidence. - pub async fn all_evidence( + /// SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or + /// counterfactual signing. + pub async fn submit_evidence( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { self.inner .ready() .await @@ -253,7 +253,7 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.evidence.v1beta1.Query/AllEvidence", + "/cosmos.evidence.v1beta1.Msg/SubmitEvidence", ); self.inner.unary(request.into_request(), path, codec).await } diff --git a/cosmos-sdk-proto/src/prost/cosmos.feegrant.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.v1beta1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.feegrant.v1beta1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.v1beta1.rs index 4576ab3b..c8bba85b 100644 --- a/cosmos-sdk-proto/src/prost/cosmos.feegrant.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.v1beta1.rs @@ -1,7 +1,53 @@ -/// MsgGrantAllowance adds permission for Grantee to spend up to Allowance -/// of fees from the account of Granter. +/// 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)] -pub struct MsgGrantAllowance { +pub struct BasicAllowance { + /// spend_limit specifies the maximum amount of tokens that can be spent + /// by this allowance and will be updated as tokens are spent. If it is + /// empty, there is no spend limit and any amount of coins can be spent. + #[prost(message, repeated, tag="1")] + pub spend_limit: ::prost::alloc::vec::Vec, + /// expiration specifies an optional time when this allowance expires + #[prost(message, optional, tag="2")] + pub expiration: ::core::option::Option<::prost_types::Timestamp>, +} +/// PeriodicAllowance extends Allowance to allow for both a maximum cap, +/// as well as a limit per time period. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PeriodicAllowance { + /// basic specifies a struct of `BasicAllowance` + #[prost(message, optional, tag="1")] + pub basic: ::core::option::Option, + /// period specifies the time duration in which period_spend_limit coins can + /// be spent before that allowance is reset + #[prost(message, optional, tag="2")] + pub period: ::core::option::Option<::prost_types::Duration>, + /// period_spend_limit specifies the maximum number of coins that can be spent + /// in the period + #[prost(message, repeated, tag="3")] + pub period_spend_limit: ::prost::alloc::vec::Vec, + /// period_can_spend is the number of coins left to be spent before the period_reset time + #[prost(message, repeated, tag="4")] + pub period_can_spend: ::prost::alloc::vec::Vec, + /// period_reset is the time at which this period resets and a new one begins, + /// it is calculated from the start time of the first transaction after the + /// last period ended + #[prost(message, optional, tag="5")] + pub period_reset: ::core::option::Option<::prost_types::Timestamp>, +} +/// AllowedMsgAllowance creates allowance only for specified message types. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AllowedMsgAllowance { + /// allowance can be any of basic and filtered fee allowance. + #[prost(message, optional, tag="1")] + pub allowance: ::core::option::Option<::prost_types::Any>, + /// allowed_messages are the messages for which the grantee has the access. + #[prost(string, repeated, tag="2")] + pub allowed_messages: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// Grant is stored in the KVStore to record a grant with full context +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Grant { /// granter is the address of the user granting an allowance of their funds. #[prost(string, tag="1")] pub granter: ::prost::alloc::string::String, @@ -12,13 +58,9 @@ pub struct MsgGrantAllowance { #[prost(message, optional, tag="3")] pub allowance: ::core::option::Option<::prost_types::Any>, } -/// MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgGrantAllowanceResponse { -} -/// MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. +/// QueryAllowanceRequest is the request type for the Query/Allowance RPC method. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgRevokeAllowance { +pub struct QueryAllowanceRequest { /// granter is the address of the user granting an allowance of their funds. #[prost(string, tag="1")] pub granter: ::prost::alloc::string::String, @@ -26,22 +68,44 @@ pub struct MsgRevokeAllowance { #[prost(string, tag="2")] pub grantee: ::prost::alloc::string::String, } -/// MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. +/// QueryAllowanceResponse is the response type for the Query/Allowance RPC method. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgRevokeAllowanceResponse { +pub struct QueryAllowanceResponse { + /// allowance is a allowance granted for grantee by granter. + #[prost(message, optional, tag="1")] + pub allowance: ::core::option::Option, +} +/// QueryAllowancesRequest is the request type for the Query/Allowances RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAllowancesRequest { + #[prost(string, tag="1")] + pub grantee: ::prost::alloc::string::String, + /// pagination defines an pagination for the request. + #[prost(message, optional, tag="2")] + pub pagination: ::core::option::Option, +} +/// QueryAllowancesResponse is the response type for the Query/Allowances RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAllowancesResponse { + /// allowances are allowance's granted for grantee by granter. + #[prost(message, repeated, tag="1")] + pub allowances: ::prost::alloc::vec::Vec, + /// pagination defines an pagination for the response. + #[prost(message, optional, tag="2")] + pub pagination: ::core::option::Option, } /// Generated client implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] -pub mod msg_client { +pub mod query_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - /// Msg defines the feegrant msg service. + /// Query defines the gRPC querier service. #[derive(Debug, Clone)] - pub struct MsgClient { + pub struct QueryClient { inner: tonic::client::Grpc, } - impl MsgClient { + impl QueryClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -52,7 +116,7 @@ pub mod msg_client { Ok(Self::new(conn)) } } - impl MsgClient + impl QueryClient where T: tonic::client::GrpcService, T::Error: Into, @@ -66,7 +130,7 @@ pub mod msg_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> MsgClient> + ) -> QueryClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -80,7 +144,7 @@ pub mod msg_client { http::Request, >>::Error: Into + Send + Sync, { - MsgClient::new(InterceptedService::new(inner, interceptor)) + QueryClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with `gzip`. /// @@ -97,12 +161,11 @@ pub mod msg_client { self.inner = self.inner.accept_gzip(); self } - /// GrantAllowance grants fee allowance to the grantee on the granter's - /// account with the provided expiration time. - pub async fn grant_allowance( + /// Allowance returns fee granted to the grantee by the granter. + pub async fn allowance( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { self.inner .ready() .await @@ -114,16 +177,15 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.feegrant.v1beta1.Msg/GrantAllowance", + "/cosmos.feegrant.v1beta1.Query/Allowance", ); self.inner.unary(request.into_request(), path, codec).await } - /// RevokeAllowance revokes any fee allowance of granter's account that - /// has been granted to the grantee. - pub async fn revoke_allowance( + /// Allowances returns all the grants for address. + pub async fn allowances( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { self.inner .ready() .await @@ -135,62 +197,16 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.feegrant.v1beta1.Msg/RevokeAllowance", + "/cosmos.feegrant.v1beta1.Query/Allowances", ); self.inner.unary(request.into_request(), path, codec).await } } } -/// 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)] -pub struct BasicAllowance { - /// spend_limit specifies the maximum amount of tokens that can be spent - /// by this allowance and will be updated as tokens are spent. If it is - /// empty, there is no spend limit and any amount of coins can be spent. - #[prost(message, repeated, tag="1")] - pub spend_limit: ::prost::alloc::vec::Vec, - /// expiration specifies an optional time when this allowance expires - #[prost(message, optional, tag="2")] - pub expiration: ::core::option::Option<::prost_types::Timestamp>, -} -/// PeriodicAllowance extends Allowance to allow for both a maximum cap, -/// as well as a limit per time period. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PeriodicAllowance { - /// basic specifies a struct of `BasicAllowance` - #[prost(message, optional, tag="1")] - pub basic: ::core::option::Option, - /// period specifies the time duration in which period_spend_limit coins can - /// be spent before that allowance is reset - #[prost(message, optional, tag="2")] - pub period: ::core::option::Option<::prost_types::Duration>, - /// period_spend_limit specifies the maximum number of coins that can be spent - /// in the period - #[prost(message, repeated, tag="3")] - pub period_spend_limit: ::prost::alloc::vec::Vec, - /// period_can_spend is the number of coins left to be spent before the period_reset time - #[prost(message, repeated, tag="4")] - pub period_can_spend: ::prost::alloc::vec::Vec, - /// period_reset is the time at which this period resets and a new one begins, - /// it is calculated from the start time of the first transaction after the - /// last period ended - #[prost(message, optional, tag="5")] - pub period_reset: ::core::option::Option<::prost_types::Timestamp>, -} -/// AllowedMsgAllowance creates allowance only for specified message types. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AllowedMsgAllowance { - /// allowance can be any of basic and filtered fee allowance. - #[prost(message, optional, tag="1")] - pub allowance: ::core::option::Option<::prost_types::Any>, - /// allowed_messages are the messages for which the grantee has the access. - #[prost(string, repeated, tag="2")] - pub allowed_messages: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// Grant is stored in the KVStore to record a grant with full context +/// MsgGrantAllowance adds permission for Grantee to spend up to Allowance +/// of fees from the account of Granter. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct Grant { +pub struct MsgGrantAllowance { /// granter is the address of the user granting an allowance of their funds. #[prost(string, tag="1")] pub granter: ::prost::alloc::string::String, @@ -201,9 +217,13 @@ pub struct Grant { #[prost(message, optional, tag="3")] pub allowance: ::core::option::Option<::prost_types::Any>, } -/// QueryAllowanceRequest is the request type for the Query/Allowance RPC method. +/// MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryAllowanceRequest { +pub struct MsgGrantAllowanceResponse { +} +/// MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgRevokeAllowance { /// granter is the address of the user granting an allowance of their funds. #[prost(string, tag="1")] pub granter: ::prost::alloc::string::String, @@ -211,44 +231,22 @@ pub struct QueryAllowanceRequest { #[prost(string, tag="2")] pub grantee: ::prost::alloc::string::String, } -/// QueryAllowanceResponse is the response type for the Query/Allowance RPC method. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryAllowanceResponse { - /// allowance is a allowance granted for grantee by granter. - #[prost(message, optional, tag="1")] - pub allowance: ::core::option::Option, -} -/// QueryAllowancesRequest is the request type for the Query/Allowances RPC method. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryAllowancesRequest { - #[prost(string, tag="1")] - pub grantee: ::prost::alloc::string::String, - /// pagination defines an pagination for the request. - #[prost(message, optional, tag="2")] - pub pagination: ::core::option::Option, -} -/// QueryAllowancesResponse is the response type for the Query/Allowances RPC method. +/// MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryAllowancesResponse { - /// allowances are allowance's granted for grantee by granter. - #[prost(message, repeated, tag="1")] - pub allowances: ::prost::alloc::vec::Vec, - /// pagination defines an pagination for the response. - #[prost(message, optional, tag="2")] - pub pagination: ::core::option::Option, +pub struct MsgRevokeAllowanceResponse { } /// Generated client implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] -pub mod query_client { +pub mod msg_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - /// Query defines the gRPC querier service. + /// Msg defines the feegrant msg service. #[derive(Debug, Clone)] - pub struct QueryClient { + pub struct MsgClient { inner: tonic::client::Grpc, } - impl QueryClient { + impl MsgClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -259,7 +257,7 @@ pub mod query_client { Ok(Self::new(conn)) } } - impl QueryClient + impl MsgClient where T: tonic::client::GrpcService, T::Error: Into, @@ -273,7 +271,7 @@ pub mod query_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> QueryClient> + ) -> MsgClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -287,7 +285,7 @@ pub mod query_client { http::Request, >>::Error: Into + Send + Sync, { - QueryClient::new(InterceptedService::new(inner, interceptor)) + MsgClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with `gzip`. /// @@ -304,11 +302,12 @@ pub mod query_client { self.inner = self.inner.accept_gzip(); self } - /// Allowance returns fee granted to the grantee by the granter. - pub async fn allowance( + /// GrantAllowance grants fee allowance to the grantee on the granter's + /// account with the provided expiration time. + pub async fn grant_allowance( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { self.inner .ready() .await @@ -320,15 +319,16 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.feegrant.v1beta1.Query/Allowance", + "/cosmos.feegrant.v1beta1.Msg/GrantAllowance", ); self.inner.unary(request.into_request(), path, codec).await } - /// Allowances returns all the grants for address. - pub async fn allowances( + /// RevokeAllowance revokes any fee allowance of granter's account that + /// has been granted to the grantee. + pub async fn revoke_allowance( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { self.inner .ready() .await @@ -340,7 +340,7 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.feegrant.v1beta1.Query/Allowances", + "/cosmos.feegrant.v1beta1.Msg/RevokeAllowance", ); self.inner.unary(request.into_request(), path, codec).await } diff --git a/cosmos-sdk-proto/src/prost/cosmos.genutil.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.genutil.v1beta1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.genutil.v1beta1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.genutil.v1beta1.rs diff --git a/cosmos-sdk-proto/src/prost/cosmos.gov.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1beta1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.gov.v1beta1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1beta1.rs index d4b62fdd..71b56441 100644 --- a/cosmos-sdk-proto/src/prost/cosmos.gov.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1beta1.rs @@ -150,220 +150,6 @@ pub enum ProposalStatus { /// failed. Failed = 5, } -/// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary -/// proposal Content. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSubmitProposal { - #[prost(message, optional, tag="1")] - pub content: ::core::option::Option<::prost_types::Any>, - #[prost(message, repeated, tag="2")] - pub initial_deposit: ::prost::alloc::vec::Vec, - #[prost(string, tag="3")] - pub proposer: ::prost::alloc::string::String, -} -/// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSubmitProposalResponse { - #[prost(uint64, tag="1")] - pub proposal_id: u64, -} -/// MsgVote defines a message to cast a vote. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgVote { - #[prost(uint64, tag="1")] - pub proposal_id: u64, - #[prost(string, tag="2")] - pub voter: ::prost::alloc::string::String, - #[prost(enumeration="VoteOption", tag="3")] - pub option: i32, -} -/// MsgVoteResponse defines the Msg/Vote response type. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgVoteResponse { -} -/// MsgVoteWeighted defines a message to cast a vote. -/// -/// Since: cosmos-sdk 0.43 -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgVoteWeighted { - #[prost(uint64, tag="1")] - pub proposal_id: u64, - #[prost(string, tag="2")] - pub voter: ::prost::alloc::string::String, - #[prost(message, repeated, tag="3")] - pub options: ::prost::alloc::vec::Vec, -} -/// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. -/// -/// Since: cosmos-sdk 0.43 -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgVoteWeightedResponse { -} -/// MsgDeposit defines a message to submit a deposit to an existing proposal. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgDeposit { - #[prost(uint64, tag="1")] - pub proposal_id: u64, - #[prost(string, tag="2")] - pub depositor: ::prost::alloc::string::String, - #[prost(message, repeated, tag="3")] - pub amount: ::prost::alloc::vec::Vec, -} -/// MsgDepositResponse defines the Msg/Deposit response type. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgDepositResponse { -} -/// Generated client implementations. -#[cfg(feature = "grpc")] -#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] -pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Msg defines the bank Msg service. - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, - } - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: std::convert::TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl MsgClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> MsgClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + Send + Sync, - { - MsgClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with `gzip`. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_gzip(mut self) -> Self { - self.inner = self.inner.send_gzip(); - self - } - /// Enable decompressing responses with `gzip`. - #[must_use] - pub fn accept_gzip(mut self) -> Self { - self.inner = self.inner.accept_gzip(); - self - } - /// SubmitProposal defines a method to create new proposal given a content. - pub async fn submit_proposal( - &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()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.gov.v1beta1.Msg/SubmitProposal", - ); - self.inner.unary(request.into_request(), path, codec).await - } - /// Vote defines a method to add a vote on a specific proposal. - pub async fn vote( - &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()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.gov.v1beta1.Msg/Vote", - ); - self.inner.unary(request.into_request(), path, codec).await - } - /// VoteWeighted defines a method to add a weighted vote on a specific proposal. - /// - /// Since: cosmos-sdk 0.43 - pub async fn vote_weighted( - &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()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.gov.v1beta1.Msg/VoteWeighted", - ); - self.inner.unary(request.into_request(), path, codec).await - } - /// Deposit defines a method to add deposit on a specific proposal. - pub async fn deposit( - &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()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.gov.v1beta1.Msg/Deposit", - ); - self.inner.unary(request.into_request(), path, codec).await - } - } -} /// QueryProposalRequest is the request type for the Query/Proposal RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalRequest { @@ -740,6 +526,220 @@ pub mod query_client { } } } +/// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary +/// proposal Content. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSubmitProposal { + #[prost(message, optional, tag="1")] + pub content: ::core::option::Option<::prost_types::Any>, + #[prost(message, repeated, tag="2")] + pub initial_deposit: ::prost::alloc::vec::Vec, + #[prost(string, tag="3")] + pub proposer: ::prost::alloc::string::String, +} +/// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSubmitProposalResponse { + #[prost(uint64, tag="1")] + pub proposal_id: u64, +} +/// MsgVote defines a message to cast a vote. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgVote { + #[prost(uint64, tag="1")] + pub proposal_id: u64, + #[prost(string, tag="2")] + pub voter: ::prost::alloc::string::String, + #[prost(enumeration="VoteOption", tag="3")] + pub option: i32, +} +/// MsgVoteResponse defines the Msg/Vote response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgVoteResponse { +} +/// MsgVoteWeighted defines a message to cast a vote. +/// +/// Since: cosmos-sdk 0.43 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgVoteWeighted { + #[prost(uint64, tag="1")] + pub proposal_id: u64, + #[prost(string, tag="2")] + pub voter: ::prost::alloc::string::String, + #[prost(message, repeated, tag="3")] + pub options: ::prost::alloc::vec::Vec, +} +/// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. +/// +/// Since: cosmos-sdk 0.43 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgVoteWeightedResponse { +} +/// MsgDeposit defines a message to submit a deposit to an existing proposal. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgDeposit { + #[prost(uint64, tag="1")] + pub proposal_id: u64, + #[prost(string, tag="2")] + pub depositor: ::prost::alloc::string::String, + #[prost(message, repeated, tag="3")] + pub amount: ::prost::alloc::vec::Vec, +} +/// MsgDepositResponse defines the Msg/Deposit response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgDepositResponse { +} +/// Generated client implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod msg_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Msg defines the bank Msg service. + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: std::convert::TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl MsgClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> MsgClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + MsgClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with `gzip`. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_gzip(mut self) -> Self { + self.inner = self.inner.send_gzip(); + self + } + /// Enable decompressing responses with `gzip`. + #[must_use] + pub fn accept_gzip(mut self) -> Self { + self.inner = self.inner.accept_gzip(); + self + } + /// SubmitProposal defines a method to create new proposal given a content. + pub async fn submit_proposal( + &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()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.gov.v1beta1.Msg/SubmitProposal", + ); + self.inner.unary(request.into_request(), path, codec).await + } + /// Vote defines a method to add a vote on a specific proposal. + pub async fn vote( + &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()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.gov.v1beta1.Msg/Vote", + ); + self.inner.unary(request.into_request(), path, codec).await + } + /// VoteWeighted defines a method to add a weighted vote on a specific proposal. + /// + /// Since: cosmos-sdk 0.43 + pub async fn vote_weighted( + &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()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.gov.v1beta1.Msg/VoteWeighted", + ); + self.inner.unary(request.into_request(), path, codec).await + } + /// Deposit defines a method to add deposit on a specific proposal. + pub async fn deposit( + &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()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.gov.v1beta1.Msg/Deposit", + ); + self.inner.unary(request.into_request(), path, codec).await + } + } +} /// 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.mint.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.v1beta1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.mint.v1beta1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.v1beta1.rs diff --git a/cosmos-sdk-proto/src/prost/cosmos.params.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.params.v1beta1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.params.v1beta1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.params.v1beta1.rs diff --git a/cosmos-sdk-proto/src/prost/cosmos.slashing.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.v1beta1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.slashing.v1beta1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.v1beta1.rs index fb33d051..0480a04d 100644 --- a/cosmos-sdk-proto/src/prost/cosmos.slashing.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.v1beta1.rs @@ -1,104 +1,3 @@ -/// MsgUnjail defines the Msg/Unjail request type -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUnjail { - #[prost(string, tag="1")] - pub validator_addr: ::prost::alloc::string::String, -} -/// MsgUnjailResponse defines the Msg/Unjail response type -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUnjailResponse { -} -/// Generated client implementations. -#[cfg(feature = "grpc")] -#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] -pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Msg defines the slashing Msg service. - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, - } - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: std::convert::TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl MsgClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> MsgClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + Send + Sync, - { - MsgClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with `gzip`. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_gzip(mut self) -> Self { - self.inner = self.inner.send_gzip(); - self - } - /// Enable decompressing responses with `gzip`. - #[must_use] - pub fn accept_gzip(mut self) -> Self { - self.inner = self.inner.accept_gzip(); - self - } - /// 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. - pub async fn unjail( - &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()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.slashing.v1beta1.Msg/Unjail", - ); - self.inner.unary(request.into_request(), path, codec).await - } - } -} /// ValidatorSigningInfo defines a validator's signing info for monitoring their /// liveness activity. #[derive(Clone, PartialEq, ::prost::Message)] @@ -311,6 +210,107 @@ pub mod query_client { } } } +/// MsgUnjail defines the Msg/Unjail request type +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUnjail { + #[prost(string, tag="1")] + pub validator_addr: ::prost::alloc::string::String, +} +/// MsgUnjailResponse defines the Msg/Unjail response type +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUnjailResponse { +} +/// Generated client implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod msg_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Msg defines the slashing Msg service. + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: std::convert::TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl MsgClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> MsgClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + MsgClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with `gzip`. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_gzip(mut self) -> Self { + self.inner = self.inner.send_gzip(); + self + } + /// Enable decompressing responses with `gzip`. + #[must_use] + pub fn accept_gzip(mut self) -> Self { + self.inner = self.inner.accept_gzip(); + self + } + /// 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. + pub async fn unjail( + &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()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.slashing.v1beta1.Msg/Unjail", + ); + self.inner.unary(request.into_request(), path, codec).await + } + } +} /// 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.staking.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.rs similarity index 74% rename from cosmos-sdk-proto/src/prost/cosmos.staking.v1beta1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.rs index eb16948f..aa0ef50d 100644 --- a/cosmos-sdk-proto/src/prost/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. @@ -289,275 +289,89 @@ pub enum BondStatus { /// BONDED defines a validator that is bonded. Bonded = 3, } -/// MsgCreateValidator defines a SDK message for creating a new validator. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgCreateValidator { - #[prost(message, optional, tag = "1")] - pub description: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub commission: ::core::option::Option, - #[prost(string, tag = "3")] - pub min_self_delegation: ::prost::alloc::string::String, - #[prost(string, tag = "4")] - pub delegator_address: ::prost::alloc::string::String, - #[prost(string, tag = "5")] - pub validator_address: ::prost::alloc::string::String, - #[prost(message, optional, tag = "6")] - pub pubkey: ::core::option::Option<::prost_types::Any>, - #[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 {} -/// MsgEditValidator defines a SDK message for editing an existing validator. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgEditValidator { - #[prost(message, optional, tag = "1")] - pub description: ::core::option::Option, - #[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")] - pub commission_rate: ::prost::alloc::string::String, - #[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 {} -/// 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")] - pub delegator_address: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub validator_address: ::prost::alloc::string::String, - #[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 {} -/// 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")] - pub delegator_address: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub validator_src_address: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub validator_dst_address: ::prost::alloc::string::String, - #[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")] - 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")] - pub delegator_address: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub validator_address: ::prost::alloc::string::String, - #[prost(message, optional, tag = "3")] - pub amount: ::core::option::Option, -} -/// MsgUndelegateResponse defines the Msg/Undelegate response type. +/// StakeAuthorization defines authorization for delegate/undelegate/redelegate. +/// +/// Since: cosmos-sdk 0.43 #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUndelegateResponse { - #[prost(message, optional, tag = "1")] - pub completion_time: ::core::option::Option<::prost_types::Timestamp>, +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")] + pub max_tokens: ::core::option::Option, + /// authorization_type defines one of AuthorizationType. + #[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")] + pub validators: ::core::option::Option, } -/// Generated client implementations. -#[cfg(feature = "grpc")] -#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] -pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Msg defines the staking Msg service. - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, - } - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: std::convert::TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } +/// Nested message and enum types in `StakeAuthorization`. +pub mod stake_authorization { + /// StakeAuthorizationValidators defines list of validator addresses. + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct StakeAuthorizationValidators { + #[prost(string, repeated, tag="1")] + pub address: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } - impl MsgClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - MsgClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with `gzip`. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_gzip(mut self) -> Self { - self.inner = self.inner.send_gzip(); - self - } - /// Enable decompressing responses with `gzip`. - #[must_use] - pub fn accept_gzip(mut self) -> Self { - self.inner = self.inner.accept_gzip(); - self - } - /// CreateValidator defines a method for creating a new validator. - pub async fn create_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()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - 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. - pub async fn edit_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()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - 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 - /// from a delegator to a validator. - pub async fn delegate( - &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()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - 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 - /// of coins from a delegator and source validator to a destination validator. - pub async fn begin_redelegate( - &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()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - 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 - /// delegate and a validator. - pub async fn undelegate( - &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()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/cosmos.staking.v1beta1.Msg/Undelegate"); - self.inner.unary(request.into_request(), path, codec).await - } + /// IsStakeAuthorizationValidators is the oneof that represents either allow_list or deny_list + #[derive(Clone, PartialEq, ::prost::Oneof)] + 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")] + AllowList(StakeAuthorizationValidators), + /// deny_list specifies list of validator addresses to whom grantee can not delegate tokens. + #[prost(message, tag="3")] + DenyList(StakeAuthorizationValidators), } } +/// AuthorizationType defines the type of staking module authorization type +/// +/// Since: cosmos-sdk 0.43 +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum AuthorizationType { + /// AUTHORIZATION_TYPE_UNSPECIFIED specifies an unknown authorization type + Unspecified = 0, + /// AUTHORIZATION_TYPE_DELEGATE defines an authorization type for Msg/Delegate + Delegate = 1, + /// AUTHORIZATION_TYPE_UNDELEGATE defines an authorization type for Msg/Undelegate + Undelegate = 2, + /// AUTHORIZATION_TYPE_REDELEGATE defines an authorization type for Msg/BeginRedelegate + Redelegate = 3, +} /// 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 @@ -565,20 +379,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 @@ -586,37 +400,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 @@ -624,10 +438,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 @@ -635,7 +449,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 @@ -643,10 +457,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 @@ -654,10 +468,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 @@ -665,20 +479,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 @@ -686,26 +500,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 @@ -713,10 +527,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 @@ -724,10 +538,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 @@ -735,10 +549,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 @@ -746,7 +560,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 @@ -754,7 +568,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 @@ -762,27 +576,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. @@ -831,8 +647,9 @@ pub mod query_client { >::ResponseBody, >, >, - >>::Error: - Into + Send + Sync, + , + >>::Error: Into + Send + Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -856,15 +673,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. @@ -872,29 +693,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", @@ -904,15 +734,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", @@ -924,15 +761,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 @@ -940,14 +781,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", @@ -958,14 +804,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", @@ -976,15 +827,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", @@ -996,15 +854,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 @@ -1012,14 +874,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", @@ -1031,14 +898,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", @@ -1050,12 +922,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", @@ -1067,14 +942,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. @@ -1082,108 +962,324 @@ 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 } } } -/// StakeAuthorization defines authorization for delegate/undelegate/redelegate. -/// -/// Since: cosmos-sdk 0.43 +/// MsgCreateValidator defines a SDK message for creating a new validator. #[derive(Clone, PartialEq, ::prost::Message)] -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")] - pub max_tokens: ::core::option::Option, - /// authorization_type defines one of AuthorizationType. - #[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" - )] - pub validators: ::core::option::Option, +pub struct MsgCreateValidator { + #[prost(message, optional, tag="1")] + pub description: ::core::option::Option, + #[prost(message, optional, tag="2")] + pub commission: ::core::option::Option, + #[prost(string, tag="3")] + pub min_self_delegation: ::prost::alloc::string::String, + #[prost(string, tag="4")] + pub delegator_address: ::prost::alloc::string::String, + #[prost(string, tag="5")] + pub validator_address: ::prost::alloc::string::String, + #[prost(message, optional, tag="6")] + pub pubkey: ::core::option::Option<::prost_types::Any>, + #[prost(message, optional, tag="7")] + pub value: ::core::option::Option, } -/// Nested message and enum types in `StakeAuthorization`. -pub mod stake_authorization { - /// Validators defines list of validator addresses. - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct StakeAuthorizationValidators { - #[prost(string, repeated, tag = "1")] - pub address: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +/// MsgCreateValidatorResponse defines the Msg/CreateValidator response type. +#[derive(Clone, PartialEq, ::prost::Message)] +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")] + pub description: ::core::option::Option, + #[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")] + pub commission_rate: ::prost::alloc::string::String, + #[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 { +} +/// 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")] + pub delegator_address: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub validator_address: ::prost::alloc::string::String, + #[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 { +} +/// 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")] + pub delegator_address: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub validator_src_address: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub validator_dst_address: ::prost::alloc::string::String, + #[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")] + 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")] + pub delegator_address: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub validator_address: ::prost::alloc::string::String, + #[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")] + pub completion_time: ::core::option::Option<::prost_types::Timestamp>, +} +/// Generated client implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod msg_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Msg defines the staking Msg service. + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, } - /// validators is the oneof that represents either allow_list or deny_list - #[derive(Clone, PartialEq, ::prost::Oneof)] - 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")] - AllowList(StakeAuthorizationValidators), - /// deny_list specifies list of validator addresses to whom grantee can not delegate tokens. - #[prost(message, tag = "3")] - DenyList(StakeAuthorizationValidators), + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: std::convert::TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl MsgClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> MsgClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + MsgClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with `gzip`. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_gzip(mut self) -> Self { + self.inner = self.inner.send_gzip(); + self + } + /// Enable decompressing responses with `gzip`. + #[must_use] + pub fn accept_gzip(mut self) -> Self { + self.inner = self.inner.accept_gzip(); + self + } + /// CreateValidator defines a method for creating a new validator. + pub async fn create_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()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + 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. + pub async fn edit_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()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + 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 + /// from a delegator to a validator. + pub async fn delegate( + &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()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + 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 + /// of coins from a delegator and source validator to a destination validator. + pub async fn begin_redelegate( + &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()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + 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 + /// delegate and a validator. + pub async fn undelegate( + &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()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.staking.v1beta1.Msg/Undelegate", + ); + self.inner.unary(request.into_request(), path, codec).await + } } -} -/// AuthorizationType defines the type of staking module authorization type -/// -/// Since: cosmos-sdk 0.43 -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum AuthorizationType { - /// AUTHORIZATION_TYPE_UNSPECIFIED specifies an unknown authorization type - Unspecified = 0, - /// AUTHORIZATION_TYPE_DELEGATE defines an authorization type for Msg/Delegate - Delegate = 1, - /// AUTHORIZATION_TYPE_UNDELEGATE defines an authorization type for Msg/Undelegate - Undelegate = 2, - /// AUTHORIZATION_TYPE_REDELEGATE defines an authorization type for Msg/BeginRedelegate - Redelegate = 3, } /// GenesisState defines the staking module's genesis state. #[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.tx.signing.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.signing.v1beta1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.tx.signing.v1beta1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.signing.v1beta1.rs diff --git a/cosmos-sdk-proto/src/prost/cosmos.tx.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.tx.v1beta1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.rs 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 new file mode 100644 index 00000000..e2e556ed --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.upgrade.v1beta1.rs @@ -0,0 +1,292 @@ +/// Plan specifies information about a planned upgrade and when it should occur. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Plan { + /// Sets the name for the upgrade. This name will be used by the upgraded + /// version of the software to apply any special "on-upgrade" commands during + /// the first BeginBlock method after the upgrade is applied. It is also used + /// to detect whether a software version can handle a given upgrade. If no + /// upgrade handler with this name has been set in the software, it will be + /// assumed that the software is out-of-date when the upgrade Time or Height is + /// reached and the software will exit. + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, + /// Deprecated: Time based upgrades have been deprecated. Time based upgrade logic + /// has been removed from the SDK. + /// If this field is not empty, an error will be thrown. + #[deprecated] + #[prost(message, optional, tag="2")] + pub time: ::core::option::Option<::prost_types::Timestamp>, + /// The height at which the upgrade must be performed. + /// Only used if Time is not set. + #[prost(int64, tag="3")] + pub height: i64, + /// Any application specific upgrade info to be included on-chain + /// such as a git commit that validators could automatically upgrade to + #[prost(string, tag="4")] + pub info: ::prost::alloc::string::String, + /// Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been + /// moved to the IBC module in the sub module 02-client. + /// If this field is not empty, an error will be thrown. + #[deprecated] + #[prost(message, optional, tag="5")] + pub upgraded_client_state: ::core::option::Option<::prost_types::Any>, +} +/// SoftwareUpgradeProposal is a gov Content type for initiating a software +/// upgrade. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SoftwareUpgradeProposal { + #[prost(string, tag="1")] + pub title: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub description: ::prost::alloc::string::String, + #[prost(message, optional, tag="3")] + pub plan: ::core::option::Option, +} +/// CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software +/// upgrade. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CancelSoftwareUpgradeProposal { + #[prost(string, tag="1")] + pub title: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub description: ::prost::alloc::string::String, +} +/// ModuleVersion specifies a module and its consensus version. +/// +/// Since: cosmos-sdk 0.43 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ModuleVersion { + /// name of the app module + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, + /// consensus version of the app module + #[prost(uint64, tag="2")] + pub version: u64, +} +/// QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC +/// method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryCurrentPlanRequest { +} +/// QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC +/// method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryCurrentPlanResponse { + /// plan is the current upgrade plan. + #[prost(message, optional, tag="1")] + pub plan: ::core::option::Option, +} +/// QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC +/// method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAppliedPlanRequest { + /// name is the name of the applied plan to query for. + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, +} +/// QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC +/// method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAppliedPlanResponse { + /// height is the block height at which the plan was applied. + #[prost(int64, tag="1")] + pub height: i64, +} +/// QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState +/// RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryUpgradedConsensusStateRequest { + /// last height of the current chain must be sent in request + /// as this is the height under which next consensus state is stored + #[prost(int64, tag="1")] + pub last_height: i64, +} +/// QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState +/// RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryUpgradedConsensusStateResponse { + /// Since: cosmos-sdk 0.43 + #[prost(bytes="vec", tag="2")] + pub upgraded_consensus_state: ::prost::alloc::vec::Vec, +} +/// QueryModuleVersionsRequest is the request type for the Query/ModuleVersions +/// RPC method. +/// +/// Since: cosmos-sdk 0.43 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryModuleVersionsRequest { + /// module_name is a field to query a specific module + /// consensus version from state. Leaving this empty will + /// fetch the full list of module versions from state + #[prost(string, tag="1")] + pub module_name: ::prost::alloc::string::String, +} +/// QueryModuleVersionsResponse is the response type for the Query/ModuleVersions +/// RPC method. +/// +/// Since: cosmos-sdk 0.43 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryModuleVersionsResponse { + /// module_versions is a list of module names with their consensus versions. + #[prost(message, repeated, tag="1")] + pub module_versions: ::prost::alloc::vec::Vec, +} +/// Generated client implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod query_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Query defines the gRPC upgrade querier service. + #[derive(Debug, Clone)] + pub struct QueryClient { + inner: tonic::client::Grpc, + } + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: std::convert::TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl QueryClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> QueryClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + QueryClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with `gzip`. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_gzip(mut self) -> Self { + self.inner = self.inner.send_gzip(); + self + } + /// Enable decompressing responses with `gzip`. + #[must_use] + pub fn accept_gzip(mut self) -> Self { + self.inner = self.inner.accept_gzip(); + self + } + /// CurrentPlan queries the current upgrade plan. + pub async fn current_plan( + &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()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.upgrade.v1beta1.Query/CurrentPlan", + ); + self.inner.unary(request.into_request(), path, codec).await + } + /// AppliedPlan queries a previously applied upgrade plan by its name. + pub async fn applied_plan( + &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()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.upgrade.v1beta1.Query/AppliedPlan", + ); + self.inner.unary(request.into_request(), path, codec).await + } + /// 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) + pub async fn upgraded_consensus_state( + &mut self, + request: impl tonic::IntoRequest, + ) -> 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.upgrade.v1beta1.Query/UpgradedConsensusState", + ); + self.inner.unary(request.into_request(), path, codec).await + } + /// ModuleVersions queries the list of module versions from state. + /// + /// Since: cosmos-sdk 0.43 + pub async fn module_versions( + &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()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.upgrade.v1beta1.Query/ModuleVersions", + ); + self.inner.unary(request.into_request(), path, codec).await + } + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos.vesting.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.v1beta1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.vesting.v1beta1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.v1beta1.rs index c9decbfb..1b49fc3c 100644 --- a/cosmos-sdk-proto/src/prost/cosmos.vesting.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.v1beta1.rs @@ -1,3 +1,64 @@ +/// BaseVestingAccount implements the VestingAccount interface. It contains all +/// the necessary fields needed for any vesting account implementation. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BaseVestingAccount { + #[prost(message, optional, tag="1")] + pub base_account: ::core::option::Option, + #[prost(message, repeated, tag="2")] + pub original_vesting: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="3")] + pub delegated_free: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="4")] + pub delegated_vesting: ::prost::alloc::vec::Vec, + #[prost(int64, tag="5")] + pub end_time: i64, +} +/// ContinuousVestingAccount implements the VestingAccount interface. It +/// continuously vests by unlocking coins linearly with respect to time. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ContinuousVestingAccount { + #[prost(message, optional, tag="1")] + pub base_vesting_account: ::core::option::Option, + #[prost(int64, tag="2")] + pub start_time: i64, +} +/// DelayedVestingAccount implements the VestingAccount interface. It vests all +/// coins after a specific time, but non prior. In other words, it keeps them +/// locked until a specified time. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DelayedVestingAccount { + #[prost(message, optional, tag="1")] + pub base_vesting_account: ::core::option::Option, +} +/// Period defines a length of time and amount of coins that will vest. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Period { + #[prost(int64, tag="1")] + pub length: i64, + #[prost(message, repeated, tag="2")] + pub amount: ::prost::alloc::vec::Vec, +} +/// PeriodicVestingAccount implements the VestingAccount interface. It +/// periodically vests by unlocking coins during each specified period. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PeriodicVestingAccount { + #[prost(message, optional, tag="1")] + pub base_vesting_account: ::core::option::Option, + #[prost(int64, tag="2")] + pub start_time: i64, + #[prost(message, repeated, tag="3")] + pub vesting_periods: ::prost::alloc::vec::Vec, +} +/// PermanentLockedAccount implements the VestingAccount interface. It does +/// not ever release coins, locking them indefinitely. Coins in this account can +/// still be used for delegating and for governance votes even while locked. +/// +/// Since: cosmos-sdk 0.43 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PermanentLockedAccount { + #[prost(message, optional, tag="1")] + pub base_vesting_account: ::core::option::Option, +} /// MsgCreateVestingAccount defines a message that enables creating a vesting /// account. #[derive(Clone, PartialEq, ::prost::Message)] @@ -110,64 +171,3 @@ pub mod msg_client { } } } -/// BaseVestingAccount implements the VestingAccount interface. It contains all -/// the necessary fields needed for any vesting account implementation. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BaseVestingAccount { - #[prost(message, optional, tag="1")] - pub base_account: ::core::option::Option, - #[prost(message, repeated, tag="2")] - pub original_vesting: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="3")] - pub delegated_free: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="4")] - pub delegated_vesting: ::prost::alloc::vec::Vec, - #[prost(int64, tag="5")] - pub end_time: i64, -} -/// ContinuousVestingAccount implements the VestingAccount interface. It -/// continuously vests by unlocking coins linearly with respect to time. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ContinuousVestingAccount { - #[prost(message, optional, tag="1")] - pub base_vesting_account: ::core::option::Option, - #[prost(int64, tag="2")] - pub start_time: i64, -} -/// DelayedVestingAccount implements the VestingAccount interface. It vests all -/// coins after a specific time, but non prior. In other words, it keeps them -/// locked until a specified time. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DelayedVestingAccount { - #[prost(message, optional, tag="1")] - pub base_vesting_account: ::core::option::Option, -} -/// Period defines a length of time and amount of coins that will vest. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Period { - #[prost(int64, tag="1")] - pub length: i64, - #[prost(message, repeated, tag="2")] - pub amount: ::prost::alloc::vec::Vec, -} -/// PeriodicVestingAccount implements the VestingAccount interface. It -/// periodically vests by unlocking coins during each specified period. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PeriodicVestingAccount { - #[prost(message, optional, tag="1")] - pub base_vesting_account: ::core::option::Option, - #[prost(int64, tag="2")] - pub start_time: i64, - #[prost(message, repeated, tag="3")] - pub vesting_periods: ::prost::alloc::vec::Vec, -} -/// PermanentLockedAccount implements the VestingAccount interface. It does -/// not ever release coins, locking them indefinitely. Coins in this account can -/// still be used for delegating and for governance votes even while locked. -/// -/// Since: cosmos-sdk 0.43 -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PermanentLockedAccount { - #[prost(message, optional, tag="1")] - pub base_vesting_account: ::core::option::Option, -} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos_proto.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos_proto.rs new file mode 100644 index 00000000..e69de29b diff --git a/cosmos-sdk-proto/src/prost/IBC_COMMIT b/cosmos-sdk-proto/src/prost/ibc-go/IBC_COMMIT similarity index 100% rename from cosmos-sdk-proto/src/prost/IBC_COMMIT rename to cosmos-sdk-proto/src/prost/ibc-go/IBC_COMMIT diff --git a/cosmos-sdk-proto/src/prost/cosmos.auth.v1beta1.rs b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.auth.v1beta1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.auth.v1beta1.rs rename to cosmos-sdk-proto/src/prost/ibc-go/cosmos.auth.v1beta1.rs diff --git a/cosmos-sdk-proto/src/prost/ibc-go/cosmos.base.query.v1beta1.rs b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.base.query.v1beta1.rs new file mode 100644 index 00000000..12898bc2 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.base.query.v1beta1.rs @@ -0,0 +1,48 @@ +/// PageRequest is to be embedded in gRPC request messages for efficient +/// pagination. Ex: +/// +/// message SomeRequest { +/// Foo some_parameter = 1; +/// PageRequest pagination = 2; +/// } +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PageRequest { + /// key is a value returned in PageResponse.next_key to begin + /// querying the next page most efficiently. Only one of offset or key + /// should be set. + #[prost(bytes="vec", tag="1")] + pub key: ::prost::alloc::vec::Vec, + /// offset is a numeric offset that can be used when key is unavailable. + /// It is less efficient than using key. Only one of offset or key should + /// be set. + #[prost(uint64, tag="2")] + pub offset: u64, + /// limit is the total number of results to be returned in the result page. + /// If left empty it will default to a value to be set by each app. + #[prost(uint64, tag="3")] + pub limit: u64, + /// count_total is set to true to indicate that the result set should include + /// a count of the total number of items available for pagination in UIs. + /// count_total is only respected when offset is used. It is ignored when key + /// is set. + #[prost(bool, tag="4")] + pub count_total: bool, +} +/// PageResponse is to be embedded in gRPC response messages where the +/// corresponding request message has used PageRequest. +/// +/// message SomeResponse { +/// repeated Bar results = 1; +/// PageResponse page = 2; +/// } +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PageResponse { + /// next_key is the key to be passed to PageRequest.key to + /// query the next page most efficiently + #[prost(bytes="vec", tag="1")] + pub next_key: ::prost::alloc::vec::Vec, + /// total is total number of results available if PageRequest.count_total + /// was set, its value is undefined otherwise + #[prost(uint64, tag="2")] + pub total: u64, +} diff --git a/cosmos-sdk-proto/src/prost/ibc-go/cosmos.base.v1beta1.rs b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.base.v1beta1.rs new file mode 100644 index 00000000..44b3e63b --- /dev/null +++ b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.base.v1beta1.rs @@ -0,0 +1,34 @@ +/// Coin defines a token with a denomination and an amount. +/// +/// NOTE: The amount field is an Int which implements the custom method +/// signatures required by gogoproto. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Coin { + #[prost(string, tag="1")] + pub denom: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub amount: ::prost::alloc::string::String, +} +/// DecCoin defines a token with a denomination and a decimal amount. +/// +/// NOTE: The amount field is an Dec which implements the custom method +/// signatures required by gogoproto. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DecCoin { + #[prost(string, tag="1")] + pub denom: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub amount: ::prost::alloc::string::String, +} +/// IntProto defines a Protobuf wrapper around an Int object. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct IntProto { + #[prost(string, tag="1")] + pub int: ::prost::alloc::string::String, +} +/// DecProto defines a Protobuf wrapper around a Dec object. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DecProto { + #[prost(string, tag="1")] + pub dec: ::prost::alloc::string::String, +} diff --git a/cosmos-sdk-proto/src/prost/cosmos.upgrade.v1beta1.rs b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.upgrade.v1beta1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmos.upgrade.v1beta1.rs rename to cosmos-sdk-proto/src/prost/ibc-go/cosmos.upgrade.v1beta1.rs diff --git a/cosmos-sdk-proto/src/prost/ibc-go/cosmos_proto.rs b/cosmos-sdk-proto/src/prost/ibc-go/cosmos_proto.rs new file mode 100644 index 00000000..e69de29b diff --git a/cosmos-sdk-proto/src/prost/ibc.applications.interchain_accounts.controller.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.controller.v1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/ibc.applications.interchain_accounts.controller.v1.rs rename to cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.controller.v1.rs diff --git a/cosmos-sdk-proto/src/prost/ibc.applications.interchain_accounts.host.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.host.v1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/ibc.applications.interchain_accounts.host.v1.rs rename to cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.host.v1.rs diff --git a/cosmos-sdk-proto/src/prost/ibc.applications.interchain_accounts.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.v1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/ibc.applications.interchain_accounts.v1.rs rename to cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.v1.rs index 0f103b22..79255de7 100644 --- a/cosmos-sdk-proto/src/prost/ibc.applications.interchain_accounts.v1.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.v1.rs @@ -1,37 +1,3 @@ -/// An InterchainAccount is defined as a BaseAccount & the address of the account owner on the controller chain -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct InterchainAccount { - #[prost(message, optional, tag="1")] - pub base_account: ::core::option::Option, - #[prost(string, tag="2")] - pub account_owner: ::prost::alloc::string::String, -} -/// InterchainAccountPacketData is comprised of a raw transaction, type of transaction and optional memo field. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct InterchainAccountPacketData { - #[prost(enumeration="Type", tag="1")] - pub r#type: i32, - #[prost(bytes="vec", tag="2")] - pub data: ::prost::alloc::vec::Vec, - #[prost(string, tag="3")] - pub memo: ::prost::alloc::string::String, -} -/// CosmosTx contains a list of sdk.Msg's. It should be used when sending transactions to an SDK host chain. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CosmosTx { - #[prost(message, repeated, tag="1")] - pub messages: ::prost::alloc::vec::Vec<::prost_types::Any>, -} -/// Type defines a classification of message issued from a controller chain to its associated interchain accounts -/// host -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum Type { - /// Default zero value enumeration - Unspecified = 0, - /// Execute a transaction on an interchain accounts host chain - ExecuteTx = 1, -} /// Metadata defines a set of protocol specific data encoded into the ICS27 channel version bytestring /// See ICS004: #[derive(Clone, PartialEq, ::prost::Message)] @@ -108,3 +74,37 @@ pub struct RegisteredInterchainAccount { #[prost(string, tag="3")] pub account_address: ::prost::alloc::string::String, } +/// InterchainAccountPacketData is comprised of a raw transaction, type of transaction and optional memo field. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct InterchainAccountPacketData { + #[prost(enumeration="Type", tag="1")] + pub r#type: i32, + #[prost(bytes="vec", tag="2")] + pub data: ::prost::alloc::vec::Vec, + #[prost(string, tag="3")] + pub memo: ::prost::alloc::string::String, +} +/// CosmosTx contains a list of sdk.Msg's. It should be used when sending transactions to an SDK host chain. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CosmosTx { + #[prost(message, repeated, tag="1")] + pub messages: ::prost::alloc::vec::Vec<::prost_types::Any>, +} +/// Type defines a classification of message issued from a controller chain to its associated interchain accounts +/// host +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum Type { + /// Default zero value enumeration + Unspecified = 0, + /// Execute a transaction on an interchain accounts host chain + ExecuteTx = 1, +} +/// An InterchainAccount is defined as a BaseAccount & the address of the account owner on the controller chain +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct InterchainAccount { + #[prost(message, optional, tag="1")] + pub base_account: ::core::option::Option, + #[prost(string, tag="2")] + pub account_owner: ::prost::alloc::string::String, +} diff --git a/cosmos-sdk-proto/src/prost/ibc.applications.transfer.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.transfer.v1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/ibc.applications.transfer.v1.rs rename to cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.transfer.v1.rs index e87e9a34..ddccbfd0 100644 --- a/cosmos-sdk-proto/src/prost/ibc.applications.transfer.v1.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.transfer.v1.rs @@ -1,125 +1,3 @@ -/// MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between -/// ICS20 enabled chains. See ICS Spec here: -/// -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgTransfer { - /// the port on which the packet will be sent - #[prost(string, tag="1")] - pub source_port: ::prost::alloc::string::String, - /// the channel by which the packet will be sent - #[prost(string, tag="2")] - pub source_channel: ::prost::alloc::string::String, - /// the tokens to be transferred - #[prost(message, optional, tag="3")] - pub token: ::core::option::Option, - /// the sender address - #[prost(string, tag="4")] - pub sender: ::prost::alloc::string::String, - /// the recipient address on the destination chain - #[prost(string, tag="5")] - pub receiver: ::prost::alloc::string::String, - /// Timeout height relative to the current block height. - /// The timeout is disabled when set to 0. - #[prost(message, optional, tag="6")] - pub timeout_height: ::core::option::Option, - /// Timeout timestamp in absolute nanoseconds since unix epoch. - /// The timeout is disabled when set to 0. - #[prost(uint64, tag="7")] - pub timeout_timestamp: u64, -} -/// MsgTransferResponse defines the Msg/Transfer response type. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgTransferResponse { -} -/// Generated client implementations. -#[cfg(feature = "grpc")] -#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] -pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Msg defines the ibc/transfer Msg service. - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, - } - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: std::convert::TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl MsgClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> MsgClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + Send + Sync, - { - MsgClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with `gzip`. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_gzip(mut self) -> Self { - self.inner = self.inner.send_gzip(); - self - } - /// Enable decompressing responses with `gzip`. - #[must_use] - pub fn accept_gzip(mut self) -> Self { - self.inner = self.inner.accept_gzip(); - self - } - /// Transfer defines a rpc handler method for MsgTransfer. - pub async fn transfer( - &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()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.applications.transfer.v1.Msg/Transfer", - ); - self.inner.unary(request.into_request(), path, codec).await - } - } -} /// DenomTrace contains the base denomination for ICS20 fungible tokens and the /// source tracing information path. #[derive(Clone, PartialEq, ::prost::Message)] @@ -358,6 +236,128 @@ pub mod query_client { } } } +/// MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between +/// ICS20 enabled chains. See ICS Spec here: +/// +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgTransfer { + /// the port on which the packet will be sent + #[prost(string, tag="1")] + pub source_port: ::prost::alloc::string::String, + /// the channel by which the packet will be sent + #[prost(string, tag="2")] + pub source_channel: ::prost::alloc::string::String, + /// the tokens to be transferred + #[prost(message, optional, tag="3")] + pub token: ::core::option::Option, + /// the sender address + #[prost(string, tag="4")] + pub sender: ::prost::alloc::string::String, + /// the recipient address on the destination chain + #[prost(string, tag="5")] + pub receiver: ::prost::alloc::string::String, + /// Timeout height relative to the current block height. + /// The timeout is disabled when set to 0. + #[prost(message, optional, tag="6")] + pub timeout_height: ::core::option::Option, + /// Timeout timestamp in absolute nanoseconds since unix epoch. + /// The timeout is disabled when set to 0. + #[prost(uint64, tag="7")] + pub timeout_timestamp: u64, +} +/// MsgTransferResponse defines the Msg/Transfer response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgTransferResponse { +} +/// Generated client implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod msg_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Msg defines the ibc/transfer Msg service. + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: std::convert::TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl MsgClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> MsgClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + MsgClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with `gzip`. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_gzip(mut self) -> Self { + self.inner = self.inner.send_gzip(); + self + } + /// Enable decompressing responses with `gzip`. + #[must_use] + pub fn accept_gzip(mut self) -> Self { + self.inner = self.inner.accept_gzip(); + self + } + /// Transfer defines a rpc handler method for MsgTransfer. + pub async fn transfer( + &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()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/ibc.applications.transfer.v1.Msg/Transfer", + ); + self.inner.unary(request.into_request(), path, codec).await + } + } +} /// GenesisState defines the ibc-transfer genesis state #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { diff --git a/cosmos-sdk-proto/src/prost/ibc.applications.transfer.v2.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.transfer.v2.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/ibc.applications.transfer.v2.rs rename to cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.transfer.v2.rs diff --git a/cosmos-sdk-proto/src/prost/ibc.core.channel.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.channel.v1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/ibc.core.channel.v1.rs rename to cosmos-sdk-proto/src/prost/ibc-go/ibc.core.channel.v1.rs index 572a5db5..7329f352 100644 --- a/cosmos-sdk-proto/src/prost/ibc.core.channel.v1.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.channel.v1.rs @@ -160,231 +160,366 @@ pub enum Order { /// packets are delivered exactly in the order which they were sent Ordered = 2, } -/// MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It -/// is called by a relayer on Chain A. +/// QueryChannelRequest is the request type for the Query/Channel RPC method #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelOpenInit { +pub struct QueryChannelRequest { + /// port unique identifier #[prost(string, tag="1")] pub port_id: ::prost::alloc::string::String, - #[prost(message, optional, tag="2")] + /// channel unique identifier + #[prost(string, tag="2")] + pub channel_id: ::prost::alloc::string::String, +} +/// QueryChannelResponse is the response type for the Query/Channel RPC method. +/// Besides the Channel end, it includes a proof and the height from which the +/// proof was retrieved. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryChannelResponse { + /// channel associated with the request identifiers + #[prost(message, optional, tag="1")] pub channel: ::core::option::Option, - #[prost(string, tag="3")] - pub signer: ::prost::alloc::string::String, + /// merkle proof of existence + #[prost(bytes="vec", tag="2")] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag="3")] + pub proof_height: ::core::option::Option, } -/// MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. +/// QueryChannelsRequest is the request type for the Query/Channels RPC method #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelOpenInitResponse { - #[prost(string, tag="1")] - pub channel_id: ::prost::alloc::string::String, +pub struct QueryChannelsRequest { + /// pagination request + #[prost(message, optional, tag="1")] + pub pagination: ::core::option::Option, } -/// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel -/// on Chain B. The version field within the Channel field has been deprecated. Its -/// value will be ignored by core IBC. +/// QueryChannelsResponse is the response type for the Query/Channels RPC method. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelOpenTry { - #[prost(string, tag="1")] - pub port_id: ::prost::alloc::string::String, - /// in the case of crossing hello's, when both chains call OpenInit, we need - /// the channel identifier of the previous channel in state INIT - #[prost(string, tag="2")] - pub previous_channel_id: ::prost::alloc::string::String, - /// NOTE: the version field within the channel has been deprecated. Its value will be ignored by core IBC. +pub struct QueryChannelsResponse { + /// list of stored channels of the chain. + #[prost(message, repeated, tag="1")] + pub channels: ::prost::alloc::vec::Vec, + /// pagination response + #[prost(message, optional, tag="2")] + pub pagination: ::core::option::Option, + /// query block height #[prost(message, optional, tag="3")] - pub channel: ::core::option::Option, - #[prost(string, tag="4")] - pub counterparty_version: ::prost::alloc::string::String, - #[prost(bytes="vec", tag="5")] - pub proof_init: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag="6")] - pub proof_height: ::core::option::Option, - #[prost(string, tag="7")] - pub signer: ::prost::alloc::string::String, + pub height: ::core::option::Option, } -/// MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. +/// QueryConnectionChannelsRequest is the request type for the +/// Query/QueryConnectionChannels RPC method #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelOpenTryResponse { +pub struct QueryConnectionChannelsRequest { + /// connection unique identifier + #[prost(string, tag="1")] + pub connection: ::prost::alloc::string::String, + /// pagination request + #[prost(message, optional, tag="2")] + pub pagination: ::core::option::Option, } -/// MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge -/// the change of channel state to TRYOPEN on Chain B. +/// QueryConnectionChannelsResponse is the Response type for the +/// Query/QueryConnectionChannels RPC method #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelOpenAck { +pub struct QueryConnectionChannelsResponse { + /// list of channels associated with a connection. + #[prost(message, repeated, tag="1")] + pub channels: ::prost::alloc::vec::Vec, + /// pagination response + #[prost(message, optional, tag="2")] + pub pagination: ::core::option::Option, + /// query block height + #[prost(message, optional, tag="3")] + pub height: ::core::option::Option, +} +/// QueryChannelClientStateRequest is the request type for the Query/ClientState +/// RPC method +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryChannelClientStateRequest { + /// port unique identifier #[prost(string, tag="1")] pub port_id: ::prost::alloc::string::String, + /// channel unique identifier #[prost(string, tag="2")] pub channel_id: ::prost::alloc::string::String, - #[prost(string, tag="3")] - pub counterparty_channel_id: ::prost::alloc::string::String, - #[prost(string, tag="4")] - pub counterparty_version: ::prost::alloc::string::String, - #[prost(bytes="vec", tag="5")] - pub proof_try: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag="6")] - pub proof_height: ::core::option::Option, - #[prost(string, tag="7")] - pub signer: ::prost::alloc::string::String, } -/// MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. +/// QueryChannelClientStateResponse is the Response type for the +/// Query/QueryChannelClientState RPC method #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelOpenAckResponse { +pub struct QueryChannelClientStateResponse { + /// client state associated with the channel + #[prost(message, optional, tag="1")] + pub identified_client_state: ::core::option::Option, + /// merkle proof of existence + #[prost(bytes="vec", tag="2")] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag="3")] + pub proof_height: ::core::option::Option, } -/// MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to -/// acknowledge the change of channel state to OPEN on Chain A. +/// QueryChannelConsensusStateRequest is the request type for the +/// Query/ConsensusState RPC method #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelOpenConfirm { +pub struct QueryChannelConsensusStateRequest { + /// port unique identifier #[prost(string, tag="1")] pub port_id: ::prost::alloc::string::String, + /// channel unique identifier #[prost(string, tag="2")] pub channel_id: ::prost::alloc::string::String, + /// revision number of the consensus state + #[prost(uint64, tag="3")] + pub revision_number: u64, + /// revision height of the consensus state + #[prost(uint64, tag="4")] + pub revision_height: u64, +} +/// QueryChannelClientStateResponse is the Response type for the +/// Query/QueryChannelClientState RPC method +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryChannelConsensusStateResponse { + /// consensus state associated with the channel + #[prost(message, optional, tag="1")] + pub consensus_state: ::core::option::Option<::prost_types::Any>, + /// client ID associated with the consensus state + #[prost(string, tag="2")] + pub client_id: ::prost::alloc::string::String, + /// merkle proof of existence #[prost(bytes="vec", tag="3")] - pub proof_ack: ::prost::alloc::vec::Vec, + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved #[prost(message, optional, tag="4")] pub proof_height: ::core::option::Option, - #[prost(string, tag="5")] - pub signer: ::prost::alloc::string::String, } -/// MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response -/// type. +/// QueryPacketCommitmentRequest is the request type for the +/// Query/PacketCommitment RPC method #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelOpenConfirmResponse { +pub struct QueryPacketCommitmentRequest { + /// port unique identifier + #[prost(string, tag="1")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag="2")] + pub channel_id: ::prost::alloc::string::String, + /// packet sequence + #[prost(uint64, tag="3")] + pub sequence: u64, } -/// MsgChannelCloseInit defines a msg sent by a Relayer to Chain A -/// to close a channel with Chain B. +/// QueryPacketCommitmentResponse defines the client query response for a packet +/// which also includes a proof and the height from which the proof was +/// retrieved #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelCloseInit { +pub struct QueryPacketCommitmentResponse { + /// packet associated with the request fields + #[prost(bytes="vec", tag="1")] + pub commitment: ::prost::alloc::vec::Vec, + /// merkle proof of existence + #[prost(bytes="vec", tag="2")] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag="3")] + pub proof_height: ::core::option::Option, +} +/// QueryPacketCommitmentsRequest is the request type for the +/// Query/QueryPacketCommitments RPC method +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryPacketCommitmentsRequest { + /// port unique identifier #[prost(string, tag="1")] pub port_id: ::prost::alloc::string::String, + /// channel unique identifier #[prost(string, tag="2")] pub channel_id: ::prost::alloc::string::String, - #[prost(string, tag="3")] - pub signer: ::prost::alloc::string::String, + /// pagination request + #[prost(message, optional, tag="3")] + pub pagination: ::core::option::Option, } -/// MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. +/// QueryPacketCommitmentsResponse is the request type for the +/// Query/QueryPacketCommitments RPC method #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelCloseInitResponse { +pub struct QueryPacketCommitmentsResponse { + #[prost(message, repeated, tag="1")] + pub commitments: ::prost::alloc::vec::Vec, + /// pagination response + #[prost(message, optional, tag="2")] + pub pagination: ::core::option::Option, + /// query block height + #[prost(message, optional, tag="3")] + pub height: ::core::option::Option, } -/// MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B -/// to acknowledge the change of channel state to CLOSED on Chain A. +/// QueryPacketReceiptRequest is the request type for the +/// Query/PacketReceipt RPC method #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelCloseConfirm { +pub struct QueryPacketReceiptRequest { + /// port unique identifier #[prost(string, tag="1")] pub port_id: ::prost::alloc::string::String, + /// channel unique identifier #[prost(string, tag="2")] pub channel_id: ::prost::alloc::string::String, + /// packet sequence + #[prost(uint64, tag="3")] + pub sequence: u64, +} +/// QueryPacketReceiptResponse defines the client query response for a packet +/// receipt which also includes a proof, and the height from which the proof was +/// retrieved +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryPacketReceiptResponse { + /// success flag for if receipt exists + #[prost(bool, tag="2")] + pub received: bool, + /// merkle proof of existence #[prost(bytes="vec", tag="3")] - pub proof_init: ::prost::alloc::vec::Vec, + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved #[prost(message, optional, tag="4")] pub proof_height: ::core::option::Option, - #[prost(string, tag="5")] - pub signer: ::prost::alloc::string::String, } -/// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response -/// type. +/// QueryPacketAcknowledgementRequest is the request type for the +/// Query/PacketAcknowledgement RPC method #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelCloseConfirmResponse { +pub struct QueryPacketAcknowledgementRequest { + /// port unique identifier + #[prost(string, tag="1")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag="2")] + pub channel_id: ::prost::alloc::string::String, + /// packet sequence + #[prost(uint64, tag="3")] + pub sequence: u64, } -/// MsgRecvPacket receives incoming IBC packet +/// QueryPacketAcknowledgementResponse defines the client query response for a +/// packet which also includes a proof and the height from which the +/// proof was retrieved #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgRecvPacket { - #[prost(message, optional, tag="1")] - pub packet: ::core::option::Option, +pub struct QueryPacketAcknowledgementResponse { + /// packet associated with the request fields + #[prost(bytes="vec", tag="1")] + pub acknowledgement: ::prost::alloc::vec::Vec, + /// merkle proof of existence #[prost(bytes="vec", tag="2")] - pub proof_commitment: ::prost::alloc::vec::Vec, + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved #[prost(message, optional, tag="3")] pub proof_height: ::core::option::Option, - #[prost(string, tag="4")] - pub signer: ::prost::alloc::string::String, } -/// MsgRecvPacketResponse defines the Msg/RecvPacket response type. +/// QueryPacketAcknowledgementsRequest is the request type for the +/// Query/QueryPacketCommitments RPC method #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgRecvPacketResponse { - #[prost(enumeration="ResponseResultType", tag="1")] - pub result: i32, +pub struct QueryPacketAcknowledgementsRequest { + /// port unique identifier + #[prost(string, tag="1")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag="2")] + pub channel_id: ::prost::alloc::string::String, + /// pagination request + #[prost(message, optional, tag="3")] + pub pagination: ::core::option::Option, + /// list of packet sequences + #[prost(uint64, repeated, tag="4")] + pub packet_commitment_sequences: ::prost::alloc::vec::Vec, } -/// MsgTimeout receives timed-out packet +/// QueryPacketAcknowledgemetsResponse is the request type for the +/// Query/QueryPacketAcknowledgements RPC method #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgTimeout { - #[prost(message, optional, tag="1")] - pub packet: ::core::option::Option, - #[prost(bytes="vec", tag="2")] - pub proof_unreceived: ::prost::alloc::vec::Vec, +pub struct QueryPacketAcknowledgementsResponse { + #[prost(message, repeated, tag="1")] + pub acknowledgements: ::prost::alloc::vec::Vec, + /// pagination response + #[prost(message, optional, tag="2")] + pub pagination: ::core::option::Option, + /// query block height #[prost(message, optional, tag="3")] - pub proof_height: ::core::option::Option, - #[prost(uint64, tag="4")] - pub next_sequence_recv: u64, - #[prost(string, tag="5")] - pub signer: ::prost::alloc::string::String, + pub height: ::core::option::Option, } -/// MsgTimeoutResponse defines the Msg/Timeout response type. +/// QueryUnreceivedPacketsRequest is the request type for the +/// Query/UnreceivedPackets RPC method #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgTimeoutResponse { - #[prost(enumeration="ResponseResultType", tag="1")] - pub result: i32, +pub struct QueryUnreceivedPacketsRequest { + /// port unique identifier + #[prost(string, tag="1")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag="2")] + pub channel_id: ::prost::alloc::string::String, + /// list of packet sequences + #[prost(uint64, repeated, tag="3")] + pub packet_commitment_sequences: ::prost::alloc::vec::Vec, } -/// MsgTimeoutOnClose timed-out packet upon counterparty channel closure. +/// QueryUnreceivedPacketsResponse is the response type for the +/// Query/UnreceivedPacketCommitments RPC method #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgTimeoutOnClose { - #[prost(message, optional, tag="1")] - pub packet: ::core::option::Option, - #[prost(bytes="vec", tag="2")] - pub proof_unreceived: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="3")] - pub proof_close: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag="4")] - pub proof_height: ::core::option::Option, - #[prost(uint64, tag="5")] - pub next_sequence_recv: u64, - #[prost(string, tag="6")] - pub signer: ::prost::alloc::string::String, +pub struct QueryUnreceivedPacketsResponse { + /// list of unreceived packet sequences + #[prost(uint64, repeated, tag="1")] + pub sequences: ::prost::alloc::vec::Vec, + /// query block height + #[prost(message, optional, tag="2")] + pub height: ::core::option::Option, } -/// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. +/// QueryUnreceivedAcks is the request type for the +/// Query/UnreceivedAcks RPC method #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgTimeoutOnCloseResponse { - #[prost(enumeration="ResponseResultType", tag="1")] - pub result: i32, +pub struct QueryUnreceivedAcksRequest { + /// port unique identifier + #[prost(string, tag="1")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag="2")] + pub channel_id: ::prost::alloc::string::String, + /// list of acknowledgement sequences + #[prost(uint64, repeated, tag="3")] + pub packet_ack_sequences: ::prost::alloc::vec::Vec, } -/// MsgAcknowledgement receives incoming IBC acknowledgement +/// QueryUnreceivedAcksResponse is the response type for the +/// Query/UnreceivedAcks RPC method #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgAcknowledgement { - #[prost(message, optional, tag="1")] - pub packet: ::core::option::Option, - #[prost(bytes="vec", tag="2")] - pub acknowledgement: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="3")] - pub proof_acked: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag="4")] - pub proof_height: ::core::option::Option, - #[prost(string, tag="5")] - pub signer: ::prost::alloc::string::String, +pub struct QueryUnreceivedAcksResponse { + /// list of unreceived acknowledgement sequences + #[prost(uint64, repeated, tag="1")] + pub sequences: ::prost::alloc::vec::Vec, + /// query block height + #[prost(message, optional, tag="2")] + pub height: ::core::option::Option, } -/// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. +/// QueryNextSequenceReceiveRequest is the request type for the +/// Query/QueryNextSequenceReceiveRequest RPC method #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgAcknowledgementResponse { - #[prost(enumeration="ResponseResultType", tag="1")] - pub result: i32, +pub struct QueryNextSequenceReceiveRequest { + /// port unique identifier + #[prost(string, tag="1")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag="2")] + pub channel_id: ::prost::alloc::string::String, } -/// ResponseResultType defines the possible outcomes of the execution of a message -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum ResponseResultType { - /// Default zero value enumeration - ResponseResultUnspecified = 0, - /// The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) - ResponseResultNoop = 1, - /// The message was executed successfully - ResponseResultSuccess = 2, +/// QuerySequenceResponse is the request type for the +/// Query/QueryNextSequenceReceiveResponse RPC method +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryNextSequenceReceiveResponse { + /// next sequence receive number + #[prost(uint64, tag="1")] + pub next_sequence_receive: u64, + /// merkle proof of existence + #[prost(bytes="vec", tag="2")] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag="3")] + pub proof_height: ::core::option::Option, } /// Generated client implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] -pub mod msg_client { +pub mod query_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - /// Msg defines the ibc/channel Msg service. + /// Query provides defines the gRPC querier service #[derive(Debug, Clone)] - pub struct MsgClient { + pub struct QueryClient { inner: tonic::client::Grpc, } - impl MsgClient { + impl QueryClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -395,7 +530,7 @@ pub mod msg_client { Ok(Self::new(conn)) } } - impl MsgClient + impl QueryClient where T: tonic::client::GrpcService, T::Error: Into, @@ -409,7 +544,7 @@ pub mod msg_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> MsgClient> + ) -> QueryClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -423,7 +558,7 @@ pub mod msg_client { http::Request, >>::Error: Into + Send + Sync, { - MsgClient::new(InterceptedService::new(inner, interceptor)) + QueryClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with `gzip`. /// @@ -440,11 +575,11 @@ pub mod msg_client { self.inner = self.inner.accept_gzip(); self } - /// ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. - pub async fn channel_open_init( + /// Channel queries an IBC Channel. + pub async fn channel( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { self.inner .ready() .await @@ -456,15 +591,15 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Msg/ChannelOpenInit", + "/ibc.core.channel.v1.Query/Channel", ); self.inner.unary(request.into_request(), path, codec).await } - /// ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. - pub async fn channel_open_try( + /// Channels queries all the IBC channels of a chain. + pub async fn channels( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { self.inner .ready() .await @@ -476,15 +611,19 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Msg/ChannelOpenTry", + "/ibc.core.channel.v1.Query/Channels", ); self.inner.unary(request.into_request(), path, codec).await } - /// ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. - pub async fn channel_open_ack( + /// ConnectionChannels queries all the channels associated with a connection + /// end. + pub async fn connection_channels( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + request: impl tonic::IntoRequest, + ) -> Result< + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -496,16 +635,17 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Msg/ChannelOpenAck", + "/ibc.core.channel.v1.Query/ConnectionChannels", ); self.inner.unary(request.into_request(), path, codec).await } - /// ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. - pub async fn channel_open_confirm( + /// ChannelClientState queries for the client state for the channel associated + /// with the provided channel identifiers. + pub async fn channel_client_state( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -519,15 +659,19 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Msg/ChannelOpenConfirm", + "/ibc.core.channel.v1.Query/ChannelClientState", ); self.inner.unary(request.into_request(), path, codec).await } - /// ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. - pub async fn channel_close_init( + /// ChannelConsensusState queries for the consensus state for the channel + /// associated with the provided channel identifiers. + pub async fn channel_consensus_state( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + request: impl tonic::IntoRequest, + ) -> Result< + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -539,17 +683,16 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Msg/ChannelCloseInit", + "/ibc.core.channel.v1.Query/ChannelConsensusState", ); self.inner.unary(request.into_request(), path, codec).await } - /// ChannelCloseConfirm defines a rpc handler method for - /// MsgChannelCloseConfirm. - pub async fn channel_close_confirm( + /// PacketCommitment queries a stored packet commitment hash. + pub async fn packet_commitment( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -563,17 +706,21 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Msg/ChannelCloseConfirm", + "/ibc.core.channel.v1.Query/PacketCommitment", ); self.inner.unary(request.into_request(), path, codec).await } - /// RecvPacket defines a rpc handler method for MsgRecvPacket. - pub async fn recv_packet( + /// PacketCommitments returns all the packet commitments hashes associated + /// with a channel. + pub async fn packet_commitments( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { - self.inner - .ready() + request: impl tonic::IntoRequest, + ) -> Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() .await .map_err(|e| { tonic::Status::new( @@ -583,15 +730,16 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Msg/RecvPacket", + "/ibc.core.channel.v1.Query/PacketCommitments", ); self.inner.unary(request.into_request(), path, codec).await } - /// Timeout defines a rpc handler method for MsgTimeout. - pub async fn timeout( + /// PacketReceipt queries if a given packet sequence has been received on the + /// queried chain + pub async fn packet_receipt( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { self.inner .ready() .await @@ -603,15 +751,18 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Msg/Timeout", + "/ibc.core.channel.v1.Query/PacketReceipt", ); self.inner.unary(request.into_request(), path, codec).await } - /// TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. - pub async fn timeout_on_close( + /// PacketAcknowledgement queries a stored packet acknowledgement hash. + pub async fn packet_acknowledgement( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + request: impl tonic::IntoRequest, + ) -> Result< + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -623,15 +774,19 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Msg/TimeoutOnClose", + "/ibc.core.channel.v1.Query/PacketAcknowledgement", ); self.inner.unary(request.into_request(), path, codec).await } - /// Acknowledgement defines a rpc handler method for MsgAcknowledgement. - pub async fn acknowledgement( + /// PacketAcknowledgements returns all the packet acknowledgements associated + /// with a channel. + pub async fn packet_acknowledgements( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + request: impl tonic::IntoRequest, + ) -> Result< + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -643,372 +798,305 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Msg/Acknowledgement", + "/ibc.core.channel.v1.Query/PacketAcknowledgements", + ); + self.inner.unary(request.into_request(), path, codec).await + } + /// UnreceivedPackets returns all the unreceived IBC packets associated with a + /// channel and sequences. + pub async fn unreceived_packets( + &mut self, + request: impl tonic::IntoRequest, + ) -> 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( + "/ibc.core.channel.v1.Query/UnreceivedPackets", + ); + self.inner.unary(request.into_request(), path, codec).await + } + /// UnreceivedAcks returns all the unreceived IBC acknowledgements associated + /// with a channel and sequences. + pub async fn unreceived_acks( + &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()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/ibc.core.channel.v1.Query/UnreceivedAcks", + ); + self.inner.unary(request.into_request(), path, codec).await + } + /// NextSequenceReceive returns the next receive sequence for a given channel. + pub async fn next_sequence_receive( + &mut self, + request: impl tonic::IntoRequest, + ) -> 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( + "/ibc.core.channel.v1.Query/NextSequenceReceive", ); self.inner.unary(request.into_request(), path, codec).await } } } -/// QueryChannelRequest is the request type for the Query/Channel RPC method +/// MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It +/// is called by a relayer on Chain A. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryChannelRequest { - /// port unique identifier +pub struct MsgChannelOpenInit { #[prost(string, tag="1")] pub port_id: ::prost::alloc::string::String, - /// channel unique identifier - #[prost(string, tag="2")] - pub channel_id: ::prost::alloc::string::String, -} -/// QueryChannelResponse is the response type for the Query/Channel RPC method. -/// Besides the Channel end, it includes a proof and the height from which the -/// proof was retrieved. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryChannelResponse { - /// channel associated with the request identifiers - #[prost(message, optional, tag="1")] - pub channel: ::core::option::Option, - /// merkle proof of existence - #[prost(bytes="vec", tag="2")] - pub proof: ::prost::alloc::vec::Vec, - /// height at which the proof was retrieved - #[prost(message, optional, tag="3")] - pub proof_height: ::core::option::Option, -} -/// QueryChannelsRequest is the request type for the Query/Channels RPC method -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryChannelsRequest { - /// pagination request - #[prost(message, optional, tag="1")] - pub pagination: ::core::option::Option, -} -/// QueryChannelsResponse is the response type for the Query/Channels RPC method. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryChannelsResponse { - /// list of stored channels of the chain. - #[prost(message, repeated, tag="1")] - pub channels: ::prost::alloc::vec::Vec, - /// pagination response #[prost(message, optional, tag="2")] - pub pagination: ::core::option::Option, - /// query block height - #[prost(message, optional, tag="3")] - pub height: ::core::option::Option, + pub channel: ::core::option::Option, + #[prost(string, tag="3")] + pub signer: ::prost::alloc::string::String, } -/// QueryConnectionChannelsRequest is the request type for the -/// Query/QueryConnectionChannels RPC method +/// MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConnectionChannelsRequest { - /// connection unique identifier +pub struct MsgChannelOpenInitResponse { #[prost(string, tag="1")] - pub connection: ::prost::alloc::string::String, - /// pagination request - #[prost(message, optional, tag="2")] - pub pagination: ::core::option::Option, -} -/// QueryConnectionChannelsResponse is the Response type for the -/// Query/QueryConnectionChannels RPC method -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConnectionChannelsResponse { - /// list of channels associated with a connection. - #[prost(message, repeated, tag="1")] - pub channels: ::prost::alloc::vec::Vec, - /// pagination response - #[prost(message, optional, tag="2")] - pub pagination: ::core::option::Option, - /// query block height - #[prost(message, optional, tag="3")] - pub height: ::core::option::Option, + pub channel_id: ::prost::alloc::string::String, } -/// QueryChannelClientStateRequest is the request type for the Query/ClientState -/// RPC method +/// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel +/// on Chain B. The version field within the Channel field has been deprecated. Its +/// value will be ignored by core IBC. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryChannelClientStateRequest { - /// port unique identifier +pub struct MsgChannelOpenTry { #[prost(string, tag="1")] pub port_id: ::prost::alloc::string::String, - /// channel unique identifier + /// in the case of crossing hello's, when both chains call OpenInit, we need + /// the channel identifier of the previous channel in state INIT #[prost(string, tag="2")] - pub channel_id: ::prost::alloc::string::String, -} -/// QueryChannelClientStateResponse is the Response type for the -/// Query/QueryChannelClientState RPC method -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryChannelClientStateResponse { - /// client state associated with the channel - #[prost(message, optional, tag="1")] - pub identified_client_state: ::core::option::Option, - /// merkle proof of existence - #[prost(bytes="vec", tag="2")] - pub proof: ::prost::alloc::vec::Vec, - /// height at which the proof was retrieved + pub previous_channel_id: ::prost::alloc::string::String, + /// NOTE: the version field within the channel has been deprecated. Its value will be ignored by core IBC. #[prost(message, optional, tag="3")] + pub channel: ::core::option::Option, + #[prost(string, tag="4")] + pub counterparty_version: ::prost::alloc::string::String, + #[prost(bytes="vec", tag="5")] + pub proof_init: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag="6")] pub proof_height: ::core::option::Option, + #[prost(string, tag="7")] + pub signer: ::prost::alloc::string::String, } -/// QueryChannelConsensusStateRequest is the request type for the -/// Query/ConsensusState RPC method +/// MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryChannelConsensusStateRequest { - /// port unique identifier +pub struct MsgChannelOpenTryResponse { +} +/// MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge +/// the change of channel state to TRYOPEN on Chain B. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgChannelOpenAck { #[prost(string, tag="1")] pub port_id: ::prost::alloc::string::String, - /// channel unique identifier #[prost(string, tag="2")] pub channel_id: ::prost::alloc::string::String, - /// revision number of the consensus state - #[prost(uint64, tag="3")] - pub revision_number: u64, - /// revision height of the consensus state - #[prost(uint64, tag="4")] - pub revision_height: u64, + #[prost(string, tag="3")] + pub counterparty_channel_id: ::prost::alloc::string::String, + #[prost(string, tag="4")] + pub counterparty_version: ::prost::alloc::string::String, + #[prost(bytes="vec", tag="5")] + pub proof_try: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag="6")] + pub proof_height: ::core::option::Option, + #[prost(string, tag="7")] + pub signer: ::prost::alloc::string::String, } -/// QueryChannelClientStateResponse is the Response type for the -/// Query/QueryChannelClientState RPC method +/// MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryChannelConsensusStateResponse { - /// consensus state associated with the channel - #[prost(message, optional, tag="1")] - pub consensus_state: ::core::option::Option<::prost_types::Any>, - /// client ID associated with the consensus state - #[prost(string, tag="2")] - pub client_id: ::prost::alloc::string::String, - /// merkle proof of existence - #[prost(bytes="vec", tag="3")] - pub proof: ::prost::alloc::vec::Vec, - /// height at which the proof was retrieved - #[prost(message, optional, tag="4")] - pub proof_height: ::core::option::Option, +pub struct MsgChannelOpenAckResponse { } -/// QueryPacketCommitmentRequest is the request type for the -/// Query/PacketCommitment RPC method +/// MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to +/// acknowledge the change of channel state to OPEN on Chain A. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketCommitmentRequest { - /// port unique identifier +pub struct MsgChannelOpenConfirm { #[prost(string, tag="1")] pub port_id: ::prost::alloc::string::String, - /// channel unique identifier #[prost(string, tag="2")] pub channel_id: ::prost::alloc::string::String, - /// packet sequence - #[prost(uint64, tag="3")] - pub sequence: u64, + #[prost(bytes="vec", tag="3")] + pub proof_ack: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag="4")] + pub proof_height: ::core::option::Option, + #[prost(string, tag="5")] + pub signer: ::prost::alloc::string::String, } -/// QueryPacketCommitmentResponse defines the client query response for a packet -/// which also includes a proof and the height from which the proof was -/// retrieved +/// MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response +/// type. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketCommitmentResponse { - /// packet associated with the request fields - #[prost(bytes="vec", tag="1")] - pub commitment: ::prost::alloc::vec::Vec, - /// merkle proof of existence - #[prost(bytes="vec", tag="2")] - pub proof: ::prost::alloc::vec::Vec, - /// height at which the proof was retrieved - #[prost(message, optional, tag="3")] - pub proof_height: ::core::option::Option, +pub struct MsgChannelOpenConfirmResponse { } -/// QueryPacketCommitmentsRequest is the request type for the -/// Query/QueryPacketCommitments RPC method +/// MsgChannelCloseInit defines a msg sent by a Relayer to Chain A +/// to close a channel with Chain B. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketCommitmentsRequest { - /// port unique identifier +pub struct MsgChannelCloseInit { #[prost(string, tag="1")] pub port_id: ::prost::alloc::string::String, - /// channel unique identifier #[prost(string, tag="2")] pub channel_id: ::prost::alloc::string::String, - /// pagination request - #[prost(message, optional, tag="3")] - pub pagination: ::core::option::Option, + #[prost(string, tag="3")] + pub signer: ::prost::alloc::string::String, } -/// QueryPacketCommitmentsResponse is the request type for the -/// Query/QueryPacketCommitments RPC method +/// MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketCommitmentsResponse { - #[prost(message, repeated, tag="1")] - pub commitments: ::prost::alloc::vec::Vec, - /// pagination response - #[prost(message, optional, tag="2")] - pub pagination: ::core::option::Option, - /// query block height - #[prost(message, optional, tag="3")] - pub height: ::core::option::Option, +pub struct MsgChannelCloseInitResponse { } -/// QueryPacketReceiptRequest is the request type for the -/// Query/PacketReceipt RPC method +/// MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B +/// to acknowledge the change of channel state to CLOSED on Chain A. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketReceiptRequest { - /// port unique identifier +pub struct MsgChannelCloseConfirm { #[prost(string, tag="1")] pub port_id: ::prost::alloc::string::String, - /// channel unique identifier #[prost(string, tag="2")] pub channel_id: ::prost::alloc::string::String, - /// packet sequence - #[prost(uint64, tag="3")] - pub sequence: u64, -} -/// QueryPacketReceiptResponse defines the client query response for a packet -/// receipt which also includes a proof, and the height from which the proof was -/// retrieved -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketReceiptResponse { - /// success flag for if receipt exists - #[prost(bool, tag="2")] - pub received: bool, - /// merkle proof of existence #[prost(bytes="vec", tag="3")] - pub proof: ::prost::alloc::vec::Vec, - /// height at which the proof was retrieved + pub proof_init: ::prost::alloc::vec::Vec, #[prost(message, optional, tag="4")] pub proof_height: ::core::option::Option, + #[prost(string, tag="5")] + pub signer: ::prost::alloc::string::String, } -/// QueryPacketAcknowledgementRequest is the request type for the -/// Query/PacketAcknowledgement RPC method +/// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response +/// type. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketAcknowledgementRequest { - /// port unique identifier - #[prost(string, tag="1")] - pub port_id: ::prost::alloc::string::String, - /// channel unique identifier - #[prost(string, tag="2")] - pub channel_id: ::prost::alloc::string::String, - /// packet sequence - #[prost(uint64, tag="3")] - pub sequence: u64, +pub struct MsgChannelCloseConfirmResponse { } -/// QueryPacketAcknowledgementResponse defines the client query response for a -/// packet which also includes a proof and the height from which the -/// proof was retrieved +/// MsgRecvPacket receives incoming IBC packet #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketAcknowledgementResponse { - /// packet associated with the request fields - #[prost(bytes="vec", tag="1")] - pub acknowledgement: ::prost::alloc::vec::Vec, - /// merkle proof of existence +pub struct MsgRecvPacket { + #[prost(message, optional, tag="1")] + pub packet: ::core::option::Option, #[prost(bytes="vec", tag="2")] - pub proof: ::prost::alloc::vec::Vec, - /// height at which the proof was retrieved + pub proof_commitment: ::prost::alloc::vec::Vec, #[prost(message, optional, tag="3")] pub proof_height: ::core::option::Option, + #[prost(string, tag="4")] + pub signer: ::prost::alloc::string::String, } -/// QueryPacketAcknowledgementsRequest is the request type for the -/// Query/QueryPacketCommitments RPC method +/// MsgRecvPacketResponse defines the Msg/RecvPacket response type. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketAcknowledgementsRequest { - /// port unique identifier - #[prost(string, tag="1")] - pub port_id: ::prost::alloc::string::String, - /// channel unique identifier - #[prost(string, tag="2")] - pub channel_id: ::prost::alloc::string::String, - /// pagination request - #[prost(message, optional, tag="3")] - pub pagination: ::core::option::Option, - /// list of packet sequences - #[prost(uint64, repeated, tag="4")] - pub packet_commitment_sequences: ::prost::alloc::vec::Vec, +pub struct MsgRecvPacketResponse { + #[prost(enumeration="ResponseResultType", tag="1")] + pub result: i32, } -/// QueryPacketAcknowledgemetsResponse is the request type for the -/// Query/QueryPacketAcknowledgements RPC method +/// MsgTimeout receives timed-out packet #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketAcknowledgementsResponse { - #[prost(message, repeated, tag="1")] - pub acknowledgements: ::prost::alloc::vec::Vec, - /// pagination response - #[prost(message, optional, tag="2")] - pub pagination: ::core::option::Option, - /// query block height +pub struct MsgTimeout { + #[prost(message, optional, tag="1")] + pub packet: ::core::option::Option, + #[prost(bytes="vec", tag="2")] + pub proof_unreceived: ::prost::alloc::vec::Vec, #[prost(message, optional, tag="3")] - pub height: ::core::option::Option, -} -/// QueryUnreceivedPacketsRequest is the request type for the -/// Query/UnreceivedPackets RPC method -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUnreceivedPacketsRequest { - /// port unique identifier - #[prost(string, tag="1")] - pub port_id: ::prost::alloc::string::String, - /// channel unique identifier - #[prost(string, tag="2")] - pub channel_id: ::prost::alloc::string::String, - /// list of packet sequences - #[prost(uint64, repeated, tag="3")] - pub packet_commitment_sequences: ::prost::alloc::vec::Vec, -} -/// QueryUnreceivedPacketsResponse is the response type for the -/// Query/UnreceivedPacketCommitments RPC method -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUnreceivedPacketsResponse { - /// list of unreceived packet sequences - #[prost(uint64, repeated, tag="1")] - pub sequences: ::prost::alloc::vec::Vec, - /// query block height - #[prost(message, optional, tag="2")] - pub height: ::core::option::Option, + pub proof_height: ::core::option::Option, + #[prost(uint64, tag="4")] + pub next_sequence_recv: u64, + #[prost(string, tag="5")] + pub signer: ::prost::alloc::string::String, } -/// QueryUnreceivedAcks is the request type for the -/// Query/UnreceivedAcks RPC method +/// MsgTimeoutResponse defines the Msg/Timeout response type. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUnreceivedAcksRequest { - /// port unique identifier - #[prost(string, tag="1")] - pub port_id: ::prost::alloc::string::String, - /// channel unique identifier - #[prost(string, tag="2")] - pub channel_id: ::prost::alloc::string::String, - /// list of acknowledgement sequences - #[prost(uint64, repeated, tag="3")] - pub packet_ack_sequences: ::prost::alloc::vec::Vec, +pub struct MsgTimeoutResponse { + #[prost(enumeration="ResponseResultType", tag="1")] + pub result: i32, } -/// QueryUnreceivedAcksResponse is the response type for the -/// Query/UnreceivedAcks RPC method +/// MsgTimeoutOnClose timed-out packet upon counterparty channel closure. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUnreceivedAcksResponse { - /// list of unreceived acknowledgement sequences - #[prost(uint64, repeated, tag="1")] - pub sequences: ::prost::alloc::vec::Vec, - /// query block height - #[prost(message, optional, tag="2")] - pub height: ::core::option::Option, +pub struct MsgTimeoutOnClose { + #[prost(message, optional, tag="1")] + pub packet: ::core::option::Option, + #[prost(bytes="vec", tag="2")] + pub proof_unreceived: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="3")] + pub proof_close: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag="4")] + pub proof_height: ::core::option::Option, + #[prost(uint64, tag="5")] + pub next_sequence_recv: u64, + #[prost(string, tag="6")] + pub signer: ::prost::alloc::string::String, } -/// QueryNextSequenceReceiveRequest is the request type for the -/// Query/QueryNextSequenceReceiveRequest RPC method +/// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryNextSequenceReceiveRequest { - /// port unique identifier - #[prost(string, tag="1")] - pub port_id: ::prost::alloc::string::String, - /// channel unique identifier - #[prost(string, tag="2")] - pub channel_id: ::prost::alloc::string::String, +pub struct MsgTimeoutOnCloseResponse { + #[prost(enumeration="ResponseResultType", tag="1")] + pub result: i32, } -/// QuerySequenceResponse is the request type for the -/// Query/QueryNextSequenceReceiveResponse RPC method +/// MsgAcknowledgement receives incoming IBC acknowledgement #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryNextSequenceReceiveResponse { - /// next sequence receive number - #[prost(uint64, tag="1")] - pub next_sequence_receive: u64, - /// merkle proof of existence +pub struct MsgAcknowledgement { + #[prost(message, optional, tag="1")] + pub packet: ::core::option::Option, #[prost(bytes="vec", tag="2")] - pub proof: ::prost::alloc::vec::Vec, - /// height at which the proof was retrieved - #[prost(message, optional, tag="3")] + pub acknowledgement: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="3")] + pub proof_acked: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag="4")] pub proof_height: ::core::option::Option, + #[prost(string, tag="5")] + pub signer: ::prost::alloc::string::String, +} +/// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgAcknowledgementResponse { + #[prost(enumeration="ResponseResultType", tag="1")] + pub result: i32, +} +/// ResponseResultType defines the possible outcomes of the execution of a message +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ResponseResultType { + /// Default zero value enumeration + ResponseResultUnspecified = 0, + /// The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) + ResponseResultNoop = 1, + /// The message was executed successfully + ResponseResultSuccess = 2, } /// Generated client implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] -pub mod query_client { +pub mod msg_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - /// Query provides defines the gRPC querier service + /// Msg defines the ibc/channel Msg service. #[derive(Debug, Clone)] - pub struct QueryClient { + pub struct MsgClient { inner: tonic::client::Grpc, } - impl QueryClient { + impl MsgClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -1019,7 +1107,7 @@ pub mod query_client { Ok(Self::new(conn)) } } - impl QueryClient + impl MsgClient where T: tonic::client::GrpcService, T::Error: Into, @@ -1033,7 +1121,7 @@ pub mod query_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> QueryClient> + ) -> MsgClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -1047,7 +1135,7 @@ pub mod query_client { http::Request, >>::Error: Into + Send + Sync, { - QueryClient::new(InterceptedService::new(inner, interceptor)) + MsgClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with `gzip`. /// @@ -1064,79 +1152,11 @@ pub mod query_client { self.inner = self.inner.accept_gzip(); self } - /// Channel queries an IBC Channel. - pub async fn channel( - &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()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/Channel", - ); - self.inner.unary(request.into_request(), path, codec).await - } - /// Channels queries all the IBC channels of a chain. - pub async fn channels( - &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()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/Channels", - ); - self.inner.unary(request.into_request(), path, codec).await - } - /// ConnectionChannels queries all the channels associated with a connection - /// end. - pub async fn connection_channels( - &mut self, - request: impl tonic::IntoRequest, - ) -> 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( - "/ibc.core.channel.v1.Query/ConnectionChannels", - ); - self.inner.unary(request.into_request(), path, codec).await - } - /// ChannelClientState queries for the client state for the channel associated - /// with the provided channel identifiers. - pub async fn channel_client_state( + /// ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. + pub async fn channel_open_init( &mut self, - request: impl tonic::IntoRequest, - ) -> Result< - tonic::Response, - tonic::Status, - > { + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { self.inner .ready() .await @@ -1148,19 +1168,15 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/ChannelClientState", + "/ibc.core.channel.v1.Msg/ChannelOpenInit", ); self.inner.unary(request.into_request(), path, codec).await } - /// ChannelConsensusState queries for the consensus state for the channel - /// associated with the provided channel identifiers. - pub async fn channel_consensus_state( + /// ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. + pub async fn channel_open_try( &mut self, - request: impl tonic::IntoRequest, - ) -> Result< - tonic::Response, - tonic::Status, - > { + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { self.inner .ready() .await @@ -1172,18 +1188,15 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/ChannelConsensusState", + "/ibc.core.channel.v1.Msg/ChannelOpenTry", ); self.inner.unary(request.into_request(), path, codec).await } - /// PacketCommitment queries a stored packet commitment hash. - pub async fn packet_commitment( + /// ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. + pub async fn channel_open_ack( &mut self, - request: impl tonic::IntoRequest, - ) -> Result< - tonic::Response, - tonic::Status, - > { + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { self.inner .ready() .await @@ -1195,17 +1208,16 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/PacketCommitment", + "/ibc.core.channel.v1.Msg/ChannelOpenAck", ); self.inner.unary(request.into_request(), path, codec).await } - /// PacketCommitments returns all the packet commitments hashes associated - /// with a channel. - pub async fn packet_commitments( + /// ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. + pub async fn channel_open_confirm( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1219,16 +1231,15 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/PacketCommitments", + "/ibc.core.channel.v1.Msg/ChannelOpenConfirm", ); self.inner.unary(request.into_request(), path, codec).await } - /// PacketReceipt queries if a given packet sequence has been received on the - /// queried chain - pub async fn packet_receipt( + /// ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. + pub async fn channel_close_init( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { self.inner .ready() .await @@ -1240,16 +1251,17 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/PacketReceipt", + "/ibc.core.channel.v1.Msg/ChannelCloseInit", ); self.inner.unary(request.into_request(), path, codec).await } - /// PacketAcknowledgement queries a stored packet acknowledgement hash. - pub async fn packet_acknowledgement( + /// ChannelCloseConfirm defines a rpc handler method for + /// MsgChannelCloseConfirm. + pub async fn channel_close_confirm( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1263,19 +1275,15 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/PacketAcknowledgement", + "/ibc.core.channel.v1.Msg/ChannelCloseConfirm", ); self.inner.unary(request.into_request(), path, codec).await } - /// PacketAcknowledgements returns all the packet acknowledgements associated - /// with a channel. - pub async fn packet_acknowledgements( + /// RecvPacket defines a rpc handler method for MsgRecvPacket. + pub async fn recv_packet( &mut self, - request: impl tonic::IntoRequest, - ) -> Result< - tonic::Response, - tonic::Status, - > { + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { self.inner .ready() .await @@ -1287,19 +1295,15 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/PacketAcknowledgements", + "/ibc.core.channel.v1.Msg/RecvPacket", ); self.inner.unary(request.into_request(), path, codec).await } - /// UnreceivedPackets returns all the unreceived IBC packets associated with a - /// channel and sequences. - pub async fn unreceived_packets( + /// Timeout defines a rpc handler method for MsgTimeout. + pub async fn timeout( &mut self, - request: impl tonic::IntoRequest, - ) -> Result< - tonic::Response, - tonic::Status, - > { + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { self.inner .ready() .await @@ -1311,16 +1315,15 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/UnreceivedPackets", + "/ibc.core.channel.v1.Msg/Timeout", ); self.inner.unary(request.into_request(), path, codec).await } - /// UnreceivedAcks returns all the unreceived IBC acknowledgements associated - /// with a channel and sequences. - pub async fn unreceived_acks( + /// TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. + pub async fn timeout_on_close( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { self.inner .ready() .await @@ -1332,18 +1335,15 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/UnreceivedAcks", + "/ibc.core.channel.v1.Msg/TimeoutOnClose", ); self.inner.unary(request.into_request(), path, codec).await } - /// NextSequenceReceive returns the next receive sequence for a given channel. - pub async fn next_sequence_receive( + /// Acknowledgement defines a rpc handler method for MsgAcknowledgement. + pub async fn acknowledgement( &mut self, - request: impl tonic::IntoRequest, - ) -> Result< - tonic::Response, - tonic::Status, - > { + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { self.inner .ready() .await @@ -1355,7 +1355,7 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/NextSequenceReceive", + "/ibc.core.channel.v1.Msg/Acknowledgement", ); self.inner.unary(request.into_request(), path, codec).await } diff --git a/cosmos-sdk-proto/src/prost/ibc.core.client.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.client.v1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/ibc.core.client.v1.rs rename to cosmos-sdk-proto/src/prost/ibc-go/ibc.core.client.v1.rs index 01796aaa..994c750b 100644 --- a/cosmos-sdk-proto/src/prost/ibc.core.client.v1.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.client.v1.rs @@ -96,241 +96,6 @@ pub struct Params { #[prost(string, repeated, tag="1")] pub allowed_clients: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } -/// MsgCreateClient defines a message to create an IBC client -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgCreateClient { - /// light client state - #[prost(message, optional, tag="1")] - pub client_state: ::core::option::Option<::prost_types::Any>, - /// consensus state associated with the client that corresponds to a given - /// height. - #[prost(message, optional, tag="2")] - pub consensus_state: ::core::option::Option<::prost_types::Any>, - /// signer address - #[prost(string, tag="3")] - pub signer: ::prost::alloc::string::String, -} -/// MsgCreateClientResponse defines the Msg/CreateClient response type. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgCreateClientResponse { -} -/// MsgUpdateClient defines an sdk.Msg to update a IBC client state using -/// the given header. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUpdateClient { - /// client unique identifier - #[prost(string, tag="1")] - pub client_id: ::prost::alloc::string::String, - /// header to update the light client - #[prost(message, optional, tag="2")] - pub header: ::core::option::Option<::prost_types::Any>, - /// signer address - #[prost(string, tag="3")] - pub signer: ::prost::alloc::string::String, -} -/// MsgUpdateClientResponse defines the Msg/UpdateClient response type. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUpdateClientResponse { -} -/// MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client -/// state -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUpgradeClient { - /// client unique identifier - #[prost(string, tag="1")] - pub client_id: ::prost::alloc::string::String, - /// upgraded client state - #[prost(message, optional, tag="2")] - pub client_state: ::core::option::Option<::prost_types::Any>, - /// upgraded consensus state, only contains enough information to serve as a - /// basis of trust in update logic - #[prost(message, optional, tag="3")] - pub consensus_state: ::core::option::Option<::prost_types::Any>, - /// proof that old chain committed to new client - #[prost(bytes="vec", tag="4")] - pub proof_upgrade_client: ::prost::alloc::vec::Vec, - /// proof that old chain committed to new consensus state - #[prost(bytes="vec", tag="5")] - pub proof_upgrade_consensus_state: ::prost::alloc::vec::Vec, - /// signer address - #[prost(string, tag="6")] - pub signer: ::prost::alloc::string::String, -} -/// MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUpgradeClientResponse { -} -/// MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for -/// light client misbehaviour. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSubmitMisbehaviour { - /// client unique identifier - #[prost(string, tag="1")] - pub client_id: ::prost::alloc::string::String, - /// misbehaviour used for freezing the light client - #[prost(message, optional, tag="2")] - pub misbehaviour: ::core::option::Option<::prost_types::Any>, - /// signer address - #[prost(string, tag="3")] - pub signer: ::prost::alloc::string::String, -} -/// MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response -/// type. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSubmitMisbehaviourResponse { -} -/// Generated client implementations. -#[cfg(feature = "grpc")] -#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] -pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Msg defines the ibc/client Msg service. - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, - } - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: std::convert::TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl MsgClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> MsgClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + Send + Sync, - { - MsgClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with `gzip`. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_gzip(mut self) -> Self { - self.inner = self.inner.send_gzip(); - self - } - /// Enable decompressing responses with `gzip`. - #[must_use] - pub fn accept_gzip(mut self) -> Self { - self.inner = self.inner.accept_gzip(); - self - } - /// CreateClient defines a rpc handler method for MsgCreateClient. - pub async fn create_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()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.core.client.v1.Msg/CreateClient", - ); - self.inner.unary(request.into_request(), path, codec).await - } - /// UpdateClient defines a rpc handler method for MsgUpdateClient. - pub async fn update_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()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.core.client.v1.Msg/UpdateClient", - ); - self.inner.unary(request.into_request(), path, codec).await - } - /// UpgradeClient defines a rpc handler method for MsgUpgradeClient. - pub async fn upgrade_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()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.core.client.v1.Msg/UpgradeClient", - ); - self.inner.unary(request.into_request(), path, codec).await - } - /// SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. - pub async fn submit_misbehaviour( - &mut self, - request: impl tonic::IntoRequest, - ) -> 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( - "/ibc.core.client.v1.Msg/SubmitMisbehaviour", - ); - self.inner.unary(request.into_request(), path, codec).await - } - } -} /// QueryClientStateRequest is the request type for the Query/ClientState RPC /// method #[derive(Clone, PartialEq, ::prost::Message)] @@ -722,6 +487,241 @@ pub mod query_client { } } } +/// MsgCreateClient defines a message to create an IBC client +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreateClient { + /// light client state + #[prost(message, optional, tag="1")] + pub client_state: ::core::option::Option<::prost_types::Any>, + /// consensus state associated with the client that corresponds to a given + /// height. + #[prost(message, optional, tag="2")] + pub consensus_state: ::core::option::Option<::prost_types::Any>, + /// signer address + #[prost(string, tag="3")] + pub signer: ::prost::alloc::string::String, +} +/// MsgCreateClientResponse defines the Msg/CreateClient response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreateClientResponse { +} +/// MsgUpdateClient defines an sdk.Msg to update a IBC client state using +/// the given header. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateClient { + /// client unique identifier + #[prost(string, tag="1")] + pub client_id: ::prost::alloc::string::String, + /// header to update the light client + #[prost(message, optional, tag="2")] + pub header: ::core::option::Option<::prost_types::Any>, + /// signer address + #[prost(string, tag="3")] + pub signer: ::prost::alloc::string::String, +} +/// MsgUpdateClientResponse defines the Msg/UpdateClient response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateClientResponse { +} +/// MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client +/// state +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpgradeClient { + /// client unique identifier + #[prost(string, tag="1")] + pub client_id: ::prost::alloc::string::String, + /// upgraded client state + #[prost(message, optional, tag="2")] + pub client_state: ::core::option::Option<::prost_types::Any>, + /// upgraded consensus state, only contains enough information to serve as a + /// basis of trust in update logic + #[prost(message, optional, tag="3")] + pub consensus_state: ::core::option::Option<::prost_types::Any>, + /// proof that old chain committed to new client + #[prost(bytes="vec", tag="4")] + pub proof_upgrade_client: ::prost::alloc::vec::Vec, + /// proof that old chain committed to new consensus state + #[prost(bytes="vec", tag="5")] + pub proof_upgrade_consensus_state: ::prost::alloc::vec::Vec, + /// signer address + #[prost(string, tag="6")] + pub signer: ::prost::alloc::string::String, +} +/// MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpgradeClientResponse { +} +/// MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for +/// light client misbehaviour. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSubmitMisbehaviour { + /// client unique identifier + #[prost(string, tag="1")] + pub client_id: ::prost::alloc::string::String, + /// misbehaviour used for freezing the light client + #[prost(message, optional, tag="2")] + pub misbehaviour: ::core::option::Option<::prost_types::Any>, + /// signer address + #[prost(string, tag="3")] + pub signer: ::prost::alloc::string::String, +} +/// MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response +/// type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSubmitMisbehaviourResponse { +} +/// Generated client implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod msg_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Msg defines the ibc/client Msg service. + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: std::convert::TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl MsgClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> MsgClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + MsgClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with `gzip`. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_gzip(mut self) -> Self { + self.inner = self.inner.send_gzip(); + self + } + /// Enable decompressing responses with `gzip`. + #[must_use] + pub fn accept_gzip(mut self) -> Self { + self.inner = self.inner.accept_gzip(); + self + } + /// CreateClient defines a rpc handler method for MsgCreateClient. + pub async fn create_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()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/ibc.core.client.v1.Msg/CreateClient", + ); + self.inner.unary(request.into_request(), path, codec).await + } + /// UpdateClient defines a rpc handler method for MsgUpdateClient. + pub async fn update_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()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/ibc.core.client.v1.Msg/UpdateClient", + ); + self.inner.unary(request.into_request(), path, codec).await + } + /// UpgradeClient defines a rpc handler method for MsgUpgradeClient. + pub async fn upgrade_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()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/ibc.core.client.v1.Msg/UpgradeClient", + ); + self.inner.unary(request.into_request(), path, codec).await + } + /// SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. + pub async fn submit_misbehaviour( + &mut self, + request: impl tonic::IntoRequest, + ) -> 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( + "/ibc.core.client.v1.Msg/SubmitMisbehaviour", + ); + self.inner.unary(request.into_request(), path, codec).await + } + } +} /// GenesisState defines the ibc client submodule's genesis state. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { diff --git a/cosmos-sdk-proto/src/prost/ibc.core.commitment.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.commitment.v1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/ibc.core.commitment.v1.rs rename to cosmos-sdk-proto/src/prost/ibc-go/ibc.core.commitment.v1.rs diff --git a/cosmos-sdk-proto/src/prost/ibc.core.connection.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.connection.v1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/ibc.core.connection.v1.rs rename to cosmos-sdk-proto/src/prost/ibc-go/ibc.core.connection.v1.rs index a010688e..8bb27639 100644 --- a/cosmos-sdk-proto/src/prost/ibc.core.connection.v1.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.connection.v1.rs @@ -117,129 +117,135 @@ pub enum State { /// A connection end has completed the handshake. Open = 3, } -/// MsgConnectionOpenInit defines the msg sent by an account on Chain A to -/// initialize a connection with Chain B. +/// QueryConnectionRequest is the request type for the Query/Connection RPC +/// method #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgConnectionOpenInit { +pub struct QueryConnectionRequest { + /// connection unique identifier #[prost(string, tag="1")] - pub client_id: ::prost::alloc::string::String, - #[prost(message, optional, tag="2")] - pub counterparty: ::core::option::Option, + pub connection_id: ::prost::alloc::string::String, +} +/// QueryConnectionResponse is the response type for the Query/Connection RPC +/// method. Besides the connection end, it includes a proof and the height from +/// which the proof was retrieved. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryConnectionResponse { + /// connection associated with the request identifier + #[prost(message, optional, tag="1")] + pub connection: ::core::option::Option, + /// merkle proof of existence + #[prost(bytes="vec", tag="2")] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved #[prost(message, optional, tag="3")] - pub version: ::core::option::Option, - #[prost(uint64, tag="4")] - pub delay_period: u64, - #[prost(string, tag="5")] - pub signer: ::prost::alloc::string::String, + pub proof_height: ::core::option::Option, } -/// MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response -/// type. +/// QueryConnectionsRequest is the request type for the Query/Connections RPC +/// method #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgConnectionOpenInitResponse { +pub struct QueryConnectionsRequest { + #[prost(message, optional, tag="1")] + pub pagination: ::core::option::Option, } -/// MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a -/// connection on Chain B. +/// QueryConnectionsResponse is the response type for the Query/Connections RPC +/// method. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgConnectionOpenTry { - #[prost(string, tag="1")] - pub client_id: ::prost::alloc::string::String, - /// in the case of crossing hello's, when both chains call OpenInit, we need - /// the connection identifier of the previous connection in state INIT - #[prost(string, tag="2")] - pub previous_connection_id: ::prost::alloc::string::String, +pub struct QueryConnectionsResponse { + /// list of stored connections of the chain. + #[prost(message, repeated, tag="1")] + pub connections: ::prost::alloc::vec::Vec, + /// pagination response + #[prost(message, optional, tag="2")] + pub pagination: ::core::option::Option, + /// query block height #[prost(message, optional, tag="3")] - pub client_state: ::core::option::Option<::prost_types::Any>, - #[prost(message, optional, tag="4")] - pub counterparty: ::core::option::Option, - #[prost(uint64, tag="5")] - pub delay_period: u64, - #[prost(message, repeated, tag="6")] - pub counterparty_versions: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag="7")] - pub proof_height: ::core::option::Option, - /// proof of the initialization the connection on Chain A: `UNITIALIZED -> - /// INIT` - #[prost(bytes="vec", tag="8")] - pub proof_init: ::prost::alloc::vec::Vec, - /// proof of client state included in message - #[prost(bytes="vec", tag="9")] - pub proof_client: ::prost::alloc::vec::Vec, - /// proof of client consensus state - #[prost(bytes="vec", tag="10")] - pub proof_consensus: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag="11")] - pub consensus_height: ::core::option::Option, - #[prost(string, tag="12")] - pub signer: ::prost::alloc::string::String, + pub height: ::core::option::Option, } -/// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. +/// QueryClientConnectionsRequest is the request type for the +/// Query/ClientConnections RPC method #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgConnectionOpenTryResponse { +pub struct QueryClientConnectionsRequest { + /// client identifier associated with a connection + #[prost(string, tag="1")] + pub client_id: ::prost::alloc::string::String, } -/// MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to -/// acknowledge the change of connection state to TRYOPEN on Chain B. +/// QueryClientConnectionsResponse is the response type for the +/// Query/ClientConnections RPC method #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgConnectionOpenAck { - #[prost(string, tag="1")] - pub connection_id: ::prost::alloc::string::String, - #[prost(string, tag="2")] - pub counterparty_connection_id: ::prost::alloc::string::String, +pub struct QueryClientConnectionsResponse { + /// slice of all the connection paths associated with a client. + #[prost(string, repeated, tag="1")] + pub connection_paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// merkle proof of existence + #[prost(bytes="vec", tag="2")] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was generated #[prost(message, optional, tag="3")] - pub version: ::core::option::Option, - #[prost(message, optional, tag="4")] - pub client_state: ::core::option::Option<::prost_types::Any>, - #[prost(message, optional, tag="5")] pub proof_height: ::core::option::Option, - /// proof of the initialization the connection on Chain B: `UNITIALIZED -> - /// TRYOPEN` - #[prost(bytes="vec", tag="6")] - pub proof_try: ::prost::alloc::vec::Vec, - /// proof of client state included in message - #[prost(bytes="vec", tag="7")] - pub proof_client: ::prost::alloc::vec::Vec, - /// proof of client consensus state - #[prost(bytes="vec", tag="8")] - pub proof_consensus: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag="9")] - pub consensus_height: ::core::option::Option, - #[prost(string, tag="10")] - pub signer: ::prost::alloc::string::String, -} -/// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgConnectionOpenAckResponse { } -/// MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to -/// acknowledge the change of connection state to OPEN on Chain A. +/// QueryConnectionClientStateRequest is the request type for the +/// Query/ConnectionClientState RPC method #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgConnectionOpenConfirm { +pub struct QueryConnectionClientStateRequest { + /// connection identifier #[prost(string, tag="1")] pub connection_id: ::prost::alloc::string::String, - /// proof for the change of the connection state on Chain A: `INIT -> OPEN` +} +/// QueryConnectionClientStateResponse is the response type for the +/// Query/ConnectionClientState RPC method +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryConnectionClientStateResponse { + /// client state associated with the channel + #[prost(message, optional, tag="1")] + pub identified_client_state: ::core::option::Option, + /// merkle proof of existence #[prost(bytes="vec", tag="2")] - pub proof_ack: ::prost::alloc::vec::Vec, + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved #[prost(message, optional, tag="3")] pub proof_height: ::core::option::Option, - #[prost(string, tag="4")] - pub signer: ::prost::alloc::string::String, } -/// MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm -/// response type. +/// QueryConnectionConsensusStateRequest is the request type for the +/// Query/ConnectionConsensusState RPC method #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgConnectionOpenConfirmResponse { +pub struct QueryConnectionConsensusStateRequest { + /// connection identifier + #[prost(string, tag="1")] + pub connection_id: ::prost::alloc::string::String, + #[prost(uint64, tag="2")] + pub revision_number: u64, + #[prost(uint64, tag="3")] + pub revision_height: u64, +} +/// QueryConnectionConsensusStateResponse is the response type for the +/// Query/ConnectionConsensusState RPC method +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryConnectionConsensusStateResponse { + /// consensus state associated with the channel + #[prost(message, optional, tag="1")] + pub consensus_state: ::core::option::Option<::prost_types::Any>, + /// client ID associated with the consensus state + #[prost(string, tag="2")] + pub client_id: ::prost::alloc::string::String, + /// merkle proof of existence + #[prost(bytes="vec", tag="3")] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag="4")] + pub proof_height: ::core::option::Option, } /// Generated client implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] -pub mod msg_client { +pub mod query_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - /// Msg defines the ibc/connection Msg service. + /// Query provides defines the gRPC querier service #[derive(Debug, Clone)] - pub struct MsgClient { + pub struct QueryClient { inner: tonic::client::Grpc, } - impl MsgClient { + impl QueryClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -250,7 +256,7 @@ pub mod msg_client { Ok(Self::new(conn)) } } - impl MsgClient + impl QueryClient where T: tonic::client::GrpcService, T::Error: Into, @@ -264,7 +270,7 @@ pub mod msg_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> MsgClient> + ) -> QueryClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -278,7 +284,7 @@ pub mod msg_client { http::Request, >>::Error: Into + Send + Sync, { - MsgClient::new(InterceptedService::new(inner, interceptor)) + QueryClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with `gzip`. /// @@ -295,14 +301,11 @@ pub mod msg_client { self.inner = self.inner.accept_gzip(); self } - /// ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. - pub async fn connection_open_init( + /// Connection queries an IBC connection end. + pub async fn connection( &mut self, - request: impl tonic::IntoRequest, - ) -> Result< - tonic::Response, - tonic::Status, - > { + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { self.inner .ready() .await @@ -314,16 +317,37 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.connection.v1.Msg/ConnectionOpenInit", + "/ibc.core.connection.v1.Query/Connection", ); self.inner.unary(request.into_request(), path, codec).await } - /// ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. - pub async fn connection_open_try( + /// Connections queries all the IBC connections of a chain. + pub async fn connections( &mut self, - request: impl tonic::IntoRequest, + 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()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/ibc.core.connection.v1.Query/Connections", + ); + self.inner.unary(request.into_request(), path, codec).await + } + /// ClientConnections queries the connection paths associated with a client + /// state. + pub async fn client_connections( + &mut self, + request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -337,16 +361,17 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.connection.v1.Msg/ConnectionOpenTry", + "/ibc.core.connection.v1.Query/ClientConnections", ); self.inner.unary(request.into_request(), path, codec).await } - /// ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. - pub async fn connection_open_ack( + /// ConnectionClientState queries the client state associated with the + /// connection. + pub async fn connection_client_state( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -360,17 +385,17 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.connection.v1.Msg/ConnectionOpenAck", + "/ibc.core.connection.v1.Query/ConnectionClientState", ); self.inner.unary(request.into_request(), path, codec).await } - /// ConnectionOpenConfirm defines a rpc handler method for - /// MsgConnectionOpenConfirm. - pub async fn connection_open_confirm( + /// ConnectionConsensusState queries the consensus state associated with the + /// connection. + pub async fn connection_consensus_state( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -384,141 +409,135 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.connection.v1.Msg/ConnectionOpenConfirm", + "/ibc.core.connection.v1.Query/ConnectionConsensusState", ); self.inner.unary(request.into_request(), path, codec).await } - } -} -/// QueryConnectionRequest is the request type for the Query/Connection RPC -/// method -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConnectionRequest { - /// connection unique identifier - #[prost(string, tag="1")] - pub connection_id: ::prost::alloc::string::String, + } } -/// QueryConnectionResponse is the response type for the Query/Connection RPC -/// method. Besides the connection end, it includes a proof and the height from -/// which the proof was retrieved. +/// MsgConnectionOpenInit defines the msg sent by an account on Chain A to +/// initialize a connection with Chain B. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConnectionResponse { - /// connection associated with the request identifier - #[prost(message, optional, tag="1")] - pub connection: ::core::option::Option, - /// merkle proof of existence - #[prost(bytes="vec", tag="2")] - pub proof: ::prost::alloc::vec::Vec, - /// height at which the proof was retrieved +pub struct MsgConnectionOpenInit { + #[prost(string, tag="1")] + pub client_id: ::prost::alloc::string::String, + #[prost(message, optional, tag="2")] + pub counterparty: ::core::option::Option, #[prost(message, optional, tag="3")] - pub proof_height: ::core::option::Option, -} -/// QueryConnectionsRequest is the request type for the Query/Connections RPC -/// method -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConnectionsRequest { - #[prost(message, optional, tag="1")] - pub pagination: ::core::option::Option, + pub version: ::core::option::Option, + #[prost(uint64, tag="4")] + pub delay_period: u64, + #[prost(string, tag="5")] + pub signer: ::prost::alloc::string::String, } -/// QueryConnectionsResponse is the response type for the Query/Connections RPC -/// method. +/// MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response +/// type. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConnectionsResponse { - /// list of stored connections of the chain. - #[prost(message, repeated, tag="1")] - pub connections: ::prost::alloc::vec::Vec, - /// pagination response - #[prost(message, optional, tag="2")] - pub pagination: ::core::option::Option, - /// query block height - #[prost(message, optional, tag="3")] - pub height: ::core::option::Option, +pub struct MsgConnectionOpenInitResponse { } -/// QueryClientConnectionsRequest is the request type for the -/// Query/ClientConnections RPC method +/// MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a +/// connection on Chain B. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClientConnectionsRequest { - /// client identifier associated with a connection +pub struct MsgConnectionOpenTry { #[prost(string, tag="1")] pub client_id: ::prost::alloc::string::String, -} -/// QueryClientConnectionsResponse is the response type for the -/// Query/ClientConnections RPC method -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClientConnectionsResponse { - /// slice of all the connection paths associated with a client. - #[prost(string, repeated, tag="1")] - pub connection_paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// merkle proof of existence - #[prost(bytes="vec", tag="2")] - pub proof: ::prost::alloc::vec::Vec, - /// height at which the proof was generated + /// in the case of crossing hello's, when both chains call OpenInit, we need + /// the connection identifier of the previous connection in state INIT + #[prost(string, tag="2")] + pub previous_connection_id: ::prost::alloc::string::String, #[prost(message, optional, tag="3")] + pub client_state: ::core::option::Option<::prost_types::Any>, + #[prost(message, optional, tag="4")] + pub counterparty: ::core::option::Option, + #[prost(uint64, tag="5")] + pub delay_period: u64, + #[prost(message, repeated, tag="6")] + pub counterparty_versions: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag="7")] pub proof_height: ::core::option::Option, + /// proof of the initialization the connection on Chain A: `UNITIALIZED -> + /// INIT` + #[prost(bytes="vec", tag="8")] + pub proof_init: ::prost::alloc::vec::Vec, + /// proof of client state included in message + #[prost(bytes="vec", tag="9")] + pub proof_client: ::prost::alloc::vec::Vec, + /// proof of client consensus state + #[prost(bytes="vec", tag="10")] + pub proof_consensus: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag="11")] + pub consensus_height: ::core::option::Option, + #[prost(string, tag="12")] + pub signer: ::prost::alloc::string::String, } -/// QueryConnectionClientStateRequest is the request type for the -/// Query/ConnectionClientState RPC method +/// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConnectionClientStateRequest { - /// connection identifier - #[prost(string, tag="1")] - pub connection_id: ::prost::alloc::string::String, +pub struct MsgConnectionOpenTryResponse { } -/// QueryConnectionClientStateResponse is the response type for the -/// Query/ConnectionClientState RPC method +/// MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to +/// acknowledge the change of connection state to TRYOPEN on Chain B. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConnectionClientStateResponse { - /// client state associated with the channel - #[prost(message, optional, tag="1")] - pub identified_client_state: ::core::option::Option, - /// merkle proof of existence - #[prost(bytes="vec", tag="2")] - pub proof: ::prost::alloc::vec::Vec, - /// height at which the proof was retrieved +pub struct MsgConnectionOpenAck { + #[prost(string, tag="1")] + pub connection_id: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub counterparty_connection_id: ::prost::alloc::string::String, #[prost(message, optional, tag="3")] + pub version: ::core::option::Option, + #[prost(message, optional, tag="4")] + pub client_state: ::core::option::Option<::prost_types::Any>, + #[prost(message, optional, tag="5")] pub proof_height: ::core::option::Option, + /// proof of the initialization the connection on Chain B: `UNITIALIZED -> + /// TRYOPEN` + #[prost(bytes="vec", tag="6")] + pub proof_try: ::prost::alloc::vec::Vec, + /// proof of client state included in message + #[prost(bytes="vec", tag="7")] + pub proof_client: ::prost::alloc::vec::Vec, + /// proof of client consensus state + #[prost(bytes="vec", tag="8")] + pub proof_consensus: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag="9")] + pub consensus_height: ::core::option::Option, + #[prost(string, tag="10")] + pub signer: ::prost::alloc::string::String, } -/// QueryConnectionConsensusStateRequest is the request type for the -/// Query/ConnectionConsensusState RPC method +/// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConnectionConsensusStateRequest { - /// connection identifier +pub struct MsgConnectionOpenAckResponse { +} +/// MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to +/// acknowledge the change of connection state to OPEN on Chain A. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgConnectionOpenConfirm { #[prost(string, tag="1")] pub connection_id: ::prost::alloc::string::String, - #[prost(uint64, tag="2")] - pub revision_number: u64, - #[prost(uint64, tag="3")] - pub revision_height: u64, + /// proof for the change of the connection state on Chain A: `INIT -> OPEN` + #[prost(bytes="vec", tag="2")] + pub proof_ack: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag="3")] + pub proof_height: ::core::option::Option, + #[prost(string, tag="4")] + pub signer: ::prost::alloc::string::String, } -/// QueryConnectionConsensusStateResponse is the response type for the -/// Query/ConnectionConsensusState RPC method +/// MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm +/// response type. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConnectionConsensusStateResponse { - /// consensus state associated with the channel - #[prost(message, optional, tag="1")] - pub consensus_state: ::core::option::Option<::prost_types::Any>, - /// client ID associated with the consensus state - #[prost(string, tag="2")] - pub client_id: ::prost::alloc::string::String, - /// merkle proof of existence - #[prost(bytes="vec", tag="3")] - pub proof: ::prost::alloc::vec::Vec, - /// height at which the proof was retrieved - #[prost(message, optional, tag="4")] - pub proof_height: ::core::option::Option, +pub struct MsgConnectionOpenConfirmResponse { } /// Generated client implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] -pub mod query_client { +pub mod msg_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - /// Query provides defines the gRPC querier service + /// Msg defines the ibc/connection Msg service. #[derive(Debug, Clone)] - pub struct QueryClient { + pub struct MsgClient { inner: tonic::client::Grpc, } - impl QueryClient { + impl MsgClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -529,7 +548,7 @@ pub mod query_client { Ok(Self::new(conn)) } } - impl QueryClient + impl MsgClient where T: tonic::client::GrpcService, T::Error: Into, @@ -543,7 +562,7 @@ pub mod query_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> QueryClient> + ) -> MsgClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -557,7 +576,7 @@ pub mod query_client { http::Request, >>::Error: Into + Send + Sync, { - QueryClient::new(InterceptedService::new(inner, interceptor)) + MsgClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with `gzip`. /// @@ -574,31 +593,14 @@ pub mod query_client { self.inner = self.inner.accept_gzip(); self } - /// Connection queries an IBC connection end. - pub async fn connection( - &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()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.core.connection.v1.Query/Connection", - ); - self.inner.unary(request.into_request(), path, codec).await - } - /// Connections queries all the IBC connections of a chain. - pub async fn connections( + /// ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. + pub async fn connection_open_init( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + request: impl tonic::IntoRequest, + ) -> Result< + tonic::Response, + tonic::Status, + > { self.inner .ready() .await @@ -610,17 +612,16 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.connection.v1.Query/Connections", + "/ibc.core.connection.v1.Msg/ConnectionOpenInit", ); self.inner.unary(request.into_request(), path, codec).await } - /// ClientConnections queries the connection paths associated with a client - /// state. - pub async fn client_connections( + /// ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. + pub async fn connection_open_try( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -634,17 +635,16 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.connection.v1.Query/ClientConnections", + "/ibc.core.connection.v1.Msg/ConnectionOpenTry", ); self.inner.unary(request.into_request(), path, codec).await } - /// ConnectionClientState queries the client state associated with the - /// connection. - pub async fn connection_client_state( + /// ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. + pub async fn connection_open_ack( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -658,17 +658,17 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.connection.v1.Query/ConnectionClientState", + "/ibc.core.connection.v1.Msg/ConnectionOpenAck", ); self.inner.unary(request.into_request(), path, codec).await } - /// ConnectionConsensusState queries the consensus state associated with the - /// connection. - pub async fn connection_consensus_state( + /// ConnectionOpenConfirm defines a rpc handler method for + /// MsgConnectionOpenConfirm. + pub async fn connection_open_confirm( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -682,7 +682,7 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.connection.v1.Query/ConnectionConsensusState", + "/ibc.core.connection.v1.Msg/ConnectionOpenConfirm", ); self.inner.unary(request.into_request(), path, codec).await } diff --git a/cosmos-sdk-proto/src/prost/ibc.core.types.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.types.v1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/ibc.core.types.v1.rs rename to cosmos-sdk-proto/src/prost/ibc-go/ibc.core.types.v1.rs diff --git a/cosmos-sdk-proto/src/prost/ibc.lightclients.localhost.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.localhost.v1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/ibc.lightclients.localhost.v1.rs rename to cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.localhost.v1.rs diff --git a/cosmos-sdk-proto/src/prost/ibc.lightclients.solomachine.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.solomachine.v1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/ibc.lightclients.solomachine.v1.rs rename to cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.solomachine.v1.rs diff --git a/cosmos-sdk-proto/src/prost/ibc.lightclients.solomachine.v2.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.solomachine.v2.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/ibc.lightclients.solomachine.v2.rs rename to cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.solomachine.v2.rs diff --git a/cosmos-sdk-proto/src/prost/ibc.lightclients.tendermint.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.tendermint.v1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/ibc.lightclients.tendermint.v1.rs rename to cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.tendermint.v1.rs diff --git a/cosmos-sdk-proto/src/prost/ics23.rs b/cosmos-sdk-proto/src/prost/ibc-go/ics23.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/ics23.rs rename to cosmos-sdk-proto/src/prost/ibc-go/ics23.rs diff --git a/cosmos-sdk-proto/src/prost/WASMD_COMMIT b/cosmos-sdk-proto/src/prost/wasmd/WASMD_COMMIT similarity index 100% rename from cosmos-sdk-proto/src/prost/WASMD_COMMIT rename to cosmos-sdk-proto/src/prost/wasmd/WASMD_COMMIT diff --git a/cosmos-sdk-proto/src/prost/wasmd/cosmos.base.query.v1beta1.rs b/cosmos-sdk-proto/src/prost/wasmd/cosmos.base.query.v1beta1.rs new file mode 100644 index 00000000..2bf86eb4 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/wasmd/cosmos.base.query.v1beta1.rs @@ -0,0 +1,53 @@ +/// PageRequest is to be embedded in gRPC request messages for efficient +/// pagination. Ex: +/// +/// message SomeRequest { +/// Foo some_parameter = 1; +/// PageRequest pagination = 2; +/// } +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PageRequest { + /// key is a value returned in PageResponse.next_key to begin + /// querying the next page most efficiently. Only one of offset or key + /// should be set. + #[prost(bytes="vec", tag="1")] + pub key: ::prost::alloc::vec::Vec, + /// offset is a numeric offset that can be used when key is unavailable. + /// It is less efficient than using key. Only one of offset or key should + /// be set. + #[prost(uint64, tag="2")] + pub offset: u64, + /// limit is the total number of results to be returned in the result page. + /// If left empty it will default to a value to be set by each app. + #[prost(uint64, tag="3")] + pub limit: u64, + /// count_total is set to true to indicate that the result set should include + /// a count of the total number of items available for pagination in UIs. + /// count_total is only respected when offset is used. It is ignored when key + /// 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. +/// +/// message SomeResponse { +/// repeated Bar results = 1; +/// PageResponse page = 2; +/// } +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PageResponse { + /// next_key is the key to be passed to PageRequest.key to + /// query the next page most efficiently + #[prost(bytes="vec", tag="1")] + pub next_key: ::prost::alloc::vec::Vec, + /// total is total number of results available if PageRequest.count_total + /// was set, its value is undefined otherwise + #[prost(uint64, tag="2")] + pub total: u64, +} diff --git a/cosmos-sdk-proto/src/prost/wasmd/cosmos.base.v1beta1.rs b/cosmos-sdk-proto/src/prost/wasmd/cosmos.base.v1beta1.rs new file mode 100644 index 00000000..44b3e63b --- /dev/null +++ b/cosmos-sdk-proto/src/prost/wasmd/cosmos.base.v1beta1.rs @@ -0,0 +1,34 @@ +/// Coin defines a token with a denomination and an amount. +/// +/// NOTE: The amount field is an Int which implements the custom method +/// signatures required by gogoproto. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Coin { + #[prost(string, tag="1")] + pub denom: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub amount: ::prost::alloc::string::String, +} +/// DecCoin defines a token with a denomination and a decimal amount. +/// +/// NOTE: The amount field is an Dec which implements the custom method +/// signatures required by gogoproto. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DecCoin { + #[prost(string, tag="1")] + pub denom: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub amount: ::prost::alloc::string::String, +} +/// IntProto defines a Protobuf wrapper around an Int object. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct IntProto { + #[prost(string, tag="1")] + pub int: ::prost::alloc::string::String, +} +/// DecProto defines a Protobuf wrapper around a Dec object. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DecProto { + #[prost(string, tag="1")] + pub dec: ::prost::alloc::string::String, +} diff --git a/cosmos-sdk-proto/src/prost/wasmd/cosmos_proto.rs b/cosmos-sdk-proto/src/prost/wasmd/cosmos_proto.rs new file mode 100644 index 00000000..e69de29b diff --git a/cosmos-sdk-proto/src/prost/cosmwasm.wasm.v1.rs b/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.rs similarity index 100% rename from cosmos-sdk-proto/src/prost/cosmwasm.wasm.v1.rs rename to cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.rs diff --git a/proto-build/src/main.rs b/proto-build/src/main.rs index 9969c428..142a38fe 100644 --- a/proto-build/src/main.rs +++ b/proto-build/src/main.rs @@ -83,17 +83,26 @@ fn main() { fs::remove_dir_all(tmp_build_dir.clone()).unwrap(); } - fs::create_dir(tmp_build_dir.clone()).unwrap(); + let temp_sdk_dir = tmp_build_dir.join("cosmos-sdk"); + let temp_ibc_dir = tmp_build_dir.join("ibc-go"); + let temp_wasmd_dir = tmp_build_dir.join("wasmd"); + + fs::create_dir_all(&temp_sdk_dir).unwrap(); + fs::create_dir_all(&temp_ibc_dir).unwrap(); + fs::create_dir_all(&temp_wasmd_dir).unwrap(); update_submodules(); - output_sdk_version(&tmp_build_dir); - output_ibc_version(&tmp_build_dir); - output_wasmd_version(&tmp_build_dir); - compile_sdk_protos_and_services(&tmp_build_dir); - compile_ibc_protos_and_services(&tmp_build_dir); - compile_wasmd_protos(&tmp_build_dir); - compile_wasmd_proto_services(&tmp_build_dir); - copy_generated_files(&tmp_build_dir, &proto_dir); + output_sdk_version(&temp_sdk_dir); + output_ibc_version(&temp_ibc_dir); + output_wasmd_version(&temp_wasmd_dir); + compile_sdk_protos_and_services(&temp_sdk_dir); + compile_ibc_protos_and_services(&temp_ibc_dir); + compile_wasmd_protos(&temp_wasmd_dir); + compile_wasmd_proto_services(&temp_wasmd_dir); + + copy_generated_files(&temp_sdk_dir, &proto_dir.join("cosmos-sdk")); + copy_generated_files(&temp_ibc_dir, &proto_dir.join("ibc-go")); + copy_generated_files(&temp_wasmd_dir, &proto_dir.join("wasmd")); if is_github() { println!( @@ -263,7 +272,7 @@ fn compile_sdk_protos_and_services(out_dir: &Path) { info!("=> Done!"); } -fn compile_wasmd_proto_services(out_dir: impl AsRef) { +fn compile_wasmd_proto_services(out_dir: &Path) { let root = PathBuf::from(env!("CARGO_MANIFEST_DIR")); let sdk_dir = PathBuf::from(WASMD_DIR);