diff --git a/packages/proto-build/Cargo.toml b/packages/proto-build/Cargo.toml index 26f2810e..106f2491 100644 --- a/packages/proto-build/Cargo.toml +++ b/packages/proto-build/Cargo.toml @@ -20,6 +20,4 @@ prost-types = { workspace = true } quote = "1.0.26" regex = "1" syn = { version = "1.0.109", features = ["full", "parsing", "extra-traits"] } -tonic = "0.7" -tonic-build = "0.7" -walkdir = "2" \ No newline at end of file +walkdir = "2" diff --git a/packages/proto-build/provenance.buf.gen.yaml b/packages/proto-build/provenance.buf.gen.yaml index a1da1cee..1129dcc5 100644 --- a/packages/proto-build/provenance.buf.gen.yaml +++ b/packages/proto-build/provenance.buf.gen.yaml @@ -5,4 +5,10 @@ plugins: opt: - extern_path=.google.protobuf.Timestamp=crate::shim::Timestamp - extern_path=.google.protobuf.Duration=crate::shim::Duration - - extern_path=.google.protobuf.Any=crate::shim::Any \ No newline at end of file + - extern_path=.google.protobuf.Any=crate::shim::Any + - plugin: buf.build/community/neoeinstein-tonic + out: . + opt: + - extern_path=.google.protobuf.Timestamp=crate::shim::Timestamp + - extern_path=.google.protobuf.Duration=crate::shim::Duration + - extern_path=.google.protobuf.Any=crate::shim::Any diff --git a/packages/proto-build/src/transform.rs b/packages/proto-build/src/transform.rs index 95c9f219..da92d6d6 100644 --- a/packages/proto-build/src/transform.rs +++ b/packages/proto-build/src/transform.rs @@ -17,9 +17,11 @@ use crate::transformers; const EXCLUDED_PROTO_PACKAGES: &[&str] = &["amino", "cosmos_proto", "gogoproto", "google"]; /// These structures are excluded from the final module +/// matched against using String::contains(...) const EXCLUDED_STRUCTURES: &[&str] = &[ "provenance::msgfees::v1::CalculateTxFeesRequest", "provenance::msgfees::v1::CalculateTxFeesResponse", + "::tonic::", ]; pub fn copy_and_transform_all(from_dir: &Path, to_dir: &Path, descriptor: &FileDescriptorSet) { @@ -153,8 +155,10 @@ fn transform_items( _ => s.ident.to_string(), }; - if EXCLUDED_STRUCTURES.contains(&full_path.as_str()) { - return None; + for exclude in EXCLUDED_STRUCTURES { + if full_path.contains(exclude) { + return None; + } } let s = transformers::add_derive_eq_struct(&s); let s = transformers::append_attrs_struct(src, &s, descriptor); diff --git a/packages/provwasm-std/src/types/cosmos/app/mod.rs b/packages/provwasm-std/src/types/cosmos/app/mod.rs index 6e347e34..fa51b9ef 100644 --- a/packages/provwasm-std/src/types/cosmos/app/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/app/mod.rs @@ -1,2 +1,2 @@ -pub mod runtime; +pub mod module; pub mod v1alpha1; diff --git a/packages/provwasm-std/src/types/cosmos/app/runtime/mod.rs b/packages/provwasm-std/src/types/cosmos/app/module/mod.rs similarity index 100% rename from packages/provwasm-std/src/types/cosmos/app/runtime/mod.rs rename to packages/provwasm-std/src/types/cosmos/app/module/mod.rs diff --git a/packages/provwasm-std/src/types/cosmos/authz/module/v1.rs b/packages/provwasm-std/src/types/cosmos/app/module/v1alpha1.rs similarity index 67% rename from packages/provwasm-std/src/types/cosmos/authz/module/v1.rs rename to packages/provwasm-std/src/types/cosmos/app/module/v1alpha1.rs index 689d49e1..821dccb7 100644 --- a/packages/provwasm-std/src/types/cosmos/authz/module/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/app/module/v1alpha1.rs @@ -1,5 +1,5 @@ use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// Module is the config object of the authz module. +/// Module is the module config object for the cosmos.app v1 app module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -11,5 +11,5 @@ use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.authz.module.v1.Module")] +#[proto_message(type_url = "/cosmos.app.module.v1alpha1.Module")] pub struct Module {} diff --git a/packages/provwasm-std/src/types/cosmos/app/runtime/v1alpha1.rs b/packages/provwasm-std/src/types/cosmos/app/runtime/v1alpha1.rs deleted file mode 100644 index e96f7dbf..00000000 --- a/packages/provwasm-std/src/types/cosmos/app/runtime/v1alpha1.rs +++ /dev/null @@ -1,80 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// Module is the config object for the runtime module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.app.runtime.v1alpha1.Module")] -pub struct Module { - /// app_name is the name of the app. - #[prost(string, tag = "1")] - pub app_name: ::prost::alloc::string::String, - /// begin_blockers specifies the module names of begin blockers - /// to call in the order in which they should be called. If this is left empty - /// no begin blocker will be registered. - #[prost(string, repeated, tag = "2")] - pub begin_blockers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// end_blockers specifies the module names of the end blockers - /// to call in the order in which they should be called. If this is left empty - /// no end blocker will be registered. - #[prost(string, repeated, tag = "3")] - pub end_blockers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// init_genesis specifies the module names of init genesis functions - /// to call in the order in which they should be called. If this is left empty - /// no init genesis function will be registered. - #[prost(string, repeated, tag = "4")] - pub init_genesis: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// export_genesis specifies the order in which to export module genesis data. - /// If this is left empty, the init_genesis order will be used for export genesis - /// if it is specified. - #[prost(string, repeated, tag = "5")] - pub export_genesis: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// override_store_keys is an optional list of overrides for the module store keys - /// to be used in keeper construction. - #[prost(message, repeated, tag = "6")] - pub override_store_keys: ::prost::alloc::vec::Vec, - /// order_migrations defines the order in which module migrations are performed. - /// If this is left empty, it uses the default migration order. - /// - #[prost(string, repeated, tag = "7")] - pub order_migrations: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// precommiters specifies the module names of the precommiters - /// to call in the order in which they should be called. If this is left empty - /// no precommit function will be registered. - #[prost(string, repeated, tag = "8")] - pub precommiters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// prepare_check_staters specifies the module names of the prepare_check_staters - /// to call in the order in which they should be called. If this is left empty - /// no preparecheckstate function will be registered. - #[prost(string, repeated, tag = "9")] - pub prepare_check_staters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// StoreKeyConfig may be supplied to override the default module store key, which -/// is the module name. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.app.runtime.v1alpha1.StoreKeyConfig")] -pub struct StoreKeyConfig { - /// name of the module to override the store key of - #[prost(string, tag = "1")] - pub module_name: ::prost::alloc::string::String, - /// the kv store key to use instead of the module name. - #[prost(string, tag = "2")] - pub kv_store_key: ::prost::alloc::string::String, -} diff --git a/packages/provwasm-std/src/types/cosmos/app/v1alpha1.rs b/packages/provwasm-std/src/types/cosmos/app/v1alpha1.rs index 1fbbb423..47d0c59b 100644 --- a/packages/provwasm-std/src/types/cosmos/app/v1alpha1.rs +++ b/packages/provwasm-std/src/types/cosmos/app/v1alpha1.rs @@ -65,7 +65,7 @@ pub struct PackageReference { /// /// When a new version of a module is released and items are added to existing /// .proto files, these definitions should contain comments of the form - /// "Since: Revision N" where N is an integer revision. + /// "Since Revision N" where N is an integer revision. /// /// When the module runtime starts up, it will check the pinned proto /// image and panic if there are runtime protobuf definitions that are not @@ -132,11 +132,6 @@ pub struct Config { /// modules are the module configurations for the app. #[prost(message, repeated, tag = "1")] pub modules: ::prost::alloc::vec::Vec, - /// golang_bindings specifies explicit interface to implementation type bindings which - /// depinject uses to resolve interface inputs to provider functions. The scope of this - /// field's configuration is global (not module specific). - #[prost(message, repeated, tag = "2")] - pub golang_bindings: ::prost::alloc::vec::Vec, } /// ModuleConfig is a module configuration for an app. #[allow(clippy::derive_partial_eq_without_eq)] @@ -168,32 +163,6 @@ pub struct ModuleConfig { /// define a ModuleDescriptor using the cosmos.app.v1alpha1.is_module extension. #[prost(message, optional, tag = "2")] pub config: ::core::option::Option, - /// golang_bindings specifies explicit interface to implementation type bindings which - /// depinject uses to resolve interface inputs to provider functions. The scope of this - /// field's configuration is module specific. - #[prost(message, repeated, tag = "3")] - pub golang_bindings: ::prost::alloc::vec::Vec, -} -/// GolangBinding is an explicit interface type to implementing type binding for dependency injection. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.app.v1alpha1.GolangBinding")] -pub struct GolangBinding { - /// interface_type is the interface type which will be bound to a specific implementation type - #[prost(string, tag = "1")] - pub interface_type: ::prost::alloc::string::String, - /// implementation is the implementing type which will be supplied when an input of type interface is requested - #[prost(string, tag = "2")] - pub implementation: ::prost::alloc::string::String, } /// QueryConfigRequest is the Query/Config request type. #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/packages/provwasm-std/src/types/cosmos/auth/mod.rs b/packages/provwasm-std/src/types/cosmos/auth/mod.rs index 537a3360..9f64fc82 100644 --- a/packages/provwasm-std/src/types/cosmos/auth/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/auth/mod.rs @@ -1,2 +1 @@ -pub mod module; pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/auth/module/v1.rs b/packages/provwasm-std/src/types/cosmos/auth/module/v1.rs deleted file mode 100644 index ca50684a..00000000 --- a/packages/provwasm-std/src/types/cosmos/auth/module/v1.rs +++ /dev/null @@ -1,47 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// Module is the config object for the auth module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.auth.module.v1.Module")] -pub struct Module { - /// bech32_prefix is the bech32 account prefix for the app. - #[prost(string, tag = "1")] - pub bech32_prefix: ::prost::alloc::string::String, - /// module_account_permissions are module account permissions. - #[prost(message, repeated, tag = "2")] - pub module_account_permissions: ::prost::alloc::vec::Vec, - /// authority defines the custom module authority. If not set, defaults to the governance module. - #[prost(string, tag = "3")] - pub authority: ::prost::alloc::string::String, -} -/// ModuleAccountPermission represents permissions for a module account. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.auth.module.v1.ModuleAccountPermission")] -pub struct ModuleAccountPermission { - /// account is the name of the module. - #[prost(string, tag = "1")] - pub account: ::prost::alloc::string::String, - /// permissions are the permissions this module has. Currently recognized - /// values are minter, burner and staking. - #[prost(string, repeated, tag = "2")] - pub permissions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} diff --git a/packages/provwasm-std/src/types/cosmos/auth/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/auth/v1beta1.rs index 686a76f4..895d5441 100644 --- a/packages/provwasm-std/src/types/cosmos/auth/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/auth/v1beta1.rs @@ -53,30 +53,6 @@ pub struct ModuleAccount { #[prost(string, repeated, tag = "3")] pub permissions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } -/// ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.auth.v1beta1.ModuleCredential")] -pub struct ModuleCredential { - /// module_name is the name of the module used for address derivation (passed into address.Module). - #[prost(string, tag = "1")] - pub module_name: ::prost::alloc::string::String, - /// derivation_keys is for deriving a module account address (passed into address.Module) - /// adding more keys creates sub-account addresses (passed into address.Derive) - #[prost(bytes = "vec", repeated, tag = "2")] - pub derivation_keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, -} /// Params defines the parameters for the auth module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -136,7 +112,7 @@ pub struct Params { )] #[proto_message(type_url = "/cosmos.auth.v1beta1.GenesisState")] pub struct GenesisState { - /// params defines all the parameters of the module. + /// 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. @@ -494,27 +470,15 @@ pub struct AddressStringToBytesResponse { response_type = QueryAccountAddressByIdResponse )] pub struct QueryAccountAddressByIdRequest { - /// Deprecated, use account_id instead - /// /// id is the account number of the address to be queried. This field /// should have been an uint64 (like all account numbers), and will be /// updated to uint64 in a future version of the auth query. - #[deprecated] #[prost(int64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub id: i64, - /// account_id is the account number of the address to be queried. - /// - /// Since: cosmos-sdk 0.47 - #[prost(uint64, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub account_id: u64, } /// QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method /// @@ -535,92 +499,6 @@ pub struct QueryAccountAddressByIdResponse { #[prost(string, tag = "1")] pub account_address: ::prost::alloc::string::String, } -/// QueryAccountInfoRequest is the Query/AccountInfo request type. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.auth.v1beta1.QueryAccountInfoRequest")] -#[proto_query( - path = "/cosmos.auth.v1beta1.Query/AccountInfo", - response_type = QueryAccountInfoResponse -)] -pub struct QueryAccountInfoRequest { - /// address is the account address string. - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, -} -/// QueryAccountInfoResponse is the Query/AccountInfo response type. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.auth.v1beta1.QueryAccountInfoResponse")] -pub struct QueryAccountInfoResponse { - /// info is the account info which is represented by BaseAccount. - #[prost(message, optional, tag = "1")] - pub info: ::core::option::Option, -} -/// MsgUpdateParams is the Msg/UpdateParams request type. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.auth.v1beta1.MsgUpdateParams")] -pub struct MsgUpdateParams { - /// authority is the address that controls the module (defaults to x/gov unless overwritten). - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// params defines the x/auth parameters to update. - /// - /// NOTE: All parameters must be supplied. - #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, -} -/// MsgUpdateParamsResponse defines the response structure for executing a -/// MsgUpdateParams message. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.auth.v1beta1.MsgUpdateParamsResponse")] -pub struct MsgUpdateParamsResponse {} pub struct AuthQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } @@ -643,9 +521,8 @@ impl<'a, Q: cosmwasm_std::CustomQuery> AuthQuerier<'a, Q> { pub fn account_address_by_id( &self, id: i64, - account_id: u64, ) -> Result { - QueryAccountAddressByIdRequest { id, account_id }.query(self.querier) + QueryAccountAddressByIdRequest { id }.query(self.querier) } pub fn params(&self) -> Result { QueryParamsRequest {}.query(self.querier) @@ -674,10 +551,4 @@ impl<'a, Q: cosmwasm_std::CustomQuery> AuthQuerier<'a, Q> { ) -> Result { AddressStringToBytesRequest { address_string }.query(self.querier) } - pub fn account_info( - &self, - address: ::prost::alloc::string::String, - ) -> Result { - QueryAccountInfoRequest { address }.query(self.querier) - } } diff --git a/packages/provwasm-std/src/types/cosmos/authz/mod.rs b/packages/provwasm-std/src/types/cosmos/authz/mod.rs index 537a3360..9f64fc82 100644 --- a/packages/provwasm-std/src/types/cosmos/authz/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/authz/mod.rs @@ -1,2 +1 @@ -pub mod module; pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/authz/module/mod.rs b/packages/provwasm-std/src/types/cosmos/authz/module/mod.rs deleted file mode 100644 index a3a6d96c..00000000 --- a/packages/provwasm-std/src/types/cosmos/authz/module/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/authz/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/authz/v1beta1.rs index 6b58501f..039c8109 100644 --- a/packages/provwasm-std/src/types/cosmos/authz/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/authz/v1beta1.rs @@ -265,7 +265,7 @@ pub struct QueryGranterGrantsResponse { #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } -/// QueryGranteeGrantsRequest is the request type for the Query/GranteeGrants RPC method. +/// QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -332,7 +332,7 @@ pub struct MsgGrant { #[prost(message, optional, tag = "3")] pub grant: ::core::option::Option, } -/// MsgGrantResponse defines the Msg/MsgGrant response type. +/// MsgExecResponse defines the Msg/MsgExecResponse response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -344,8 +344,11 @@ pub struct MsgGrant { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.authz.v1beta1.MsgGrantResponse")] -pub struct MsgGrantResponse {} +#[proto_message(type_url = "/cosmos.authz.v1beta1.MsgExecResponse")] +pub struct MsgExecResponse { + #[prost(bytes = "vec", repeated, tag = "1")] + pub results: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} /// 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. @@ -364,13 +367,13 @@ pub struct MsgGrantResponse {} pub struct MsgExec { #[prost(string, tag = "1")] pub grantee: ::prost::alloc::string::String, - /// Execute Msg. + /// 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, } -/// MsgExecResponse defines the Msg/MsgExecResponse response type. +/// MsgGrantResponse defines the Msg/MsgGrant response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -382,11 +385,8 @@ pub struct MsgExec { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.authz.v1beta1.MsgExecResponse")] -pub struct MsgExecResponse { - #[prost(bytes = "vec", repeated, tag = "1")] - pub results: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, -} +#[proto_message(type_url = "/cosmos.authz.v1beta1.MsgGrantResponse")] +pub struct MsgGrantResponse {} /// MsgRevoke revokes any authorization with the provided sdk.Msg type on the /// granter's account with that has been granted to the grantee. #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/packages/provwasm-std/src/types/cosmos/bank/mod.rs b/packages/provwasm-std/src/types/cosmos/bank/mod.rs index 537a3360..9f64fc82 100644 --- a/packages/provwasm-std/src/types/cosmos/bank/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/bank/mod.rs @@ -1,2 +1 @@ -pub mod module; pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/bank/module/mod.rs b/packages/provwasm-std/src/types/cosmos/bank/module/mod.rs deleted file mode 100644 index a3a6d96c..00000000 --- a/packages/provwasm-std/src/types/cosmos/bank/module/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/bank/module/v1.rs b/packages/provwasm-std/src/types/cosmos/bank/module/v1.rs deleted file mode 100644 index 6e8a4fc0..00000000 --- a/packages/provwasm-std/src/types/cosmos/bank/module/v1.rs +++ /dev/null @@ -1,30 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// Module is the config object of the bank module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.bank.module.v1.Module")] -pub struct Module { - /// blocked_module_accounts_override configures exceptional module accounts which should be blocked from receiving - /// funds. If left empty it defaults to the list of account names supplied in the auth module configuration as - /// module_account_permissions - #[prost(string, repeated, tag = "1")] - pub blocked_module_accounts_override: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// authority defines the custom module authority. If not set, defaults to the governance module. - #[prost(string, tag = "2")] - pub authority: ::prost::alloc::string::String, - /// restrictions_order specifies the order of send restrictions and should be - /// a list of module names which provide a send restriction instance. If no - /// order is provided, then restrictions will be applied in alphabetical order - /// of module names. - #[prost(string, repeated, tag = "3")] - pub restrictions_order: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} diff --git a/packages/provwasm-std/src/types/cosmos/bank/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/bank/v1beta1.rs index 49956985..65d35aee 100644 --- a/packages/provwasm-std/src/types/cosmos/bank/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/bank/v1beta1.rs @@ -329,11 +329,6 @@ pub struct QueryAllBalancesRequest { /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, - /// resolve_denom is the flag to resolve the denom into a human-readable form from the metadata. - /// - /// Since: cosmos-sdk 0.50 - #[prost(bool, tag = "3")] - pub resolve_denom: bool, } /// QueryAllBalancesResponse is the response type for the Query/AllBalances RPC /// method. @@ -409,55 +404,6 @@ pub struct QuerySpendableBalancesResponse { #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } -/// QuerySpendableBalanceByDenomRequest defines the gRPC request structure for -/// querying an account's spendable balance for a specific denom. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest")] -#[proto_query( - path = "/cosmos.bank.v1beta1.Query/SpendableBalanceByDenom", - response_type = QuerySpendableBalanceByDenomResponse -)] -pub struct QuerySpendableBalanceByDenomRequest { - /// address is the address to query balances for. - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - /// denom is the coin denom to query balances for. - #[prost(string, tag = "2")] - pub denom: ::prost::alloc::string::String, -} -/// QuerySpendableBalanceByDenomResponse defines the gRPC response structure for -/// querying an account's spendable balance for a specific denom. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse")] -pub struct QuerySpendableBalanceByDenomResponse { - /// balance is the balance of the coin. - #[prost(message, optional, tag = "1")] - pub balance: ::core::option::Option, -} /// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC /// method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -579,7 +525,6 @@ pub struct QueryParamsRequest {} )] #[proto_message(type_url = "/cosmos.bank.v1beta1.QueryParamsResponse")] pub struct QueryParamsResponse { - /// params provides the parameters of the bank module. #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } @@ -668,48 +613,6 @@ pub struct QueryDenomMetadataResponse { #[prost(message, optional, tag = "1")] pub metadata: ::core::option::Option, } -/// QueryDenomMetadataByQueryStringRequest is the request type for the Query/DenomMetadata RPC method. -/// Identical with QueryDenomMetadataRequest but receives denom as query string. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest")] -#[proto_query( - path = "/cosmos.bank.v1beta1.Query/DenomMetadataByQueryString", - response_type = QueryDenomMetadataByQueryStringResponse -)] -pub struct QueryDenomMetadataByQueryStringRequest { - /// denom is the coin denom to query the metadata for. - #[prost(string, tag = "1")] - pub denom: ::prost::alloc::string::String, -} -/// QueryDenomMetadataByQueryStringResponse is the response type for the Query/DenomMetadata RPC -/// method. Identical with QueryDenomMetadataResponse but receives denom as query string in request. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse")] -pub struct QueryDenomMetadataByQueryStringResponse { - /// metadata describes and provides all the client information for the requested token. - #[prost(message, optional, tag = "1")] - pub metadata: ::core::option::Option, -} /// QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, /// which queries for a paginated set of all account holders of a particular /// denomination. @@ -784,57 +687,6 @@ pub struct QueryDenomOwnersResponse { #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } -/// QueryDenomOwnersByQueryRequest defines the request type for the DenomOwnersByQuery RPC query, -/// which queries for a paginated set of all account holders of a particular -/// denomination. -/// -/// Since: cosmos-sdk 0.50.3 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest")] -#[proto_query( - path = "/cosmos.bank.v1beta1.Query/DenomOwnersByQuery", - response_type = QueryDenomOwnersByQueryResponse -)] -pub struct QueryDenomOwnersByQueryRequest { - /// denom defines the coin denomination to query all account holders for. - #[prost(string, tag = "1")] - pub denom: ::prost::alloc::string::String, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option, -} -/// QueryDenomOwnersByQueryResponse defines the RPC response of a DenomOwnersByQuery RPC query. -/// -/// Since: cosmos-sdk 0.50.3 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse")] -pub struct QueryDenomOwnersByQueryResponse { - #[prost(message, repeated, tag = "1")] - pub denom_owners: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option, -} /// QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. /// /// Since: cosmos-sdk 0.47 @@ -858,8 +710,7 @@ pub struct QuerySendEnabledRequest { /// denoms is the specific denoms you want look up. Leave empty to get all entries. #[prost(string, repeated, tag = "1")] pub denoms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// pagination defines an optional pagination for the request. This field is - /// only read if the denoms field is empty. + /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "99")] pub pagination: ::core::option::Option, } @@ -881,8 +732,7 @@ pub struct QuerySendEnabledRequest { pub struct QuerySendEnabledResponse { #[prost(message, repeated, tag = "1")] pub send_enabled: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. This field is only - /// populated if the denoms field in the request is empty. + /// pagination defines the pagination in the response. #[prost(message, optional, tag = "99")] pub pagination: ::core::option::Option, } @@ -935,8 +785,6 @@ pub struct MsgSendResponse {} )] #[proto_message(type_url = "/cosmos.bank.v1beta1.MsgMultiSend")] pub struct MsgMultiSend { - /// Inputs, despite being `repeated`, only allows one sender input. This is - /// checked in MsgMultiSend's ValidateBasic. #[prost(message, repeated, tag = "1")] pub inputs: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag = "2")] @@ -956,98 +804,7 @@ pub struct MsgMultiSend { )] #[proto_message(type_url = "/cosmos.bank.v1beta1.MsgMultiSendResponse")] pub struct MsgMultiSendResponse {} -/// MsgUpdateParams is the Msg/UpdateParams request type. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.bank.v1beta1.MsgUpdateParams")] -pub struct MsgUpdateParams { - /// authority is the address that controls the module (defaults to x/gov unless overwritten). - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// params defines the x/bank parameters to update. - /// - /// NOTE: All parameters must be supplied. - #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, -} -/// MsgUpdateParamsResponse defines the response structure for executing a -/// MsgUpdateParams message. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.bank.v1beta1.MsgUpdateParamsResponse")] -pub struct MsgUpdateParamsResponse {} -/// MsgSetSendEnabled is the Msg/SetSendEnabled request type. -/// -/// Only entries to add/update/delete need to be included. -/// Existing SendEnabled entries that are not included in this -/// message are left unchanged. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.bank.v1beta1.MsgSetSendEnabled")] -pub struct MsgSetSendEnabled { - /// authority is the address that controls the module. - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// send_enabled is the list of entries to add or update. - #[prost(message, repeated, tag = "2")] - pub send_enabled: ::prost::alloc::vec::Vec, - /// use_default_for is a list of denoms that should use the params.default_send_enabled value. - /// Denoms listed here will have their SendEnabled entries deleted. - /// If a denom is included that doesn't have a SendEnabled entry, - /// it will be ignored. - #[prost(string, repeated, tag = "3")] - pub use_default_for: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.bank.v1beta1.MsgSetSendEnabledResponse")] -pub struct MsgSetSendEnabledResponse {} -/// MsgUpdateDenomMetadata defines the Msg/UpdateDenomMetadata request type. +/// MsgUpdateDenomMetadata represents a message to update denom metadata #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1102,12 +859,10 @@ impl<'a, Q: cosmwasm_std::CustomQuery> BankQuerier<'a, Q> { &self, address: ::prost::alloc::string::String, pagination: ::core::option::Option, - resolve_denom: bool, ) -> Result { QueryAllBalancesRequest { address, pagination, - resolve_denom, } .query(self.querier) } @@ -1122,13 +877,6 @@ impl<'a, Q: cosmwasm_std::CustomQuery> BankQuerier<'a, Q> { } .query(self.querier) } - pub fn spendable_balance_by_denom( - &self, - address: ::prost::alloc::string::String, - denom: ::prost::alloc::string::String, - ) -> Result { - QuerySpendableBalanceByDenomRequest { address, denom }.query(self.querier) - } pub fn total_supply( &self, pagination: ::core::option::Option, @@ -1150,12 +898,6 @@ impl<'a, Q: cosmwasm_std::CustomQuery> BankQuerier<'a, Q> { ) -> Result { QueryDenomMetadataRequest { denom }.query(self.querier) } - pub fn denom_metadata_by_query_string( - &self, - denom: ::prost::alloc::string::String, - ) -> Result { - QueryDenomMetadataByQueryStringRequest { denom }.query(self.querier) - } pub fn denoms_metadata( &self, pagination: ::core::option::Option, @@ -1169,13 +911,6 @@ impl<'a, Q: cosmwasm_std::CustomQuery> BankQuerier<'a, Q> { ) -> Result { QueryDenomOwnersRequest { denom, pagination }.query(self.querier) } - pub fn denom_owners_by_query( - &self, - denom: ::prost::alloc::string::String, - pagination: ::core::option::Option, - ) -> Result { - QueryDenomOwnersByQueryRequest { denom, pagination }.query(self.querier) - } pub fn send_enabled( &self, denoms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, diff --git a/packages/provwasm-std/src/types/cosmos/base/abci/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/base/abci/v1beta1.rs index ee944c2e..98722380 100644 --- a/packages/provwasm-std/src/types/cosmos/base/abci/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/base/abci/v1beta1.rs @@ -327,56 +327,3 @@ pub struct SearchTxsResult { #[prost(message, repeated, tag = "6")] pub txs: ::prost::alloc::vec::Vec, } -/// SearchBlocksResult defines a structure for querying blocks pageable -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.base.abci.v1beta1.SearchBlocksResult")] -pub struct SearchBlocksResult { - /// Count of all blocks - #[prost(int64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub total_count: i64, - /// Count of blocks in current page - #[prost(int64, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub count: i64, - /// Index of current page, start from 1 - #[prost(int64, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub page_number: i64, - /// Count of total pages - #[prost(int64, tag = "4")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub page_total: i64, - /// Max count blocks per page - #[prost(int64, tag = "5")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub limit: i64, - /// List of blocks in current page - #[prost(message, repeated, tag = "6")] - pub blocks: ::prost::alloc::vec::Vec, -} diff --git a/packages/provwasm-std/src/types/cosmos/store/internal/kv/mod.rs b/packages/provwasm-std/src/types/cosmos/base/kv/mod.rs similarity index 100% rename from packages/provwasm-std/src/types/cosmos/store/internal/kv/mod.rs rename to packages/provwasm-std/src/types/cosmos/base/kv/mod.rs diff --git a/packages/provwasm-std/src/types/cosmos/store/internal/kv/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/base/kv/v1beta1.rs similarity index 89% rename from packages/provwasm-std/src/types/cosmos/store/internal/kv/v1beta1.rs rename to packages/provwasm-std/src/types/cosmos/base/kv/v1beta1.rs index 0d4c20e2..105c0b73 100644 --- a/packages/provwasm-std/src/types/cosmos/store/internal/kv/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/base/kv/v1beta1.rs @@ -11,7 +11,7 @@ use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.store.internal.kv.v1beta1.Pairs")] +#[proto_message(type_url = "/cosmos.base.kv.v1beta1.Pairs")] pub struct Pairs { #[prost(message, repeated, tag = "1")] pub pairs: ::prost::alloc::vec::Vec, @@ -28,7 +28,7 @@ pub struct Pairs { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.store.internal.kv.v1beta1.Pair")] +#[proto_message(type_url = "/cosmos.base.kv.v1beta1.Pair")] pub struct Pair { #[prost(bytes = "vec", tag = "1")] #[serde( diff --git a/packages/provwasm-std/src/types/cosmos/base/mod.rs b/packages/provwasm-std/src/types/cosmos/base/mod.rs index ff4a21a7..0e9dc5a8 100644 --- a/packages/provwasm-std/src/types/cosmos/base/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/base/mod.rs @@ -1,5 +1,8 @@ pub mod abci; +pub mod kv; pub mod node; pub mod query; +pub mod snapshots; +pub mod store; pub mod tendermint; pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/base/node/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/base/node/v1beta1.rs index 3a771ea1..a79a2f07 100644 --- a/packages/provwasm-std/src/types/cosmos/base/node/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/base/node/v1beta1.rs @@ -29,74 +29,4 @@ pub struct ConfigRequest {} pub struct ConfigResponse { #[prost(string, tag = "1")] pub minimum_gas_price: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub pruning_keep_recent: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub pruning_interval: ::prost::alloc::string::String, - #[prost(uint64, tag = "4")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub halt_height: u64, -} -/// StateRequest defines the request structure for the status of a node. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.base.node.v1beta1.StatusRequest")] -pub struct StatusRequest {} -/// StateResponse defines the response structure for the status of a node. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.base.node.v1beta1.StatusResponse")] -pub struct StatusResponse { - /// earliest block height available in the store - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub earliest_store_height: u64, - /// current block height - #[prost(uint64, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub height: u64, - /// block height timestamp - #[prost(message, optional, tag = "3")] - pub timestamp: ::core::option::Option, - /// app hash of the current block - #[prost(bytes = "vec", tag = "4")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub app_hash: ::prost::alloc::vec::Vec, - /// validator hash provided by the consensus header - #[prost(bytes = "vec", tag = "5")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub validator_hash: ::prost::alloc::vec::Vec, } diff --git a/packages/provwasm-std/src/types/cosmos/base/snapshots/mod.rs b/packages/provwasm-std/src/types/cosmos/base/snapshots/mod.rs new file mode 100644 index 00000000..9f64fc82 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/base/snapshots/mod.rs @@ -0,0 +1 @@ +pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/store/snapshots/v1.rs b/packages/provwasm-std/src/types/cosmos/base/snapshots/v1beta1.rs similarity index 70% rename from packages/provwasm-std/src/types/cosmos/store/snapshots/v1.rs rename to packages/provwasm-std/src/types/cosmos/base/snapshots/v1beta1.rs index 998e61e7..1e21429a 100644 --- a/packages/provwasm-std/src/types/cosmos/store/snapshots/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/base/snapshots/v1beta1.rs @@ -11,7 +11,7 @@ use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.store.snapshots.v1.Snapshot")] +#[proto_message(type_url = "/cosmos.base.snapshots.v1beta1.Snapshot")] pub struct Snapshot { #[prost(uint64, tag = "1")] #[serde( @@ -44,7 +44,7 @@ pub struct Snapshot { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.store.snapshots.v1.Metadata")] +#[proto_message(type_url = "/cosmos.base.snapshots.v1beta1.Metadata")] pub struct Metadata { /// SHA-256 chunk hashes #[prost(bytes = "vec", repeated, tag = "1")] @@ -64,10 +64,10 @@ pub struct Metadata { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.store.snapshots.v1.SnapshotItem")] +#[proto_message(type_url = "/cosmos.base.snapshots.v1beta1.SnapshotItem")] pub struct SnapshotItem { /// item is the specific type of snapshot item. - #[prost(oneof = "snapshot_item::Item", tags = "1, 2, 3, 4")] + #[prost(oneof = "snapshot_item::Item", tags = "1, 2, 3, 4, 5, 6")] pub item: ::core::option::Option, } /// Nested message and enum types in `SnapshotItem`. @@ -93,6 +93,10 @@ pub mod snapshot_item { Extension(super::SnapshotExtensionMeta), #[prost(message, tag = "4")] ExtensionPayload(super::SnapshotExtensionPayload), + #[prost(message, tag = "5")] + Kv(super::SnapshotKvItem), + #[prost(message, tag = "6")] + Schema(super::SnapshotSchema), } } /// SnapshotStoreItem contains metadata about a snapshotted store. @@ -109,7 +113,7 @@ pub mod snapshot_item { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.store.snapshots.v1.SnapshotStoreItem")] +#[proto_message(type_url = "/cosmos.base.snapshots.v1beta1.SnapshotStoreItem")] pub struct SnapshotStoreItem { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, @@ -128,7 +132,7 @@ pub struct SnapshotStoreItem { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.store.snapshots.v1.SnapshotIAVLItem")] +#[proto_message(type_url = "/cosmos.base.snapshots.v1beta1.SnapshotIAVLItem")] pub struct SnapshotIavlItem { #[prost(bytes = "vec", tag = "1")] #[serde( @@ -167,7 +171,7 @@ pub struct SnapshotIavlItem { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.store.snapshots.v1.SnapshotExtensionMeta")] +#[proto_message(type_url = "/cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta")] pub struct SnapshotExtensionMeta { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, @@ -188,7 +192,7 @@ pub struct SnapshotExtensionMeta { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.store.snapshots.v1.SnapshotExtensionPayload")] +#[proto_message(type_url = "/cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload")] pub struct SnapshotExtensionPayload { #[prost(bytes = "vec", tag = "1")] #[serde( @@ -197,3 +201,51 @@ pub struct SnapshotExtensionPayload { )] pub payload: ::prost::alloc::vec::Vec, } +/// SnapshotKVItem is an exported Key/Value Pair +/// +/// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmos.base.snapshots.v1beta1.SnapshotKVItem")] +pub struct SnapshotKvItem { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub key: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub value: ::prost::alloc::vec::Vec, +} +/// SnapshotSchema is an exported schema of smt store +/// +/// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmos.base.snapshots.v1beta1.SnapshotSchema")] +pub struct SnapshotSchema { + #[prost(bytes = "vec", repeated, tag = "1")] + pub keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} diff --git a/packages/provwasm-std/src/types/cosmos/base/store/mod.rs b/packages/provwasm-std/src/types/cosmos/base/store/mod.rs new file mode 100644 index 00000000..9f64fc82 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/base/store/mod.rs @@ -0,0 +1 @@ +pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/store/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/base/store/v1beta1.rs similarity index 62% rename from packages/provwasm-std/src/types/cosmos/store/v1beta1.rs rename to packages/provwasm-std/src/types/cosmos/base/store/v1beta1.rs index c014842b..84afbb20 100644 --- a/packages/provwasm-std/src/types/cosmos/store/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/base/store/v1beta1.rs @@ -1,9 +1,6 @@ use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes) -/// It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and -/// Deletes -/// -/// Since: cosmos-sdk 0.43 +/// CommitInfo defines commit information used by the multi-store when committing +/// a version/height. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -15,29 +12,19 @@ use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.store.v1beta1.StoreKVPair")] -pub struct StoreKvPair { - /// the store key for the KVStore this pair originates from - #[prost(string, tag = "1")] - pub store_key: ::prost::alloc::string::String, - /// true indicates a delete operation, false indicates a set operation - #[prost(bool, tag = "2")] - pub delete: bool, - #[prost(bytes = "vec", tag = "3")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub key: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "4")] +#[proto_message(type_url = "/cosmos.base.store.v1beta1.CommitInfo")] +pub struct CommitInfo { + #[prost(int64, tag = "1")] #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" )] - pub value: ::prost::alloc::vec::Vec, + pub version: i64, + #[prost(message, repeated, tag = "2")] + pub store_infos: ::prost::alloc::vec::Vec, } -/// BlockMetadata contains all the abci event data of a block -/// the file streamer dump them into files together with the state changes. +/// StoreInfo defines store-specific commit information. It contains a reference +/// between a store name and the commit ID. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -49,21 +36,15 @@ pub struct StoreKvPair { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.store.v1beta1.BlockMetadata")] -pub struct BlockMetadata { - #[prost(message, optional, tag = "6")] - pub response_commit: - ::core::option::Option, - #[prost(message, optional, tag = "7")] - pub request_finalize_block: - ::core::option::Option, - /// TODO: should we renumber this? - #[prost(message, optional, tag = "8")] - pub response_finalize_block: - ::core::option::Option, +#[proto_message(type_url = "/cosmos.base.store.v1beta1.StoreInfo")] +pub struct StoreInfo { + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub commit_id: ::core::option::Option, } -/// CommitInfo defines commit information used by the multi-store when committing -/// a version/height. +/// CommitID defines the committment information when a specific store is +/// committed. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -75,21 +56,26 @@ pub struct BlockMetadata { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.store.v1beta1.CommitInfo")] -pub struct CommitInfo { +#[proto_message(type_url = "/cosmos.base.store.v1beta1.CommitID")] +pub struct CommitId { #[prost(int64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub version: i64, - #[prost(message, repeated, tag = "2")] - pub store_infos: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "3")] - pub timestamp: ::core::option::Option, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub hash: ::prost::alloc::vec::Vec, } -/// StoreInfo defines store-specific commit information. It contains a reference -/// between a store name and the commit ID. +/// StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes) +/// It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and +/// Deletes +/// +/// Since: cosmos-sdk 0.43 #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -101,15 +87,29 @@ pub struct CommitInfo { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.store.v1beta1.StoreInfo")] -pub struct StoreInfo { +#[proto_message(type_url = "/cosmos.base.store.v1beta1.StoreKVPair")] +pub struct StoreKvPair { + /// the store key for the KVStore this pair originates from #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub commit_id: ::core::option::Option, + pub store_key: ::prost::alloc::string::String, + /// true indicates a delete operation, false indicates a set operation + #[prost(bool, tag = "2")] + pub delete: bool, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub key: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub value: ::prost::alloc::vec::Vec, } -/// CommitID defines the commitment information when a specific store is -/// committed. +/// BlockMetadata contains all the abci event data of a block +/// the file streamer dump them into files together with the state changes. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -121,18 +121,50 @@ pub struct StoreInfo { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.store.v1beta1.CommitID")] -pub struct CommitId { - #[prost(int64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub version: i64, - #[prost(bytes = "vec", tag = "2")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" +#[proto_message(type_url = "/cosmos.base.store.v1beta1.BlockMetadata")] +pub struct BlockMetadata { + #[prost(message, optional, tag = "1")] + pub request_begin_block: + ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub response_begin_block: + ::core::option::Option, + #[prost(message, repeated, tag = "3")] + pub deliver_txs: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "4")] + pub request_end_block: + ::core::option::Option, + #[prost(message, optional, tag = "5")] + pub response_end_block: + ::core::option::Option, + #[prost(message, optional, tag = "6")] + pub response_commit: + ::core::option::Option, +} +/// Nested message and enum types in `BlockMetadata`. +pub mod block_metadata { + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + /// DeliverTx encapulate deliver tx request and response. + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, )] - pub hash: ::prost::alloc::vec::Vec, + #[proto_message(type_url = "/cosmos.base.store.v1beta1.BlockMetadata.DeliverTx")] + pub struct DeliverTx { + #[prost(message, optional, tag = "1")] + pub request: ::core::option::Option< + super::super::super::super::super::tendermint::abci::RequestDeliverTx, + >, + #[prost(message, optional, tag = "2")] + pub response: ::core::option::Option< + super::super::super::super::super::tendermint::abci::ResponseDeliverTx, + >, + } } diff --git a/packages/provwasm-std/src/types/cosmos/base/tendermint/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/base/tendermint/v1beta1.rs index f83ad479..02dbf536 100644 --- a/packages/provwasm-std/src/types/cosmos/base/tendermint/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/base/tendermint/v1beta1.rs @@ -125,7 +125,8 @@ pub struct Header { #[prost(string, tag = "14")] pub proposer_address: ::prost::alloc::string::String, } -/// GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. +/// GetValidatorSetByHeightRequest is the request type for the +/// Query/GetValidatorSetByHeight RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -149,7 +150,8 @@ pub struct GetValidatorSetByHeightRequest { #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } -/// GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. +/// GetValidatorSetByHeightResponse is the response type for the +/// Query/GetValidatorSetByHeight RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -175,7 +177,8 @@ pub struct GetValidatorSetByHeightResponse { #[prost(message, optional, tag = "3")] pub pagination: ::core::option::Option, } -/// GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. +/// GetLatestValidatorSetRequest is the request type for the +/// Query/GetValidatorSetByHeight RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -193,7 +196,8 @@ pub struct GetLatestValidatorSetRequest { #[prost(message, optional, tag = "1")] pub pagination: ::core::option::Option, } -/// GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. +/// GetLatestValidatorSetResponse is the response type for the +/// Query/GetValidatorSetByHeight RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -250,7 +254,8 @@ pub struct Validator { )] pub proposer_priority: i64, } -/// GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. +/// GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight +/// RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -271,7 +276,8 @@ pub struct GetBlockByHeightRequest { )] pub height: i64, } -/// GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. +/// GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight +/// RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -294,7 +300,8 @@ pub struct GetBlockByHeightResponse { #[prost(message, optional, tag = "3")] pub sdk_block: ::core::option::Option, } -/// GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. +/// GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC +/// method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -308,7 +315,8 @@ pub struct GetBlockByHeightResponse { )] #[proto_message(type_url = "/cosmos.base.tendermint.v1beta1.GetLatestBlockRequest")] pub struct GetLatestBlockRequest {} -/// GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. +/// GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC +/// method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -376,7 +384,8 @@ pub struct GetSyncingResponse { )] #[proto_message(type_url = "/cosmos.base.tendermint.v1beta1.GetNodeInfoRequest")] pub struct GetNodeInfoRequest {} -/// GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. +/// GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC +/// method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -483,7 +492,8 @@ pub struct AbciQueryRequest { #[prost(bool, tag = "4")] pub prove: bool, } -/// ABCIQueryResponse defines the response structure for the ABCIQuery gRPC query. +/// ABCIQueryResponse defines the response structure for the ABCIQuery gRPC +/// query. /// /// Note: This type is a duplicate of the ResponseQuery proto type defined in /// Tendermint. @@ -538,10 +548,11 @@ pub struct AbciQueryResponse { pub codespace: ::prost::alloc::string::String, } /// ProofOp defines an operation used for calculating Merkle root. The data could -/// be arbitrary format, providing necessary data for example neighbouring node +/// be arbitrary format, providing nessecary data for example neighbouring node /// hash. /// -/// Note: This type is a duplicate of the ProofOp proto type defined in Tendermint. +/// Note: This type is a duplicate of the ProofOp proto type defined in +/// Tendermint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -572,7 +583,8 @@ pub struct ProofOp { } /// ProofOps is Merkle proof defined by the list of ProofOps. /// -/// Note: This type is a duplicate of the ProofOps proto type defined in Tendermint. +/// Note: This type is a duplicate of the ProofOps proto type defined in +/// Tendermint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, diff --git a/packages/provwasm-std/src/types/cosmos/base/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/base/v1beta1.rs index e55eb27e..3d048c01 100644 --- a/packages/provwasm-std/src/types/cosmos/base/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/base/v1beta1.rs @@ -44,7 +44,6 @@ pub struct DecCoin { pub amount: ::prost::alloc::string::String, } /// IntProto defines a Protobuf wrapper around an Int object. -/// Deprecated: Prefer to use math.Int directly. It supports binary Marshal and Unmarshal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -62,7 +61,6 @@ pub struct IntProto { pub int: ::prost::alloc::string::String, } /// DecProto defines a Protobuf wrapper around a Dec object. -/// Deprecated: Prefer to use math.LegacyDec directly. It supports binary Marshal and Unmarshal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, diff --git a/packages/provwasm-std/src/types/cosmos/capability/mod.rs b/packages/provwasm-std/src/types/cosmos/capability/mod.rs new file mode 100644 index 00000000..9f64fc82 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/capability/mod.rs @@ -0,0 +1 @@ +pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/capability/v1.rs b/packages/provwasm-std/src/types/cosmos/capability/v1beta1.rs similarity index 89% rename from packages/provwasm-std/src/types/capability/v1.rs rename to packages/provwasm-std/src/types/cosmos/capability/v1beta1.rs index fd7410e0..39e59ad5 100644 --- a/packages/provwasm-std/src/types/capability/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/capability/v1beta1.rs @@ -12,7 +12,7 @@ use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/capability.v1.Capability")] +#[proto_message(type_url = "/cosmos.capability.v1beta1.Capability")] pub struct Capability { #[prost(uint64, tag = "1")] #[serde( @@ -34,7 +34,7 @@ pub struct Capability { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/capability.v1.Owner")] +#[proto_message(type_url = "/cosmos.capability.v1beta1.Owner")] pub struct Owner { #[prost(string, tag = "1")] pub module: ::prost::alloc::string::String, @@ -54,7 +54,7 @@ pub struct Owner { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/capability.v1.CapabilityOwners")] +#[proto_message(type_url = "/cosmos.capability.v1beta1.CapabilityOwners")] pub struct CapabilityOwners { #[prost(message, repeated, tag = "1")] pub owners: ::prost::alloc::vec::Vec, @@ -71,7 +71,7 @@ pub struct CapabilityOwners { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/capability.v1.GenesisOwners")] +#[proto_message(type_url = "/cosmos.capability.v1beta1.GenesisOwners")] pub struct GenesisOwners { /// index is the index of the capability owner. #[prost(uint64, tag = "1")] @@ -96,7 +96,7 @@ pub struct GenesisOwners { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/capability.v1.GenesisState")] +#[proto_message(type_url = "/cosmos.capability.v1beta1.GenesisState")] pub struct GenesisState { /// index is the capability global index. #[prost(uint64, tag = "1")] diff --git a/packages/provwasm-std/src/types/cosmos/circuit/mod.rs b/packages/provwasm-std/src/types/cosmos/circuit/mod.rs deleted file mode 100644 index a8429e39..00000000 --- a/packages/provwasm-std/src/types/cosmos/circuit/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod module; -pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/circuit/module/mod.rs b/packages/provwasm-std/src/types/cosmos/circuit/module/mod.rs deleted file mode 100644 index a3a6d96c..00000000 --- a/packages/provwasm-std/src/types/cosmos/circuit/module/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/circuit/module/v1.rs b/packages/provwasm-std/src/types/cosmos/circuit/module/v1.rs deleted file mode 100644 index a83115c6..00000000 --- a/packages/provwasm-std/src/types/cosmos/circuit/module/v1.rs +++ /dev/null @@ -1,19 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// Module is the config object of the circuit module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.circuit.module.v1.Module")] -pub struct Module { - /// authority defines the custom module authority. If not set, defaults to the governance module. - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, -} diff --git a/packages/provwasm-std/src/types/cosmos/circuit/v1.rs b/packages/provwasm-std/src/types/cosmos/circuit/v1.rs deleted file mode 100644 index 6a4614ef..00000000 --- a/packages/provwasm-std/src/types/cosmos/circuit/v1.rs +++ /dev/null @@ -1,379 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// Permissions are the permissions that an account has to trip -/// or reset the circuit breaker. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.circuit.v1.Permissions")] -pub struct Permissions { - /// level is the level of permissions granted to this account. - #[prost(enumeration = "permissions::Level", tag = "1")] - #[serde( - serialize_with = "permissions::Level::serialize", - deserialize_with = "permissions::Level::deserialize" - )] - pub level: i32, - /// limit_type_urls is used with LEVEL_SOME_MSGS to limit the lists of Msg type - /// URLs that the account can trip. It is an error to use limit_type_urls with - /// a level other than LEVEL_SOME_MSGS. - #[prost(string, repeated, tag = "2")] - pub limit_type_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// Nested message and enum types in `Permissions`. -pub mod permissions { - use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; - /// Level is the permission level. - #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] - #[repr(i32)] - #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] - pub enum Level { - /// LEVEL_NONE_UNSPECIFIED indicates that the account will have no circuit - /// breaker permissions. - NoneUnspecified = 0, - /// LEVEL_SOME_MSGS indicates that the account will have permission to - /// trip or reset the circuit breaker for some Msg type URLs. If this level - /// is chosen, a non-empty list of Msg type URLs must be provided in - /// limit_type_urls. - SomeMsgs = 1, - /// LEVEL_ALL_MSGS indicates that the account can trip or reset the circuit - /// breaker for Msg's of all type URLs. - AllMsgs = 2, - /// LEVEL_SUPER_ADMIN indicates that the account can take all circuit breaker - /// actions and can grant permissions to other accounts. - SuperAdmin = 3, - } - impl Level { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Level::NoneUnspecified => "LEVEL_NONE_UNSPECIFIED", - Level::SomeMsgs => "LEVEL_SOME_MSGS", - Level::AllMsgs => "LEVEL_ALL_MSGS", - Level::SuperAdmin => "LEVEL_SUPER_ADMIN", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "LEVEL_NONE_UNSPECIFIED" => Some(Self::NoneUnspecified), - "LEVEL_SOME_MSGS" => Some(Self::SomeMsgs), - "LEVEL_ALL_MSGS" => Some(Self::AllMsgs), - "LEVEL_SUPER_ADMIN" => Some(Self::SuperAdmin), - _ => None, - } - } - } -} -/// GenesisAccountPermissions is the account permissions for the circuit breaker in genesis -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.circuit.v1.GenesisAccountPermissions")] -pub struct GenesisAccountPermissions { - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub permissions: ::core::option::Option, -} -/// GenesisState is the state that must be provided at genesis. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.circuit.v1.GenesisState")] -pub struct GenesisState { - #[prost(message, repeated, tag = "1")] - pub account_permissions: ::prost::alloc::vec::Vec, - #[prost(string, repeated, tag = "2")] - pub disabled_type_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// QueryAccountRequest is the request type for the Query/Account RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.circuit.v1.QueryAccountRequest")] -#[proto_query( - path = "/cosmos.circuit.v1.Query/Account", - response_type = AccountResponse -)] -pub struct QueryAccountRequest { - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, -} -/// AccountResponse is the response type for the Query/Account RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.circuit.v1.AccountResponse")] -pub struct AccountResponse { - #[prost(message, optional, tag = "1")] - pub permission: ::core::option::Option, -} -/// QueryAccountsRequest is the request type for the Query/Accounts RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.circuit.v1.QueryAccountsRequest")] -#[proto_query( - path = "/cosmos.circuit.v1.Query/Accounts", - response_type = AccountsResponse -)] -pub struct QueryAccountsRequest { - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "1")] - pub pagination: ::core::option::Option, -} -/// AccountsResponse is the response type for the Query/Accounts RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.circuit.v1.AccountsResponse")] -pub struct AccountsResponse { - #[prost(message, repeated, tag = "1")] - pub accounts: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option, -} -/// QueryDisableListRequest is the request type for the Query/DisabledList RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.circuit.v1.QueryDisabledListRequest")] -#[proto_query( - path = "/cosmos.circuit.v1.Query/DisabledList", - response_type = DisabledListResponse -)] -pub struct QueryDisabledListRequest {} -/// DisabledListResponse is the response type for the Query/DisabledList RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.circuit.v1.DisabledListResponse")] -pub struct DisabledListResponse { - #[prost(string, repeated, tag = "1")] - pub disabled_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// MsgAuthorizeCircuitBreaker defines the Msg/AuthorizeCircuitBreaker request type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.circuit.v1.MsgAuthorizeCircuitBreaker")] -pub struct MsgAuthorizeCircuitBreaker { - /// granter is the granter of the circuit breaker permissions and must have - /// LEVEL_SUPER_ADMIN. - #[prost(string, tag = "1")] - pub granter: ::prost::alloc::string::String, - /// grantee is the account authorized with the provided permissions. - #[prost(string, tag = "2")] - pub grantee: ::prost::alloc::string::String, - /// permissions are the circuit breaker permissions that the grantee receives. - /// These will overwrite any existing permissions. LEVEL_NONE_UNSPECIFIED can - /// be specified to revoke all permissions. - #[prost(message, optional, tag = "3")] - pub permissions: ::core::option::Option, -} -/// MsgAuthorizeCircuitBreakerResponse defines the Msg/AuthorizeCircuitBreaker response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.circuit.v1.MsgAuthorizeCircuitBreakerResponse")] -pub struct MsgAuthorizeCircuitBreakerResponse { - #[prost(bool, tag = "1")] - pub success: bool, -} -/// MsgTripCircuitBreaker defines the Msg/TripCircuitBreaker request type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.circuit.v1.MsgTripCircuitBreaker")] -pub struct MsgTripCircuitBreaker { - /// authority is the account authorized to trip the circuit breaker. - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// msg_type_urls specifies a list of type URLs to immediately stop processing. - /// IF IT IS LEFT EMPTY, ALL MSG PROCESSING WILL STOP IMMEDIATELY. - /// This value is validated against the authority's permissions and if the - /// authority does not have permissions to trip the specified msg type URLs - /// (or all URLs), the operation will fail. - #[prost(string, repeated, tag = "2")] - pub msg_type_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// MsgTripCircuitBreakerResponse defines the Msg/TripCircuitBreaker response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.circuit.v1.MsgTripCircuitBreakerResponse")] -pub struct MsgTripCircuitBreakerResponse { - #[prost(bool, tag = "1")] - pub success: bool, -} -/// MsgResetCircuitBreaker defines the Msg/ResetCircuitBreaker request type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.circuit.v1.MsgResetCircuitBreaker")] -pub struct MsgResetCircuitBreaker { - /// authority is the account authorized to trip or reset the circuit breaker. - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// msg_type_urls specifies a list of Msg type URLs to resume processing. If - /// it is left empty all Msg processing for type URLs that the account is - /// authorized to trip will resume. - #[prost(string, repeated, tag = "3")] - pub msg_type_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// MsgResetCircuitBreakerResponse defines the Msg/ResetCircuitBreaker response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.circuit.v1.MsgResetCircuitBreakerResponse")] -pub struct MsgResetCircuitBreakerResponse { - #[prost(bool, tag = "1")] - pub success: bool, -} -pub struct CircuitQuerier<'a, Q: cosmwasm_std::CustomQuery> { - querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, -} -impl<'a, Q: cosmwasm_std::CustomQuery> CircuitQuerier<'a, Q> { - pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { - Self { querier } - } - pub fn account( - &self, - address: ::prost::alloc::string::String, - ) -> Result { - QueryAccountRequest { address }.query(self.querier) - } - pub fn accounts( - &self, - pagination: ::core::option::Option, - ) -> Result { - QueryAccountsRequest { pagination }.query(self.querier) - } - pub fn disabled_list(&self) -> Result { - QueryDisabledListRequest {}.query(self.querier) - } -} diff --git a/packages/provwasm-std/src/types/cosmos/consensus/mod.rs b/packages/provwasm-std/src/types/cosmos/consensus/mod.rs deleted file mode 100644 index a8429e39..00000000 --- a/packages/provwasm-std/src/types/cosmos/consensus/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod module; -pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/consensus/module/mod.rs b/packages/provwasm-std/src/types/cosmos/consensus/module/mod.rs deleted file mode 100644 index a3a6d96c..00000000 --- a/packages/provwasm-std/src/types/cosmos/consensus/module/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/consensus/module/v1.rs b/packages/provwasm-std/src/types/cosmos/consensus/module/v1.rs deleted file mode 100644 index 8f11ca53..00000000 --- a/packages/provwasm-std/src/types/cosmos/consensus/module/v1.rs +++ /dev/null @@ -1,19 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// Module is the config object of the consensus module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.consensus.module.v1.Module")] -pub struct Module { - /// authority defines the custom module authority. If not set, defaults to the governance module. - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, -} diff --git a/packages/provwasm-std/src/types/cosmos/consensus/v1.rs b/packages/provwasm-std/src/types/cosmos/consensus/v1.rs deleted file mode 100644 index e2a5aec1..00000000 --- a/packages/provwasm-std/src/types/cosmos/consensus/v1.rs +++ /dev/null @@ -1,97 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// QueryParamsRequest defines the request type for querying x/consensus parameters. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.consensus.v1.QueryParamsRequest")] -#[proto_query( - path = "/cosmos.consensus.v1.Query/Params", - response_type = QueryParamsResponse -)] -pub struct QueryParamsRequest {} -/// QueryParamsResponse defines the response type for querying x/consensus parameters. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.consensus.v1.QueryParamsResponse")] -pub struct QueryParamsResponse { - /// params are the tendermint consensus params stored in the consensus module. - /// Please note that `params.version` is not populated in this response, it is - /// tracked separately in the x/upgrade module. - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, -} -/// MsgUpdateParams is the Msg/UpdateParams request type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.consensus.v1.MsgUpdateParams")] -pub struct MsgUpdateParams { - /// authority is the address that controls the module (defaults to x/gov unless overwritten). - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// params defines the x/consensus parameters to update. - /// VersionsParams is not included in this Msg because it is tracked - /// separarately in x/upgrade. - /// - /// NOTE: All parameters must be supplied. - #[prost(message, optional, tag = "2")] - pub block: ::core::option::Option, - #[prost(message, optional, tag = "3")] - pub evidence: ::core::option::Option, - #[prost(message, optional, tag = "4")] - pub validator: ::core::option::Option, - /// Since: cosmos-sdk 0.50 - #[prost(message, optional, tag = "5")] - pub abci: ::core::option::Option, -} -/// MsgUpdateParamsResponse defines the response structure for executing a -/// MsgUpdateParams message. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.consensus.v1.MsgUpdateParamsResponse")] -pub struct MsgUpdateParamsResponse {} -pub struct ConsensusQuerier<'a, Q: cosmwasm_std::CustomQuery> { - querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, -} -impl<'a, Q: cosmwasm_std::CustomQuery> ConsensusQuerier<'a, Q> { - pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { - Self { querier } - } - pub fn params(&self) -> Result { - QueryParamsRequest {}.query(self.querier) - } -} diff --git a/packages/provwasm-std/src/types/cosmos/crisis/mod.rs b/packages/provwasm-std/src/types/cosmos/crisis/mod.rs index 537a3360..9f64fc82 100644 --- a/packages/provwasm-std/src/types/cosmos/crisis/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/crisis/mod.rs @@ -1,2 +1 @@ -pub mod module; pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/crisis/module/mod.rs b/packages/provwasm-std/src/types/cosmos/crisis/module/mod.rs deleted file mode 100644 index a3a6d96c..00000000 --- a/packages/provwasm-std/src/types/cosmos/crisis/module/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/crisis/module/v1.rs b/packages/provwasm-std/src/types/cosmos/crisis/module/v1.rs deleted file mode 100644 index fbbe3290..00000000 --- a/packages/provwasm-std/src/types/cosmos/crisis/module/v1.rs +++ /dev/null @@ -1,22 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// Module is the config object of the crisis module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.crisis.module.v1.Module")] -pub struct Module { - /// fee_collector_name is the name of the FeeCollector ModuleAccount. - #[prost(string, tag = "1")] - pub fee_collector_name: ::prost::alloc::string::String, - /// authority defines the custom module authority. If not set, defaults to the governance module. - #[prost(string, tag = "2")] - pub authority: ::prost::alloc::string::String, -} diff --git a/packages/provwasm-std/src/types/cosmos/crisis/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/crisis/v1beta1.rs index 1b1c8504..3d5e5688 100644 --- a/packages/provwasm-std/src/types/cosmos/crisis/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/crisis/v1beta1.rs @@ -32,13 +32,10 @@ pub struct GenesisState { )] #[proto_message(type_url = "/cosmos.crisis.v1beta1.MsgVerifyInvariant")] pub struct MsgVerifyInvariant { - /// sender is the account address of private key to send coins to fee collector account. #[prost(string, tag = "1")] pub sender: ::prost::alloc::string::String, - /// name of the invariant module. #[prost(string, tag = "2")] pub invariant_module_name: ::prost::alloc::string::String, - /// invariant_route is the msg's invariant route. #[prost(string, tag = "3")] pub invariant_route: ::prost::alloc::string::String, } @@ -56,43 +53,3 @@ pub struct MsgVerifyInvariant { )] #[proto_message(type_url = "/cosmos.crisis.v1beta1.MsgVerifyInvariantResponse")] pub struct MsgVerifyInvariantResponse {} -/// MsgUpdateParams is the Msg/UpdateParams request type. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.crisis.v1beta1.MsgUpdateParams")] -pub struct MsgUpdateParams { - /// authority is the address that controls the module (defaults to x/gov unless overwritten). - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// constant_fee defines the x/crisis parameter. - #[prost(message, optional, tag = "2")] - pub constant_fee: ::core::option::Option, -} -/// MsgUpdateParamsResponse defines the response structure for executing a -/// MsgUpdateParams message. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.crisis.v1beta1.MsgUpdateParamsResponse")] -pub struct MsgUpdateParamsResponse {} diff --git a/packages/provwasm-std/src/types/cosmos/crypto/ed25519.rs b/packages/provwasm-std/src/types/cosmos/crypto/ed25519.rs index 704d14ff..956c2e9b 100644 --- a/packages/provwasm-std/src/types/cosmos/crypto/ed25519.rs +++ b/packages/provwasm-std/src/types/cosmos/crypto/ed25519.rs @@ -24,7 +24,7 @@ pub struct PubKey { )] pub key: ::prost::alloc::vec::Vec, } -/// PrivKey defines a ed25519 private key. +/// Deprecated: PrivKey defines a ed25519 private key. /// NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/distribution/mod.rs b/packages/provwasm-std/src/types/cosmos/distribution/mod.rs index 537a3360..9f64fc82 100644 --- a/packages/provwasm-std/src/types/cosmos/distribution/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/distribution/mod.rs @@ -1,2 +1 @@ -pub mod module; pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/distribution/module/mod.rs b/packages/provwasm-std/src/types/cosmos/distribution/module/mod.rs deleted file mode 100644 index a3a6d96c..00000000 --- a/packages/provwasm-std/src/types/cosmos/distribution/module/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/distribution/module/v1.rs b/packages/provwasm-std/src/types/cosmos/distribution/module/v1.rs deleted file mode 100644 index e179336a..00000000 --- a/packages/provwasm-std/src/types/cosmos/distribution/module/v1.rs +++ /dev/null @@ -1,21 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// Module is the config object of the distribution module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.distribution.module.v1.Module")] -pub struct Module { - #[prost(string, tag = "1")] - pub fee_collector_name: ::prost::alloc::string::String, - /// authority defines the custom module authority. If not set, defaults to the governance module. - #[prost(string, tag = "2")] - pub authority: ::prost::alloc::string::String, -} diff --git a/packages/provwasm-std/src/types/cosmos/distribution/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/distribution/v1beta1.rs index 143c5d95..f7af60a4 100644 --- a/packages/provwasm-std/src/types/cosmos/distribution/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/distribution/v1beta1.rs @@ -15,14 +15,8 @@ use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; pub struct Params { #[prost(string, tag = "1")] pub community_tax: ::prost::alloc::string::String, - /// Deprecated: The base_proposer_reward field is deprecated and is no longer used - /// in the x/distribution module's reward mechanism. - #[deprecated] #[prost(string, tag = "2")] pub base_proposer_reward: ::prost::alloc::string::String, - /// Deprecated: The bonus_proposer_reward field is deprecated and is no longer used - /// in the x/distribution module's reward mechanism. - #[deprecated] #[prost(string, tag = "3")] pub bonus_proposer_reward: ::prost::alloc::string::String, #[prost(bool, tag = "4")] @@ -182,11 +176,6 @@ pub struct FeePool { /// CommunityPoolSpendProposal details a proposal for use of community funds, /// together with how many coins are proposed to be spent, and to which /// recipient account. -/// -/// Deprecated: Do not use. As of the Cosmos SDK release v0.47.x, there is no -/// longer a need for an explicit CommunityPoolSpendProposal. To spend community -/// pool funds, a simple MsgCommunityPoolSpend can be invoked from the x/gov -/// module via a v1 governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -199,7 +188,6 @@ pub struct FeePool { CosmwasmExt, )] #[proto_message(type_url = "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal")] -#[deprecated] pub struct CommunityPoolSpendProposal { #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, @@ -330,7 +318,7 @@ pub struct ValidatorOutstandingRewardsRecord { /// validator_address is the address of the validator. #[prost(string, tag = "1")] pub validator_address: ::prost::alloc::string::String, - /// outstanding_rewards represents the outstanding rewards of a validator. + /// outstanding_rewards represents the oustanding rewards of a validator. #[prost(message, repeated, tag = "2")] pub outstanding_rewards: ::prost::alloc::vec::Vec, } @@ -447,7 +435,7 @@ pub struct ValidatorSlashEventRecord { /// validator_address is the address of the validator. #[prost(string, tag = "1")] pub validator_address: ::prost::alloc::string::String, - /// height defines the block height at which the slash event occurred. + /// height defines the block height at which the slash event occured. #[prost(uint64, tag = "2")] #[serde( serialize_with = "crate::serde::as_str::serialize", @@ -479,7 +467,7 @@ pub struct ValidatorSlashEventRecord { )] #[proto_message(type_url = "/cosmos.distribution.v1beta1.GenesisState")] pub struct GenesisState { - /// params defines all the parameters of the module. + /// params defines all the paramaters of the module. #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, /// fee_pool defines the fee pool at genesis. @@ -494,7 +482,7 @@ pub struct GenesisState { /// fee_pool defines the outstanding rewards of all validators at genesis. #[prost(message, repeated, tag = "5")] pub outstanding_rewards: ::prost::alloc::vec::Vec, - /// fee_pool defines the accumulated commissions of all validators at genesis. + /// fee_pool defines the accumulated commisions of all validators at genesis. #[prost(message, repeated, tag = "6")] pub validator_accumulated_commissions: ::prost::alloc::vec::Vec, @@ -547,52 +535,6 @@ pub struct QueryParamsResponse { #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } -/// QueryValidatorDistributionInfoRequest is the request type for the Query/ValidatorDistributionInfo RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.distribution.v1beta1.QueryValidatorDistributionInfoRequest")] -#[proto_query( - path = "/cosmos.distribution.v1beta1.Query/ValidatorDistributionInfo", - response_type = QueryValidatorDistributionInfoResponse -)] -pub struct QueryValidatorDistributionInfoRequest { - /// validator_address defines the validator address to query for. - #[prost(string, tag = "1")] - pub validator_address: ::prost::alloc::string::String, -} -/// QueryValidatorDistributionInfoResponse is the response type for the Query/ValidatorDistributionInfo RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.distribution.v1beta1.QueryValidatorDistributionInfoResponse")] -pub struct QueryValidatorDistributionInfoResponse { - /// operator_address defines the validator operator address. - #[prost(string, tag = "1")] - pub operator_address: ::prost::alloc::string::String, - /// self_bond_rewards defines the self delegations rewards. - #[prost(message, repeated, tag = "2")] - pub self_bond_rewards: ::prost::alloc::vec::Vec, - /// commission defines the commission the validator received. - #[prost(message, repeated, tag = "3")] - pub commission: ::prost::alloc::vec::Vec, -} /// QueryValidatorOutstandingRewardsRequest is the request type for the /// Query/ValidatorOutstandingRewards RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -672,7 +614,7 @@ pub struct QueryValidatorCommissionRequest { )] #[proto_message(type_url = "/cosmos.distribution.v1beta1.QueryValidatorCommissionResponse")] pub struct QueryValidatorCommissionResponse { - /// commission defines the commission the validator received. + /// commission defines the commision the validator received. #[prost(message, optional, tag = "1")] pub commission: ::core::option::Option, } @@ -970,8 +912,7 @@ pub struct MsgSetWithdrawAddress { #[prost(string, tag = "2")] pub withdraw_address: ::prost::alloc::string::String, } -/// MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response -/// type. +/// MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1005,8 +946,7 @@ pub struct MsgWithdrawDelegatorReward { #[prost(string, tag = "2")] pub validator_address: ::prost::alloc::string::String, } -/// MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward -/// response type. +/// MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1042,8 +982,7 @@ pub struct MsgWithdrawValidatorCommission { #[prost(string, tag = "1")] pub validator_address: ::prost::alloc::string::String, } -/// MsgWithdrawValidatorCommissionResponse defines the -/// Msg/WithdrawValidatorCommission response type. +/// MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1095,132 +1034,6 @@ pub struct MsgFundCommunityPool { )] #[proto_message(type_url = "/cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse")] pub struct MsgFundCommunityPoolResponse {} -/// MsgUpdateParams is the Msg/UpdateParams request type. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.distribution.v1beta1.MsgUpdateParams")] -pub struct MsgUpdateParams { - /// authority is the address that controls the module (defaults to x/gov unless overwritten). - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// params defines the x/distribution parameters to update. - /// - /// NOTE: All parameters must be supplied. - #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, -} -/// MsgUpdateParamsResponse defines the response structure for executing a -/// MsgUpdateParams message. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.distribution.v1beta1.MsgUpdateParamsResponse")] -pub struct MsgUpdateParamsResponse {} -/// MsgCommunityPoolSpend defines a message for sending tokens from the community -/// pool to another account. This message is typically executed via a governance -/// proposal with the governance module being the executing authority. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend")] -pub struct MsgCommunityPoolSpend { - /// authority is the address that controls the module (defaults to x/gov unless overwritten). - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub recipient: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "3")] - pub amount: ::prost::alloc::vec::Vec, -} -/// MsgCommunityPoolSpendResponse defines the response to executing a -/// MsgCommunityPoolSpend message. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.distribution.v1beta1.MsgCommunityPoolSpendResponse")] -pub struct MsgCommunityPoolSpendResponse {} -/// DepositValidatorRewardsPool defines the request structure to provide -/// additional rewards to delegators from a specific validator. -/// -/// Since: cosmos-sdk 0.50 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPool")] -pub struct MsgDepositValidatorRewardsPool { - #[prost(string, tag = "1")] - pub depositor: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub validator_address: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "3")] - pub amount: ::prost::alloc::vec::Vec, -} -/// MsgDepositValidatorRewardsPoolResponse defines the response to executing a -/// MsgDepositValidatorRewardsPool message. -/// -/// Since: cosmos-sdk 0.50 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPoolResponse")] -pub struct MsgDepositValidatorRewardsPoolResponse {} pub struct DistributionQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } @@ -1231,12 +1044,6 @@ impl<'a, Q: cosmwasm_std::CustomQuery> DistributionQuerier<'a, Q> { pub fn params(&self) -> Result { QueryParamsRequest {}.query(self.querier) } - pub fn validator_distribution_info( - &self, - validator_address: ::prost::alloc::string::String, - ) -> Result { - QueryValidatorDistributionInfoRequest { validator_address }.query(self.querier) - } pub fn validator_outstanding_rewards( &self, validator_address: ::prost::alloc::string::String, diff --git a/packages/provwasm-std/src/types/cosmos/evidence/mod.rs b/packages/provwasm-std/src/types/cosmos/evidence/mod.rs index 537a3360..9f64fc82 100644 --- a/packages/provwasm-std/src/types/cosmos/evidence/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/evidence/mod.rs @@ -1,2 +1 @@ -pub mod module; pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/evidence/module/mod.rs b/packages/provwasm-std/src/types/cosmos/evidence/module/mod.rs deleted file mode 100644 index a3a6d96c..00000000 --- a/packages/provwasm-std/src/types/cosmos/evidence/module/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/evidence/module/v1.rs b/packages/provwasm-std/src/types/cosmos/evidence/module/v1.rs deleted file mode 100644 index 63a4006c..00000000 --- a/packages/provwasm-std/src/types/cosmos/evidence/module/v1.rs +++ /dev/null @@ -1,15 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// Module is the config object of the evidence module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.evidence.module.v1.Module")] -pub struct Module {} diff --git a/packages/provwasm-std/src/types/cosmos/evidence/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/evidence/v1beta1.rs index 88e3f797..4b52212c 100644 --- a/packages/provwasm-std/src/types/cosmos/evidence/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/evidence/v1beta1.rs @@ -14,24 +14,20 @@ use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; )] #[proto_message(type_url = "/cosmos.evidence.v1beta1.Equivocation")] pub struct Equivocation { - /// height is the equivocation height. #[prost(int64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub height: i64, - /// time is the equivocation time. #[prost(message, optional, tag = "2")] pub time: ::core::option::Option, - /// power is the equivocation validator power. #[prost(int64, tag = "3")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub power: i64, - /// consensus_address is the equivocation validator consensus address. #[prost(string, tag = "4")] pub consensus_address: ::prost::alloc::string::String, } @@ -72,19 +68,12 @@ pub struct GenesisState { )] pub struct QueryEvidenceRequest { /// evidence_hash defines the hash of the requested evidence. - /// Deprecated: Use hash, a HEX encoded string, instead. - #[deprecated] #[prost(bytes = "vec", tag = "1")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] pub evidence_hash: ::prost::alloc::vec::Vec, - /// hash defines the evidence hash of the requested evidence. - /// - /// Since: cosmos-sdk 0.47 - #[prost(string, tag = "2")] - pub hash: ::prost::alloc::string::String, } /// QueryEvidenceResponse is the response type for the Query/Evidence RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -164,10 +153,8 @@ pub struct QueryAllEvidenceResponse { )] #[proto_message(type_url = "/cosmos.evidence.v1beta1.MsgSubmitEvidence")] pub struct MsgSubmitEvidence { - /// submitter is the signer account address of evidence. #[prost(string, tag = "1")] pub submitter: ::prost::alloc::string::String, - /// evidence defines the evidence of misbehavior. #[prost(message, optional, tag = "2")] pub evidence: ::core::option::Option, } @@ -203,13 +190,8 @@ impl<'a, Q: cosmwasm_std::CustomQuery> EvidenceQuerier<'a, Q> { pub fn evidence( &self, evidence_hash: ::prost::alloc::vec::Vec, - hash: ::prost::alloc::string::String, ) -> Result { - QueryEvidenceRequest { - evidence_hash, - hash, - } - .query(self.querier) + QueryEvidenceRequest { evidence_hash }.query(self.querier) } pub fn all_evidence( &self, diff --git a/packages/provwasm-std/src/types/cosmos/feegrant/mod.rs b/packages/provwasm-std/src/types/cosmos/feegrant/mod.rs index 537a3360..9f64fc82 100644 --- a/packages/provwasm-std/src/types/cosmos/feegrant/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/feegrant/mod.rs @@ -1,2 +1 @@ -pub mod module; pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/feegrant/module/mod.rs b/packages/provwasm-std/src/types/cosmos/feegrant/module/mod.rs deleted file mode 100644 index a3a6d96c..00000000 --- a/packages/provwasm-std/src/types/cosmos/feegrant/module/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/feegrant/module/v1.rs b/packages/provwasm-std/src/types/cosmos/feegrant/module/v1.rs deleted file mode 100644 index 0e2e39ed..00000000 --- a/packages/provwasm-std/src/types/cosmos/feegrant/module/v1.rs +++ /dev/null @@ -1,15 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// Module is the config object of the feegrant module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.feegrant.module.v1.Module")] -pub struct Module {} diff --git a/packages/provwasm-std/src/types/cosmos/feegrant/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/feegrant/v1beta1.rs index 98904b86..f44a3e0d 100644 --- a/packages/provwasm-std/src/types/cosmos/feegrant/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/feegrant/v1beta1.rs @@ -331,42 +331,6 @@ pub struct MsgRevokeAllowance { )] #[proto_message(type_url = "/cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse")] pub struct MsgRevokeAllowanceResponse {} -/// MsgPruneAllowances prunes expired fee allowances. -/// -/// Since cosmos-sdk 0.50 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.feegrant.v1beta1.MsgPruneAllowances")] -pub struct MsgPruneAllowances { - /// pruner is the address of the user pruning expired allowances. - #[prost(string, tag = "1")] - pub pruner: ::prost::alloc::string::String, -} -/// MsgPruneAllowancesResponse defines the Msg/PruneAllowancesResponse response type. -/// -/// Since cosmos-sdk 0.50 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse")] -pub struct MsgPruneAllowancesResponse {} pub struct FeegrantQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } diff --git a/packages/provwasm-std/src/types/cosmos/genutil/mod.rs b/packages/provwasm-std/src/types/cosmos/genutil/mod.rs index 537a3360..9f64fc82 100644 --- a/packages/provwasm-std/src/types/cosmos/genutil/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/genutil/mod.rs @@ -1,2 +1 @@ -pub mod module; pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/genutil/module/mod.rs b/packages/provwasm-std/src/types/cosmos/genutil/module/mod.rs deleted file mode 100644 index a3a6d96c..00000000 --- a/packages/provwasm-std/src/types/cosmos/genutil/module/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/genutil/module/v1.rs b/packages/provwasm-std/src/types/cosmos/genutil/module/v1.rs deleted file mode 100644 index 79f46a49..00000000 --- a/packages/provwasm-std/src/types/cosmos/genutil/module/v1.rs +++ /dev/null @@ -1,15 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// Module is the config object for the genutil module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.genutil.module.v1.Module")] -pub struct Module {} diff --git a/packages/provwasm-std/src/types/cosmos/gov/mod.rs b/packages/provwasm-std/src/types/cosmos/gov/mod.rs index 316ad46f..517ec853 100644 --- a/packages/provwasm-std/src/types/cosmos/gov/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/gov/mod.rs @@ -1,3 +1,2 @@ -pub mod module; pub mod v1; pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/gov/module/mod.rs b/packages/provwasm-std/src/types/cosmos/gov/module/mod.rs deleted file mode 100644 index a3a6d96c..00000000 --- a/packages/provwasm-std/src/types/cosmos/gov/module/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/gov/module/v1.rs b/packages/provwasm-std/src/types/cosmos/gov/module/v1.rs deleted file mode 100644 index eb66e780..00000000 --- a/packages/provwasm-std/src/types/cosmos/gov/module/v1.rs +++ /dev/null @@ -1,27 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// Module is the config object of the gov module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.gov.module.v1.Module")] -pub struct Module { - /// max_metadata_len defines the maximum proposal metadata length. - /// Defaults to 255 if not explicitly set. - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub max_metadata_len: u64, - /// authority defines the custom module authority. If not set, defaults to the governance module. - #[prost(string, tag = "2")] - pub authority: ::prost::alloc::string::String, -} diff --git a/packages/provwasm-std/src/types/cosmos/gov/v1.rs b/packages/provwasm-std/src/types/cosmos/gov/v1.rs index 6608e054..adbad815 100644 --- a/packages/provwasm-std/src/types/cosmos/gov/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/gov/v1.rs @@ -13,14 +13,12 @@ use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; )] #[proto_message(type_url = "/cosmos.gov.v1.WeightedVoteOption")] pub struct WeightedVoteOption { - /// option defines the valid vote options, it must not contain duplicate vote options. #[prost(enumeration = "VoteOption", tag = "1")] #[serde( serialize_with = "VoteOption::serialize", deserialize_with = "VoteOption::deserialize" )] pub option: i32, - /// weight is the vote weight associated with the vote option. #[prost(string, tag = "2")] pub weight: ::prost::alloc::string::String, } @@ -39,17 +37,14 @@ pub struct WeightedVoteOption { )] #[proto_message(type_url = "/cosmos.gov.v1.Deposit")] pub struct Deposit { - /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub proposal_id: u64, - /// depositor defines the deposit addresses from the proposals. #[prost(string, tag = "2")] pub depositor: ::prost::alloc::string::String, - /// amount to be deposited by depositor. #[prost(message, repeated, tag = "3")] pub amount: ::prost::alloc::vec::Vec, } @@ -67,17 +62,14 @@ pub struct Deposit { )] #[proto_message(type_url = "/cosmos.gov.v1.Proposal")] pub struct Proposal { - /// id defines the unique id of the proposal. #[prost(uint64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub id: u64, - /// messages are the arbitrary messages to be executed if the proposal passes. #[prost(message, repeated, tag = "2")] pub messages: ::prost::alloc::vec::Vec, - /// status defines the proposal status. #[prost(enumeration = "ProposalStatus", tag = "3")] #[serde( serialize_with = "ProposalStatus::serialize", @@ -89,51 +81,19 @@ pub struct Proposal { /// proposal's voting period has ended. #[prost(message, optional, tag = "4")] pub final_tally_result: ::core::option::Option, - /// submit_time is the time of proposal submission. #[prost(message, optional, tag = "5")] pub submit_time: ::core::option::Option, - /// deposit_end_time is the end time for deposition. #[prost(message, optional, tag = "6")] pub deposit_end_time: ::core::option::Option, - /// total_deposit is the total deposit on the proposal. #[prost(message, repeated, tag = "7")] pub total_deposit: ::prost::alloc::vec::Vec, - /// voting_start_time is the starting time to vote on a proposal. #[prost(message, optional, tag = "8")] pub voting_start_time: ::core::option::Option, - /// voting_end_time is the end time of voting on a proposal. #[prost(message, optional, tag = "9")] pub voting_end_time: ::core::option::Option, /// metadata is any arbitrary metadata attached to the proposal. - /// the recommended format of the metadata is to be found here: - /// #[prost(string, tag = "10")] pub metadata: ::prost::alloc::string::String, - /// title is the title of the proposal - /// - /// Since: cosmos-sdk 0.47 - #[prost(string, tag = "11")] - pub title: ::prost::alloc::string::String, - /// summary is a short summary of the proposal - /// - /// Since: cosmos-sdk 0.47 - #[prost(string, tag = "12")] - pub summary: ::prost::alloc::string::String, - /// proposer is the address of the proposal sumbitter - /// - /// Since: cosmos-sdk 0.47 - #[prost(string, tag = "13")] - pub proposer: ::prost::alloc::string::String, - /// expedited defines if the proposal is expedited - /// - /// Since: cosmos-sdk 0.50 - #[prost(bool, tag = "14")] - pub expedited: bool, - /// failed_reason defines the reason why the proposal failed - /// - /// Since: cosmos-sdk 0.50 - #[prost(string, tag = "15")] - pub failed_reason: ::prost::alloc::string::String, } /// TallyResult defines a standard tally for a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] @@ -149,16 +109,12 @@ pub struct Proposal { )] #[proto_message(type_url = "/cosmos.gov.v1.TallyResult")] pub struct TallyResult { - /// yes_count is the number of yes votes on a proposal. #[prost(string, tag = "1")] pub yes_count: ::prost::alloc::string::String, - /// abstain_count is the number of abstain votes on a proposal. #[prost(string, tag = "2")] pub abstain_count: ::prost::alloc::string::String, - /// no_count is the number of no votes on a proposal. #[prost(string, tag = "3")] pub no_count: ::prost::alloc::string::String, - /// no_with_veto_count is the number of no with veto votes on a proposal. #[prost(string, tag = "4")] pub no_with_veto_count: ::prost::alloc::string::String, } @@ -177,21 +133,17 @@ pub struct TallyResult { )] #[proto_message(type_url = "/cosmos.gov.v1.Vote")] pub struct Vote { - /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub proposal_id: u64, - /// voter is the voter address of the proposal. #[prost(string, tag = "2")] pub voter: ::prost::alloc::string::String, - /// options is the weighted vote options. #[prost(message, repeated, tag = "4")] pub options: ::prost::alloc::vec::Vec, - /// metadata is any arbitrary metadata attached to the vote. - /// the recommended format of the metadata is to be found here: + /// metadata is any arbitrary metadata to attached to the vote. #[prost(string, tag = "5")] pub metadata: ::prost::alloc::string::String, } @@ -208,13 +160,12 @@ pub struct Vote { CosmwasmExt, )] #[proto_message(type_url = "/cosmos.gov.v1.DepositParams")] -#[deprecated] pub struct DepositParams { - /// Minimum deposit for a proposal to enter voting period. + /// Minimum deposit for a proposal to enter voting period. #[prost(message, repeated, tag = "1")] pub min_deposit: ::prost::alloc::vec::Vec, - /// Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - /// months. + /// Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + /// months. #[prost(message, optional, tag = "2")] pub max_deposit_period: ::core::option::Option, } @@ -231,9 +182,8 @@ pub struct DepositParams { CosmwasmExt, )] #[proto_message(type_url = "/cosmos.gov.v1.VotingParams")] -#[deprecated] pub struct VotingParams { - /// Duration of the voting period. + /// Length of the voting period. #[prost(message, optional, tag = "1")] pub voting_period: ::core::option::Option, } @@ -250,100 +200,18 @@ pub struct VotingParams { CosmwasmExt, )] #[proto_message(type_url = "/cosmos.gov.v1.TallyParams")] -#[deprecated] pub struct TallyParams { - /// Minimum percentage of total stake needed to vote for a result to be - /// considered valid. - #[prost(string, tag = "1")] - pub quorum: ::prost::alloc::string::String, - /// Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. - #[prost(string, tag = "2")] - pub threshold: ::prost::alloc::string::String, - /// Minimum value of Veto votes to Total votes ratio for proposal to be - /// vetoed. Default value: 1/3. - #[prost(string, tag = "3")] - pub veto_threshold: ::prost::alloc::string::String, -} -/// Params defines the parameters for the x/gov module. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.gov.v1.Params")] -pub struct Params { - /// Minimum deposit for a proposal to enter voting period. - #[prost(message, repeated, tag = "1")] - pub min_deposit: ::prost::alloc::vec::Vec, - /// Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - /// months. - #[prost(message, optional, tag = "2")] - pub max_deposit_period: ::core::option::Option, - /// Duration of the voting period. - #[prost(message, optional, tag = "3")] - pub voting_period: ::core::option::Option, /// Minimum percentage of total stake needed to vote for a result to be /// considered valid. - #[prost(string, tag = "4")] + #[prost(string, tag = "1")] pub quorum: ::prost::alloc::string::String, /// Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. - #[prost(string, tag = "5")] + #[prost(string, tag = "2")] pub threshold: ::prost::alloc::string::String, /// Minimum value of Veto votes to Total votes ratio for proposal to be /// vetoed. Default value: 1/3. - #[prost(string, tag = "6")] + #[prost(string, tag = "3")] pub veto_threshold: ::prost::alloc::string::String, - /// The ratio representing the proportion of the deposit value that must be paid at proposal submission. - #[prost(string, tag = "7")] - pub min_initial_deposit_ratio: ::prost::alloc::string::String, - /// The cancel ratio which will not be returned back to the depositors when a proposal is cancelled. - /// - /// Since: cosmos-sdk 0.50 - #[prost(string, tag = "8")] - pub proposal_cancel_ratio: ::prost::alloc::string::String, - /// The address which will receive (proposal_cancel_ratio * deposit) proposal deposits. - /// If empty, the (proposal_cancel_ratio * deposit) proposal deposits will be burned. - /// - /// Since: cosmos-sdk 0.50 - #[prost(string, tag = "9")] - pub proposal_cancel_dest: ::prost::alloc::string::String, - /// Duration of the voting period of an expedited proposal. - /// - /// Since: cosmos-sdk 0.50 - #[prost(message, optional, tag = "10")] - pub expedited_voting_period: ::core::option::Option, - /// Minimum proportion of Yes votes for proposal to pass. Default value: 0.67. - /// - /// Since: cosmos-sdk 0.50 - #[prost(string, tag = "11")] - pub expedited_threshold: ::prost::alloc::string::String, - /// Minimum expedited deposit for a proposal to enter voting period. - #[prost(message, repeated, tag = "12")] - pub expedited_min_deposit: ::prost::alloc::vec::Vec, - /// burn deposits if a proposal does not meet quorum - #[prost(bool, tag = "13")] - pub burn_vote_quorum: bool, - /// burn deposits if the proposal does not enter voting period - #[prost(bool, tag = "14")] - pub burn_proposal_deposit_prevote: bool, - /// burn deposits if quorum with vote type no_veto is met - #[prost(bool, tag = "15")] - pub burn_vote_veto: bool, - /// The ratio representing the proportion of the deposit value minimum that must be met when making a deposit. - /// Default value: 0.01. Meaning that for a chain with a min_deposit of 100stake, a deposit of 1stake would be - /// required. - /// - /// Since: cosmos-sdk 0.50 - #[prost(string, tag = "16")] - pub min_deposit_ratio: ::prost::alloc::string::String, } /// VoteOption enumerates the valid vote options for a given governance proposal. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] @@ -468,69 +336,15 @@ pub struct GenesisState { /// proposals defines all the proposals present at genesis. #[prost(message, repeated, tag = "4")] pub proposals: ::prost::alloc::vec::Vec, - /// Deprecated: Prefer to use `params` instead. - /// deposit_params defines all the paramaters of related to deposit. - #[deprecated] + /// params defines all the paramaters of related to deposit. #[prost(message, optional, tag = "5")] pub deposit_params: ::core::option::Option, - /// Deprecated: Prefer to use `params` instead. - /// voting_params defines all the paramaters of related to voting. - #[deprecated] + /// params defines all the paramaters of related to voting. #[prost(message, optional, tag = "6")] pub voting_params: ::core::option::Option, - /// Deprecated: Prefer to use `params` instead. - /// tally_params defines all the paramaters of related to tally. - #[deprecated] + /// params defines all the paramaters of related to tally. #[prost(message, optional, tag = "7")] pub tally_params: ::core::option::Option, - /// params defines all the paramaters of x/gov module. - /// - /// Since: cosmos-sdk 0.47 - #[prost(message, optional, tag = "8")] - pub params: ::core::option::Option, - /// The constitution allows builders to lay a foundation and define purpose. - /// This is an immutable string set in genesis. - /// There are no amendments, to go outside of scope, just fork. - /// constitution is an immutable string in genesis for a chain builder to lay out their vision, ideas and ideals. - /// - /// Since: cosmos-sdk 0.50 - #[prost(string, tag = "9")] - pub constitution: ::prost::alloc::string::String, -} -/// QueryConstitutionRequest is the request type for the Query/Constitution RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.gov.v1.QueryConstitutionRequest")] -#[proto_query( - path = "/cosmos.gov.v1.Query/Constitution", - response_type = QueryConstitutionResponse -)] -pub struct QueryConstitutionRequest {} -/// QueryConstitutionResponse is the response type for the Query/Constitution RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.gov.v1.QueryConstitutionResponse")] -pub struct QueryConstitutionResponse { - #[prost(string, tag = "1")] - pub constitution: ::prost::alloc::string::String, } /// QueryProposalRequest is the request type for the Query/Proposal RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -572,7 +386,6 @@ pub struct QueryProposalRequest { )] #[proto_message(type_url = "/cosmos.gov.v1.QueryProposalResponse")] pub struct QueryProposalResponse { - /// proposal is the requested governance proposal. #[prost(message, optional, tag = "1")] pub proposal: ::core::option::Option, } @@ -626,7 +439,6 @@ pub struct QueryProposalsRequest { )] #[proto_message(type_url = "/cosmos.gov.v1.QueryProposalsResponse")] pub struct QueryProposalsResponse { - /// proposals defines all the requested governance proposals. #[prost(message, repeated, tag = "1")] pub proposals: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. @@ -673,7 +485,7 @@ pub struct QueryVoteRequest { )] #[proto_message(type_url = "/cosmos.gov.v1.QueryVoteResponse")] pub struct QueryVoteResponse { - /// vote defines the queried vote. + /// vote defined the queried vote. #[prost(message, optional, tag = "1")] pub vote: ::core::option::Option, } @@ -717,7 +529,7 @@ pub struct QueryVotesRequest { )] #[proto_message(type_url = "/cosmos.gov.v1.QueryVotesResponse")] pub struct QueryVotesResponse { - /// votes defines the queried votes. + /// votes defined the queried votes. #[prost(message, repeated, tag = "1")] pub votes: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. @@ -758,26 +570,15 @@ pub struct QueryParamsRequest { )] #[proto_message(type_url = "/cosmos.gov.v1.QueryParamsResponse")] pub struct QueryParamsResponse { - /// Deprecated: Prefer to use `params` instead. /// voting_params defines the parameters related to voting. - #[deprecated] #[prost(message, optional, tag = "1")] pub voting_params: ::core::option::Option, - /// Deprecated: Prefer to use `params` instead. /// deposit_params defines the parameters related to deposit. - #[deprecated] #[prost(message, optional, tag = "2")] pub deposit_params: ::core::option::Option, - /// Deprecated: Prefer to use `params` instead. /// tally_params defines the parameters related to tally. - #[deprecated] #[prost(message, optional, tag = "3")] pub tally_params: ::core::option::Option, - /// params defines all the paramaters of x/gov module. - /// - /// Since: cosmos-sdk 0.47 - #[prost(message, optional, tag = "4")] - pub params: ::core::option::Option, } /// QueryDepositRequest is the request type for the Query/Deposit RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -869,7 +670,6 @@ pub struct QueryDepositsRequest { )] #[proto_message(type_url = "/cosmos.gov.v1.QueryDepositsResponse")] pub struct QueryDepositsResponse { - /// deposits defines the requested deposits. #[prost(message, repeated, tag = "1")] pub deposits: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. @@ -935,33 +735,15 @@ pub struct QueryTallyResultResponse { )] #[proto_message(type_url = "/cosmos.gov.v1.MsgSubmitProposal")] pub struct MsgSubmitProposal { - /// messages are the arbitrary messages to be executed if proposal passes. #[prost(message, repeated, tag = "1")] pub messages: ::prost::alloc::vec::Vec, - /// initial_deposit is the deposit value that must be paid at proposal submission. #[prost(message, repeated, tag = "2")] pub initial_deposit: ::prost::alloc::vec::Vec, - /// proposer is the account address of the proposer. #[prost(string, tag = "3")] pub proposer: ::prost::alloc::string::String, /// metadata is any arbitrary metadata attached to the proposal. #[prost(string, tag = "4")] pub metadata: ::prost::alloc::string::String, - /// title is the title of the proposal. - /// - /// Since: cosmos-sdk 0.47 - #[prost(string, tag = "5")] - pub title: ::prost::alloc::string::String, - /// summary is the summary of the proposal - /// - /// Since: cosmos-sdk 0.47 - #[prost(string, tag = "6")] - pub summary: ::prost::alloc::string::String, - /// expedited defines if the proposal is expedited or not - /// - /// Since: cosmos-sdk 0.50 - #[prost(bool, tag = "7")] - pub expedited: bool, } /// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. #[allow(clippy::derive_partial_eq_without_eq)] @@ -977,7 +759,6 @@ pub struct MsgSubmitProposal { )] #[proto_message(type_url = "/cosmos.gov.v1.MsgSubmitProposalResponse")] pub struct MsgSubmitProposalResponse { - /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", @@ -1035,24 +816,20 @@ pub struct MsgExecLegacyContentResponse {} )] #[proto_message(type_url = "/cosmos.gov.v1.MsgVote")] pub struct MsgVote { - /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub proposal_id: u64, - /// voter is the voter address for the proposal. #[prost(string, tag = "2")] pub voter: ::prost::alloc::string::String, - /// option defines the vote option. #[prost(enumeration = "VoteOption", tag = "3")] #[serde( serialize_with = "VoteOption::serialize", deserialize_with = "VoteOption::deserialize" )] pub option: i32, - /// metadata is any arbitrary metadata attached to the Vote. #[prost(string, tag = "4")] pub metadata: ::prost::alloc::string::String, } @@ -1084,20 +861,16 @@ pub struct MsgVoteResponse {} )] #[proto_message(type_url = "/cosmos.gov.v1.MsgVoteWeighted")] pub struct MsgVoteWeighted { - /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub proposal_id: u64, - /// voter is the voter address for the proposal. #[prost(string, tag = "2")] pub voter: ::prost::alloc::string::String, - /// options defines the weighted vote options. #[prost(message, repeated, tag = "3")] pub options: ::prost::alloc::vec::Vec, - /// metadata is any arbitrary metadata attached to the VoteWeighted. #[prost(string, tag = "4")] pub metadata: ::prost::alloc::string::String, } @@ -1129,17 +902,14 @@ pub struct MsgVoteWeightedResponse {} )] #[proto_message(type_url = "/cosmos.gov.v1.MsgDeposit")] pub struct MsgDeposit { - /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub proposal_id: u64, - /// depositor defines the deposit addresses from the proposals. #[prost(string, tag = "2")] pub depositor: ::prost::alloc::string::String, - /// amount to be deposited by depositor. #[prost(message, repeated, tag = "3")] pub amount: ::prost::alloc::vec::Vec, } @@ -1157,110 +927,6 @@ pub struct MsgDeposit { )] #[proto_message(type_url = "/cosmos.gov.v1.MsgDepositResponse")] pub struct MsgDepositResponse {} -/// MsgUpdateParams is the Msg/UpdateParams request type. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.gov.v1.MsgUpdateParams")] -pub struct MsgUpdateParams { - /// authority is the address that controls the module (defaults to x/gov unless overwritten). - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// params defines the x/gov parameters to update. - /// - /// NOTE: All parameters must be supplied. - #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, -} -/// MsgUpdateParamsResponse defines the response structure for executing a -/// MsgUpdateParams message. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.gov.v1.MsgUpdateParamsResponse")] -pub struct MsgUpdateParamsResponse {} -/// MsgCancelProposal is the Msg/CancelProposal request type. -/// -/// Since: cosmos-sdk 0.50 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.gov.v1.MsgCancelProposal")] -pub struct MsgCancelProposal { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub proposal_id: u64, - /// proposer is the account address of the proposer. - #[prost(string, tag = "2")] - pub proposer: ::prost::alloc::string::String, -} -/// MsgCancelProposalResponse defines the response structure for executing a -/// MsgCancelProposal message. -/// -/// Since: cosmos-sdk 0.50 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.gov.v1.MsgCancelProposalResponse")] -pub struct MsgCancelProposalResponse { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub proposal_id: u64, - /// canceled_time is the time when proposal is canceled. - #[prost(message, optional, tag = "2")] - pub canceled_time: ::core::option::Option, - /// canceled_height defines the block height at which the proposal is canceled. - #[prost(uint64, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub canceled_height: u64, -} pub struct GovQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } @@ -1268,9 +934,6 @@ impl<'a, Q: cosmwasm_std::CustomQuery> GovQuerier<'a, Q> { pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { Self { querier } } - pub fn constitution(&self) -> Result { - QueryConstitutionRequest {}.query(self.querier) - } pub fn proposal( &self, proposal_id: u64, diff --git a/packages/provwasm-std/src/types/cosmos/gov/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/gov/v1beta1.rs index 2bbe9b02..3f0f53c6 100644 --- a/packages/provwasm-std/src/types/cosmos/gov/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/gov/v1beta1.rs @@ -15,14 +15,12 @@ use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; )] #[proto_message(type_url = "/cosmos.gov.v1beta1.WeightedVoteOption")] pub struct WeightedVoteOption { - /// option defines the valid vote options, it must not contain duplicate vote options. #[prost(enumeration = "VoteOption", tag = "1")] #[serde( serialize_with = "VoteOption::serialize", deserialize_with = "VoteOption::deserialize" )] pub option: i32, - /// weight is the vote weight associated with the vote option. #[prost(string, tag = "2")] pub weight: ::prost::alloc::string::String, } @@ -41,10 +39,8 @@ pub struct WeightedVoteOption { )] #[proto_message(type_url = "/cosmos.gov.v1beta1.TextProposal")] pub struct TextProposal { - /// title of the proposal. #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, - /// description associated with the proposal. #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, } @@ -63,17 +59,14 @@ pub struct TextProposal { )] #[proto_message(type_url = "/cosmos.gov.v1beta1.Deposit")] pub struct Deposit { - /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub proposal_id: u64, - /// depositor defines the deposit addresses from the proposals. #[prost(string, tag = "2")] pub depositor: ::prost::alloc::string::String, - /// amount to be deposited by depositor. #[prost(message, repeated, tag = "3")] pub amount: ::prost::alloc::vec::Vec, } @@ -91,17 +84,14 @@ pub struct Deposit { )] #[proto_message(type_url = "/cosmos.gov.v1beta1.Proposal")] pub struct Proposal { - /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub proposal_id: u64, - /// content is the proposal's content. #[prost(message, optional, tag = "2")] pub content: ::core::option::Option, - /// status defines the proposal status. #[prost(enumeration = "ProposalStatus", tag = "3")] #[serde( serialize_with = "ProposalStatus::serialize", @@ -113,19 +103,14 @@ pub struct Proposal { /// proposal's voting period has ended. #[prost(message, optional, tag = "4")] pub final_tally_result: ::core::option::Option, - /// submit_time is the time of proposal submission. #[prost(message, optional, tag = "5")] pub submit_time: ::core::option::Option, - /// deposit_end_time is the end time for deposition. #[prost(message, optional, tag = "6")] pub deposit_end_time: ::core::option::Option, - /// total_deposit is the total deposit on the proposal. #[prost(message, repeated, tag = "7")] pub total_deposit: ::prost::alloc::vec::Vec, - /// voting_start_time is the starting time to vote on a proposal. #[prost(message, optional, tag = "8")] pub voting_start_time: ::core::option::Option, - /// voting_end_time is the end time of voting on a proposal. #[prost(message, optional, tag = "9")] pub voting_end_time: ::core::option::Option, } @@ -143,16 +128,12 @@ pub struct Proposal { )] #[proto_message(type_url = "/cosmos.gov.v1beta1.TallyResult")] pub struct TallyResult { - /// yes is the number of yes votes on a proposal. #[prost(string, tag = "1")] pub yes: ::prost::alloc::string::String, - /// abstain is the number of abstain votes on a proposal. #[prost(string, tag = "2")] pub abstain: ::prost::alloc::string::String, - /// no is the number of no votes on a proposal. #[prost(string, tag = "3")] pub no: ::prost::alloc::string::String, - /// no_with_veto is the number of no with veto votes on a proposal. #[prost(string, tag = "4")] pub no_with_veto: ::prost::alloc::string::String, } @@ -171,14 +152,12 @@ pub struct TallyResult { )] #[proto_message(type_url = "/cosmos.gov.v1beta1.Vote")] pub struct Vote { - /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub proposal_id: u64, - /// voter is the voter address of the proposal. #[prost(string, tag = "2")] pub voter: ::prost::alloc::string::String, /// Deprecated: Prefer to use `options` instead. This field is set in queries @@ -191,8 +170,6 @@ pub struct Vote { deserialize_with = "VoteOption::deserialize" )] pub option: i32, - /// options is the weighted vote options. - /// /// Since: cosmos-sdk 0.43 #[prost(message, repeated, tag = "4")] pub options: ::prost::alloc::vec::Vec, @@ -211,11 +188,11 @@ pub struct Vote { )] #[proto_message(type_url = "/cosmos.gov.v1beta1.DepositParams")] pub struct DepositParams { - /// Minimum deposit for a proposal to enter voting period. + /// Minimum deposit for a proposal to enter voting period. #[prost(message, repeated, tag = "1")] pub min_deposit: ::prost::alloc::vec::Vec, - /// Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - /// months. + /// Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + /// months. #[prost(message, optional, tag = "2")] pub max_deposit_period: ::core::option::Option, } @@ -233,7 +210,7 @@ pub struct DepositParams { )] #[proto_message(type_url = "/cosmos.gov.v1beta1.VotingParams")] pub struct VotingParams { - /// Duration of the voting period. + /// Length of the voting period. #[prost(message, optional, tag = "1")] pub voting_period: ::core::option::Option, } @@ -251,23 +228,23 @@ pub struct VotingParams { )] #[proto_message(type_url = "/cosmos.gov.v1beta1.TallyParams")] pub struct TallyParams { - /// Minimum percentage of total stake needed to vote for a result to be - /// considered valid. + /// Minimum percentage of total stake needed to vote for a result to be + /// considered valid. #[prost(bytes = "vec", tag = "1")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] pub quorum: ::prost::alloc::vec::Vec, - /// Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + /// Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. #[prost(bytes = "vec", tag = "2")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] pub threshold: ::prost::alloc::vec::Vec, - /// Minimum value of Veto votes to Total votes ratio for proposal to be - /// vetoed. Default value: 1/3. + /// Minimum value of Veto votes to Total votes ratio for proposal to be + /// vetoed. Default value: 1/3. #[prost(bytes = "vec", tag = "3")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", @@ -398,13 +375,13 @@ pub struct GenesisState { /// proposals defines all the proposals present at genesis. #[prost(message, repeated, tag = "4")] pub proposals: ::prost::alloc::vec::Vec, - /// deposit_params defines all the parameters related to deposit. + /// params defines all the paramaters of related to deposit. #[prost(message, optional, tag = "5")] pub deposit_params: ::core::option::Option, - /// voting_params defines all the parameters related to voting. + /// params defines all the paramaters of related to voting. #[prost(message, optional, tag = "6")] pub voting_params: ::core::option::Option, - /// tally_params defines all the parameters related to tally. + /// params defines all the paramaters of related to tally. #[prost(message, optional, tag = "7")] pub tally_params: ::core::option::Option, } @@ -501,7 +478,6 @@ pub struct QueryProposalsRequest { )] #[proto_message(type_url = "/cosmos.gov.v1beta1.QueryProposalsResponse")] pub struct QueryProposalsResponse { - /// proposals defines all the requested governance proposals. #[prost(message, repeated, tag = "1")] pub proposals: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. @@ -551,7 +527,7 @@ pub struct QueryVoteRequest { )] #[proto_message(type_url = "/cosmos.gov.v1beta1.QueryVoteResponse")] pub struct QueryVoteResponse { - /// vote defines the queried vote. + /// vote defined the queried vote. #[prost(message, optional, tag = "1")] pub vote: ::core::option::Option, } @@ -598,7 +574,7 @@ pub struct QueryVotesRequest { )] #[proto_message(type_url = "/cosmos.gov.v1beta1.QueryVotesResponse")] pub struct QueryVotesResponse { - /// votes defines the queried votes. + /// votes defined the queried votes. #[prost(message, repeated, tag = "1")] pub votes: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. @@ -742,7 +718,6 @@ pub struct QueryDepositsRequest { )] #[proto_message(type_url = "/cosmos.gov.v1beta1.QueryDepositsResponse")] pub struct QueryDepositsResponse { - /// deposits defines the requested deposits. #[prost(message, repeated, tag = "1")] pub deposits: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. @@ -808,13 +783,10 @@ pub struct QueryTallyResultResponse { )] #[proto_message(type_url = "/cosmos.gov.v1beta1.MsgSubmitProposal")] pub struct MsgSubmitProposal { - /// content is the proposal's content. #[prost(message, optional, tag = "1")] pub content: ::core::option::Option, - /// initial_deposit is the deposit value that must be paid at proposal submission. #[prost(message, repeated, tag = "2")] pub initial_deposit: ::prost::alloc::vec::Vec, - /// proposer is the account address of the proposer. #[prost(string, tag = "3")] pub proposer: ::prost::alloc::string::String, } @@ -832,7 +804,6 @@ pub struct MsgSubmitProposal { )] #[proto_message(type_url = "/cosmos.gov.v1beta1.MsgSubmitProposalResponse")] pub struct MsgSubmitProposalResponse { - /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", @@ -854,17 +825,14 @@ pub struct MsgSubmitProposalResponse { )] #[proto_message(type_url = "/cosmos.gov.v1beta1.MsgVote")] pub struct MsgVote { - /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub proposal_id: u64, - /// voter is the voter address for the proposal. #[prost(string, tag = "2")] pub voter: ::prost::alloc::string::String, - /// option defines the vote option. #[prost(enumeration = "VoteOption", tag = "3")] #[serde( serialize_with = "VoteOption::serialize", @@ -902,17 +870,14 @@ pub struct MsgVoteResponse {} )] #[proto_message(type_url = "/cosmos.gov.v1beta1.MsgVoteWeighted")] pub struct MsgVoteWeighted { - /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub proposal_id: u64, - /// voter is the voter address for the proposal. #[prost(string, tag = "2")] pub voter: ::prost::alloc::string::String, - /// options defines the weighted vote options. #[prost(message, repeated, tag = "3")] pub options: ::prost::alloc::vec::Vec, } @@ -946,17 +911,14 @@ pub struct MsgVoteWeightedResponse {} )] #[proto_message(type_url = "/cosmos.gov.v1beta1.MsgDeposit")] pub struct MsgDeposit { - /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub proposal_id: u64, - /// depositor defines the deposit addresses from the proposals. #[prost(string, tag = "2")] pub depositor: ::prost::alloc::string::String, - /// amount to be deposited by depositor. #[prost(message, repeated, tag = "3")] pub amount: ::prost::alloc::vec::Vec, } diff --git a/packages/provwasm-std/src/types/cosmos/group/mod.rs b/packages/provwasm-std/src/types/cosmos/group/mod.rs index a8429e39..a3a6d96c 100644 --- a/packages/provwasm-std/src/types/cosmos/group/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/group/mod.rs @@ -1,2 +1 @@ -pub mod module; pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/group/module/mod.rs b/packages/provwasm-std/src/types/cosmos/group/module/mod.rs deleted file mode 100644 index a3a6d96c..00000000 --- a/packages/provwasm-std/src/types/cosmos/group/module/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/group/module/v1.rs b/packages/provwasm-std/src/types/cosmos/group/module/v1.rs deleted file mode 100644 index 684d9ecf..00000000 --- a/packages/provwasm-std/src/types/cosmos/group/module/v1.rs +++ /dev/null @@ -1,28 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// Module is the config object of the group module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.group.module.v1.Module")] -pub struct Module { - /// max_execution_period defines the max duration after a proposal's voting period ends that members can send a MsgExec - /// to execute the proposal. - #[prost(message, optional, tag = "1")] - pub max_execution_period: ::core::option::Option, - /// max_metadata_len defines the max length of the metadata bytes field for various entities within the group module. - /// Defaults to 255 if not explicitly set. - #[prost(uint64, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub max_metadata_len: u64, -} diff --git a/packages/provwasm-std/src/types/cosmos/group/v1.rs b/packages/provwasm-std/src/types/cosmos/group/v1.rs index b3db1b91..ba996bfa 100644 --- a/packages/provwasm-std/src/types/cosmos/group/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/group/v1.rs @@ -55,7 +55,7 @@ pub struct MemberRequest { } /// ThresholdDecisionPolicy is a decision policy where a proposal passes when it /// satisfies the two following conditions: -/// 1. The sum of all `YES` voter's weights is greater or equal than the defined +/// 1. The sum of all `YES` voters' weights is greater or equal than the defined /// `threshold`. /// 2. The voting and execution periods of the proposal respect the parameters /// given by `windows`. @@ -99,7 +99,7 @@ pub struct ThresholdDecisionPolicy { )] #[proto_message(type_url = "/cosmos.group.v1.PercentageDecisionPolicy")] pub struct PercentageDecisionPolicy { - /// percentage is the minimum percentage of the weighted sum of `YES` votes must + /// percentage is the minimum percentage the weighted sum of `YES` votes must /// meet for a proposal to succeed. #[prost(string, tag = "1")] pub percentage: ::prost::alloc::string::String, @@ -164,7 +164,6 @@ pub struct GroupInfo { #[prost(string, tag = "2")] pub admin: ::prost::alloc::string::String, /// metadata is any arbitrary metadata to attached to the group. - /// the recommended format of the metadata is to be found here: #[prost(string, tag = "3")] pub metadata: ::prost::alloc::string::String, /// version is used to track changes to a group's membership structure that @@ -236,9 +235,7 @@ pub struct GroupPolicyInfo { /// admin is the account address of the group admin. #[prost(string, tag = "3")] pub admin: ::prost::alloc::string::String, - /// metadata is any arbitrary metadata attached to the group policy. - /// the recommended format of the metadata is to be found here: - /// + /// metadata is any arbitrary metadata to attached to the group policy. #[prost(string, tag = "4")] pub metadata: ::prost::alloc::string::String, /// version is used to track changes to a group's GroupPolicyInfo structure that @@ -283,9 +280,7 @@ pub struct Proposal { /// group_policy_address is the account address of group policy. #[prost(string, tag = "2")] pub group_policy_address: ::prost::alloc::string::String, - /// metadata is any arbitrary metadata attached to the proposal. - /// the recommended format of the metadata is to be found here: - /// + /// metadata is any arbitrary metadata to attached to the proposal. #[prost(string, tag = "3")] pub metadata: ::prost::alloc::string::String, /// proposers are the account addresses of the proposers. @@ -326,7 +321,7 @@ pub struct Proposal { #[prost(message, optional, tag = "9")] pub final_tally_result: ::core::option::Option, /// voting_period_end is the timestamp before which voting must be done. - /// Unless a successful MsgExec is called before (to execute a proposal whose + /// Unless a successfull MsgExec is called before (to execute a proposal whose /// tally is successful before the voting period ends), tallying will be done /// at this point, and the `final_tally_result`and `status` fields will be /// accordingly updated. @@ -342,16 +337,6 @@ pub struct Proposal { /// messages is a list of `sdk.Msg`s that will be executed if the proposal passes. #[prost(message, repeated, tag = "12")] pub messages: ::prost::alloc::vec::Vec, - /// title is the title of the proposal - /// - /// Since: cosmos-sdk 0.47 - #[prost(string, tag = "13")] - pub title: ::prost::alloc::string::String, - /// summary is a short summary of the proposal - /// - /// Since: cosmos-sdk 0.47 - #[prost(string, tag = "14")] - pub summary: ::prost::alloc::string::String, } /// TallyResult represents the sum of weighted votes for each vote option. #[allow(clippy::derive_partial_eq_without_eq)] @@ -380,7 +365,7 @@ pub struct TallyResult { #[prost(string, tag = "4")] pub no_with_veto_count: ::prost::alloc::string::String, } -/// Vote represents a vote for a proposal.string metadata +/// Vote represents a vote for a proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -411,8 +396,7 @@ pub struct Vote { deserialize_with = "VoteOption::deserialize" )] pub option: i32, - /// metadata is any arbitrary metadata attached to the vote. - /// the recommended format of the metadata is to be found here: + /// metadata is any arbitrary metadata to attached to the vote. #[prost(string, tag = "4")] pub metadata: ::prost::alloc::string::String, /// submit_time is the timestamp when the vote was submitted. @@ -879,7 +863,7 @@ pub struct QueryGroupInfoRequest { )] #[proto_message(type_url = "/cosmos.group.v1.QueryGroupInfoResponse")] pub struct QueryGroupInfoResponse { - /// info is the GroupInfo of the group. + /// info is the GroupInfo for the group. #[prost(message, optional, tag = "1")] pub info: ::core::option::Option, } @@ -919,7 +903,7 @@ pub struct QueryGroupPolicyInfoRequest { )] #[proto_message(type_url = "/cosmos.group.v1.QueryGroupPolicyInfoResponse")] pub struct QueryGroupPolicyInfoResponse { - /// info is the GroupPolicyInfo of the group policy. + /// info is the GroupPolicyInfo for the group policy. #[prost(message, optional, tag = "1")] pub info: ::core::option::Option, } @@ -1731,20 +1715,6 @@ pub struct MsgUpdateGroupPolicyAdmin { #[prost(string, tag = "3")] pub new_admin: ::prost::alloc::string::String, } -/// MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.group.v1.MsgUpdateGroupPolicyAdminResponse")] -pub struct MsgUpdateGroupPolicyAdminResponse {} /// MsgCreateGroupWithPolicy is the Msg/CreateGroupWithPolicy request type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -1804,6 +1774,20 @@ pub struct MsgCreateGroupWithPolicyResponse { #[prost(string, tag = "2")] pub group_policy_address: ::prost::alloc::string::String, } +/// MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmos.group.v1.MsgUpdateGroupPolicyAdminResponse")] +pub struct MsgUpdateGroupPolicyAdminResponse {} /// MsgUpdateGroupPolicyDecisionPolicy is the Msg/UpdateGroupPolicyDecisionPolicy request type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -1862,7 +1846,7 @@ pub struct MsgUpdateGroupPolicyMetadata { /// group_policy_address is the account address of group policy. #[prost(string, tag = "2")] pub group_policy_address: ::prost::alloc::string::String, - /// metadata is the group policy metadata to be updated. + /// metadata is the updated group policy metadata. #[prost(string, tag = "3")] pub metadata: ::prost::alloc::string::String, } @@ -1901,7 +1885,7 @@ pub struct MsgSubmitProposal { /// Proposers signatures will be counted as yes votes. #[prost(string, repeated, tag = "2")] pub proposers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// metadata is any arbitrary metadata attached to the proposal. + /// metadata is any arbitrary metadata to attached to the proposal. #[prost(string, tag = "3")] pub metadata: ::prost::alloc::string::String, /// messages is a list of `sdk.Msg`s that will be executed if the proposal passes. @@ -1916,16 +1900,6 @@ pub struct MsgSubmitProposal { deserialize_with = "Exec::deserialize" )] pub exec: i32, - /// title is the title of the proposal. - /// - /// Since: cosmos-sdk 0.47 - #[prost(string, tag = "6")] - pub title: ::prost::alloc::string::String, - /// summary is the summary of the proposal. - /// - /// Since: cosmos-sdk 0.47 - #[prost(string, tag = "7")] - pub summary: ::prost::alloc::string::String, } /// MsgSubmitProposalResponse is the Msg/SubmitProposal response type. #[allow(clippy::derive_partial_eq_without_eq)] @@ -2019,7 +1993,7 @@ pub struct MsgVote { deserialize_with = "VoteOption::deserialize" )] pub option: i32, - /// metadata is any arbitrary metadata attached to the vote. + /// metadata is any arbitrary metadata to attached to the vote. #[prost(string, tag = "4")] pub metadata: ::prost::alloc::string::String, /// exec defines whether the proposal should be executed diff --git a/packages/provwasm-std/src/types/cosmos/ics23/mod.rs b/packages/provwasm-std/src/types/cosmos/ics23/mod.rs deleted file mode 100644 index a3a6d96c..00000000 --- a/packages/provwasm-std/src/types/cosmos/ics23/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/mint/mod.rs b/packages/provwasm-std/src/types/cosmos/mint/mod.rs index 537a3360..9f64fc82 100644 --- a/packages/provwasm-std/src/types/cosmos/mint/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/mint/mod.rs @@ -1,2 +1 @@ -pub mod module; pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/mint/module/mod.rs b/packages/provwasm-std/src/types/cosmos/mint/module/mod.rs deleted file mode 100644 index a3a6d96c..00000000 --- a/packages/provwasm-std/src/types/cosmos/mint/module/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/mint/module/v1.rs b/packages/provwasm-std/src/types/cosmos/mint/module/v1.rs deleted file mode 100644 index 7c6ab88e..00000000 --- a/packages/provwasm-std/src/types/cosmos/mint/module/v1.rs +++ /dev/null @@ -1,21 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// Module is the config object of the mint module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.mint.module.v1.Module")] -pub struct Module { - #[prost(string, tag = "1")] - pub fee_collector_name: ::prost::alloc::string::String, - /// authority defines the custom module authority. If not set, defaults to the governance module. - #[prost(string, tag = "2")] - pub authority: ::prost::alloc::string::String, -} diff --git a/packages/provwasm-std/src/types/cosmos/mint/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/mint/v1beta1.rs index 3ad6ca1a..107dadf6 100644 --- a/packages/provwasm-std/src/types/cosmos/mint/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/mint/v1beta1.rs @@ -20,7 +20,7 @@ pub struct Minter { #[prost(string, tag = "2")] pub annual_provisions: ::prost::alloc::string::String, } -/// Params defines the parameters for the x/mint module. +/// Params holds parameters for the mint module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -74,7 +74,7 @@ pub struct GenesisState { /// minter is a space for holding current inflation information. #[prost(message, optional, tag = "1")] pub minter: ::core::option::Option, - /// params defines all the parameters of the module. + /// params defines all the paramaters of the module. #[prost(message, optional, tag = "2")] pub params: ::core::option::Option, } @@ -197,48 +197,6 @@ pub struct QueryAnnualProvisionsResponse { )] pub annual_provisions: ::prost::alloc::vec::Vec, } -/// MsgUpdateParams is the Msg/UpdateParams request type. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.mint.v1beta1.MsgUpdateParams")] -pub struct MsgUpdateParams { - /// authority is the address that controls the module (defaults to x/gov unless overwritten). - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// params defines the x/mint parameters to update. - /// - /// NOTE: All parameters must be supplied. - #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, -} -/// MsgUpdateParamsResponse defines the response structure for executing a -/// MsgUpdateParams message. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.mint.v1beta1.MsgUpdateParamsResponse")] -pub struct MsgUpdateParamsResponse {} pub struct MintQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } diff --git a/packages/provwasm-std/src/types/cosmos/mod.rs b/packages/provwasm-std/src/types/cosmos/mod.rs index 17e6eee6..0c1ed707 100644 --- a/packages/provwasm-std/src/types/cosmos/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/mod.rs @@ -3,8 +3,7 @@ pub mod auth; pub mod authz; pub mod bank; pub mod base; -pub mod circuit; -pub mod consensus; +pub mod capability; pub mod crisis; pub mod crypto; pub mod distribution; @@ -13,18 +12,16 @@ pub mod feegrant; pub mod genutil; pub mod gov; pub mod group; -pub mod ics23; pub mod mint; pub mod msg; pub mod nft; pub mod orm; pub mod params; pub mod quarantine; -pub mod query; pub mod sanction; pub mod slashing; pub mod staking; -pub mod store; +pub mod streaming; pub mod tx; pub mod upgrade; pub mod vesting; diff --git a/packages/provwasm-std/src/types/cosmos/msg/mod.rs b/packages/provwasm-std/src/types/cosmos/msg/mod.rs index 1ceda4f7..a3a6d96c 100644 --- a/packages/provwasm-std/src/types/cosmos/msg/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/msg/mod.rs @@ -1,2 +1 @@ -pub mod textual; pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/msg/textual/mod.rs b/packages/provwasm-std/src/types/cosmos/msg/textual/mod.rs deleted file mode 100644 index a3a6d96c..00000000 --- a/packages/provwasm-std/src/types/cosmos/msg/textual/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/msg/textual/v1.rs b/packages/provwasm-std/src/types/cosmos/msg/textual/v1.rs deleted file mode 100644 index 9b108c8e..00000000 --- a/packages/provwasm-std/src/types/cosmos/msg/textual/v1.rs +++ /dev/null @@ -1 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; diff --git a/packages/provwasm-std/src/types/cosmos/nft/mod.rs b/packages/provwasm-std/src/types/cosmos/nft/mod.rs index 537a3360..9f64fc82 100644 --- a/packages/provwasm-std/src/types/cosmos/nft/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/nft/mod.rs @@ -1,2 +1 @@ -pub mod module; pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/nft/module/mod.rs b/packages/provwasm-std/src/types/cosmos/nft/module/mod.rs deleted file mode 100644 index a3a6d96c..00000000 --- a/packages/provwasm-std/src/types/cosmos/nft/module/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/nft/module/v1.rs b/packages/provwasm-std/src/types/cosmos/nft/module/v1.rs deleted file mode 100644 index 7466efbb..00000000 --- a/packages/provwasm-std/src/types/cosmos/nft/module/v1.rs +++ /dev/null @@ -1,15 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// Module is the config object of the nft module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.nft.module.v1.Module")] -pub struct Module {} diff --git a/packages/provwasm-std/src/types/cosmos/nft/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/nft/v1beta1.rs index 92fba6fc..8b4674ca 100644 --- a/packages/provwasm-std/src/types/cosmos/nft/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/nft/v1beta1.rs @@ -13,16 +13,12 @@ use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; )] #[proto_message(type_url = "/cosmos.nft.v1beta1.EventSend")] pub struct EventSend { - /// class_id associated with the nft #[prost(string, tag = "1")] pub class_id: ::prost::alloc::string::String, - /// id is a unique identifier of the nft #[prost(string, tag = "2")] pub id: ::prost::alloc::string::String, - /// sender is the address of the owner of nft #[prost(string, tag = "3")] pub sender: ::prost::alloc::string::String, - /// receiver is the receiver address of nft #[prost(string, tag = "4")] pub receiver: ::prost::alloc::string::String, } @@ -40,13 +36,10 @@ pub struct EventSend { )] #[proto_message(type_url = "/cosmos.nft.v1beta1.EventMint")] pub struct EventMint { - /// class_id associated with the nft #[prost(string, tag = "1")] pub class_id: ::prost::alloc::string::String, - /// id is a unique identifier of the nft #[prost(string, tag = "2")] pub id: ::prost::alloc::string::String, - /// owner is the owner address of the nft #[prost(string, tag = "3")] pub owner: ::prost::alloc::string::String, } @@ -64,13 +57,10 @@ pub struct EventMint { )] #[proto_message(type_url = "/cosmos.nft.v1beta1.EventBurn")] pub struct EventBurn { - /// class_id associated with the nft #[prost(string, tag = "1")] pub class_id: ::prost::alloc::string::String, - /// id is a unique identifier of the nft #[prost(string, tag = "2")] pub id: ::prost::alloc::string::String, - /// owner is the owner address of the nft #[prost(string, tag = "3")] pub owner: ::prost::alloc::string::String, } @@ -157,7 +147,6 @@ pub struct GenesisState { /// class defines the class of the nft type. #[prost(message, repeated, tag = "1")] pub classes: ::prost::alloc::vec::Vec, - /// entry defines all nft owned by a person. #[prost(message, repeated, tag = "2")] pub entries: ::prost::alloc::vec::Vec, } @@ -200,10 +189,8 @@ pub struct Entry { response_type = QueryBalanceResponse )] pub struct QueryBalanceRequest { - /// class_id associated with the nft #[prost(string, tag = "1")] pub class_id: ::prost::alloc::string::String, - /// owner is the owner address of the nft #[prost(string, tag = "2")] pub owner: ::prost::alloc::string::String, } @@ -221,7 +208,6 @@ pub struct QueryBalanceRequest { )] #[proto_message(type_url = "/cosmos.nft.v1beta1.QueryBalanceResponse")] pub struct QueryBalanceResponse { - /// amount is the number of all NFTs of a given class owned by the owner #[prost(uint64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", @@ -247,10 +233,8 @@ pub struct QueryBalanceResponse { response_type = QueryOwnerResponse )] pub struct QueryOwnerRequest { - /// class_id associated with the nft #[prost(string, tag = "1")] pub class_id: ::prost::alloc::string::String, - /// id is a unique identifier of the NFT #[prost(string, tag = "2")] pub id: ::prost::alloc::string::String, } @@ -268,7 +252,6 @@ pub struct QueryOwnerRequest { )] #[proto_message(type_url = "/cosmos.nft.v1beta1.QueryOwnerResponse")] pub struct QueryOwnerResponse { - /// owner is the owner address of the nft #[prost(string, tag = "1")] pub owner: ::prost::alloc::string::String, } @@ -290,7 +273,6 @@ pub struct QueryOwnerResponse { response_type = QuerySupplyResponse )] pub struct QuerySupplyRequest { - /// class_id associated with the nft #[prost(string, tag = "1")] pub class_id: ::prost::alloc::string::String, } @@ -308,7 +290,6 @@ pub struct QuerySupplyRequest { )] #[proto_message(type_url = "/cosmos.nft.v1beta1.QuerySupplyResponse")] pub struct QuerySupplyResponse { - /// amount is the number of all NFTs from the given class #[prost(uint64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", @@ -334,13 +315,10 @@ pub struct QuerySupplyResponse { response_type = QueryNfTsResponse )] pub struct QueryNfTsRequest { - /// class_id associated with the nft #[prost(string, tag = "1")] pub class_id: ::prost::alloc::string::String, - /// owner is the owner address of the nft #[prost(string, tag = "2")] pub owner: ::prost::alloc::string::String, - /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "3")] pub pagination: ::core::option::Option, } @@ -358,10 +336,8 @@ pub struct QueryNfTsRequest { )] #[proto_message(type_url = "/cosmos.nft.v1beta1.QueryNFTsResponse")] pub struct QueryNfTsResponse { - /// NFT defines the NFT #[prost(message, repeated, tag = "1")] pub nfts: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } @@ -380,10 +356,8 @@ pub struct QueryNfTsResponse { #[proto_message(type_url = "/cosmos.nft.v1beta1.QueryNFTRequest")] #[proto_query(path = "/cosmos.nft.v1beta1.Query/NFT", response_type = QueryNftResponse)] pub struct QueryNftRequest { - /// class_id associated with the nft #[prost(string, tag = "1")] pub class_id: ::prost::alloc::string::String, - /// id is a unique identifier of the NFT #[prost(string, tag = "2")] pub id: ::prost::alloc::string::String, } @@ -401,7 +375,6 @@ pub struct QueryNftRequest { )] #[proto_message(type_url = "/cosmos.nft.v1beta1.QueryNFTResponse")] pub struct QueryNftResponse { - /// owner is the owner address of the nft #[prost(message, optional, tag = "1")] pub nft: ::core::option::Option, } @@ -423,7 +396,6 @@ pub struct QueryNftResponse { response_type = QueryClassResponse )] pub struct QueryClassRequest { - /// class_id associated with the nft #[prost(string, tag = "1")] pub class_id: ::prost::alloc::string::String, } @@ -441,7 +413,6 @@ pub struct QueryClassRequest { )] #[proto_message(type_url = "/cosmos.nft.v1beta1.QueryClassResponse")] pub struct QueryClassResponse { - /// class defines the class of the nft type. #[prost(message, optional, tag = "1")] pub class: ::core::option::Option, } @@ -481,10 +452,8 @@ pub struct QueryClassesRequest { )] #[proto_message(type_url = "/cosmos.nft.v1beta1.QueryClassesResponse")] pub struct QueryClassesResponse { - /// class defines the class of the nft type. #[prost(message, repeated, tag = "1")] pub classes: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } diff --git a/packages/provwasm-std/src/types/cosmos/orm/mod.rs b/packages/provwasm-std/src/types/cosmos/orm/mod.rs index 381cd4d2..36524814 100644 --- a/packages/provwasm-std/src/types/cosmos/orm/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/orm/mod.rs @@ -1,4 +1,3 @@ pub mod module; -pub mod query; pub mod v1; pub mod v1alpha1; diff --git a/packages/provwasm-std/src/types/cosmos/orm/module/v1alpha1.rs b/packages/provwasm-std/src/types/cosmos/orm/module/v1alpha1.rs index ae1942b0..25c2f7b3 100644 --- a/packages/provwasm-std/src/types/cosmos/orm/module/v1alpha1.rs +++ b/packages/provwasm-std/src/types/cosmos/orm/module/v1alpha1.rs @@ -1,7 +1,7 @@ use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Module defines the ORM module which adds providers to the app container for -/// ORM ModuleDB's and in the future will automatically register query -/// services for modules that use the ORM. +/// module-scoped DB's. In the future it may provide gRPC services for interacting +/// with ORM data. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, diff --git a/packages/provwasm-std/src/types/cosmos/orm/query/mod.rs b/packages/provwasm-std/src/types/cosmos/orm/query/mod.rs deleted file mode 100644 index 32a5a9d4..00000000 --- a/packages/provwasm-std/src/types/cosmos/orm/query/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1alpha1; diff --git a/packages/provwasm-std/src/types/cosmos/orm/query/v1alpha1.rs b/packages/provwasm-std/src/types/cosmos/orm/query/v1alpha1.rs deleted file mode 100644 index 42b803b1..00000000 --- a/packages/provwasm-std/src/types/cosmos/orm/query/v1alpha1.rs +++ /dev/null @@ -1,274 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// GetRequest is the Query/Get request type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.orm.query.v1alpha1.GetRequest")] -#[proto_query( - path = "/cosmos.orm.query.v1alpha1.Query/Get", - response_type = GetResponse -)] -pub struct GetRequest { - /// message_name is the fully-qualified message name of the ORM table being queried. - #[prost(string, tag = "1")] - pub message_name: ::prost::alloc::string::String, - /// index is the index fields expression used in orm definitions. If it - /// is empty, the table's primary key is assumed. If it is non-empty, it must - /// refer to an unique index. - #[prost(string, tag = "2")] - pub index: ::prost::alloc::string::String, - /// values are the values of the fields corresponding to the requested index. - /// There must be as many values provided as there are fields in the index and - /// these values must correspond to the index field types. - #[prost(message, repeated, tag = "3")] - pub values: ::prost::alloc::vec::Vec, -} -/// GetResponse is the Query/Get response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.orm.query.v1alpha1.GetResponse")] -pub struct GetResponse { - /// result is the result of the get query. If no value is found, the gRPC - /// status code NOT_FOUND will be returned. - #[prost(message, optional, tag = "1")] - pub result: ::core::option::Option, -} -/// ListRequest is the Query/List request type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.orm.query.v1alpha1.ListRequest")] -#[proto_query( - path = "/cosmos.orm.query.v1alpha1.Query/List", - response_type = ListResponse -)] -pub struct ListRequest { - /// message_name is the fully-qualified message name of the ORM table being queried. - #[prost(string, tag = "1")] - pub message_name: ::prost::alloc::string::String, - /// index is the index fields expression used in orm definitions. If it - /// is empty, the table's primary key is assumed. - #[prost(string, tag = "2")] - pub index: ::prost::alloc::string::String, - /// pagination is the pagination request. - #[prost(message, optional, tag = "5")] - pub pagination: ::core::option::Option, - /// query is the query expression corresponding to the provided index. If - /// neither prefix nor range is specified, the query will list all the fields - /// in the index. - #[prost(oneof = "list_request::Query", tags = "3, 4")] - pub query: ::core::option::Option, -} -/// Nested message and enum types in `ListRequest`. -pub mod list_request { - use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; - /// Prefix specifies the arguments to a prefix query. - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, - )] - #[proto_message(type_url = "/cosmos.orm.query.v1alpha1.ListRequest.Prefix")] - pub struct Prefix { - /// values specifies the index values for the prefix query. - /// It is valid to special a partial prefix with fewer values than - /// the number of fields in the index. - #[prost(message, repeated, tag = "1")] - pub values: ::prost::alloc::vec::Vec, - } - /// Range specifies the arguments to a range query. - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, - )] - #[proto_message(type_url = "/cosmos.orm.query.v1alpha1.ListRequest.Range")] - pub struct Range { - /// start specifies the starting index values for the range query. - /// It is valid to provide fewer values than the number of fields in the - /// index. - #[prost(message, repeated, tag = "1")] - pub start: ::prost::alloc::vec::Vec, - /// end specifies the inclusive ending index values for the range query. - /// It is valid to provide fewer values than the number of fields in the - /// index. - #[prost(message, repeated, tag = "2")] - pub end: ::prost::alloc::vec::Vec, - } - /// query is the query expression corresponding to the provided index. If - /// neither prefix nor range is specified, the query will list all the fields - /// in the index. - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive( - Clone, - PartialEq, - Eq, - ::prost::Oneof, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - )] - pub enum Query { - /// prefix defines a prefix query. - #[prost(message, tag = "3")] - Prefix(Prefix), - /// range defines a range query. - #[prost(message, tag = "4")] - Range(Range), - } -} -/// ListResponse is the Query/List response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.orm.query.v1alpha1.ListResponse")] -pub struct ListResponse { - /// results are the results of the query. - #[prost(message, repeated, tag = "1")] - pub results: ::prost::alloc::vec::Vec, - /// pagination is the pagination response. - #[prost(message, optional, tag = "5")] - pub pagination: ::core::option::Option, -} -/// IndexValue represents the value of a field in an ORM index expression. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.orm.query.v1alpha1.IndexValue")] -pub struct IndexValue { - /// value specifies the index value - #[prost(oneof = "index_value::Value", tags = "1, 2, 3, 4, 5, 6, 7, 8")] - pub value: ::core::option::Option, -} -/// Nested message and enum types in `IndexValue`. -pub mod index_value { - use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; - /// value specifies the index value - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive( - Clone, - PartialEq, - Eq, - ::prost::Oneof, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - )] - pub enum Value { - /// uint specifies a value for an uint32, fixed32, uint64, or fixed64 - /// index field. - #[prost(uint64, tag = "1")] - Uint(u64), - /// int64 specifies a value for an int32, sfixed32, int64, or sfixed64 - /// index field. - #[prost(int64, tag = "2")] - Int(i64), - /// str specifies a value for a string index field. - #[prost(string, tag = "3")] - Str(::prost::alloc::string::String), - /// bytes specifies a value for a bytes index field. - #[prost(bytes, tag = "4")] - Bytes(::prost::alloc::vec::Vec), - /// enum specifies a value for an enum index field. - #[prost(string, tag = "5")] - Enum(::prost::alloc::string::String), - /// bool specifies a value for a bool index field. - #[prost(bool, tag = "6")] - Bool(bool), - /// timestamp specifies a value for a timestamp index field. - #[prost(message, tag = "7")] - Timestamp(crate::shim::Timestamp), - /// duration specifies a value for a duration index field. - #[prost(message, tag = "8")] - Duration(crate::shim::Duration), - } -} -pub struct V1alpha1Querier<'a, Q: cosmwasm_std::CustomQuery> { - querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, -} -impl<'a, Q: cosmwasm_std::CustomQuery> V1alpha1Querier<'a, Q> { - pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { - Self { querier } - } - pub fn get( - &self, - message_name: ::prost::alloc::string::String, - index: ::prost::alloc::string::String, - values: ::prost::alloc::vec::Vec, - ) -> Result { - GetRequest { - message_name, - index, - values, - } - .query(self.querier) - } - pub fn list( - &self, - message_name: ::prost::alloc::string::String, - index: ::prost::alloc::string::String, - pagination: ::core::option::Option, - query: ::core::option::Option, - ) -> Result { - ListRequest { - message_name, - index, - pagination, - query, - } - .query(self.querier) - } -} diff --git a/packages/provwasm-std/src/types/cosmos/orm/v1.rs b/packages/provwasm-std/src/types/cosmos/orm/v1.rs index b99d8bbd..a13422d1 100644 --- a/packages/provwasm-std/src/types/cosmos/orm/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/orm/v1.rs @@ -58,11 +58,8 @@ pub struct PrimaryKeyDescriptor { /// with a 32-bit unsigned varint in non-terminal segments. /// - int32, sint32, int64, sint64, sfixed32, sfixed64 are encoded as fixed width bytes with /// an encoding that enables sorted iteration. - /// - google.protobuf.Timestamp is encoded such that values with only seconds occupy 6 bytes, - /// values including nanos occupy 9 bytes, and nil values occupy 1 byte. When iterating, nil - /// values will always be ordered last. Seconds and nanos values must conform to the officially - /// specified ranges of 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z and 0 to 999,999,999 respectively. - /// - google.protobuf.Duration is encoded as 12 bytes using an encoding that enables sorted iteration. + /// - google.protobuf.Timestamp and google.protobuf.Duration are encoded + /// as 12 bytes using an encoding that enables sorted iteration. /// - enum fields are encoded using varint encoding and do not support sorted /// iteration. /// - bool fields are encoded as a single byte 0 or 1. diff --git a/packages/provwasm-std/src/types/cosmos/orm/v1alpha1.rs b/packages/provwasm-std/src/types/cosmos/orm/v1alpha1.rs index 7bf7c506..447a9eda 100644 --- a/packages/provwasm-std/src/types/cosmos/orm/v1alpha1.rs +++ b/packages/provwasm-std/src/types/cosmos/orm/v1alpha1.rs @@ -66,8 +66,11 @@ pub mod module_schema_descriptor { #[repr(i32)] #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum StorageType { - /// STORAGE_TYPE_DEFAULT_UNSPECIFIED indicates the persistent storage where all - /// data is stored in the regular Merkle-tree backed KV-store. + /// STORAGE_TYPE_DEFAULT_UNSPECIFIED indicates the persistent + /// KV-storage where primary key entries are stored in merkle-tree + /// backed commitment storage and indexes and seqs are stored in + /// fast index storage. Note that the Cosmos SDK before store/v2alpha1 + /// does not support this. DefaultUnspecified = 0, /// STORAGE_TYPE_MEMORY indicates in-memory storage that will be /// reloaded every time an app restarts. Tables with this type of storage @@ -79,6 +82,19 @@ pub enum StorageType { /// will by default be ignored when importing and exporting a module's /// state from JSON. Transient = 2, + /// STORAGE_TYPE_INDEX indicates persistent storage which is not backed + /// by a merkle-tree and won't affect the app hash. Note that the Cosmos SDK + /// before store/v2alpha1 does not support this. + Index = 3, + /// STORAGE_TYPE_INDEX indicates persistent storage which is backed by + /// a merkle-tree. With this type of storage, both primary and index keys + /// will affect the app hash and this is generally less efficient + /// than using STORAGE_TYPE_DEFAULT_UNSPECIFIED which separates index + /// keys into index storage. Note that modules built with the + /// Cosmos SDK before store/v2alpha1 must specify STORAGE_TYPE_COMMITMENT + /// instead of STORAGE_TYPE_DEFAULT_UNSPECIFIED or STORAGE_TYPE_INDEX + /// because this is the only type of persistent storage available. + Commitment = 4, } impl StorageType { /// String value of the enum field names used in the ProtoBuf definition. @@ -90,6 +106,8 @@ impl StorageType { StorageType::DefaultUnspecified => "STORAGE_TYPE_DEFAULT_UNSPECIFIED", StorageType::Memory => "STORAGE_TYPE_MEMORY", StorageType::Transient => "STORAGE_TYPE_TRANSIENT", + StorageType::Index => "STORAGE_TYPE_INDEX", + StorageType::Commitment => "STORAGE_TYPE_COMMITMENT", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -98,6 +116,8 @@ impl StorageType { "STORAGE_TYPE_DEFAULT_UNSPECIFIED" => Some(Self::DefaultUnspecified), "STORAGE_TYPE_MEMORY" => Some(Self::Memory), "STORAGE_TYPE_TRANSIENT" => Some(Self::Transient), + "STORAGE_TYPE_INDEX" => Some(Self::Index), + "STORAGE_TYPE_COMMITMENT" => Some(Self::Commitment), _ => None, } } diff --git a/packages/provwasm-std/src/types/cosmos/params/mod.rs b/packages/provwasm-std/src/types/cosmos/params/mod.rs index 537a3360..9f64fc82 100644 --- a/packages/provwasm-std/src/types/cosmos/params/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/params/mod.rs @@ -1,2 +1 @@ -pub mod module; pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/params/module/mod.rs b/packages/provwasm-std/src/types/cosmos/params/module/mod.rs deleted file mode 100644 index a3a6d96c..00000000 --- a/packages/provwasm-std/src/types/cosmos/params/module/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/params/module/v1.rs b/packages/provwasm-std/src/types/cosmos/params/module/v1.rs deleted file mode 100644 index 755b3601..00000000 --- a/packages/provwasm-std/src/types/cosmos/params/module/v1.rs +++ /dev/null @@ -1,15 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// Module is the config object of the params module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.params.module.v1.Module")] -pub struct Module {} diff --git a/packages/provwasm-std/src/types/cosmos/query/mod.rs b/packages/provwasm-std/src/types/cosmos/query/mod.rs deleted file mode 100644 index a3a6d96c..00000000 --- a/packages/provwasm-std/src/types/cosmos/query/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/query/v1.rs b/packages/provwasm-std/src/types/cosmos/query/v1.rs deleted file mode 100644 index 9b108c8e..00000000 --- a/packages/provwasm-std/src/types/cosmos/query/v1.rs +++ /dev/null @@ -1 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; diff --git a/packages/provwasm-std/src/types/cosmos/slashing/mod.rs b/packages/provwasm-std/src/types/cosmos/slashing/mod.rs index 537a3360..9f64fc82 100644 --- a/packages/provwasm-std/src/types/cosmos/slashing/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/slashing/mod.rs @@ -1,2 +1 @@ -pub mod module; pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/slashing/module/mod.rs b/packages/provwasm-std/src/types/cosmos/slashing/module/mod.rs deleted file mode 100644 index a3a6d96c..00000000 --- a/packages/provwasm-std/src/types/cosmos/slashing/module/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/slashing/module/v1.rs b/packages/provwasm-std/src/types/cosmos/slashing/module/v1.rs deleted file mode 100644 index 30607605..00000000 --- a/packages/provwasm-std/src/types/cosmos/slashing/module/v1.rs +++ /dev/null @@ -1,19 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// Module is the config object of the slashing module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.slashing.module.v1.Module")] -pub struct Module { - /// authority defines the custom module authority. If not set, defaults to the governance module. - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, -} diff --git a/packages/provwasm-std/src/types/cosmos/slashing/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/slashing/v1beta1.rs index b191bc46..8fd91f79 100644 --- a/packages/provwasm-std/src/types/cosmos/slashing/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/slashing/v1beta1.rs @@ -16,16 +16,16 @@ use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; pub struct ValidatorSigningInfo { #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, - /// Height at which validator was first a candidate OR was un-jailed + /// Height at which validator was first a candidate OR was unjailed #[prost(int64, tag = "2")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub start_height: i64, - /// Index which is incremented every time a validator is bonded in a block and - /// _may_ have signed a pre-commit or not. This in conjunction with the - /// signed_blocks_window param determines the index in the missed block bitmap. + /// Index which is incremented each time the validator was a bonded + /// in a block and may have signed a precommit or not. This in conjunction with the + /// `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`. #[prost(int64, tag = "3")] #[serde( serialize_with = "crate::serde::as_str::serialize", @@ -35,13 +35,12 @@ pub struct ValidatorSigningInfo { /// Timestamp until which the validator is jailed due to liveness downtime. #[prost(message, optional, tag = "4")] pub jailed_until: ::core::option::Option, - /// Whether or not a validator has been tombstoned (killed out of validator - /// set). It is set once the validator commits an equivocation or for any other - /// configured misbehavior. + /// Whether or not a validator has been tombstoned (killed out of validator set). It is set + /// once the validator commits an equivocation or for any other configured misbehiavor. #[prost(bool, tag = "5")] pub tombstoned: bool, - /// A counter of missed (unsigned) blocks. It is used to avoid unnecessary - /// reads in the missed block bitmap. + /// A counter kept to avoid unnecessary array reads. + /// Note that `Sum(MissedBlocksBitArray)` always equals `MissedBlocksCounter`. #[prost(int64, tag = "6")] #[serde( serialize_with = "crate::serde::as_str::serialize", @@ -104,7 +103,7 @@ pub struct Params { )] #[proto_message(type_url = "/cosmos.slashing.v1beta1.GenesisState")] pub struct GenesisState { - /// params defines all the parameters of the module. + /// params defines all the paramaters of related to deposit. #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, /// signing_infos represents a map between validator addresses and their @@ -335,48 +334,6 @@ pub struct MsgUnjail { )] #[proto_message(type_url = "/cosmos.slashing.v1beta1.MsgUnjailResponse")] pub struct MsgUnjailResponse {} -/// MsgUpdateParams is the Msg/UpdateParams request type. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.slashing.v1beta1.MsgUpdateParams")] -pub struct MsgUpdateParams { - /// authority is the address that controls the module (defaults to x/gov unless overwritten). - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// params defines the x/slashing parameters to update. - /// - /// NOTE: All parameters must be supplied. - #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, -} -/// MsgUpdateParamsResponse defines the response structure for executing a -/// MsgUpdateParams message. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.slashing.v1beta1.MsgUpdateParamsResponse")] -pub struct MsgUpdateParamsResponse {} pub struct SlashingQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } diff --git a/packages/provwasm-std/src/types/cosmos/staking/mod.rs b/packages/provwasm-std/src/types/cosmos/staking/mod.rs index 537a3360..9f64fc82 100644 --- a/packages/provwasm-std/src/types/cosmos/staking/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/staking/mod.rs @@ -1,2 +1 @@ -pub mod module; pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/staking/module/mod.rs b/packages/provwasm-std/src/types/cosmos/staking/module/mod.rs deleted file mode 100644 index a3a6d96c..00000000 --- a/packages/provwasm-std/src/types/cosmos/staking/module/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/staking/module/v1.rs b/packages/provwasm-std/src/types/cosmos/staking/module/v1.rs deleted file mode 100644 index fb352590..00000000 --- a/packages/provwasm-std/src/types/cosmos/staking/module/v1.rs +++ /dev/null @@ -1,30 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// Module is the config object of the staking module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.staking.module.v1.Module")] -pub struct Module { - /// hooks_order specifies the order of staking hooks and should be a list - /// of module names which provide a staking hooks instance. If no order is - /// provided, then hooks will be applied in alphabetical order of module names. - #[prost(string, repeated, tag = "1")] - pub hooks_order: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// authority defines the custom module authority. If not set, defaults to the governance module. - #[prost(string, tag = "2")] - pub authority: ::prost::alloc::string::String, - /// bech32_prefix_validator is the bech32 validator prefix for the app. - #[prost(string, tag = "3")] - pub bech32_prefix_validator: ::prost::alloc::string::String, - /// bech32_prefix_consensus is the bech32 consensus node prefix for the app. - #[prost(string, tag = "4")] - pub bech32_prefix_consensus: ::prost::alloc::string::String, -} diff --git a/packages/provwasm-std/src/types/cosmos/staking/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/staking/v1beta1.rs index 065fde68..384ed584 100644 --- a/packages/provwasm-std/src/types/cosmos/staking/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/staking/v1beta1.rs @@ -86,8 +86,6 @@ pub enum AuthorizationType { Undelegate = 2, /// AUTHORIZATION_TYPE_REDELEGATE defines an authorization type for Msg/BeginRedelegate Redelegate = 3, - /// AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION defines an authorization type for Msg/MsgCancelUnbondingDelegation - CancelUnbondingDelegation = 4, } impl AuthorizationType { /// String value of the enum field names used in the ProtoBuf definition. @@ -100,9 +98,6 @@ impl AuthorizationType { AuthorizationType::Delegate => "AUTHORIZATION_TYPE_DELEGATE", AuthorizationType::Undelegate => "AUTHORIZATION_TYPE_UNDELEGATE", AuthorizationType::Redelegate => "AUTHORIZATION_TYPE_REDELEGATE", - AuthorizationType::CancelUnbondingDelegation => { - "AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION" - } } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -112,9 +107,6 @@ impl AuthorizationType { "AUTHORIZATION_TYPE_DELEGATE" => Some(Self::Delegate), "AUTHORIZATION_TYPE_UNDELEGATE" => Some(Self::Undelegate), "AUTHORIZATION_TYPE_REDELEGATE" => Some(Self::Redelegate), - "AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION" => { - Some(Self::CancelUnbondingDelegation) - } _ => None, } } @@ -281,20 +273,6 @@ pub struct Validator { /// Since: cosmos-sdk 0.46 #[prost(string, tag = "11")] pub min_self_delegation: ::prost::alloc::string::String, - /// strictly positive if this validator's unbonding has been stopped by external modules - #[prost(int64, tag = "12")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub unbonding_on_hold_ref_count: i64, - /// list of unbonding ids, each uniquely identifing an unbonding of this validator - #[prost(uint64, repeated, tag = "13")] - #[serde( - serialize_with = "crate::serde::as_str_vec::serialize", - deserialize_with = "crate::serde::as_str_vec::deserialize" - )] - pub unbonding_ids: ::prost::alloc::vec::Vec, } /// ValAddresses defines a repeated set of validator addresses. #[allow(clippy::derive_partial_eq_without_eq)] @@ -408,10 +386,10 @@ pub struct DvvTriplets { )] #[proto_message(type_url = "/cosmos.staking.v1beta1.Delegation")] pub struct Delegation { - /// delegator_address is the encoded address of the delegator. + /// delegator_address is the bech32-encoded address of the delegator. #[prost(string, tag = "1")] pub delegator_address: ::prost::alloc::string::String, - /// validator_address is the encoded address of the validator. + /// validator_address is the bech32-encoded address of the validator. #[prost(string, tag = "2")] pub validator_address: ::prost::alloc::string::String, /// shares define the delegation shares received. @@ -433,10 +411,10 @@ pub struct Delegation { )] #[proto_message(type_url = "/cosmos.staking.v1beta1.UnbondingDelegation")] pub struct UnbondingDelegation { - /// delegator_address is the encoded address of the delegator. + /// delegator_address is the bech32-encoded address of the delegator. #[prost(string, tag = "1")] pub delegator_address: ::prost::alloc::string::String, - /// validator_address is the encoded address of the validator. + /// validator_address is the bech32-encoded address of the validator. #[prost(string, tag = "2")] pub validator_address: ::prost::alloc::string::String, /// entries are the unbonding delegation entries. @@ -475,20 +453,6 @@ pub struct UnbondingDelegationEntry { /// balance defines the tokens to receive at completion. #[prost(string, tag = "4")] pub balance: ::prost::alloc::string::String, - /// Incrementing id that uniquely identifies this entry - #[prost(uint64, tag = "5")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub unbonding_id: u64, - /// Strictly positive if this entry's unbonding has been stopped by external modules - #[prost(int64, tag = "6")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub unbonding_on_hold_ref_count: i64, } /// RedelegationEntry defines a redelegation object with relevant metadata. #[allow(clippy::derive_partial_eq_without_eq)] @@ -520,20 +484,6 @@ pub struct RedelegationEntry { /// shares_dst is the amount of destination-validator shares created by redelegation. #[prost(string, tag = "4")] pub shares_dst: ::prost::alloc::string::String, - /// Incrementing id that uniquely identifies this entry - #[prost(uint64, tag = "5")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub unbonding_id: u64, - /// Strictly positive if this entry's unbonding has been stopped by external modules - #[prost(int64, tag = "6")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub unbonding_on_hold_ref_count: i64, } /// Redelegation contains the list of a particular delegator's redelegating bonds /// from a particular source validator to a particular destination validator. @@ -565,7 +515,7 @@ pub struct Redelegation { #[prost(message, repeated, tag = "4")] pub entries: ::prost::alloc::vec::Vec, } -/// Params defines the parameters for the x/staking module. +/// Params defines the parameters for the staking module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -680,24 +630,6 @@ pub struct Pool { #[prost(string, tag = "2")] pub bonded_tokens: ::prost::alloc::string::String, } -/// ValidatorUpdates defines an array of abci.ValidatorUpdate objects. -/// TODO: explore moving this to proto/cosmos/base to separate modules from tendermint dependence -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.staking.v1beta1.ValidatorUpdates")] -pub struct ValidatorUpdates { - #[prost(message, repeated, tag = "1")] - pub updates: ::prost::alloc::vec::Vec, -} /// BondStatus is the status of a validator. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] @@ -736,40 +668,6 @@ impl BondStatus { } } } -/// Infraction indicates the infraction a validator commited. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] -pub enum Infraction { - /// UNSPECIFIED defines an empty infraction. - Unspecified = 0, - /// DOUBLE_SIGN defines a validator that double-signs a block. - DoubleSign = 1, - /// DOWNTIME defines a validator that missed signing too many blocks. - Downtime = 2, -} -impl Infraction { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Infraction::Unspecified => "INFRACTION_UNSPECIFIED", - Infraction::DoubleSign => "INFRACTION_DOUBLE_SIGN", - Infraction::Downtime => "INFRACTION_DOWNTIME", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "INFRACTION_UNSPECIFIED" => Some(Self::Unspecified), - "INFRACTION_DOUBLE_SIGN" => Some(Self::DoubleSign), - "INFRACTION_DOWNTIME" => Some(Self::Downtime), - _ => None, - } - } -} /// GenesisState defines the staking module's genesis state. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -784,7 +682,7 @@ impl Infraction { )] #[proto_message(type_url = "/cosmos.staking.v1beta1.GenesisState")] pub struct GenesisState { - /// params defines all the parameters of related to deposit. + /// params defines all the paramaters of related to deposit. #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, /// last_total_power tracks the total amounts of bonded tokens recorded during @@ -799,7 +697,7 @@ pub struct GenesisState { /// of the last-block's bonded validators. #[prost(message, repeated, tag = "3")] pub last_validator_powers: ::prost::alloc::vec::Vec, - /// validators defines the validator set at genesis. + /// delegations defines the validator set at genesis. #[prost(message, repeated, tag = "4")] pub validators: ::prost::alloc::vec::Vec, /// delegations defines the delegations active at genesis. @@ -811,7 +709,6 @@ pub struct GenesisState { /// redelegations defines the redelegations active at genesis. #[prost(message, repeated, tag = "7")] pub redelegations: ::prost::alloc::vec::Vec, - /// exported defines a bool to identify whether the chain dealing with exported or initialized genesis. #[prost(bool, tag = "8")] pub exported: bool, } @@ -1487,10 +1384,6 @@ pub struct MsgCreateValidator { pub commission: ::core::option::Option, #[prost(string, tag = "3")] pub min_self_delegation: ::prost::alloc::string::String, - /// Deprecated: Use of Delegator Address in MsgCreateValidator is deprecated. - /// The validator address bytes and delegator address bytes refer to the same account while creating validator (defer - /// only in bech32 notation). - #[deprecated] #[prost(string, tag = "4")] pub delegator_address: ::prost::alloc::string::String, #[prost(string, tag = "5")] @@ -1670,11 +1563,6 @@ pub struct MsgUndelegate { pub struct MsgUndelegateResponse { #[prost(message, optional, tag = "1")] pub completion_time: ::core::option::Option, - /// amount returns the amount of undelegated coins - /// - /// Since: cosmos-sdk 0.50 - #[prost(message, optional, tag = "2")] - pub amount: ::core::option::Option, } /// MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator /// @@ -1723,48 +1611,6 @@ pub struct MsgCancelUnbondingDelegation { )] #[proto_message(type_url = "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse")] pub struct MsgCancelUnbondingDelegationResponse {} -/// MsgUpdateParams is the Msg/UpdateParams request type. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.staking.v1beta1.MsgUpdateParams")] -pub struct MsgUpdateParams { - /// authority is the address that controls the module (defaults to x/gov unless overwritten). - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// params defines the x/staking parameters to update. - /// - /// NOTE: All parameters must be supplied. - #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, -} -/// MsgUpdateParamsResponse defines the response structure for executing a -/// MsgUpdateParams message. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.staking.v1beta1.MsgUpdateParamsResponse")] -pub struct MsgUpdateParamsResponse {} pub struct StakingQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } diff --git a/packages/provwasm-std/src/types/cosmos/store/internal/mod.rs b/packages/provwasm-std/src/types/cosmos/store/internal/mod.rs deleted file mode 100644 index 05c6d5b9..00000000 --- a/packages/provwasm-std/src/types/cosmos/store/internal/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod kv; diff --git a/packages/provwasm-std/src/types/cosmos/store/mod.rs b/packages/provwasm-std/src/types/cosmos/store/mod.rs deleted file mode 100644 index b772b151..00000000 --- a/packages/provwasm-std/src/types/cosmos/store/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -pub mod internal; -pub mod snapshots; -pub mod streaming; -pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/store/snapshots/mod.rs b/packages/provwasm-std/src/types/cosmos/store/snapshots/mod.rs deleted file mode 100644 index a3a6d96c..00000000 --- a/packages/provwasm-std/src/types/cosmos/store/snapshots/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/store/streaming/abci.rs b/packages/provwasm-std/src/types/cosmos/store/streaming/abci.rs deleted file mode 100644 index bb89c387..00000000 --- a/packages/provwasm-std/src/types/cosmos/store/streaming/abci.rs +++ /dev/null @@ -1,76 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// ListenEndBlockRequest is the request type for the ListenEndBlock RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.store.streaming.abci.ListenFinalizeBlockRequest")] -pub struct ListenFinalizeBlockRequest { - #[prost(message, optional, tag = "1")] - pub req: - ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub res: - ::core::option::Option, -} -/// ListenEndBlockResponse is the response type for the ListenEndBlock RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.store.streaming.abci.ListenFinalizeBlockResponse")] -pub struct ListenFinalizeBlockResponse {} -/// ListenCommitRequest is the request type for the ListenCommit RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.store.streaming.abci.ListenCommitRequest")] -pub struct ListenCommitRequest { - /// explicitly pass in block height as ResponseCommit does not contain this info - #[prost(int64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub block_height: i64, - #[prost(message, optional, tag = "2")] - pub res: ::core::option::Option, - #[prost(message, repeated, tag = "3")] - pub change_set: ::prost::alloc::vec::Vec, -} -/// ListenCommitResponse is the response type for the ListenCommit RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.store.streaming.abci.ListenCommitResponse")] -pub struct ListenCommitResponse {} diff --git a/packages/provwasm-std/src/types/capability/mod.rs b/packages/provwasm-std/src/types/cosmos/streaming/abci/mod.rs similarity index 100% rename from packages/provwasm-std/src/types/capability/mod.rs rename to packages/provwasm-std/src/types/cosmos/streaming/abci/mod.rs diff --git a/packages/provwasm-std/src/types/cosmos/streaming/abci/v1.rs b/packages/provwasm-std/src/types/cosmos/streaming/abci/v1.rs new file mode 100644 index 00000000..96a55ea9 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/streaming/abci/v1.rs @@ -0,0 +1,151 @@ +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; +/// ListenBeginBlockRequest is the request type for the ListenBeginBlock RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmos.streaming.abci.v1.ListenBeginBlockRequest")] +pub struct ListenBeginBlockRequest { + #[prost(message, optional, tag = "1")] + pub req: + ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub res: + ::core::option::Option, +} +/// ListenBeginBlockResponse is the response type for the ListenBeginBlock RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmos.streaming.abci.v1.ListenBeginBlockResponse")] +pub struct ListenBeginBlockResponse {} +/// ListenEndBlockRequest is the request type for the ListenEndBlock RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmos.streaming.abci.v1.ListenEndBlockRequest")] +pub struct ListenEndBlockRequest { + #[prost(message, optional, tag = "1")] + pub req: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub res: ::core::option::Option, +} +/// ListenEndBlockResponse is the response type for the ListenEndBlock RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmos.streaming.abci.v1.ListenEndBlockResponse")] +pub struct ListenEndBlockResponse {} +/// ListenDeliverTxRequest is the request type for the ListenDeliverTx RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmos.streaming.abci.v1.ListenDeliverTxRequest")] +pub struct ListenDeliverTxRequest { + /// explicitly pass in block height as neither RequestDeliverTx or ResponseDeliverTx contain it + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub block_height: i64, + #[prost(message, optional, tag = "2")] + pub req: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub res: + ::core::option::Option, +} +/// ListenDeliverTxResponse is the response type for the ListenDeliverTx RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmos.streaming.abci.v1.ListenDeliverTxResponse")] +pub struct ListenDeliverTxResponse {} +/// ListenCommitRequest is the request type for the ListenCommit RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmos.streaming.abci.v1.ListenCommitRequest")] +pub struct ListenCommitRequest { + /// explicitly pass in block height as ResponseCommit does not contain this info + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub block_height: i64, + #[prost(message, optional, tag = "2")] + pub res: ::core::option::Option, + #[prost(message, repeated, tag = "3")] + pub change_set: + ::prost::alloc::vec::Vec, +} +/// ListenCommitResponse is the response type for the ListenCommit RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmos.streaming.abci.v1.ListenCommitResponse")] +pub struct ListenCommitResponse {} diff --git a/packages/provwasm-std/src/types/cosmos/store/streaming/mod.rs b/packages/provwasm-std/src/types/cosmos/streaming/mod.rs similarity index 100% rename from packages/provwasm-std/src/types/cosmos/store/streaming/mod.rs rename to packages/provwasm-std/src/types/cosmos/streaming/mod.rs diff --git a/packages/provwasm-std/src/types/cosmos/tx/config/mod.rs b/packages/provwasm-std/src/types/cosmos/tx/config/mod.rs deleted file mode 100644 index a3a6d96c..00000000 --- a/packages/provwasm-std/src/types/cosmos/tx/config/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/tx/config/v1.rs b/packages/provwasm-std/src/types/cosmos/tx/config/v1.rs deleted file mode 100644 index 3c3099c7..00000000 --- a/packages/provwasm-std/src/types/cosmos/tx/config/v1.rs +++ /dev/null @@ -1,24 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// Config is the config object of the x/auth/tx package. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.tx.config.v1.Config")] -pub struct Config { - /// skip_ante_handler defines whether the ante handler registration should be skipped in case an app wants to override - /// this functionality. - #[prost(bool, tag = "1")] - pub skip_ante_handler: bool, - /// skip_post_handler defines whether the post handler registration should be skipped in case an app wants to override - /// this functionality. - #[prost(bool, tag = "2")] - pub skip_post_handler: bool, -} diff --git a/packages/provwasm-std/src/types/cosmos/tx/mod.rs b/packages/provwasm-std/src/types/cosmos/tx/mod.rs index 404cbb51..401d83ce 100644 --- a/packages/provwasm-std/src/types/cosmos/tx/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/tx/mod.rs @@ -1,3 +1,2 @@ -pub mod config; pub mod signing; pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/tx/signing/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/tx/signing/v1beta1.rs index c8c0b48f..9225ee27 100644 --- a/packages/provwasm-std/src/types/cosmos/tx/signing/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/tx/signing/v1beta1.rs @@ -166,13 +166,12 @@ pub enum SignMode { Direct = 1, /// SIGN_MODE_TEXTUAL is a future signing mode that will verify some /// human-readable textual representation on top of the binary representation - /// from SIGN_MODE_DIRECT. - /// - /// Since: cosmos-sdk 0.50 + /// from SIGN_MODE_DIRECT. It is currently not supported. Textual = 2, /// SIGN_MODE_DIRECT_AUX specifies a signing mode which uses /// SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not - /// require signers signing over other signers' `signer_info`. + /// require signers signing over other signers' `signer_info`. It also allows + /// for adding Tips in transactions. /// /// Since: cosmos-sdk 0.46 DirectAux = 3, diff --git a/packages/provwasm-std/src/types/cosmos/tx/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/tx/v1beta1.rs index a47f1893..9a111ebe 100644 --- a/packages/provwasm-std/src/types/cosmos/tx/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/tx/v1beta1.rs @@ -156,8 +156,12 @@ pub struct SignDocDirectAux { deserialize_with = "crate::serde::as_str::deserialize" )] pub sequence: u64, - /// tips have been depreacted and should not be used - #[deprecated] + /// Tip is the optional tip used for transactions fees paid in another denom. + /// It should be left empty if the signer is not the tipper for this + /// transaction. + /// + /// This field is ignored if the chain didn't enable tips, i.e. didn't add the + /// `TipDecorator` in its posthandler. #[prost(message, optional, tag = "6")] pub tip: ::core::option::Option, } @@ -241,7 +245,6 @@ pub struct AuthInfo { /// `TipDecorator` in its posthandler. /// /// Since: cosmos-sdk 0.46 - #[deprecated] #[prost(message, optional, tag = "3")] pub tip: ::core::option::Option, } @@ -422,7 +425,6 @@ pub struct Fee { CosmwasmExt, )] #[proto_message(type_url = "/cosmos.tx.v1beta1.Tip")] -#[deprecated] pub struct Tip { /// amount is the amount of the tip #[prost(message, repeated, tag = "1")] @@ -491,9 +493,6 @@ pub struct AuxSignerData { #[proto_message(type_url = "/cosmos.tx.v1beta1.GetTxsEventRequest")] pub struct GetTxsEventRequest { /// events is the list of transaction event type. - /// Deprecated post v0.47.x: use query instead, which should contain a valid - /// events query. - #[deprecated] #[prost(string, repeated, tag = "1")] pub events: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, /// pagination defines a pagination for the request. @@ -507,8 +506,7 @@ pub struct GetTxsEventRequest { deserialize_with = "OrderBy::deserialize" )] pub order_by: i32, - /// page is the page number to query, starts at 1. If not provided, will - /// default to first page. + /// page is the page number to query, starts at 1. If not provided, will default to first page. #[prost(uint64, tag = "4")] #[serde( serialize_with = "crate::serde::as_str::serialize", @@ -523,12 +521,6 @@ pub struct GetTxsEventRequest { deserialize_with = "crate::serde::as_str::deserialize" )] pub limit: u64, - /// query defines the transaction event query that is proxied to Tendermint's - /// TxSearch RPC method. The query must be valid. - /// - /// Since cosmos-sdk 0.50 - #[prost(string, tag = "6")] - pub query: ::prost::alloc::string::String, } /// GetTxsEventResponse is the response type for the Service.TxsByEvents /// RPC method. @@ -732,8 +724,7 @@ pub struct GetBlockWithTxsRequest { #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } -/// GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs -/// method. +/// GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. /// /// Since: cosmos-sdk 0.45.2 #[allow(clippy::derive_partial_eq_without_eq)] @@ -760,193 +751,12 @@ pub struct GetBlockWithTxsResponse { #[prost(message, optional, tag = "4")] pub pagination: ::core::option::Option, } -/// TxDecodeRequest is the request type for the Service.TxDecode -/// RPC method. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.tx.v1beta1.TxDecodeRequest")] -pub struct TxDecodeRequest { - /// tx_bytes is the raw transaction. - #[prost(bytes = "vec", tag = "1")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub tx_bytes: ::prost::alloc::vec::Vec, -} -/// TxDecodeResponse is the response type for the -/// Service.TxDecode method. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.tx.v1beta1.TxDecodeResponse")] -pub struct TxDecodeResponse { - /// tx is the decoded transaction. - #[prost(message, optional, tag = "1")] - pub tx: ::core::option::Option, -} -/// TxEncodeRequest is the request type for the Service.TxEncode -/// RPC method. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.tx.v1beta1.TxEncodeRequest")] -pub struct TxEncodeRequest { - /// tx is the transaction to encode. - #[prost(message, optional, tag = "1")] - pub tx: ::core::option::Option, -} -/// TxEncodeResponse is the response type for the -/// Service.TxEncode method. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.tx.v1beta1.TxEncodeResponse")] -pub struct TxEncodeResponse { - /// tx_bytes is the encoded transaction bytes. - #[prost(bytes = "vec", tag = "1")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub tx_bytes: ::prost::alloc::vec::Vec, -} -/// TxEncodeAminoRequest is the request type for the Service.TxEncodeAmino -/// RPC method. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.tx.v1beta1.TxEncodeAminoRequest")] -pub struct TxEncodeAminoRequest { - #[prost(string, tag = "1")] - pub amino_json: ::prost::alloc::string::String, -} -/// TxEncodeAminoResponse is the response type for the Service.TxEncodeAmino -/// RPC method. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.tx.v1beta1.TxEncodeAminoResponse")] -pub struct TxEncodeAminoResponse { - #[prost(bytes = "vec", tag = "1")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub amino_binary: ::prost::alloc::vec::Vec, -} -/// TxDecodeAminoRequest is the request type for the Service.TxDecodeAmino -/// RPC method. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.tx.v1beta1.TxDecodeAminoRequest")] -pub struct TxDecodeAminoRequest { - #[prost(bytes = "vec", tag = "1")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub amino_binary: ::prost::alloc::vec::Vec, -} -/// TxDecodeAminoResponse is the response type for the Service.TxDecodeAmino -/// RPC method. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.tx.v1beta1.TxDecodeAminoResponse")] -pub struct TxDecodeAminoResponse { - #[prost(string, tag = "1")] - pub amino_json: ::prost::alloc::string::String, -} /// OrderBy defines the sorting order #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum OrderBy { - /// ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults - /// to ASC in this case. + /// ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. Unspecified = 0, /// ORDER_BY_ASC defines ascending order Asc = 1, @@ -975,22 +785,21 @@ impl OrderBy { } } } -/// BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC -/// method. +/// BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum BroadcastMode { /// zero-value for mode ordering Unspecified = 0, - /// DEPRECATED: use BROADCAST_MODE_SYNC instead, - /// BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. + /// BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for + /// the tx to be committed in a block. Block = 1, - /// BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits - /// for a CheckTx execution response only. + /// BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for + /// a CheckTx execution response only. Sync = 2, - /// BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client - /// returns immediately. + /// BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns + /// immediately. Async = 3, } impl BroadcastMode { diff --git a/packages/provwasm-std/src/types/cosmos/upgrade/mod.rs b/packages/provwasm-std/src/types/cosmos/upgrade/mod.rs index 537a3360..9f64fc82 100644 --- a/packages/provwasm-std/src/types/cosmos/upgrade/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/upgrade/mod.rs @@ -1,2 +1 @@ -pub mod module; pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/upgrade/module/mod.rs b/packages/provwasm-std/src/types/cosmos/upgrade/module/mod.rs deleted file mode 100644 index a3a6d96c..00000000 --- a/packages/provwasm-std/src/types/cosmos/upgrade/module/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/upgrade/module/v1.rs b/packages/provwasm-std/src/types/cosmos/upgrade/module/v1.rs deleted file mode 100644 index 952929ee..00000000 --- a/packages/provwasm-std/src/types/cosmos/upgrade/module/v1.rs +++ /dev/null @@ -1,19 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// Module is the config object of the upgrade module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.upgrade.module.v1.Module")] -pub struct Module { - /// authority defines the custom module authority. If not set, defaults to the governance module. - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, -} diff --git a/packages/provwasm-std/src/types/cosmos/upgrade/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/upgrade/v1beta1.rs index 1c1c149a..468a00a2 100644 --- a/packages/provwasm-std/src/types/cosmos/upgrade/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/upgrade/v1beta1.rs @@ -29,6 +29,7 @@ pub struct Plan { #[prost(message, optional, tag = "2")] pub time: ::core::option::Option, /// The height at which the upgrade must be performed. + /// Only used if Time is not set. #[prost(int64, tag = "3")] #[serde( serialize_with = "crate::serde::as_str::serialize", @@ -64,13 +65,10 @@ pub struct Plan { #[proto_message(type_url = "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal")] #[deprecated] pub struct SoftwareUpgradeProposal { - /// title of the proposal #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, - /// description of the proposal #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, - /// plan of the proposal #[prost(message, optional, tag = "3")] pub plan: ::core::option::Option, } @@ -92,10 +90,8 @@ pub struct SoftwareUpgradeProposal { #[proto_message(type_url = "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal")] #[deprecated] pub struct CancelSoftwareUpgradeProposal { - /// title of the proposal #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, - /// description of the proposal #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, } @@ -366,7 +362,7 @@ pub struct QueryAuthorityResponse { )] #[proto_message(type_url = "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade")] pub struct MsgSoftwareUpgrade { - /// authority is the address that controls the module (defaults to x/gov unless overwritten). + /// authority is the address of the governance account. #[prost(string, tag = "1")] pub authority: ::prost::alloc::string::String, /// plan is the upgrade plan. @@ -405,7 +401,7 @@ pub struct MsgSoftwareUpgradeResponse {} )] #[proto_message(type_url = "/cosmos.upgrade.v1beta1.MsgCancelUpgrade")] pub struct MsgCancelUpgrade { - /// authority is the address that controls the module (defaults to x/gov unless overwritten). + /// authority is the address of the governance account. #[prost(string, tag = "1")] pub authority: ::prost::alloc::string::String, } diff --git a/packages/provwasm-std/src/types/cosmos/vesting/mod.rs b/packages/provwasm-std/src/types/cosmos/vesting/mod.rs index 537a3360..9f64fc82 100644 --- a/packages/provwasm-std/src/types/cosmos/vesting/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/vesting/mod.rs @@ -1,2 +1 @@ -pub mod module; pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/vesting/module/mod.rs b/packages/provwasm-std/src/types/cosmos/vesting/module/mod.rs deleted file mode 100644 index a3a6d96c..00000000 --- a/packages/provwasm-std/src/types/cosmos/vesting/module/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/vesting/module/v1.rs b/packages/provwasm-std/src/types/cosmos/vesting/module/v1.rs deleted file mode 100644 index d478608d..00000000 --- a/packages/provwasm-std/src/types/cosmos/vesting/module/v1.rs +++ /dev/null @@ -1,15 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// Module is the config object of the vesting module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.vesting.module.v1.Module")] -pub struct Module {} diff --git a/packages/provwasm-std/src/types/cosmwasm/wasm/v1.rs b/packages/provwasm-std/src/types/cosmwasm/wasm/v1.rs index a17725c0..0fbde84b 100644 --- a/packages/provwasm-std/src/types/cosmwasm/wasm/v1.rs +++ b/packages/provwasm-std/src/types/cosmwasm/wasm/v1.rs @@ -1,4 +1,195 @@ use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; +/// ContractExecutionAuthorization defines authorization for wasm execute. +/// Since: wasmd 0.30 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.ContractExecutionAuthorization")] +pub struct ContractExecutionAuthorization { + /// Grants for contract executions + #[prost(message, repeated, tag = "1")] + pub grants: ::prost::alloc::vec::Vec, +} +/// ContractMigrationAuthorization defines authorization for wasm contract +/// migration. Since: wasmd 0.30 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.ContractMigrationAuthorization")] +pub struct ContractMigrationAuthorization { + /// Grants for contract migrations + #[prost(message, repeated, tag = "1")] + pub grants: ::prost::alloc::vec::Vec, +} +/// ContractGrant a granted permission for a single contract +/// Since: wasmd 0.30 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.ContractGrant")] +pub struct ContractGrant { + /// Contract is the bech32 address of the smart contract + #[prost(string, tag = "1")] + pub contract: ::prost::alloc::string::String, + /// Limit defines execution limits that are enforced and updated when the grant + /// is applied. When the limit lapsed the grant is removed. + #[prost(message, optional, tag = "2")] + pub limit: ::core::option::Option, + /// Filter define more fine-grained control on the message payload passed + /// to the contract in the operation. When no filter applies on execution, the + /// operation is prohibited. + #[prost(message, optional, tag = "3")] + pub filter: ::core::option::Option, +} +/// MaxCallsLimit limited number of calls to the contract. No funds transferable. +/// Since: wasmd 0.30 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.MaxCallsLimit")] +pub struct MaxCallsLimit { + /// Remaining number that is decremented on each execution + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub remaining: u64, +} +/// MaxFundsLimit defines the maximal amounts that can be sent to the contract. +/// Since: wasmd 0.30 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.MaxFundsLimit")] +pub struct MaxFundsLimit { + /// Amounts is the maximal amount of tokens transferable to the contract. + #[prost(message, repeated, tag = "1")] + pub amounts: ::prost::alloc::vec::Vec, +} +/// CombinedLimit defines the maximal amounts that can be sent to a contract and +/// the maximal number of calls executable. Both need to remain >0 to be valid. +/// Since: wasmd 0.30 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.CombinedLimit")] +pub struct CombinedLimit { + /// Remaining number that is decremented on each execution + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub calls_remaining: u64, + /// Amounts is the maximal amount of tokens transferable to the contract. + #[prost(message, repeated, tag = "2")] + pub amounts: ::prost::alloc::vec::Vec, +} +/// AllowAllMessagesFilter is a wildcard to allow any type of contract payload +/// message. +/// Since: wasmd 0.30 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.AllowAllMessagesFilter")] +pub struct AllowAllMessagesFilter {} +/// AcceptedMessageKeysFilter accept only the specific contract message keys in +/// the json object to be executed. +/// Since: wasmd 0.30 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.AcceptedMessageKeysFilter")] +pub struct AcceptedMessageKeysFilter { + /// Messages is the list of unique keys + #[prost(string, repeated, tag = "1")] + pub keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// AcceptedMessagesFilter accept only the specific raw contract messages to be +/// executed. +/// Since: wasmd 0.30 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.AcceptedMessagesFilter")] +pub struct AcceptedMessagesFilter { + /// Messages is the list of raw contract messages + #[prost(bytes = "vec", repeated, tag = "1")] + pub messages: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} /// AccessTypeParam #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -40,6 +231,10 @@ pub struct AccessConfig { deserialize_with = "AccessType::deserialize" )] pub permission: i32, + /// Address + /// Deprecated: replaced by addresses + #[prost(string, tag = "2")] + pub address: ::prost::alloc::string::String, #[prost(string, repeated, tag = "3")] pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } @@ -240,6 +435,9 @@ pub enum AccessType { Unspecified = 0, /// AccessTypeNobody forbidden Nobody = 1, + /// AccessTypeOnlyAddress restricted to a single address + /// Deprecated: use AccessTypeAnyOfAddresses instead + OnlyAddress = 2, /// AccessTypeEverybody unrestricted Everybody = 3, /// AccessTypeAnyOfAddresses allow any of the addresses @@ -254,6 +452,7 @@ impl AccessType { match self { AccessType::Unspecified => "ACCESS_TYPE_UNSPECIFIED", AccessType::Nobody => "ACCESS_TYPE_NOBODY", + AccessType::OnlyAddress => "ACCESS_TYPE_ONLY_ADDRESS", AccessType::Everybody => "ACCESS_TYPE_EVERYBODY", AccessType::AnyOfAddresses => "ACCESS_TYPE_ANY_OF_ADDRESSES", } @@ -263,6 +462,7 @@ impl AccessType { match value { "ACCESS_TYPE_UNSPECIFIED" => Some(Self::Unspecified), "ACCESS_TYPE_NOBODY" => Some(Self::Nobody), + "ACCESS_TYPE_ONLY_ADDRESS" => Some(Self::OnlyAddress), "ACCESS_TYPE_EVERYBODY" => Some(Self::Everybody), "ACCESS_TYPE_ANY_OF_ADDRESSES" => Some(Self::AnyOfAddresses), _ => None, @@ -313,27 +513,7 @@ impl ContractCodeHistoryOperationType { } } } -/// StoreCodeAuthorization defines authorization for wasm code upload. -/// Since: wasmd 0.42 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.StoreCodeAuthorization")] -pub struct StoreCodeAuthorization { - /// Grants for code upload - #[prost(message, repeated, tag = "1")] - pub grants: ::prost::alloc::vec::Vec, -} -/// ContractExecutionAuthorization defines authorization for wasm execute. -/// Since: wasmd 0.30 +/// MsgStoreCode submit Wasm code to the system #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -345,14 +525,24 @@ pub struct StoreCodeAuthorization { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.ContractExecutionAuthorization")] -pub struct ContractExecutionAuthorization { - /// Grants for contract executions - #[prost(message, repeated, tag = "1")] - pub grants: ::prost::alloc::vec::Vec, +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgStoreCode")] +pub struct MsgStoreCode { + /// Sender is the that actor that signed the messages + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + /// WASMByteCode can be raw or gzip compressed + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub wasm_byte_code: ::prost::alloc::vec::Vec, + /// InstantiatePermission access control to apply on contract creation, + /// optional + #[prost(message, optional, tag = "5")] + pub instantiate_permission: ::core::option::Option, } -/// ContractMigrationAuthorization defines authorization for wasm contract -/// migration. Since: wasmd 0.30 +/// MsgStoreCodeResponse returns store result data. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -364,13 +554,25 @@ pub struct ContractExecutionAuthorization { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.ContractMigrationAuthorization")] -pub struct ContractMigrationAuthorization { - /// Grants for contract migrations - #[prost(message, repeated, tag = "1")] - pub grants: ::prost::alloc::vec::Vec, +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgStoreCodeResponse")] +pub struct MsgStoreCodeResponse { + /// CodeID is the reference to the stored WASM code + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code_id: u64, + /// Checksum is the sha256 hash of the stored code + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub checksum: ::prost::alloc::vec::Vec, } -/// CodeGrant a granted permission for a single code +/// MsgInstantiateContract create a new smart contract instance for the given +/// code id. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -382,1040 +584,37 @@ pub struct ContractMigrationAuthorization { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.CodeGrant")] -pub struct CodeGrant { - /// CodeHash is the unique identifier created by wasmvm - /// Wildcard "*" is used to specify any kind of grant. - #[prost(bytes = "vec", tag = "1")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub code_hash: ::prost::alloc::vec::Vec, - /// InstantiatePermission is the superset access control to apply - /// on contract creation. - /// Optional - #[prost(message, optional, tag = "2")] - pub instantiate_permission: ::core::option::Option, -} -/// ContractGrant a granted permission for a single contract -/// Since: wasmd 0.30 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.ContractGrant")] -pub struct ContractGrant { - /// Contract is the bech32 address of the smart contract - #[prost(string, tag = "1")] - pub contract: ::prost::alloc::string::String, - /// Limit defines execution limits that are enforced and updated when the grant - /// is applied. When the limit lapsed the grant is removed. - #[prost(message, optional, tag = "2")] - pub limit: ::core::option::Option, - /// Filter define more fine-grained control on the message payload passed - /// to the contract in the operation. When no filter applies on execution, the - /// operation is prohibited. - #[prost(message, optional, tag = "3")] - pub filter: ::core::option::Option, -} -/// MaxCallsLimit limited number of calls to the contract. No funds transferable. -/// Since: wasmd 0.30 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MaxCallsLimit")] -pub struct MaxCallsLimit { - /// Remaining number that is decremented on each execution - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub remaining: u64, -} -/// MaxFundsLimit defines the maximal amounts that can be sent to the contract. -/// Since: wasmd 0.30 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MaxFundsLimit")] -pub struct MaxFundsLimit { - /// Amounts is the maximal amount of tokens transferable to the contract. - #[prost(message, repeated, tag = "1")] - pub amounts: ::prost::alloc::vec::Vec, -} -/// CombinedLimit defines the maximal amounts that can be sent to a contract and -/// the maximal number of calls executable. Both need to remain >0 to be valid. -/// Since: wasmd 0.30 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.CombinedLimit")] -pub struct CombinedLimit { - /// Remaining number that is decremented on each execution - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub calls_remaining: u64, - /// Amounts is the maximal amount of tokens transferable to the contract. - #[prost(message, repeated, tag = "2")] - pub amounts: ::prost::alloc::vec::Vec, -} -/// AllowAllMessagesFilter is a wildcard to allow any type of contract payload -/// message. -/// Since: wasmd 0.30 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.AllowAllMessagesFilter")] -pub struct AllowAllMessagesFilter {} -/// AcceptedMessageKeysFilter accept only the specific contract message keys in -/// the json object to be executed. -/// Since: wasmd 0.30 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.AcceptedMessageKeysFilter")] -pub struct AcceptedMessageKeysFilter { - /// Messages is the list of unique keys - #[prost(string, repeated, tag = "1")] - pub keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// AcceptedMessagesFilter accept only the specific raw contract messages to be -/// executed. -/// Since: wasmd 0.30 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.AcceptedMessagesFilter")] -pub struct AcceptedMessagesFilter { - /// Messages is the list of raw contract messages - #[prost(bytes = "vec", repeated, tag = "1")] - pub messages: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, -} -/// GenesisState - genesis state of x/wasm -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.GenesisState")] -pub struct GenesisState { - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, - #[prost(message, repeated, tag = "2")] - pub codes: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "3")] - pub contracts: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "4")] - pub sequences: ::prost::alloc::vec::Vec, -} -/// Code struct encompasses CodeInfo and CodeBytes -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.Code")] -pub struct Code { - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub code_id: u64, - #[prost(message, optional, tag = "2")] - pub code_info: ::core::option::Option, - #[prost(bytes = "vec", tag = "3")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub code_bytes: ::prost::alloc::vec::Vec, - /// Pinned to wasmvm cache - #[prost(bool, tag = "4")] - pub pinned: bool, -} -/// Contract struct encompasses ContractAddress, ContractInfo, and ContractState -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.Contract")] -pub struct Contract { - #[prost(string, tag = "1")] - pub contract_address: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub contract_info: ::core::option::Option, - #[prost(message, repeated, tag = "3")] - pub contract_state: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "4")] - pub contract_code_history: ::prost::alloc::vec::Vec, -} -/// Sequence key and value of an id generation counter -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.Sequence")] -pub struct Sequence { - #[prost(bytes = "vec", tag = "1")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub id_key: ::prost::alloc::vec::Vec, - #[prost(uint64, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub value: u64, -} -/// MsgIBCSend -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgIBCSend")] -pub struct MsgIbcSend { - /// the channel by which the packet will be sent - #[prost(string, tag = "2")] - pub channel: ::prost::alloc::string::String, - /// Timeout height relative to the current block height. - /// The timeout is disabled when set to 0. - #[prost(uint64, tag = "4")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub timeout_height: u64, - /// Timeout timestamp (in nanoseconds) relative to the current block timestamp. - /// The timeout is disabled when set to 0. - #[prost(uint64, tag = "5")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub timeout_timestamp: u64, - /// Data is the payload to transfer. We must not make assumption what format or - /// content is in here. - #[prost(bytes = "vec", tag = "6")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub data: ::prost::alloc::vec::Vec, -} -/// MsgIBCSendResponse -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgIBCSendResponse")] -pub struct MsgIbcSendResponse { - /// Sequence number of the IBC packet sent - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub sequence: u64, -} -/// MsgIBCWriteAcknowledgementResponse -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgIBCWriteAcknowledgementResponse")] -pub struct MsgIbcWriteAcknowledgementResponse {} -/// MsgIBCCloseChannel port and channel need to be owned by the contract -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgIBCCloseChannel")] -pub struct MsgIbcCloseChannel { - #[prost(string, tag = "2")] - pub channel: ::prost::alloc::string::String, -} -/// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for -/// an explicit StoreCodeProposal. To submit WASM code to the system, -/// a simple MsgStoreCode can be invoked from the x/gov module via -/// a v1 governance proposal. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.StoreCodeProposal")] -#[deprecated] -pub struct StoreCodeProposal { - /// Title is a short summary - #[prost(string, tag = "1")] - pub title: ::prost::alloc::string::String, - /// Description is a human readable text - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - /// RunAs is the address that is passed to the contract's environment as sender - #[prost(string, tag = "3")] - pub run_as: ::prost::alloc::string::String, - /// WASMByteCode can be raw or gzip compressed - #[prost(bytes = "vec", tag = "4")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub wasm_byte_code: ::prost::alloc::vec::Vec, - /// InstantiatePermission to apply on contract creation, optional - #[prost(message, optional, tag = "7")] - pub instantiate_permission: ::core::option::Option, - /// UnpinCode code on upload, optional - #[prost(bool, tag = "8")] - pub unpin_code: bool, - /// Source is the URL where the code is hosted - #[prost(string, tag = "9")] - pub source: ::prost::alloc::string::String, - /// Builder is the docker image used to build the code deterministically, used - /// for smart contract verification - #[prost(string, tag = "10")] - pub builder: ::prost::alloc::string::String, - /// CodeHash is the SHA256 sum of the code outputted by builder, used for smart - /// contract verification - #[prost(bytes = "vec", tag = "11")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub code_hash: ::prost::alloc::vec::Vec, -} -/// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for -/// an explicit InstantiateContractProposal. To instantiate a contract, -/// a simple MsgInstantiateContract can be invoked from the x/gov module via -/// a v1 governance proposal. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.InstantiateContractProposal")] -#[deprecated] -pub struct InstantiateContractProposal { - /// Title is a short summary - #[prost(string, tag = "1")] - pub title: ::prost::alloc::string::String, - /// Description is a human readable text - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - /// RunAs is the address that is passed to the contract's environment as sender - #[prost(string, tag = "3")] - pub run_as: ::prost::alloc::string::String, - /// Admin is an optional address that can execute migrations - #[prost(string, tag = "4")] - pub admin: ::prost::alloc::string::String, - /// CodeID is the reference to the stored WASM code - #[prost(uint64, tag = "5")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub code_id: u64, - /// Label is optional metadata to be stored with a constract instance. - #[prost(string, tag = "6")] - pub label: ::prost::alloc::string::String, - /// Msg json encoded message to be passed to the contract on instantiation - #[prost(bytes = "vec", tag = "7")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub msg: ::prost::alloc::vec::Vec, - /// Funds coins that are transferred to the contract on instantiation - #[prost(message, repeated, tag = "8")] - pub funds: ::prost::alloc::vec::Vec, -} -/// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for -/// an explicit InstantiateContract2Proposal. To instantiate contract 2, -/// a simple MsgInstantiateContract2 can be invoked from the x/gov module via -/// a v1 governance proposal. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.InstantiateContract2Proposal")] -#[deprecated] -pub struct InstantiateContract2Proposal { - /// Title is a short summary - #[prost(string, tag = "1")] - pub title: ::prost::alloc::string::String, - /// Description is a human readable text - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - /// RunAs is the address that is passed to the contract's enviroment as sender - #[prost(string, tag = "3")] - pub run_as: ::prost::alloc::string::String, - /// Admin is an optional address that can execute migrations - #[prost(string, tag = "4")] - pub admin: ::prost::alloc::string::String, - /// CodeID is the reference to the stored WASM code - #[prost(uint64, tag = "5")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub code_id: u64, - /// Label is optional metadata to be stored with a constract instance. - #[prost(string, tag = "6")] - pub label: ::prost::alloc::string::String, - /// Msg json encode message to be passed to the contract on instantiation - #[prost(bytes = "vec", tag = "7")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub msg: ::prost::alloc::vec::Vec, - /// Funds coins that are transferred to the contract on instantiation - #[prost(message, repeated, tag = "8")] - pub funds: ::prost::alloc::vec::Vec, - /// Salt is an arbitrary value provided by the sender. Size can be 1 to 64. - #[prost(bytes = "vec", tag = "9")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub salt: ::prost::alloc::vec::Vec, - /// FixMsg include the msg value into the hash for the predictable address. - /// Default is false - #[prost(bool, tag = "10")] - pub fix_msg: bool, -} -/// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for -/// an explicit MigrateContractProposal. To migrate a contract, -/// a simple MsgMigrateContract can be invoked from the x/gov module via -/// a v1 governance proposal. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MigrateContractProposal")] -#[deprecated] -pub struct MigrateContractProposal { - /// Title is a short summary - #[prost(string, tag = "1")] - pub title: ::prost::alloc::string::String, - /// Description is a human readable text - /// - /// Note: skipping 3 as this was previously used for unneeded run_as - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - /// Contract is the address of the smart contract - #[prost(string, tag = "4")] - pub contract: ::prost::alloc::string::String, - /// CodeID references the new WASM code - #[prost(uint64, tag = "5")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub code_id: u64, - /// Msg json encoded message to be passed to the contract on migration - #[prost(bytes = "vec", tag = "6")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub msg: ::prost::alloc::vec::Vec, -} -/// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for -/// an explicit SudoContractProposal. To call sudo on a contract, -/// a simple MsgSudoContract can be invoked from the x/gov module via -/// a v1 governance proposal. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.SudoContractProposal")] -#[deprecated] -pub struct SudoContractProposal { - /// Title is a short summary - #[prost(string, tag = "1")] - pub title: ::prost::alloc::string::String, - /// Description is a human readable text - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - /// Contract is the address of the smart contract - #[prost(string, tag = "3")] - pub contract: ::prost::alloc::string::String, - /// Msg json encoded message to be passed to the contract as sudo - #[prost(bytes = "vec", tag = "4")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub msg: ::prost::alloc::vec::Vec, -} -/// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for -/// an explicit ExecuteContractProposal. To call execute on a contract, -/// a simple MsgExecuteContract can be invoked from the x/gov module via -/// a v1 governance proposal. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.ExecuteContractProposal")] -#[deprecated] -pub struct ExecuteContractProposal { - /// Title is a short summary - #[prost(string, tag = "1")] - pub title: ::prost::alloc::string::String, - /// Description is a human readable text - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - /// RunAs is the address that is passed to the contract's environment as sender - #[prost(string, tag = "3")] - pub run_as: ::prost::alloc::string::String, - /// Contract is the address of the smart contract - #[prost(string, tag = "4")] - pub contract: ::prost::alloc::string::String, - /// Msg json encoded message to be passed to the contract as execute - #[prost(bytes = "vec", tag = "5")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub msg: ::prost::alloc::vec::Vec, - /// Funds coins that are transferred to the contract on instantiation - #[prost(message, repeated, tag = "6")] - pub funds: ::prost::alloc::vec::Vec, -} -/// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for -/// an explicit UpdateAdminProposal. To set an admin for a contract, -/// a simple MsgUpdateAdmin can be invoked from the x/gov module via -/// a v1 governance proposal. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.UpdateAdminProposal")] -#[deprecated] -pub struct UpdateAdminProposal { - /// Title is a short summary - #[prost(string, tag = "1")] - pub title: ::prost::alloc::string::String, - /// Description is a human readable text - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - /// NewAdmin address to be set - #[prost(string, tag = "3")] - pub new_admin: ::prost::alloc::string::String, - /// Contract is the address of the smart contract - #[prost(string, tag = "4")] - pub contract: ::prost::alloc::string::String, -} -/// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for -/// an explicit ClearAdminProposal. To clear the admin of a contract, -/// a simple MsgClearAdmin can be invoked from the x/gov module via -/// a v1 governance proposal. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.ClearAdminProposal")] -#[deprecated] -pub struct ClearAdminProposal { - /// Title is a short summary - #[prost(string, tag = "1")] - pub title: ::prost::alloc::string::String, - /// Description is a human readable text - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - /// Contract is the address of the smart contract - #[prost(string, tag = "3")] - pub contract: ::prost::alloc::string::String, -} -/// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for -/// an explicit PinCodesProposal. To pin a set of code ids in the wasmvm -/// cache, a simple MsgPinCodes can be invoked from the x/gov module via -/// a v1 governance proposal. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.PinCodesProposal")] -#[deprecated] -pub struct PinCodesProposal { - /// Title is a short summary - #[prost(string, tag = "1")] - pub title: ::prost::alloc::string::String, - /// Description is a human readable text - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - /// CodeIDs references the new WASM codes - #[prost(uint64, repeated, packed = "false", tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str_vec::serialize", - deserialize_with = "crate::serde::as_str_vec::deserialize" - )] - pub code_ids: ::prost::alloc::vec::Vec, -} -/// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for -/// an explicit UnpinCodesProposal. To unpin a set of code ids in the wasmvm -/// cache, a simple MsgUnpinCodes can be invoked from the x/gov module via -/// a v1 governance proposal. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.UnpinCodesProposal")] -#[deprecated] -pub struct UnpinCodesProposal { - /// Title is a short summary - #[prost(string, tag = "1")] - pub title: ::prost::alloc::string::String, - /// Description is a human readable text - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - /// CodeIDs references the WASM codes - #[prost(uint64, repeated, packed = "false", tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str_vec::serialize", - deserialize_with = "crate::serde::as_str_vec::deserialize" - )] - pub code_ids: ::prost::alloc::vec::Vec, -} -/// AccessConfigUpdate contains the code id and the access config to be -/// applied. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.AccessConfigUpdate")] -pub struct AccessConfigUpdate { - /// CodeID is the reference to the stored WASM code to be updated - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub code_id: u64, - /// InstantiatePermission to apply to the set of code ids - #[prost(message, optional, tag = "2")] - pub instantiate_permission: ::core::option::Option, -} -/// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for -/// an explicit UpdateInstantiateConfigProposal. To update instantiate config -/// to a set of code ids, a simple MsgUpdateInstantiateConfig can be invoked from -/// the x/gov module via a v1 governance proposal. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal")] -#[deprecated] -pub struct UpdateInstantiateConfigProposal { - /// Title is a short summary - #[prost(string, tag = "1")] - pub title: ::prost::alloc::string::String, - /// Description is a human readable text - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - /// AccessConfigUpdate contains the list of code ids and the access config - /// to be applied. - #[prost(message, repeated, tag = "3")] - pub access_config_updates: ::prost::alloc::vec::Vec, -} -/// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for -/// an explicit StoreAndInstantiateContractProposal. To store and instantiate -/// the contract, a simple MsgStoreAndInstantiateContract can be invoked from -/// the x/gov module via a v1 governance proposal. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal")] -#[deprecated] -pub struct StoreAndInstantiateContractProposal { - /// Title is a short summary - #[prost(string, tag = "1")] - pub title: ::prost::alloc::string::String, - /// Description is a human readable text - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - /// RunAs is the address that is passed to the contract's environment as sender - #[prost(string, tag = "3")] - pub run_as: ::prost::alloc::string::String, - /// WASMByteCode can be raw or gzip compressed - #[prost(bytes = "vec", tag = "4")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub wasm_byte_code: ::prost::alloc::vec::Vec, - /// InstantiatePermission to apply on contract creation, optional - #[prost(message, optional, tag = "5")] - pub instantiate_permission: ::core::option::Option, - /// UnpinCode code on upload, optional - #[prost(bool, tag = "6")] - pub unpin_code: bool, - /// Admin is an optional address that can execute migrations - #[prost(string, tag = "7")] - pub admin: ::prost::alloc::string::String, - /// Label is optional metadata to be stored with a constract instance. - #[prost(string, tag = "8")] - pub label: ::prost::alloc::string::String, - /// Msg json encoded message to be passed to the contract on instantiation - #[prost(bytes = "vec", tag = "9")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub msg: ::prost::alloc::vec::Vec, - /// Funds coins that are transferred to the contract on instantiation - #[prost(message, repeated, tag = "10")] - pub funds: ::prost::alloc::vec::Vec, - /// Source is the URL where the code is hosted - #[prost(string, tag = "11")] - pub source: ::prost::alloc::string::String, - /// Builder is the docker image used to build the code deterministically, used - /// for smart contract verification - #[prost(string, tag = "12")] - pub builder: ::prost::alloc::string::String, - /// CodeHash is the SHA256 sum of the code outputted by builder, used for smart - /// contract verification - #[prost(bytes = "vec", tag = "13")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub code_hash: ::prost::alloc::vec::Vec, -} -/// QueryContractInfoRequest is the request type for the Query/ContractInfo RPC -/// method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryContractInfoRequest")] -#[proto_query( - path = "/cosmwasm.wasm.v1.Query/ContractInfo", - response_type = QueryContractInfoResponse -)] -pub struct QueryContractInfoRequest { - /// address is the address of the contract to query - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, -} -/// QueryContractInfoResponse is the response type for the Query/ContractInfo RPC -/// method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryContractInfoResponse")] -pub struct QueryContractInfoResponse { - /// address is the address of the contract - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub contract_info: ::core::option::Option, -} -/// QueryContractHistoryRequest is the request type for the Query/ContractHistory -/// RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryContractHistoryRequest")] -#[proto_query( - path = "/cosmwasm.wasm.v1.Query/ContractHistory", - response_type = QueryContractHistoryResponse -)] -pub struct QueryContractHistoryRequest { - /// address is the address of the contract to query - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] - pub pagination: - ::core::option::Option, -} -/// QueryContractHistoryResponse is the response type for the -/// Query/ContractHistory RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryContractHistoryResponse")] -pub struct QueryContractHistoryResponse { - #[prost(message, repeated, tag = "1")] - pub entries: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: - ::core::option::Option, -} -/// QueryContractsByCodeRequest is the request type for the Query/ContractsByCode -/// RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryContractsByCodeRequest")] -#[proto_query( - path = "/cosmwasm.wasm.v1.Query/ContractsByCode", - response_type = QueryContractsByCodeResponse -)] -pub struct QueryContractsByCodeRequest { - /// grpc-gateway_out does not support Go style CodID - #[prost(uint64, tag = "1")] +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgInstantiateContract")] +pub struct MsgInstantiateContract { + /// Sender is the that actor that signed the messages + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + /// Admin is an optional address that can execute migrations + #[prost(string, tag = "2")] + pub admin: ::prost::alloc::string::String, + /// CodeID is the reference to the stored WASM code + #[prost(uint64, tag = "3")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub code_id: u64, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] - pub pagination: - ::core::option::Option, + /// Label is optional metadata to be stored with a contract instance. + #[prost(string, tag = "4")] + pub label: ::prost::alloc::string::String, + /// Msg json encoded message to be passed to the contract on instantiation + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub msg: ::prost::alloc::vec::Vec, + /// Funds coins that are transferred to the contract on instantiation + #[prost(message, repeated, tag = "6")] + pub funds: ::prost::alloc::vec::Vec, } -/// QueryContractsByCodeResponse is the response type for the -/// Query/ContractsByCode RPC method +/// MsgInstantiateContract2 create a new smart contract instance for the given +/// code id with a predicable address. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1427,18 +626,47 @@ pub struct QueryContractsByCodeRequest { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryContractsByCodeResponse")] -pub struct QueryContractsByCodeResponse { - /// contracts are a set of contract addresses - #[prost(string, repeated, tag = "1")] - pub contracts: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: - ::core::option::Option, +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgInstantiateContract2")] +pub struct MsgInstantiateContract2 { + /// Sender is the that actor that signed the messages + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + /// Admin is an optional address that can execute migrations + #[prost(string, tag = "2")] + pub admin: ::prost::alloc::string::String, + /// CodeID is the reference to the stored WASM code + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code_id: u64, + /// Label is optional metadata to be stored with a contract instance. + #[prost(string, tag = "4")] + pub label: ::prost::alloc::string::String, + /// Msg json encoded message to be passed to the contract on instantiation + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub msg: ::prost::alloc::vec::Vec, + /// Funds coins that are transferred to the contract on instantiation + #[prost(message, repeated, tag = "6")] + pub funds: ::prost::alloc::vec::Vec, + /// Salt is an arbitrary value provided by the sender. Size can be 1 to 64. + #[prost(bytes = "vec", tag = "7")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub salt: ::prost::alloc::vec::Vec, + /// FixMsg include the msg value into the hash for the predictable address. + /// Default is false + #[prost(bool, tag = "8")] + pub fix_msg: bool, } -/// QueryAllContractStateRequest is the request type for the -/// Query/AllContractState RPC method +/// MsgInstantiateContractResponse return instantiation result data #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1450,22 +678,20 @@ pub struct QueryContractsByCodeResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryAllContractStateRequest")] -#[proto_query( - path = "/cosmwasm.wasm.v1.Query/AllContractState", - response_type = QueryAllContractStateResponse -)] -pub struct QueryAllContractStateRequest { - /// address is the address of the contract +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgInstantiateContractResponse")] +pub struct MsgInstantiateContractResponse { + /// Address is the bech32 address of the new contract instance. #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] - pub pagination: - ::core::option::Option, + /// Data contains bytes to returned from the contract + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, } -/// QueryAllContractStateResponse is the response type for the -/// Query/AllContractState RPC method +/// MsgInstantiateContract2Response return instantiation result data #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1477,17 +703,20 @@ pub struct QueryAllContractStateRequest { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryAllContractStateResponse")] -pub struct QueryAllContractStateResponse { - #[prost(message, repeated, tag = "1")] - pub models: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: - ::core::option::Option, +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgInstantiateContract2Response")] +pub struct MsgInstantiateContract2Response { + /// Address is the bech32 address of the new contract instance. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// Data contains bytes to returned from the contract + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, } -/// QueryRawContractStateRequest is the request type for the -/// Query/RawContractState RPC method +/// MsgExecuteContract submits the given message data to a smart contract #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1499,24 +728,26 @@ pub struct QueryAllContractStateResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryRawContractStateRequest")] -#[proto_query( - path = "/cosmwasm.wasm.v1.Query/RawContractState", - response_type = QueryRawContractStateResponse -)] -pub struct QueryRawContractStateRequest { - /// address is the address of the contract +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgExecuteContract")] +pub struct MsgExecuteContract { + /// Sender is the that actor that signed the messages #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - #[prost(bytes = "vec", tag = "2")] + pub sender: ::prost::alloc::string::String, + /// Contract is the address of the smart contract + #[prost(string, tag = "2")] + pub contract: ::prost::alloc::string::String, + /// Msg json encoded message to be passed to the contract + #[prost(bytes = "vec", tag = "3")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] - pub query_data: ::prost::alloc::vec::Vec, + pub msg: ::prost::alloc::vec::Vec, + /// Funds coins that are transferred to the contract on execution + #[prost(message, repeated, tag = "5")] + pub funds: ::prost::alloc::vec::Vec, } -/// QueryRawContractStateResponse is the response type for the -/// Query/RawContractState RPC method +/// MsgExecuteContractResponse returns execution result data. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1528,9 +759,9 @@ pub struct QueryRawContractStateRequest { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryRawContractStateResponse")] -pub struct QueryRawContractStateResponse { - /// Data contains the raw store data +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgExecuteContractResponse")] +pub struct MsgExecuteContractResponse { + /// Data contains bytes to returned from the contract #[prost(bytes = "vec", tag = "1")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", @@ -1538,8 +769,7 @@ pub struct QueryRawContractStateResponse { )] pub data: ::prost::alloc::vec::Vec, } -/// QuerySmartContractStateRequest is the request type for the -/// Query/SmartContractState RPC method +/// MsgMigrateContract runs a code upgrade/ downgrade for a smart contract #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1551,25 +781,30 @@ pub struct QueryRawContractStateResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QuerySmartContractStateRequest")] -#[proto_query( - path = "/cosmwasm.wasm.v1.Query/SmartContractState", - response_type = QuerySmartContractStateResponse -)] -pub struct QuerySmartContractStateRequest { - /// address is the address of the contract +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgMigrateContract")] +pub struct MsgMigrateContract { + /// Sender is the that actor that signed the messages #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - /// QueryData contains the query data passed to the contract - #[prost(bytes = "vec", tag = "2")] + pub sender: ::prost::alloc::string::String, + /// Contract is the address of the smart contract + #[prost(string, tag = "2")] + pub contract: ::prost::alloc::string::String, + /// CodeID references the new WASM code + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code_id: u64, + /// Msg json encoded message to be passed to the contract on migration + #[prost(bytes = "vec", tag = "4")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] - pub query_data: ::prost::alloc::vec::Vec, + pub msg: ::prost::alloc::vec::Vec, } -/// QuerySmartContractStateResponse is the response type for the -/// Query/SmartContractState RPC method +/// MsgMigrateContractResponse returns contract migration result data. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1581,9 +816,10 @@ pub struct QuerySmartContractStateRequest { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QuerySmartContractStateResponse")] -pub struct QuerySmartContractStateResponse { - /// Data contains the json data returned from the smart contract +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgMigrateContractResponse")] +pub struct MsgMigrateContractResponse { + /// Data contains same raw bytes returned as data from the wasm contract. + /// (May be empty) #[prost(bytes = "vec", tag = "1")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", @@ -1591,7 +827,7 @@ pub struct QuerySmartContractStateResponse { )] pub data: ::prost::alloc::vec::Vec, } -/// QueryCodeRequest is the request type for the Query/Code RPC method +/// MsgUpdateAdmin sets a new admin for a smart contract #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1603,18 +839,19 @@ pub struct QuerySmartContractStateResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryCodeRequest")] -#[proto_query(path = "/cosmwasm.wasm.v1.Query/Code", response_type = QueryCodeResponse)] -pub struct QueryCodeRequest { - /// grpc-gateway_out does not support Go style CodID - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub code_id: u64, +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgUpdateAdmin")] +pub struct MsgUpdateAdmin { + /// Sender is the that actor that signed the messages + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + /// NewAdmin address to be set + #[prost(string, tag = "2")] + pub new_admin: ::prost::alloc::string::String, + /// Contract is the address of the smart contract + #[prost(string, tag = "3")] + pub contract: ::prost::alloc::string::String, } -/// CodeInfoResponse contains code meta data from CodeInfo +/// MsgUpdateAdminResponse returns empty data #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1622,31 +859,13 @@ pub struct QueryCodeRequest { Eq, ::prost::Message, ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.CodeInfoResponse")] -pub struct CodeInfoResponse { - /// id for legacy support - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub code_id: u64, - #[prost(string, tag = "2")] - pub creator: ::prost::alloc::string::String, - #[prost(bytes = "vec", tag = "3")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub data_hash: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "6")] - pub instantiate_permission: ::core::option::Option, -} -/// QueryCodeResponse is the response type for the Query/Code RPC method + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgUpdateAdminResponse")] +pub struct MsgUpdateAdminResponse {} +/// MsgClearAdmin removes any admin stored for a smart contract #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1658,18 +877,16 @@ pub struct CodeInfoResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryCodeResponse")] -pub struct QueryCodeResponse { - #[prost(message, optional, tag = "1")] - pub code_info: ::core::option::Option, - #[prost(bytes = "vec", tag = "2")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub data: ::prost::alloc::vec::Vec, +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgClearAdmin")] +pub struct MsgClearAdmin { + /// Sender is the that actor that signed the messages + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + /// Contract is the address of the smart contract + #[prost(string, tag = "3")] + pub contract: ::prost::alloc::string::String, } -/// QueryCodesRequest is the request type for the Query/Codes RPC method +/// MsgClearAdminResponse returns empty data #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1681,18 +898,9 @@ pub struct QueryCodeResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryCodesRequest")] -#[proto_query( - path = "/cosmwasm.wasm.v1.Query/Codes", - response_type = QueryCodesResponse -)] -pub struct QueryCodesRequest { - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "1")] - pub pagination: - ::core::option::Option, -} -/// QueryCodesResponse is the response type for the Query/Codes RPC method +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgClearAdminResponse")] +pub struct MsgClearAdminResponse {} +/// GenesisState - genesis state of x/wasm #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1704,17 +912,68 @@ pub struct QueryCodesRequest { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryCodesResponse")] -pub struct QueryCodesResponse { - #[prost(message, repeated, tag = "1")] - pub code_infos: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: - ::core::option::Option, +#[proto_message(type_url = "/cosmwasm.wasm.v1.GenesisState")] +pub struct GenesisState { + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, + #[prost(message, repeated, tag = "2")] + pub codes: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "3")] + pub contracts: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "4")] + pub sequences: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "5")] + pub gen_msgs: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `GenesisState`. +pub mod genesis_state { + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + /// GenMsgs define the messages that can be executed during genesis phase in + /// order. The intention is to have more human readable data that is auditable. + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, + )] + #[proto_message(type_url = "/cosmwasm.wasm.v1.GenesisState.GenMsgs")] + pub struct GenMsgs { + /// sum is a single message + #[prost(oneof = "gen_msgs::Sum", tags = "1, 2, 3")] + pub sum: ::core::option::Option, + } + /// Nested message and enum types in `GenMsgs`. + pub mod gen_msgs { + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + /// sum is a single message + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive( + Clone, + PartialEq, + Eq, + ::prost::Oneof, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + )] + pub enum Sum { + #[prost(message, tag = "1")] + StoreCode(super::super::MsgStoreCode), + #[prost(message, tag = "2")] + InstantiateContract(super::super::MsgInstantiateContract), + /// MsgInstantiateContract2 intentionally not supported + /// see + #[prost(message, tag = "3")] + ExecuteContract(super::super::MsgExecuteContract), + } + } } -/// QueryPinnedCodesRequest is the request type for the Query/PinnedCodes -/// RPC method +/// Code struct encompasses CodeInfo and CodeBytes #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1726,19 +985,27 @@ pub struct QueryCodesResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryPinnedCodesRequest")] -#[proto_query( - path = "/cosmwasm.wasm.v1.Query/PinnedCodes", - response_type = QueryPinnedCodesResponse -)] -pub struct QueryPinnedCodesRequest { - /// pagination defines an optional pagination for the request. +#[proto_message(type_url = "/cosmwasm.wasm.v1.Code")] +pub struct Code { + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code_id: u64, #[prost(message, optional, tag = "2")] - pub pagination: - ::core::option::Option, + pub code_info: ::core::option::Option, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub code_bytes: ::prost::alloc::vec::Vec, + /// Pinned to wasmvm cache + #[prost(bool, tag = "4")] + pub pinned: bool, } -/// QueryPinnedCodesResponse is the response type for the -/// Query/PinnedCodes RPC method +/// Contract struct encompasses ContractAddress, ContractInfo, and ContractState #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1750,20 +1017,18 @@ pub struct QueryPinnedCodesRequest { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryPinnedCodesResponse")] -pub struct QueryPinnedCodesResponse { - #[prost(uint64, repeated, packed = "false", tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str_vec::serialize", - deserialize_with = "crate::serde::as_str_vec::deserialize" - )] - pub code_ids: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. +#[proto_message(type_url = "/cosmwasm.wasm.v1.Contract")] +pub struct Contract { + #[prost(string, tag = "1")] + pub contract_address: ::prost::alloc::string::String, #[prost(message, optional, tag = "2")] - pub pagination: - ::core::option::Option, + pub contract_info: ::core::option::Option, + #[prost(message, repeated, tag = "3")] + pub contract_state: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "4")] + pub contract_code_history: ::prost::alloc::vec::Vec, } -/// QueryParamsRequest is the request type for the Query/Params RPC method. +/// Sequence key and value of an id generation counter #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1775,13 +1040,22 @@ pub struct QueryPinnedCodesResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryParamsRequest")] -#[proto_query( - path = "/cosmwasm.wasm.v1.Query/Params", - response_type = QueryParamsResponse -)] -pub struct QueryParamsRequest {} -/// QueryParamsResponse is the response type for the Query/Params RPC method. +#[proto_message(type_url = "/cosmwasm.wasm.v1.Sequence")] +pub struct Sequence { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub id_key: ::prost::alloc::vec::Vec, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub value: u64, +} +/// MsgIBCSend #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1793,14 +1067,37 @@ pub struct QueryParamsRequest {} ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryParamsResponse")] -pub struct QueryParamsResponse { - /// params defines the parameters of the module. - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgIBCSend")] +pub struct MsgIbcSend { + /// the channel by which the packet will be sent + #[prost(string, tag = "2")] + pub channel: ::prost::alloc::string::String, + /// Timeout height relative to the current block height. + /// The timeout is disabled when set to 0. + #[prost(uint64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timeout_height: u64, + /// Timeout timestamp (in nanoseconds) relative to the current block timestamp. + /// The timeout is disabled when set to 0. + #[prost(uint64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timeout_timestamp: u64, + /// Data is the payload to transfer. We must not make assumption what format or + /// content is in here. + #[prost(bytes = "vec", tag = "6")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, } -/// QueryContractsByCreatorRequest is the request type for the -/// Query/ContractsByCreator RPC method. +/// MsgIBCCloseChannel port and channel need to be owned by the contract #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1812,22 +1109,12 @@ pub struct QueryParamsResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryContractsByCreatorRequest")] -#[proto_query( - path = "/cosmwasm.wasm.v1.Query/ContractsByCreator", - response_type = QueryContractsByCreatorResponse -)] -pub struct QueryContractsByCreatorRequest { - /// CreatorAddress is the address of contract creator - #[prost(string, tag = "1")] - pub creator_address: ::prost::alloc::string::String, - /// Pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] - pub pagination: - ::core::option::Option, +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgIBCCloseChannel")] +pub struct MsgIbcCloseChannel { + #[prost(string, tag = "2")] + pub channel: ::prost::alloc::string::String, } -/// QueryContractsByCreatorResponse is the response type for the -/// Query/ContractsByCreator RPC method. +/// StoreCodeProposal gov proposal content type to submit WASM code to the system #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1839,18 +1126,48 @@ pub struct QueryContractsByCreatorRequest { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryContractsByCreatorResponse")] -pub struct QueryContractsByCreatorResponse { - /// ContractAddresses result set - #[prost(string, repeated, tag = "1")] - pub contract_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// Pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: - ::core::option::Option, +#[proto_message(type_url = "/cosmwasm.wasm.v1.StoreCodeProposal")] +pub struct StoreCodeProposal { + /// Title is a short summary + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + /// Description is a human readable text + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// RunAs is the address that is passed to the contract's environment as sender + #[prost(string, tag = "3")] + pub run_as: ::prost::alloc::string::String, + /// WASMByteCode can be raw or gzip compressed + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub wasm_byte_code: ::prost::alloc::vec::Vec, + /// InstantiatePermission to apply on contract creation, optional + #[prost(message, optional, tag = "7")] + pub instantiate_permission: ::core::option::Option, + /// UnpinCode code on upload, optional + #[prost(bool, tag = "8")] + pub unpin_code: bool, + /// Source is the URL where the code is hosted + #[prost(string, tag = "9")] + pub source: ::prost::alloc::string::String, + /// Builder is the docker image used to build the code deterministically, used + /// for smart contract verification + #[prost(string, tag = "10")] + pub builder: ::prost::alloc::string::String, + /// CodeHash is the SHA256 sum of the code outputted by builder, used for smart + /// contract verification + #[prost(bytes = "vec", tag = "11")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub code_hash: ::prost::alloc::vec::Vec, } -/// QueryBuildAddressRequest is the request type for the Query/BuildAddress RPC -/// method. +/// InstantiateContractProposal gov proposal content type to instantiate a +/// contract. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1862,32 +1179,42 @@ pub struct QueryContractsByCreatorResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryBuildAddressRequest")] -#[proto_query( - path = "/cosmwasm.wasm.v1.Query/BuildAddress", - response_type = QueryBuildAddressResponse -)] -pub struct QueryBuildAddressRequest { - /// CodeHash is the hash of the code +#[proto_message(type_url = "/cosmwasm.wasm.v1.InstantiateContractProposal")] +pub struct InstantiateContractProposal { + /// Title is a short summary #[prost(string, tag = "1")] - pub code_hash: ::prost::alloc::string::String, - /// CreatorAddress is the address of the contract instantiator + pub title: ::prost::alloc::string::String, + /// Description is a human readable text #[prost(string, tag = "2")] - pub creator_address: ::prost::alloc::string::String, - /// Salt is a hex encoded salt + pub description: ::prost::alloc::string::String, + /// RunAs is the address that is passed to the contract's environment as sender #[prost(string, tag = "3")] - pub salt: ::prost::alloc::string::String, - /// InitArgs are optional json encoded init args to be used in contract address - /// building if provided - #[prost(bytes = "vec", tag = "4")] + pub run_as: ::prost::alloc::string::String, + /// Admin is an optional address that can execute migrations + #[prost(string, tag = "4")] + pub admin: ::prost::alloc::string::String, + /// CodeID is the reference to the stored WASM code + #[prost(uint64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code_id: u64, + /// Label is optional metadata to be stored with a constract instance. + #[prost(string, tag = "6")] + pub label: ::prost::alloc::string::String, + /// Msg json encoded message to be passed to the contract on instantiation + #[prost(bytes = "vec", tag = "7")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] - pub init_args: ::prost::alloc::vec::Vec, + pub msg: ::prost::alloc::vec::Vec, + /// Funds coins that are transferred to the contract on instantiation + #[prost(message, repeated, tag = "8")] + pub funds: ::prost::alloc::vec::Vec, } -/// QueryBuildAddressResponse is the response type for the Query/BuildAddress RPC -/// method. +/// MigrateContractProposal gov proposal content type to migrate a contract. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1899,13 +1226,35 @@ pub struct QueryBuildAddressRequest { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryBuildAddressResponse")] -pub struct QueryBuildAddressResponse { - /// Address is the contract address +#[proto_message(type_url = "/cosmwasm.wasm.v1.MigrateContractProposal")] +pub struct MigrateContractProposal { + /// Title is a short summary #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, + pub title: ::prost::alloc::string::String, + /// Description is a human readable text + /// + /// Note: skipping 3 as this was previously used for unneeded run_as + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// Contract is the address of the smart contract + #[prost(string, tag = "4")] + pub contract: ::prost::alloc::string::String, + /// CodeID references the new WASM code + #[prost(uint64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code_id: u64, + /// Msg json encoded message to be passed to the contract on migration + #[prost(bytes = "vec", tag = "6")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub msg: ::prost::alloc::vec::Vec, } -/// MsgStoreCode submit Wasm code to the system +/// SudoContractProposal gov proposal content type to call sudo on a contract. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1917,24 +1266,27 @@ pub struct QueryBuildAddressResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgStoreCode")] -pub struct MsgStoreCode { - /// Sender is the actor that signed the messages +#[proto_message(type_url = "/cosmwasm.wasm.v1.SudoContractProposal")] +pub struct SudoContractProposal { + /// Title is a short summary #[prost(string, tag = "1")] - pub sender: ::prost::alloc::string::String, - /// WASMByteCode can be raw or gzip compressed - #[prost(bytes = "vec", tag = "2")] + pub title: ::prost::alloc::string::String, + /// Description is a human readable text + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// Contract is the address of the smart contract + #[prost(string, tag = "3")] + pub contract: ::prost::alloc::string::String, + /// Msg json encoded message to be passed to the contract as sudo + #[prost(bytes = "vec", tag = "4")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] - pub wasm_byte_code: ::prost::alloc::vec::Vec, - /// InstantiatePermission access control to apply on contract creation, - /// optional - #[prost(message, optional, tag = "5")] - pub instantiate_permission: ::core::option::Option, + pub msg: ::prost::alloc::vec::Vec, } -/// MsgStoreCodeResponse returns store result data. +/// ExecuteContractProposal gov proposal content type to call execute on a +/// contract. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1946,25 +1298,32 @@ pub struct MsgStoreCode { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgStoreCodeResponse")] -pub struct MsgStoreCodeResponse { - /// CodeID is the reference to the stored WASM code - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub code_id: u64, - /// Checksum is the sha256 hash of the stored code - #[prost(bytes = "vec", tag = "2")] +#[proto_message(type_url = "/cosmwasm.wasm.v1.ExecuteContractProposal")] +pub struct ExecuteContractProposal { + /// Title is a short summary + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + /// Description is a human readable text + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// RunAs is the address that is passed to the contract's environment as sender + #[prost(string, tag = "3")] + pub run_as: ::prost::alloc::string::String, + /// Contract is the address of the smart contract + #[prost(string, tag = "4")] + pub contract: ::prost::alloc::string::String, + /// Msg json encoded message to be passed to the contract as execute + #[prost(bytes = "vec", tag = "5")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] - pub checksum: ::prost::alloc::vec::Vec, + pub msg: ::prost::alloc::vec::Vec, + /// Funds coins that are transferred to the contract on instantiation + #[prost(message, repeated, tag = "6")] + pub funds: ::prost::alloc::vec::Vec, } -/// MsgInstantiateContract create a new smart contract instance for the given -/// code id. +/// UpdateAdminProposal gov proposal content type to set an admin for a contract. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1976,36 +1335,23 @@ pub struct MsgStoreCodeResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgInstantiateContract")] -pub struct MsgInstantiateContract { - /// Sender is the that actor that signed the messages +#[proto_message(type_url = "/cosmwasm.wasm.v1.UpdateAdminProposal")] +pub struct UpdateAdminProposal { + /// Title is a short summary #[prost(string, tag = "1")] - pub sender: ::prost::alloc::string::String, - /// Admin is an optional address that can execute migrations + pub title: ::prost::alloc::string::String, + /// Description is a human readable text #[prost(string, tag = "2")] - pub admin: ::prost::alloc::string::String, - /// CodeID is the reference to the stored WASM code - #[prost(uint64, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub code_id: u64, - /// Label is optional metadata to be stored with a contract instance. + pub description: ::prost::alloc::string::String, + /// NewAdmin address to be set + #[prost(string, tag = "3")] + pub new_admin: ::prost::alloc::string::String, + /// Contract is the address of the smart contract #[prost(string, tag = "4")] - pub label: ::prost::alloc::string::String, - /// Msg json encoded message to be passed to the contract on instantiation - #[prost(bytes = "vec", tag = "5")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub msg: ::prost::alloc::vec::Vec, - /// Funds coins that are transferred to the contract on instantiation - #[prost(message, repeated, tag = "6")] - pub funds: ::prost::alloc::vec::Vec, + pub contract: ::prost::alloc::string::String, } -/// MsgInstantiateContractResponse return instantiation result data +/// ClearAdminProposal gov proposal content type to clear the admin of a +/// contract. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2017,21 +1363,20 @@ pub struct MsgInstantiateContract { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgInstantiateContractResponse")] -pub struct MsgInstantiateContractResponse { - /// Address is the bech32 address of the new contract instance. +#[proto_message(type_url = "/cosmwasm.wasm.v1.ClearAdminProposal")] +pub struct ClearAdminProposal { + /// Title is a short summary #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - /// Data contains bytes to returned from the contract - #[prost(bytes = "vec", tag = "2")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub data: ::prost::alloc::vec::Vec, + pub title: ::prost::alloc::string::String, + /// Description is a human readable text + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// Contract is the address of the smart contract + #[prost(string, tag = "3")] + pub contract: ::prost::alloc::string::String, } -/// MsgInstantiateContract2 create a new smart contract instance for the given -/// code id with a predicable address. +/// PinCodesProposal gov proposal content type to pin a set of code ids in the +/// wasmvm cache. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2043,47 +1388,24 @@ pub struct MsgInstantiateContractResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgInstantiateContract2")] -pub struct MsgInstantiateContract2 { - /// Sender is the that actor that signed the messages +#[proto_message(type_url = "/cosmwasm.wasm.v1.PinCodesProposal")] +pub struct PinCodesProposal { + /// Title is a short summary #[prost(string, tag = "1")] - pub sender: ::prost::alloc::string::String, - /// Admin is an optional address that can execute migrations + pub title: ::prost::alloc::string::String, + /// Description is a human readable text #[prost(string, tag = "2")] - pub admin: ::prost::alloc::string::String, - /// CodeID is the reference to the stored WASM code - #[prost(uint64, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub code_id: u64, - /// Label is optional metadata to be stored with a contract instance. - #[prost(string, tag = "4")] - pub label: ::prost::alloc::string::String, - /// Msg json encoded message to be passed to the contract on instantiation - #[prost(bytes = "vec", tag = "5")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub msg: ::prost::alloc::vec::Vec, - /// Funds coins that are transferred to the contract on instantiation - #[prost(message, repeated, tag = "6")] - pub funds: ::prost::alloc::vec::Vec, - /// Salt is an arbitrary value provided by the sender. Size can be 1 to 64. - #[prost(bytes = "vec", tag = "7")] + pub description: ::prost::alloc::string::String, + /// CodeIDs references the new WASM codes + #[prost(uint64, repeated, packed = "false", tag = "3")] #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" )] - pub salt: ::prost::alloc::vec::Vec, - /// FixMsg include the msg value into the hash for the predictable address. - /// Default is false - #[prost(bool, tag = "8")] - pub fix_msg: bool, + pub code_ids: ::prost::alloc::vec::Vec, } -/// MsgInstantiateContract2Response return instantiation result data +/// UnpinCodesProposal gov proposal content type to unpin a set of code ids in +/// the wasmvm cache. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2095,20 +1417,24 @@ pub struct MsgInstantiateContract2 { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgInstantiateContract2Response")] -pub struct MsgInstantiateContract2Response { - /// Address is the bech32 address of the new contract instance. +#[proto_message(type_url = "/cosmwasm.wasm.v1.UnpinCodesProposal")] +pub struct UnpinCodesProposal { + /// Title is a short summary #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - /// Data contains bytes to returned from the contract - #[prost(bytes = "vec", tag = "2")] + pub title: ::prost::alloc::string::String, + /// Description is a human readable text + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// CodeIDs references the WASM codes + #[prost(uint64, repeated, packed = "false", tag = "3")] #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" )] - pub data: ::prost::alloc::vec::Vec, + pub code_ids: ::prost::alloc::vec::Vec, } -/// MsgExecuteContract submits the given message data to a smart contract +/// AccessConfigUpdate contains the code id and the access config to be +/// applied. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2120,26 +1446,21 @@ pub struct MsgInstantiateContract2Response { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgExecuteContract")] -pub struct MsgExecuteContract { - /// Sender is the that actor that signed the messages - #[prost(string, tag = "1")] - pub sender: ::prost::alloc::string::String, - /// Contract is the address of the smart contract - #[prost(string, tag = "2")] - pub contract: ::prost::alloc::string::String, - /// Msg json encoded message to be passed to the contract - #[prost(bytes = "vec", tag = "3")] +#[proto_message(type_url = "/cosmwasm.wasm.v1.AccessConfigUpdate")] +pub struct AccessConfigUpdate { + /// CodeID is the reference to the stored WASM code to be updated + #[prost(uint64, tag = "1")] #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" )] - pub msg: ::prost::alloc::vec::Vec, - /// Funds coins that are transferred to the contract on execution - #[prost(message, repeated, tag = "5")] - pub funds: ::prost::alloc::vec::Vec, + pub code_id: u64, + /// InstantiatePermission to apply to the set of code ids + #[prost(message, optional, tag = "2")] + pub instantiate_permission: ::core::option::Option, } -/// MsgExecuteContractResponse returns execution result data. +/// UpdateInstantiateConfigProposal gov proposal content type to update +/// instantiate config to a set of code ids. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2151,17 +1472,21 @@ pub struct MsgExecuteContract { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgExecuteContractResponse")] -pub struct MsgExecuteContractResponse { - /// Data contains bytes to returned from the contract - #[prost(bytes = "vec", tag = "1")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub data: ::prost::alloc::vec::Vec, +#[proto_message(type_url = "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal")] +pub struct UpdateInstantiateConfigProposal { + /// Title is a short summary + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + /// Description is a human readable text + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// AccessConfigUpdate contains the list of code ids and the access config + /// to be applied. + #[prost(message, repeated, tag = "3")] + pub access_config_updates: ::prost::alloc::vec::Vec, } -/// MsgMigrateContract runs a code upgrade/ downgrade for a smart contract +/// StoreAndInstantiateContractProposal gov proposal content type to store +/// and instantiate the contract. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2173,53 +1498,64 @@ pub struct MsgExecuteContractResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgMigrateContract")] -pub struct MsgMigrateContract { - /// Sender is the that actor that signed the messages +#[proto_message(type_url = "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal")] +pub struct StoreAndInstantiateContractProposal { + /// Title is a short summary #[prost(string, tag = "1")] - pub sender: ::prost::alloc::string::String, - /// Contract is the address of the smart contract + pub title: ::prost::alloc::string::String, + /// Description is a human readable text #[prost(string, tag = "2")] - pub contract: ::prost::alloc::string::String, - /// CodeID references the new WASM code - #[prost(uint64, tag = "3")] + pub description: ::prost::alloc::string::String, + /// RunAs is the address that is passed to the contract's environment as sender + #[prost(string, tag = "3")] + pub run_as: ::prost::alloc::string::String, + /// WASMByteCode can be raw or gzip compressed + #[prost(bytes = "vec", tag = "4")] #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] - pub code_id: u64, - /// Msg json encoded message to be passed to the contract on migration - #[prost(bytes = "vec", tag = "4")] + pub wasm_byte_code: ::prost::alloc::vec::Vec, + /// InstantiatePermission to apply on contract creation, optional + #[prost(message, optional, tag = "5")] + pub instantiate_permission: ::core::option::Option, + /// UnpinCode code on upload, optional + #[prost(bool, tag = "6")] + pub unpin_code: bool, + /// Admin is an optional address that can execute migrations + #[prost(string, tag = "7")] + pub admin: ::prost::alloc::string::String, + /// Label is optional metadata to be stored with a constract instance. + #[prost(string, tag = "8")] + pub label: ::prost::alloc::string::String, + /// Msg json encoded message to be passed to the contract on instantiation + #[prost(bytes = "vec", tag = "9")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] pub msg: ::prost::alloc::vec::Vec, -} -/// MsgMigrateContractResponse returns contract migration result data. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgMigrateContractResponse")] -pub struct MsgMigrateContractResponse { - /// Data contains same raw bytes returned as data from the wasm contract. - /// (May be empty) - #[prost(bytes = "vec", tag = "1")] + /// Funds coins that are transferred to the contract on instantiation + #[prost(message, repeated, tag = "10")] + pub funds: ::prost::alloc::vec::Vec, + /// Source is the URL where the code is hosted + #[prost(string, tag = "11")] + pub source: ::prost::alloc::string::String, + /// Builder is the docker image used to build the code deterministically, used + /// for smart contract verification + #[prost(string, tag = "12")] + pub builder: ::prost::alloc::string::String, + /// CodeHash is the SHA256 sum of the code outputted by builder, used for smart + /// contract verification + #[prost(bytes = "vec", tag = "13")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] - pub data: ::prost::alloc::vec::Vec, + pub code_hash: ::prost::alloc::vec::Vec, } -/// MsgUpdateAdmin sets a new admin for a smart contract +/// QueryContractInfoRequest is the request type for the Query/ContractInfo RPC +/// method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2231,19 +1567,18 @@ pub struct MsgMigrateContractResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgUpdateAdmin")] -pub struct MsgUpdateAdmin { - /// Sender is the that actor that signed the messages +#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryContractInfoRequest")] +#[proto_query( + path = "/cosmwasm.wasm.v1.Query/ContractInfo", + response_type = QueryContractInfoResponse +)] +pub struct QueryContractInfoRequest { + /// address is the address of the contract to query #[prost(string, tag = "1")] - pub sender: ::prost::alloc::string::String, - /// NewAdmin address to be set - #[prost(string, tag = "2")] - pub new_admin: ::prost::alloc::string::String, - /// Contract is the address of the smart contract - #[prost(string, tag = "3")] - pub contract: ::prost::alloc::string::String, + pub address: ::prost::alloc::string::String, } -/// MsgUpdateAdminResponse returns empty data +/// QueryContractInfoResponse is the response type for the Query/ContractInfo RPC +/// method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2255,9 +1590,16 @@ pub struct MsgUpdateAdmin { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgUpdateAdminResponse")] -pub struct MsgUpdateAdminResponse {} -/// MsgClearAdmin removes any admin stored for a smart contract +#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryContractInfoResponse")] +pub struct QueryContractInfoResponse { + /// address is the address of the contract + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub contract_info: ::core::option::Option, +} +/// QueryContractHistoryRequest is the request type for the Query/ContractHistory +/// RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2269,16 +1611,22 @@ pub struct MsgUpdateAdminResponse {} ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgClearAdmin")] -pub struct MsgClearAdmin { - /// Sender is the actor that signed the messages +#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryContractHistoryRequest")] +#[proto_query( + path = "/cosmwasm.wasm.v1.Query/ContractHistory", + response_type = QueryContractHistoryResponse +)] +pub struct QueryContractHistoryRequest { + /// address is the address of the contract to query #[prost(string, tag = "1")] - pub sender: ::prost::alloc::string::String, - /// Contract is the address of the smart contract - #[prost(string, tag = "3")] - pub contract: ::prost::alloc::string::String, + pub address: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, } -/// MsgClearAdminResponse returns empty data +/// QueryContractHistoryResponse is the response type for the +/// Query/ContractHistory RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2290,9 +1638,17 @@ pub struct MsgClearAdmin { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgClearAdminResponse")] -pub struct MsgClearAdminResponse {} -/// MsgUpdateInstantiateConfig updates instantiate config for a smart contract +#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryContractHistoryResponse")] +pub struct QueryContractHistoryResponse { + #[prost(message, repeated, tag = "1")] + pub entries: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +/// QueryContractsByCodeRequest is the request type for the Query/ContractsByCode +/// RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2304,23 +1660,26 @@ pub struct MsgClearAdminResponse {} ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig")] -pub struct MsgUpdateInstantiateConfig { - /// Sender is the that actor that signed the messages - #[prost(string, tag = "1")] - pub sender: ::prost::alloc::string::String, - /// CodeID references the stored WASM code - #[prost(uint64, tag = "2")] +#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryContractsByCodeRequest")] +#[proto_query( + path = "/cosmwasm.wasm.v1.Query/ContractsByCode", + response_type = QueryContractsByCodeResponse +)] +pub struct QueryContractsByCodeRequest { + /// grpc-gateway_out does not support Go style CodID + #[prost(uint64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub code_id: u64, - /// NewInstantiatePermission is the new access control - #[prost(message, optional, tag = "3")] - pub new_instantiate_permission: ::core::option::Option, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, } -/// MsgUpdateInstantiateConfigResponse returns empty data +/// QueryContractsByCodeResponse is the response type for the +/// Query/ContractsByCode RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2332,11 +1691,18 @@ pub struct MsgUpdateInstantiateConfig { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse")] -pub struct MsgUpdateInstantiateConfigResponse {} -/// MsgUpdateParams is the MsgUpdateParams request type. -/// -/// Since: 0.40 +#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryContractsByCodeResponse")] +pub struct QueryContractsByCodeResponse { + /// contracts are a set of contract addresses + #[prost(string, repeated, tag = "1")] + pub contracts: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +/// QueryAllContractStateRequest is the request type for the +/// Query/AllContractState RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2348,21 +1714,22 @@ pub struct MsgUpdateInstantiateConfigResponse {} ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgUpdateParams")] -pub struct MsgUpdateParams { - /// Authority is the address of the governance account. +#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryAllContractStateRequest")] +#[proto_query( + path = "/cosmwasm.wasm.v1.Query/AllContractState", + response_type = QueryAllContractStateResponse +)] +pub struct QueryAllContractStateRequest { + /// address is the address of the contract #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// params defines the x/wasm parameters to update. - /// - /// NOTE: All parameters must be supplied. + pub address: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, + pub pagination: + ::core::option::Option, } -/// MsgUpdateParamsResponse defines the response structure for executing a -/// MsgUpdateParams message. -/// -/// Since: 0.40 +/// QueryAllContractStateResponse is the response type for the +/// Query/AllContractState RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2374,11 +1741,17 @@ pub struct MsgUpdateParams { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgUpdateParamsResponse")] -pub struct MsgUpdateParamsResponse {} -/// MsgSudoContract is the MsgSudoContract request type. -/// -/// Since: 0.40 +#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryAllContractStateResponse")] +pub struct QueryAllContractStateResponse { + #[prost(message, repeated, tag = "1")] + pub models: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +/// QueryRawContractStateRequest is the request type for the +/// Query/RawContractState RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2390,26 +1763,24 @@ pub struct MsgUpdateParamsResponse {} ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgSudoContract")] -pub struct MsgSudoContract { - /// Authority is the address of the governance account. +#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryRawContractStateRequest")] +#[proto_query( + path = "/cosmwasm.wasm.v1.Query/RawContractState", + response_type = QueryRawContractStateResponse +)] +pub struct QueryRawContractStateRequest { + /// address is the address of the contract #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// Contract is the address of the smart contract - #[prost(string, tag = "2")] - pub contract: ::prost::alloc::string::String, - /// Msg json encoded message to be passed to the contract as sudo - #[prost(bytes = "vec", tag = "3")] + pub address: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "2")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] - pub msg: ::prost::alloc::vec::Vec, + pub query_data: ::prost::alloc::vec::Vec, } -/// MsgSudoContractResponse defines the response structure for executing a -/// MsgSudoContract message. -/// -/// Since: 0.40 +/// QueryRawContractStateResponse is the response type for the +/// Query/RawContractState RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2421,9 +1792,9 @@ pub struct MsgSudoContract { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgSudoContractResponse")] -pub struct MsgSudoContractResponse { - /// Data contains bytes to returned from the contract +#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryRawContractStateResponse")] +pub struct QueryRawContractStateResponse { + /// Data contains the raw store data #[prost(bytes = "vec", tag = "1")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", @@ -2431,9 +1802,8 @@ pub struct MsgSudoContractResponse { )] pub data: ::prost::alloc::vec::Vec, } -/// MsgPinCodes is the MsgPinCodes request type. -/// -/// Since: 0.40 +/// QuerySmartContractStateRequest is the request type for the +/// Query/SmartContractState RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2445,39 +1815,25 @@ pub struct MsgSudoContractResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgPinCodes")] -pub struct MsgPinCodes { - /// Authority is the address of the governance account. +#[proto_message(type_url = "/cosmwasm.wasm.v1.QuerySmartContractStateRequest")] +#[proto_query( + path = "/cosmwasm.wasm.v1.Query/SmartContractState", + response_type = QuerySmartContractStateResponse +)] +pub struct QuerySmartContractStateRequest { + /// address is the address of the contract #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// CodeIDs references the new WASM codes - #[prost(uint64, repeated, packed = "false", tag = "2")] + pub address: ::prost::alloc::string::String, + /// QueryData contains the query data passed to the contract + #[prost(bytes = "vec", tag = "2")] #[serde( - serialize_with = "crate::serde::as_str_vec::serialize", - deserialize_with = "crate::serde::as_str_vec::deserialize" + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] - pub code_ids: ::prost::alloc::vec::Vec, + pub query_data: ::prost::alloc::vec::Vec, } -/// MsgPinCodesResponse defines the response structure for executing a -/// MsgPinCodes message. -/// -/// Since: 0.40 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgPinCodesResponse")] -pub struct MsgPinCodesResponse {} -/// MsgUnpinCodes is the MsgUnpinCodes request type. -/// -/// Since: 0.40 +/// QuerySmartContractStateResponse is the response type for the +/// Query/SmartContractState RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2489,23 +1845,17 @@ pub struct MsgPinCodesResponse {} ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgUnpinCodes")] -pub struct MsgUnpinCodes { - /// Authority is the address of the governance account. - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// CodeIDs references the WASM codes - #[prost(uint64, repeated, packed = "false", tag = "2")] +#[proto_message(type_url = "/cosmwasm.wasm.v1.QuerySmartContractStateResponse")] +pub struct QuerySmartContractStateResponse { + /// Data contains the json data returned from the smart contract + #[prost(bytes = "vec", tag = "1")] #[serde( - serialize_with = "crate::serde::as_str_vec::serialize", - deserialize_with = "crate::serde::as_str_vec::deserialize" + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] - pub code_ids: ::prost::alloc::vec::Vec, + pub data: ::prost::alloc::vec::Vec, } -/// MsgUnpinCodesResponse defines the response structure for executing a -/// MsgUnpinCodes message. -/// -/// Since: 0.40 +/// QueryCodeRequest is the request type for the Query/Code RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2517,12 +1867,18 @@ pub struct MsgUnpinCodes { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgUnpinCodesResponse")] -pub struct MsgUnpinCodesResponse {} -/// MsgStoreAndInstantiateContract is the MsgStoreAndInstantiateContract -/// request type. -/// -/// Since: 0.40 +#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryCodeRequest")] +#[proto_query(path = "/cosmwasm.wasm.v1.Query/Code", response_type = QueryCodeResponse)] +pub struct QueryCodeRequest { + /// grpc-gateway_out does not support Go style CodID + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code_id: u64, +} +/// CodeInfoResponse contains code meta data from CodeInfo #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2534,62 +1890,27 @@ pub struct MsgUnpinCodesResponse {} ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract")] -pub struct MsgStoreAndInstantiateContract { - /// Authority is the address of the governance account. - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// WASMByteCode can be raw or gzip compressed - #[prost(bytes = "vec", tag = "3")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub wasm_byte_code: ::prost::alloc::vec::Vec, - /// InstantiatePermission to apply on contract creation, optional - #[prost(message, optional, tag = "4")] - pub instantiate_permission: ::core::option::Option, - /// UnpinCode code on upload, optional. As default the uploaded contract is - /// pinned to cache. - #[prost(bool, tag = "5")] - pub unpin_code: bool, - /// Admin is an optional address that can execute migrations - #[prost(string, tag = "6")] - pub admin: ::prost::alloc::string::String, - /// Label is optional metadata to be stored with a constract instance. - #[prost(string, tag = "7")] - pub label: ::prost::alloc::string::String, - /// Msg json encoded message to be passed to the contract on instantiation - #[prost(bytes = "vec", tag = "8")] +#[proto_message(type_url = "/cosmwasm.wasm.v1.CodeInfoResponse")] +pub struct CodeInfoResponse { + /// id for legacy support + #[prost(uint64, tag = "1")] #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" )] - pub msg: ::prost::alloc::vec::Vec, - /// Funds coins that are transferred from the authority account to the contract - /// on instantiation - #[prost(message, repeated, tag = "9")] - pub funds: ::prost::alloc::vec::Vec, - /// Source is the URL where the code is hosted - #[prost(string, tag = "10")] - pub source: ::prost::alloc::string::String, - /// Builder is the docker image used to build the code deterministically, used - /// for smart contract verification - #[prost(string, tag = "11")] - pub builder: ::prost::alloc::string::String, - /// CodeHash is the SHA256 sum of the code outputted by builder, used for smart - /// contract verification - #[prost(bytes = "vec", tag = "12")] + pub code_id: u64, + #[prost(string, tag = "2")] + pub creator: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "3")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] - pub code_hash: ::prost::alloc::vec::Vec, + pub data_hash: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "6")] + pub instantiate_permission: ::core::option::Option, } -/// MsgStoreAndInstantiateContractResponse defines the response structure -/// for executing a MsgStoreAndInstantiateContract message. -/// -/// Since: 0.40 +/// QueryCodeResponse is the response type for the Query/Code RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2601,12 +1922,10 @@ pub struct MsgStoreAndInstantiateContract { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContractResponse")] -pub struct MsgStoreAndInstantiateContractResponse { - /// Address is the bech32 address of the new contract instance. - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - /// Data contains bytes to returned from the contract +#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryCodeResponse")] +pub struct QueryCodeResponse { + #[prost(message, optional, tag = "1")] + pub code_info: ::core::option::Option, #[prost(bytes = "vec", tag = "2")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", @@ -2614,8 +1933,7 @@ pub struct MsgStoreAndInstantiateContractResponse { )] pub data: ::prost::alloc::vec::Vec, } -/// MsgAddCodeUploadParamsAddresses is the -/// MsgAddCodeUploadParamsAddresses request type. +/// QueryCodesRequest is the request type for the Query/Codes RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2627,16 +1945,18 @@ pub struct MsgStoreAndInstantiateContractResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses")] -pub struct MsgAddCodeUploadParamsAddresses { - /// Authority is the address of the governance account. - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - #[prost(string, repeated, tag = "2")] - pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryCodesRequest")] +#[proto_query( + path = "/cosmwasm.wasm.v1.Query/Codes", + response_type = QueryCodesResponse +)] +pub struct QueryCodesRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "1")] + pub pagination: + ::core::option::Option, } -/// MsgAddCodeUploadParamsAddressesResponse defines the response -/// structure for executing a MsgAddCodeUploadParamsAddresses message. +/// QueryCodesResponse is the response type for the Query/Codes RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2648,10 +1968,17 @@ pub struct MsgAddCodeUploadParamsAddresses { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddressesResponse")] -pub struct MsgAddCodeUploadParamsAddressesResponse {} -/// MsgRemoveCodeUploadParamsAddresses is the -/// MsgRemoveCodeUploadParamsAddresses request type. +#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryCodesResponse")] +pub struct QueryCodesResponse { + #[prost(message, repeated, tag = "1")] + pub code_infos: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +/// QueryPinnedCodesRequest is the request type for the Query/PinnedCodes +/// RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2663,16 +1990,19 @@ pub struct MsgAddCodeUploadParamsAddressesResponse {} ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses")] -pub struct MsgRemoveCodeUploadParamsAddresses { - /// Authority is the address of the governance account. - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - #[prost(string, repeated, tag = "2")] - pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryPinnedCodesRequest")] +#[proto_query( + path = "/cosmwasm.wasm.v1.Query/PinnedCodes", + response_type = QueryPinnedCodesResponse +)] +pub struct QueryPinnedCodesRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, } -/// MsgRemoveCodeUploadParamsAddressesResponse defines the response -/// structure for executing a MsgRemoveCodeUploadParamsAddresses message. +/// QueryPinnedCodesResponse is the response type for the +/// Query/PinnedCodes RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2684,12 +2014,20 @@ pub struct MsgRemoveCodeUploadParamsAddresses { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddressesResponse")] -pub struct MsgRemoveCodeUploadParamsAddressesResponse {} -/// MsgStoreAndMigrateContract is the MsgStoreAndMigrateContract -/// request type. -/// -/// Since: 0.42 +#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryPinnedCodesResponse")] +pub struct QueryPinnedCodesResponse { + #[prost(uint64, repeated, packed = "false", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub code_ids: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +/// QueryParamsRequest is the request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2701,36 +2039,13 @@ pub struct MsgRemoveCodeUploadParamsAddressesResponse {} ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract")] -pub struct MsgStoreAndMigrateContract { - /// Authority is the address of the governance account. - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// WASMByteCode can be raw or gzip compressed - #[prost(bytes = "vec", tag = "2")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub wasm_byte_code: ::prost::alloc::vec::Vec, - /// InstantiatePermission to apply on contract creation, optional - #[prost(message, optional, tag = "3")] - pub instantiate_permission: ::core::option::Option, - /// Contract is the address of the smart contract - #[prost(string, tag = "4")] - pub contract: ::prost::alloc::string::String, - /// Msg json encoded message to be passed to the contract on migration - #[prost(bytes = "vec", tag = "5")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub msg: ::prost::alloc::vec::Vec, -} -/// MsgStoreAndMigrateContractResponse defines the response structure -/// for executing a MsgStoreAndMigrateContract message. -/// -/// Since: 0.42 +#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryParamsRequest")] +#[proto_query( + path = "/cosmwasm.wasm.v1.Query/Params", + response_type = QueryParamsResponse +)] +pub struct QueryParamsRequest {} +/// QueryParamsResponse is the response type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2742,31 +2057,14 @@ pub struct MsgStoreAndMigrateContract { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgStoreAndMigrateContractResponse")] -pub struct MsgStoreAndMigrateContractResponse { - /// CodeID is the reference to the stored WASM code - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub code_id: u64, - /// Checksum is the sha256 hash of the stored code - #[prost(bytes = "vec", tag = "2")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub checksum: ::prost::alloc::vec::Vec, - /// Data contains bytes to returned from the contract - #[prost(bytes = "vec", tag = "3")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub data: ::prost::alloc::vec::Vec, +#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryParamsResponse")] +pub struct QueryParamsResponse { + /// params defines the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, } -/// MsgUpdateContractLabel sets a new label for a smart contract +/// QueryContractsByCreatorRequest is the request type for the +/// Query/ContractsByCreator RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2778,19 +2076,22 @@ pub struct MsgStoreAndMigrateContractResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgUpdateContractLabel")] -pub struct MsgUpdateContractLabel { - /// Sender is the that actor that signed the messages +#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryContractsByCreatorRequest")] +#[proto_query( + path = "/cosmwasm.wasm.v1.Query/ContractsByCreator", + response_type = QueryContractsByCreatorResponse +)] +pub struct QueryContractsByCreatorRequest { + /// CreatorAddress is the address of contract creator #[prost(string, tag = "1")] - pub sender: ::prost::alloc::string::String, - /// NewLabel string to be set - #[prost(string, tag = "2")] - pub new_label: ::prost::alloc::string::String, - /// Contract is the address of the smart contract - #[prost(string, tag = "3")] - pub contract: ::prost::alloc::string::String, + pub creator_address: ::prost::alloc::string::String, + /// Pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, } -/// MsgUpdateContractLabelResponse returns empty data +/// QueryContractsByCreatorResponse is the response type for the +/// Query/ContractsByCreator RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2802,8 +2103,16 @@ pub struct MsgUpdateContractLabel { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgUpdateContractLabelResponse")] -pub struct MsgUpdateContractLabelResponse {} +#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryContractsByCreatorResponse")] +pub struct QueryContractsByCreatorResponse { + /// ContractAddresses result set + #[prost(string, repeated, tag = "1")] + pub contract_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// Pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} pub struct WasmQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } @@ -2913,19 +2222,4 @@ impl<'a, Q: cosmwasm_std::CustomQuery> WasmQuerier<'a, Q> { } .query(self.querier) } - pub fn build_address( - &self, - code_hash: ::prost::alloc::string::String, - creator_address: ::prost::alloc::string::String, - salt: ::prost::alloc::string::String, - init_args: ::prost::alloc::vec::Vec, - ) -> Result { - QueryBuildAddressRequest { - code_hash, - creator_address, - salt, - init_args, - } - .query(self.querier) - } } diff --git a/packages/provwasm-std/src/types/ibc/applications/fee/v1.rs b/packages/provwasm-std/src/types/ibc/applications/fee/v1.rs index 1fbb26b5..dda6428f 100644 --- a/packages/provwasm-std/src/types/ibc/applications/fee/v1.rs +++ b/packages/provwasm-std/src/types/ibc/applications/fee/v1.rs @@ -306,11 +306,6 @@ pub struct QueryIncentivizedPacketsResponse { /// list of identified fees for incentivized packets #[prost(message, repeated, tag = "1")] pub incentivized_packets: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageResponse, - >, } /// QueryIncentivizedPacketRequest defines the request type for the IncentivizedPacket rpc #[allow(clippy::derive_partial_eq_without_eq)] @@ -412,11 +407,6 @@ pub struct QueryIncentivizedPacketsForChannelResponse { /// Map of all incentivized_packets #[prost(message, repeated, tag = "1")] pub incentivized_packets: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageResponse, - >, } /// QueryTotalRecvFeesRequest defines the request type for the TotalRecvFees rpc #[allow(clippy::derive_partial_eq_without_eq)] @@ -674,11 +664,6 @@ pub struct QueryFeeEnabledChannelsResponse { /// list of fee enabled channels #[prost(message, repeated, tag = "1")] pub fee_enabled_channels: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageResponse, - >, } /// QueryFeeEnabledChannelRequest defines the request type for the FeeEnabledChannel rpc #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/controller/v1.rs b/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/controller/v1.rs index 3a7d4c8c..9864a2b7 100644 --- a/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/controller/v1.rs +++ b/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/controller/v1.rs @@ -102,7 +102,7 @@ pub struct QueryParamsResponse { #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } -/// MsgRegisterInterchainAccount defines the payload for Msg/RegisterAccount +/// MsgRegisterInterchainAccount defines the payload for Msg/MsgRegisterInterchainAccount #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -124,17 +124,8 @@ pub struct MsgRegisterInterchainAccount { pub connection_id: ::prost::alloc::string::String, #[prost(string, tag = "3")] pub version: ::prost::alloc::string::String, - #[prost( - enumeration = "super::super::super::super::core::channel::v1::Order", - tag = "4" - )] - #[serde( - serialize_with = "super::super::super::super::core::channel::v1::Order::serialize", - deserialize_with = "super::super::super::super::core::channel::v1::Order::deserialize" - )] - pub ordering: i32, } -/// MsgRegisterInterchainAccountResponse defines the response for Msg/RegisterAccount +/// MsgRegisterInterchainAccountResponse defines the response for Msg/MsgRegisterInterchainAccountResponse #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -152,8 +143,6 @@ pub struct MsgRegisterInterchainAccount { pub struct MsgRegisterInterchainAccountResponse { #[prost(string, tag = "1")] pub channel_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub port_id: ::prost::alloc::string::String, } /// MsgSendTx defines the payload for Msg/SendTx #[allow(clippy::derive_partial_eq_without_eq)] @@ -205,45 +194,6 @@ pub struct MsgSendTxResponse { )] pub sequence: u64, } -/// MsgUpdateParams defines the payload for Msg/UpdateParams -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams")] -pub struct MsgUpdateParams { - /// signer address - #[prost(string, tag = "1")] - pub signer: ::prost::alloc::string::String, - /// params defines the 27-interchain-accounts/controller parameters to update. - /// - /// NOTE: All parameters must be supplied. - #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, -} -/// MsgUpdateParamsResponse defines the response for Msg/UpdateParams -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message( - type_url = "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParamsResponse" -)] -pub struct MsgUpdateParamsResponse {} pub struct ControllerQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } diff --git a/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/host/v1.rs b/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/host/v1.rs index 505dbe45..a7fdd1b6 100644 --- a/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/host/v1.rs +++ b/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/host/v1.rs @@ -21,34 +21,6 @@ pub struct Params { #[prost(string, repeated, tag = "2")] pub allow_messages: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } -/// QueryRequest defines the parameters for a particular query request -/// by an interchain account. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.applications.interchain_accounts.host.v1.QueryRequest")] -pub struct QueryRequest { - /// path defines the path of the query request as defined by ADR-021. - /// - #[prost(string, tag = "1")] - pub path: ::prost::alloc::string::String, - /// data defines the payload of the query request as defined by ADR-021. - /// - #[prost(bytes = "vec", tag = "2")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub data: ::prost::alloc::vec::Vec, -} /// QueryParamsRequest is the request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -85,91 +57,6 @@ pub struct QueryParamsResponse { #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } -/// MsgUpdateParams defines the payload for Msg/UpdateParams -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams")] -pub struct MsgUpdateParams { - /// signer address - #[prost(string, tag = "1")] - pub signer: ::prost::alloc::string::String, - /// params defines the 27-interchain-accounts/host parameters to update. - /// - /// NOTE: All parameters must be supplied. - #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, -} -/// MsgUpdateParamsResponse defines the response for Msg/UpdateParams -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParamsResponse")] -pub struct MsgUpdateParamsResponse {} -/// MsgModuleQuerySafe defines the payload for Msg/ModuleQuerySafe -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafe")] -pub struct MsgModuleQuerySafe { - /// signer address - #[prost(string, tag = "1")] - pub signer: ::prost::alloc::string::String, - /// requests defines the module safe queries to execute. - #[prost(message, repeated, tag = "2")] - pub requests: ::prost::alloc::vec::Vec, -} -/// MsgModuleQuerySafeResponse defines the response for Msg/ModuleQuerySafe -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message( - type_url = "/ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafeResponse" -)] -pub struct MsgModuleQuerySafeResponse { - /// height at which the responses were queried - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub height: u64, - /// protobuf encoded responses for each query - #[prost(bytes = "vec", repeated, tag = "2")] - pub responses: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, -} pub struct HostQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } diff --git a/packages/provwasm-std/src/types/ibc/applications/transfer/v1.rs b/packages/provwasm-std/src/types/ibc/applications/transfer/v1.rs index 30403ae4..b0745cd2 100644 --- a/packages/provwasm-std/src/types/ibc/applications/transfer/v1.rs +++ b/packages/provwasm-std/src/types/ibc/applications/transfer/v1.rs @@ -26,10 +26,6 @@ pub struct Allocation { /// allow list of receivers, an empty allow list permits any receiver address #[prost(string, repeated, tag = "4")] pub allow_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// allow list of memo strings, an empty list prohibits all memo strings; - /// a list only with "*" permits any memo string - #[prost(string, repeated, tag = "5")] - pub allowed_packet_data: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } /// TransferAuthorization allows the grantee to spend up to spend_limit coins from /// the granter's account for ibc transfer on a specific channel @@ -119,11 +115,6 @@ pub struct GenesisState { pub denom_traces: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "3")] pub params: ::core::option::Option, - /// total_escrowed contains the total amount of tokens escrowed - /// by the transfer module - #[prost(message, repeated, tag = "4")] - pub total_escrowed: - ::prost::alloc::vec::Vec, } /// QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC /// method @@ -337,44 +328,6 @@ pub struct QueryEscrowAddressResponse { #[prost(string, tag = "1")] pub escrow_address: ::prost::alloc::string::String, } -/// QueryTotalEscrowForDenomRequest is the request type for TotalEscrowForDenom RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.applications.transfer.v1.QueryTotalEscrowForDenomRequest")] -#[proto_query( - path = "/ibc.applications.transfer.v1.Query/TotalEscrowForDenom", - response_type = QueryTotalEscrowForDenomResponse -)] -pub struct QueryTotalEscrowForDenomRequest { - #[prost(string, tag = "1")] - pub denom: ::prost::alloc::string::String, -} -/// QueryTotalEscrowForDenomResponse is the response type for TotalEscrowForDenom RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.applications.transfer.v1.QueryTotalEscrowForDenomResponse")] -pub struct QueryTotalEscrowForDenomResponse { - #[prost(message, optional, tag = "1")] - pub amount: ::core::option::Option, -} /// MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between /// ICS20 enabled chains. See ICS Spec here: /// @@ -444,44 +397,6 @@ pub struct MsgTransferResponse { )] pub sequence: u64, } -/// MsgUpdateParams is the Msg/UpdateParams request type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.applications.transfer.v1.MsgUpdateParams")] -pub struct MsgUpdateParams { - /// signer address - #[prost(string, tag = "1")] - pub signer: ::prost::alloc::string::String, - /// params defines the transfer parameters to update. - /// - /// NOTE: All parameters must be supplied. - #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, -} -/// MsgUpdateParamsResponse defines the response structure for executing a -/// MsgUpdateParams message. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.applications.transfer.v1.MsgUpdateParamsResponse")] -pub struct MsgUpdateParamsResponse {} pub struct TransferQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } @@ -489,6 +404,12 @@ impl<'a, Q: cosmwasm_std::CustomQuery> TransferQuerier<'a, Q> { pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { Self { querier } } + pub fn denom_trace( + &self, + hash: ::prost::alloc::string::String, + ) -> Result { + QueryDenomTraceRequest { hash }.query(self.querier) + } pub fn denom_traces( &self, pagination: ::core::option::Option< @@ -497,12 +418,6 @@ impl<'a, Q: cosmwasm_std::CustomQuery> TransferQuerier<'a, Q> { ) -> Result { QueryDenomTracesRequest { pagination }.query(self.querier) } - pub fn denom_trace( - &self, - hash: ::prost::alloc::string::String, - ) -> Result { - QueryDenomTraceRequest { hash }.query(self.querier) - } pub fn params(&self) -> Result { QueryParamsRequest {}.query(self.querier) } @@ -523,10 +438,4 @@ impl<'a, Q: cosmwasm_std::CustomQuery> TransferQuerier<'a, Q> { } .query(self.querier) } - pub fn total_escrow_for_denom( - &self, - denom: ::prost::alloc::string::String, - ) -> Result { - QueryTotalEscrowForDenomRequest { denom }.query(self.querier) - } } diff --git a/packages/provwasm-std/src/types/ibc/core/channel/v1.rs b/packages/provwasm-std/src/types/ibc/core/channel/v1.rs index 23b21a0e..9f3309df 100644 --- a/packages/provwasm-std/src/types/ibc/core/channel/v1.rs +++ b/packages/provwasm-std/src/types/ibc/core/channel/v1.rs @@ -39,14 +39,6 @@ pub struct Channel { /// opaque channel version, which is agreed upon during the handshake #[prost(string, tag = "5")] pub version: ::prost::alloc::string::String, - /// upgrade sequence indicates the latest upgrade attempt performed by this channel - /// the value of 0 indicates the channel has never been upgraded - #[prost(uint64, tag = "6")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub upgrade_sequence: u64, } /// IdentifiedChannel defines a channel with additional port and channel /// identifier fields. @@ -93,14 +85,6 @@ pub struct IdentifiedChannel { /// channel identifier #[prost(string, tag = "7")] pub channel_id: ::prost::alloc::string::String, - /// upgrade sequence indicates the latest upgrade attempt performed by this channel - /// the value of 0 indicates the channel has never been upgraded - #[prost(uint64, tag = "8")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub upgrade_sequence: u64, } /// Counterparty defines a channel end counterparty #[allow(clippy::derive_partial_eq_without_eq)] @@ -289,53 +273,8 @@ pub mod acknowledgement { Error(::prost::alloc::string::String), } } -/// Timeout defines an execution deadline structure for 04-channel handlers. -/// This includes packet lifecycle handlers as well as the upgrade handshake handlers. -/// A valid Timeout contains either one or both of a timestamp and block height (sequence). -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.Timeout")] -pub struct Timeout { - /// block height after which the packet or upgrade times out - #[prost(message, optional, tag = "1")] - pub height: ::core::option::Option, - /// block timestamp (in nanoseconds) after which the packet or upgrade times out - #[prost(uint64, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub timestamp: u64, -} -/// Params defines the set of IBC channel parameters. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.Params")] -pub struct Params { - /// the relative timeout after which channel upgrades will time out. - #[prost(message, optional, tag = "1")] - pub upgrade_timeout: ::core::option::Option, -} /// State defines if a channel is in one of the following states: -/// CLOSED, INIT, TRYOPEN, OPEN, FLUSHING, FLUSHCOMPLETE or UNINITIALIZED. +/// CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] @@ -352,10 +291,6 @@ pub enum State { /// A channel has been closed and can no longer be used to send or receive /// packets. Closed = 4, - /// A channel has just accepted the upgrade handshake attempt and is flushing in-flight packets. - Flushing = 5, - /// A channel has just completed flushing any in-flight packets. - Flushcomplete = 6, } impl State { /// String value of the enum field names used in the ProtoBuf definition. @@ -369,8 +304,6 @@ impl State { State::Tryopen => "STATE_TRYOPEN", State::Open => "STATE_OPEN", State::Closed => "STATE_CLOSED", - State::Flushing => "STATE_FLUSHING", - State::Flushcomplete => "STATE_FLUSHCOMPLETE", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -381,8 +314,6 @@ impl State { "STATE_TRYOPEN" => Some(Self::Tryopen), "STATE_OPEN" => Some(Self::Open), "STATE_CLOSED" => Some(Self::Closed), - "STATE_FLUSHING" => Some(Self::Flushing), - "STATE_FLUSHCOMPLETE" => Some(Self::Flushcomplete), _ => None, } } @@ -457,8 +388,6 @@ pub struct GenesisState { deserialize_with = "crate::serde::as_str::deserialize" )] pub next_channel_sequence: u64, - #[prost(message, optional, tag = "9")] - pub params: ::core::option::Option, } /// PacketSequence defines the genesis type necessary to retrieve and store /// next send and receive sequences. @@ -486,88 +415,6 @@ pub struct PacketSequence { )] pub sequence: u64, } -/// Upgrade is a verifiable type which contains the relevant information -/// for an attempted upgrade. It provides the proposed changes to the channel -/// end, the timeout for this upgrade attempt and the next packet sequence -/// which allows the counterparty to efficiently know the highest sequence it has received. -/// The next sequence send is used for pruning and upgrading from unordered to ordered channels. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.Upgrade")] -pub struct Upgrade { - #[prost(message, optional, tag = "1")] - pub fields: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub timeout: ::core::option::Option, - #[prost(uint64, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub next_sequence_send: u64, -} -/// UpgradeFields are the fields in a channel end which may be changed -/// during a channel upgrade. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.UpgradeFields")] -pub struct UpgradeFields { - #[prost(enumeration = "Order", tag = "1")] - #[serde( - serialize_with = "Order::serialize", - deserialize_with = "Order::deserialize" - )] - pub ordering: i32, - #[prost(string, repeated, tag = "2")] - pub connection_hops: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(string, tag = "3")] - pub version: ::prost::alloc::string::String, -} -/// ErrorReceipt defines a type which encapsulates the upgrade sequence and error associated with the -/// upgrade handshake failure. When a channel upgrade handshake is aborted both chains are expected to increment to the -/// next sequence. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.ErrorReceipt")] -pub struct ErrorReceipt { - /// the channel upgrade sequence - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub sequence: u64, - /// the error message detailing the cause of failure - #[prost(string, tag = "2")] - pub message: ::prost::alloc::string::String, -} /// QueryChannelRequest is the request type for the Query/Channel RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -1318,7 +1165,7 @@ pub struct QueryNextSequenceReceiveRequest { #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, } -/// QuerySequenceResponse is the response type for the +/// QuerySequenceResponse is the request type for the /// Query/QueryNextSequenceReceiveResponse RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -1351,201 +1198,6 @@ pub struct QueryNextSequenceReceiveResponse { #[prost(message, optional, tag = "3")] pub proof_height: ::core::option::Option, } -/// QueryNextSequenceSendRequest is the request type for the -/// Query/QueryNextSequenceSend RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.QueryNextSequenceSendRequest")] -#[proto_query( - path = "/ibc.core.channel.v1.Query/NextSequenceSend", - response_type = QueryNextSequenceSendResponse -)] -pub struct QueryNextSequenceSendRequest { - /// 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, -} -/// QueryNextSequenceSendResponse is the request type for the -/// Query/QueryNextSequenceSend RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.QueryNextSequenceSendResponse")] -pub struct QueryNextSequenceSendResponse { - /// next sequence send number - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub next_sequence_send: u64, - /// merkle proof of existence - #[prost(bytes = "vec", tag = "2")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub proof: ::prost::alloc::vec::Vec, - /// height at which the proof was retrieved - #[prost(message, optional, tag = "3")] - pub proof_height: ::core::option::Option, -} -/// QueryUpgradeErrorRequest is the request type for the Query/QueryUpgradeError RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.QueryUpgradeErrorRequest")] -#[proto_query( - path = "/ibc.core.channel.v1.Query/UpgradeError", - response_type = QueryUpgradeErrorResponse -)] -pub struct QueryUpgradeErrorRequest { - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, -} -/// QueryUpgradeErrorResponse is the response type for the Query/QueryUpgradeError RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.QueryUpgradeErrorResponse")] -pub struct QueryUpgradeErrorResponse { - #[prost(message, optional, tag = "1")] - pub error_receipt: ::core::option::Option, - /// merkle proof of existence - #[prost(bytes = "vec", tag = "2")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub proof: ::prost::alloc::vec::Vec, - /// height at which the proof was retrieved - #[prost(message, optional, tag = "3")] - pub proof_height: ::core::option::Option, -} -/// QueryUpgradeRequest is the request type for the QueryUpgradeRequest RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.QueryUpgradeRequest")] -#[proto_query( - path = "/ibc.core.channel.v1.Query/Upgrade", - response_type = QueryUpgradeResponse -)] -pub struct QueryUpgradeRequest { - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, -} -/// QueryUpgradeResponse is the response type for the QueryUpgradeResponse RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.QueryUpgradeResponse")] -pub struct QueryUpgradeResponse { - #[prost(message, optional, tag = "1")] - pub upgrade: ::core::option::Option, - /// merkle proof of existence - #[prost(bytes = "vec", tag = "2")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub proof: ::prost::alloc::vec::Vec, - /// height at which the proof was retrieved - #[prost(message, optional, tag = "3")] - pub proof_height: ::core::option::Option, -} -/// QueryChannelParamsRequest is the request type for the Query/ChannelParams RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.QueryChannelParamsRequest")] -#[proto_query( - path = "/ibc.core.channel.v1.Query/ChannelParams", - response_type = QueryChannelParamsResponse -)] -pub struct QueryChannelParamsRequest {} -/// QueryChannelParamsResponse is the response type for the Query/ChannelParams RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.QueryChannelParamsResponse")] -pub struct QueryChannelParamsResponse { - /// params defines the parameters of the module. - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, -} /// MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It /// is called by a relayer on Chain A. #[allow(clippy::derive_partial_eq_without_eq)] @@ -1641,14 +1293,9 @@ pub struct MsgChannelOpenTry { pub struct MsgChannelOpenTryResponse { #[prost(string, tag = "1")] pub version: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, } /// MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge /// the change of channel state to TRYOPEN on Chain B. -/// WARNING: a channel upgrade MUST NOT initialize an upgrade for this channel -/// in the same block as executing this message otherwise the counterparty will -/// be incapable of opening. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1805,12 +1452,6 @@ pub struct MsgChannelCloseConfirm { pub proof_height: ::core::option::Option, #[prost(string, tag = "5")] pub signer: ::prost::alloc::string::String, - #[prost(uint64, tag = "6")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub counterparty_upgrade_sequence: u64, } /// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response /// type. @@ -1967,12 +1608,6 @@ pub struct MsgTimeoutOnClose { pub next_sequence_recv: u64, #[prost(string, tag = "6")] pub signer: ::prost::alloc::string::String, - #[prost(uint64, tag = "7")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub counterparty_upgrade_sequence: u64, } /// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. #[allow(clippy::derive_partial_eq_without_eq)] @@ -2049,488 +1684,6 @@ pub struct MsgAcknowledgementResponse { )] pub result: i32, } -/// MsgChannelUpgradeInit defines the request type for the ChannelUpgradeInit rpc -/// WARNING: Initializing a channel upgrade in the same block as opening the channel -/// may result in the counterparty being incapable of opening. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelUpgradeInit")] -pub struct MsgChannelUpgradeInit { - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, - #[prost(message, optional, tag = "3")] - pub fields: ::core::option::Option, - #[prost(string, tag = "4")] - pub signer: ::prost::alloc::string::String, -} -/// MsgChannelUpgradeInitResponse defines the MsgChannelUpgradeInit response type -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelUpgradeInitResponse")] -pub struct MsgChannelUpgradeInitResponse { - #[prost(message, optional, tag = "1")] - pub upgrade: ::core::option::Option, - #[prost(uint64, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub upgrade_sequence: u64, -} -/// MsgChannelUpgradeTry defines the request type for the ChannelUpgradeTry rpc -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelUpgradeTry")] -pub struct MsgChannelUpgradeTry { - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, - #[prost(string, repeated, tag = "3")] - pub proposed_upgrade_connection_hops: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(message, optional, tag = "4")] - pub counterparty_upgrade_fields: ::core::option::Option, - #[prost(uint64, tag = "5")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub counterparty_upgrade_sequence: u64, - #[prost(bytes = "vec", tag = "6")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub proof_channel: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "7")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub proof_upgrade: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "8")] - pub proof_height: ::core::option::Option, - #[prost(string, tag = "9")] - pub signer: ::prost::alloc::string::String, -} -/// MsgChannelUpgradeTryResponse defines the MsgChannelUpgradeTry response type -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelUpgradeTryResponse")] -pub struct MsgChannelUpgradeTryResponse { - #[prost(message, optional, tag = "1")] - pub upgrade: ::core::option::Option, - #[prost(uint64, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub upgrade_sequence: u64, - #[prost(enumeration = "ResponseResultType", tag = "3")] - #[serde( - serialize_with = "ResponseResultType::serialize", - deserialize_with = "ResponseResultType::deserialize" - )] - pub result: i32, -} -/// MsgChannelUpgradeAck defines the request type for the ChannelUpgradeAck rpc -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelUpgradeAck")] -pub struct MsgChannelUpgradeAck { - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, - #[prost(message, optional, tag = "3")] - pub counterparty_upgrade: ::core::option::Option, - #[prost(bytes = "vec", tag = "4")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub proof_channel: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "5")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub proof_upgrade: ::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, -} -/// MsgChannelUpgradeAckResponse defines MsgChannelUpgradeAck response type -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelUpgradeAckResponse")] -pub struct MsgChannelUpgradeAckResponse { - #[prost(enumeration = "ResponseResultType", tag = "1")] - #[serde( - serialize_with = "ResponseResultType::serialize", - deserialize_with = "ResponseResultType::deserialize" - )] - pub result: i32, -} -/// MsgChannelUpgradeConfirm defines the request type for the ChannelUpgradeConfirm rpc -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelUpgradeConfirm")] -pub struct MsgChannelUpgradeConfirm { - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, - #[prost(enumeration = "State", tag = "3")] - #[serde( - serialize_with = "State::serialize", - deserialize_with = "State::deserialize" - )] - pub counterparty_channel_state: i32, - #[prost(message, optional, tag = "4")] - pub counterparty_upgrade: ::core::option::Option, - #[prost(bytes = "vec", tag = "5")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub proof_channel: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "6")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub proof_upgrade: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "7")] - pub proof_height: ::core::option::Option, - #[prost(string, tag = "8")] - pub signer: ::prost::alloc::string::String, -} -/// MsgChannelUpgradeConfirmResponse defines MsgChannelUpgradeConfirm response type -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelUpgradeConfirmResponse")] -pub struct MsgChannelUpgradeConfirmResponse { - #[prost(enumeration = "ResponseResultType", tag = "1")] - #[serde( - serialize_with = "ResponseResultType::serialize", - deserialize_with = "ResponseResultType::deserialize" - )] - pub result: i32, -} -/// MsgChannelUpgradeOpen defines the request type for the ChannelUpgradeOpen rpc -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelUpgradeOpen")] -pub struct MsgChannelUpgradeOpen { - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, - #[prost(enumeration = "State", tag = "3")] - #[serde( - serialize_with = "State::serialize", - deserialize_with = "State::deserialize" - )] - pub counterparty_channel_state: i32, - #[prost(uint64, tag = "4")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub counterparty_upgrade_sequence: u64, - #[prost(bytes = "vec", tag = "5")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub proof_channel: ::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, -} -/// MsgChannelUpgradeOpenResponse defines the MsgChannelUpgradeOpen response type -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelUpgradeOpenResponse")] -pub struct MsgChannelUpgradeOpenResponse {} -/// MsgChannelUpgradeTimeout defines the request type for the ChannelUpgradeTimeout rpc -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelUpgradeTimeout")] -pub struct MsgChannelUpgradeTimeout { - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, - #[prost(message, optional, tag = "3")] - pub counterparty_channel: ::core::option::Option, - #[prost(bytes = "vec", tag = "4")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub proof_channel: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "5")] - pub proof_height: ::core::option::Option, - #[prost(string, tag = "6")] - pub signer: ::prost::alloc::string::String, -} -/// MsgChannelUpgradeTimeoutRepsonse defines the MsgChannelUpgradeTimeout response type -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelUpgradeTimeoutResponse")] -pub struct MsgChannelUpgradeTimeoutResponse {} -/// MsgChannelUpgradeCancel defines the request type for the ChannelUpgradeCancel rpc -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelUpgradeCancel")] -pub struct MsgChannelUpgradeCancel { - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, - #[prost(message, optional, tag = "3")] - pub error_receipt: ::core::option::Option, - #[prost(bytes = "vec", tag = "4")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub proof_error_receipt: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "5")] - pub proof_height: ::core::option::Option, - #[prost(string, tag = "6")] - pub signer: ::prost::alloc::string::String, -} -/// MsgChannelUpgradeCancelResponse defines the MsgChannelUpgradeCancel response type -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelUpgradeCancelResponse")] -pub struct MsgChannelUpgradeCancelResponse {} -/// MsgUpdateParams is the MsgUpdateParams request type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.MsgUpdateParams")] -pub struct MsgUpdateParams { - /// authority is the address that controls the module (defaults to x/gov unless overwritten). - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// params defines the channel parameters to update. - /// - /// NOTE: All parameters must be supplied. - #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, -} -/// MsgUpdateParamsResponse defines the MsgUpdateParams response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.MsgUpdateParamsResponse")] -pub struct MsgUpdateParamsResponse {} -/// MsgPruneAcknowledgements defines the request type for the PruneAcknowledgements rpc. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.MsgPruneAcknowledgements")] -pub struct MsgPruneAcknowledgements { - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, - #[prost(uint64, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub limit: u64, - #[prost(string, tag = "4")] - pub signer: ::prost::alloc::string::String, -} -/// MsgPruneAcknowledgementsResponse defines the response type for the PruneAcknowledgements rpc. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.channel.v1.MsgPruneAcknowledgementsResponse")] -pub struct MsgPruneAcknowledgementsResponse { - /// Number of sequences pruned (includes both packet acknowledgements and packet receipts where appropriate). - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub total_pruned_sequences: u64, - /// Number of sequences left after pruning. - #[prost(uint64, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub total_remaining_sequences: u64, -} /// ResponseResultType defines the possible outcomes of the execution of a message #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] @@ -2542,8 +1695,6 @@ pub enum ResponseResultType { Noop = 1, /// The message was executed successfully Success = 2, - /// The message was executed unsuccessfully - Failure = 3, } impl ResponseResultType { /// String value of the enum field names used in the ProtoBuf definition. @@ -2555,7 +1706,6 @@ impl ResponseResultType { ResponseResultType::Unspecified => "RESPONSE_RESULT_TYPE_UNSPECIFIED", ResponseResultType::Noop => "RESPONSE_RESULT_TYPE_NOOP", ResponseResultType::Success => "RESPONSE_RESULT_TYPE_SUCCESS", - ResponseResultType::Failure => "RESPONSE_RESULT_TYPE_FAILURE", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -2564,7 +1714,6 @@ impl ResponseResultType { "RESPONSE_RESULT_TYPE_UNSPECIFIED" => Some(Self::Unspecified), "RESPONSE_RESULT_TYPE_NOOP" => Some(Self::Noop), "RESPONSE_RESULT_TYPE_SUCCESS" => Some(Self::Success), - "RESPONSE_RESULT_TYPE_FAILURE" => Some(Self::Failure), _ => None, } } @@ -2742,40 +1891,4 @@ impl<'a, Q: cosmwasm_std::CustomQuery> ChannelQuerier<'a, Q> { } .query(self.querier) } - pub fn next_sequence_send( - &self, - port_id: ::prost::alloc::string::String, - channel_id: ::prost::alloc::string::String, - ) -> Result { - QueryNextSequenceSendRequest { - port_id, - channel_id, - } - .query(self.querier) - } - pub fn upgrade_error( - &self, - port_id: ::prost::alloc::string::String, - channel_id: ::prost::alloc::string::String, - ) -> Result { - QueryUpgradeErrorRequest { - port_id, - channel_id, - } - .query(self.querier) - } - pub fn upgrade( - &self, - port_id: ::prost::alloc::string::String, - channel_id: ::prost::alloc::string::String, - ) -> Result { - QueryUpgradeRequest { - port_id, - channel_id, - } - .query(self.querier) - } - pub fn channel_params(&self) -> Result { - QueryChannelParamsRequest {}.query(self.querier) - } } diff --git a/packages/provwasm-std/src/types/ibc/core/client/v1.rs b/packages/provwasm-std/src/types/ibc/core/client/v1.rs index 1f3d398a..9ddff83f 100644 --- a/packages/provwasm-std/src/types/ibc/core/client/v1.rs +++ b/packages/provwasm-std/src/types/ibc/core/client/v1.rs @@ -65,70 +65,10 @@ pub struct ClientConsensusStates { #[prost(message, repeated, tag = "2")] pub consensus_states: ::prost::alloc::vec::Vec, } -/// Height is a monotonically increasing data type -/// that can be compared against another Height for the purposes of updating and -/// freezing clients -/// -/// Normally the RevisionHeight is incremented at each height while keeping -/// RevisionNumber the same. However some consensus algorithms may choose to -/// reset the height in certain conditions e.g. hard forks, state-machine -/// breaking changes In these cases, the RevisionNumber is incremented so that -/// height continues to be monitonically increasing even as the RevisionHeight -/// gets reset -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.client.v1.Height")] -pub struct Height { - /// the revision that the client is currently on - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub revision_number: u64, - /// the height within the given revision - #[prost(uint64, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub revision_height: u64, -} -/// Params defines the set of IBC light client parameters. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.client.v1.Params")] -pub struct Params { - /// allowed_clients defines the list of allowed client state types which can be created - /// and interacted with. If a client type is removed from the allowed clients list, usage - /// of this client will be disabled until it is added again to the list. - #[prost(string, repeated, tag = "1")] - pub allowed_clients: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// ClientUpdateProposal is a legacy governance proposal. If it passes, the substitute +/// ClientUpdateProposal is a governance proposal. If it passes, the substitute /// client's latest consensus state is copied over to the subject client. The proposal /// handler may fail if the subject and the substitute do not match in client and /// chain parameters (with exception to latest height, frozen height, and chain-id). -/// -/// Deprecated: Please use MsgRecoverClient in favour of this message type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -141,7 +81,6 @@ pub struct Params { CosmwasmExt, )] #[proto_message(type_url = "/ibc.core.client.v1.ClientUpdateProposal")] -#[deprecated] pub struct ClientUpdateProposal { /// the title of the update proposal #[prost(string, tag = "1")] @@ -159,8 +98,6 @@ pub struct ClientUpdateProposal { } /// UpgradeProposal is a gov Content type for initiating an IBC breaking /// upgrade. -/// -/// Deprecated: Please use MsgIBCSoftwareUpgrade in favour of this message type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -173,7 +110,6 @@ pub struct ClientUpdateProposal { CosmwasmExt, )] #[proto_message(type_url = "/ibc.core.client.v1.UpgradeProposal")] -#[deprecated] pub struct UpgradeProposal { #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, @@ -190,6 +126,62 @@ pub struct UpgradeProposal { #[prost(message, optional, tag = "4")] pub upgraded_client_state: ::core::option::Option, } +/// Height is a monotonically increasing data type +/// that can be compared against another Height for the purposes of updating and +/// freezing clients +/// +/// Normally the RevisionHeight is incremented at each height while keeping +/// RevisionNumber the same. However some consensus algorithms may choose to +/// reset the height in certain conditions e.g. hard forks, state-machine +/// breaking changes In these cases, the RevisionNumber is incremented so that +/// height continues to be monitonically increasing even as the RevisionHeight +/// gets reset +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.Height")] +pub struct Height { + /// the revision that the client is currently on + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub revision_number: u64, + /// the height within the given revision + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub revision_height: u64, +} +/// Params defines the set of IBC light client parameters. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.Params")] +pub struct Params { + /// allowed_clients defines the list of allowed client state types. + #[prost(string, repeated, tag = "1")] + pub allowed_clients: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} /// GenesisState defines the ibc client submodule's genesis state. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -215,9 +207,7 @@ pub struct GenesisState { pub clients_metadata: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "4")] pub params: ::core::option::Option, - /// Deprecated: create_localhost has been deprecated. - /// The localhost client is automatically created at genesis. - #[deprecated] + /// create localhost on initialization #[prost(bool, tag = "5")] pub create_localhost: bool, /// the sequence for the next generated client identifier @@ -710,80 +700,6 @@ pub struct QueryUpgradedConsensusStateResponse { #[prost(message, optional, tag = "1")] pub upgraded_consensus_state: ::core::option::Option, } -/// QueryVerifyMembershipRequest is the request type for the Query/VerifyMembership RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.client.v1.QueryVerifyMembershipRequest")] -#[proto_query( - path = "/ibc.core.client.v1.Query/VerifyMembership", - response_type = QueryVerifyMembershipResponse -)] -pub struct QueryVerifyMembershipRequest { - /// client unique identifier. - #[prost(string, tag = "1")] - pub client_id: ::prost::alloc::string::String, - /// the proof to be verified by the client. - #[prost(bytes = "vec", tag = "2")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub proof: ::prost::alloc::vec::Vec, - /// the height of the commitment root at which the proof is verified. - #[prost(message, optional, tag = "3")] - pub proof_height: ::core::option::Option, - /// the commitment key path. - #[prost(message, optional, tag = "4")] - pub merkle_path: ::core::option::Option, - /// the value which is proven. - #[prost(bytes = "vec", tag = "5")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub value: ::prost::alloc::vec::Vec, - /// optional time delay - #[prost(uint64, tag = "6")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub time_delay: u64, - /// optional block delay - #[prost(uint64, tag = "7")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub block_delay: u64, -} -/// QueryVerifyMembershipResponse is the response type for the Query/VerifyMembership RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.client.v1.QueryVerifyMembershipResponse")] -pub struct QueryVerifyMembershipResponse { - /// boolean indicating success or failure of proof verification. - #[prost(bool, tag = "1")] - pub success: bool, -} /// MsgCreateClient defines a message to create an IBC client #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -824,7 +740,7 @@ pub struct MsgCreateClient { #[proto_message(type_url = "/ibc.core.client.v1.MsgCreateClientResponse")] pub struct MsgCreateClientResponse {} /// MsgUpdateClient defines an sdk.Msg to update a IBC client state using -/// the given client message. +/// the given header. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -841,9 +757,9 @@ pub struct MsgUpdateClient { /// client unique identifier #[prost(string, tag = "1")] pub client_id: ::prost::alloc::string::String, - /// client message to update the light client + /// header to update the light client #[prost(message, optional, tag = "2")] - pub client_message: ::core::option::Option, + pub header: ::core::option::Option, /// signer address #[prost(string, tag = "3")] pub signer: ::prost::alloc::string::String, @@ -921,7 +837,6 @@ pub struct MsgUpgradeClient { pub struct MsgUpgradeClientResponse {} /// MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for /// light client misbehaviour. -/// This message has been deprecated. Use MsgUpdateClient instead. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -934,7 +849,6 @@ pub struct MsgUpgradeClientResponse {} CosmwasmExt, )] #[proto_message(type_url = "/ibc.core.client.v1.MsgSubmitMisbehaviour")] -#[deprecated] pub struct MsgSubmitMisbehaviour { /// client unique identifier #[prost(string, tag = "1")] @@ -961,126 +875,6 @@ pub struct MsgSubmitMisbehaviour { )] #[proto_message(type_url = "/ibc.core.client.v1.MsgSubmitMisbehaviourResponse")] pub struct MsgSubmitMisbehaviourResponse {} -/// MsgRecoverClient defines the message used to recover a frozen or expired client. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.client.v1.MsgRecoverClient")] -pub struct MsgRecoverClient { - /// the client identifier for the client to be updated if the proposal passes - #[prost(string, tag = "1")] - pub subject_client_id: ::prost::alloc::string::String, - /// the substitute client identifier for the client which will replace the subject - /// client - #[prost(string, tag = "2")] - pub substitute_client_id: ::prost::alloc::string::String, - /// signer address - #[prost(string, tag = "3")] - pub signer: ::prost::alloc::string::String, -} -/// MsgRecoverClientResponse defines the Msg/RecoverClient response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.client.v1.MsgRecoverClientResponse")] -pub struct MsgRecoverClientResponse {} -/// MsgIBCSoftwareUpgrade defines the message used to schedule an upgrade of an IBC client using a v1 governance proposal -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.client.v1.MsgIBCSoftwareUpgrade")] -pub struct MsgIbcSoftwareUpgrade { - #[prost(message, optional, tag = "1")] - pub plan: ::core::option::Option, - /// An UpgradedClientState must be provided to perform an IBC breaking upgrade. - /// This will make the chain commit to the correct upgraded (self) client state - /// before the upgrade occurs, so that connecting chains can verify that the - /// new upgraded client is valid by verifying a proof on the previous version - /// of the chain. This will allow IBC connections to persist smoothly across - /// planned chain upgrades. Correspondingly, the UpgradedClientState field has been - /// deprecated in the Cosmos SDK to allow for this logic to exist solely in - /// the 02-client module. - #[prost(message, optional, tag = "2")] - pub upgraded_client_state: ::core::option::Option, - /// signer address - #[prost(string, tag = "3")] - pub signer: ::prost::alloc::string::String, -} -/// MsgIBCSoftwareUpgradeResponse defines the Msg/IBCSoftwareUpgrade response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.client.v1.MsgIBCSoftwareUpgradeResponse")] -pub struct MsgIbcSoftwareUpgradeResponse {} -/// MsgUpdateParams defines the sdk.Msg type to update the client parameters. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.client.v1.MsgUpdateParams")] -pub struct MsgUpdateParams { - /// signer address - #[prost(string, tag = "1")] - pub signer: ::prost::alloc::string::String, - /// params defines the client parameters to update. - /// - /// NOTE: All parameters must be supplied. - #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, -} -/// MsgUpdateParamsResponse defines the MsgUpdateParams response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.client.v1.MsgUpdateParamsResponse")] -pub struct MsgUpdateParamsResponse {} pub struct ClientQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } @@ -1162,25 +956,4 @@ impl<'a, Q: cosmwasm_std::CustomQuery> ClientQuerier<'a, Q> { ) -> Result { QueryUpgradedConsensusStateRequest {}.query(self.querier) } - pub fn verify_membership( - &self, - client_id: ::prost::alloc::string::String, - proof: ::prost::alloc::vec::Vec, - proof_height: ::core::option::Option, - merkle_path: ::core::option::Option, - value: ::prost::alloc::vec::Vec, - time_delay: u64, - block_delay: u64, - ) -> Result { - QueryVerifyMembershipRequest { - client_id, - proof, - proof_height, - merkle_path, - value, - time_delay, - block_delay, - } - .query(self.querier) - } } diff --git a/packages/provwasm-std/src/types/ibc/core/commitment/v1.rs b/packages/provwasm-std/src/types/ibc/core/commitment/v1.rs index fcd03f8c..dd3c98e8 100644 --- a/packages/provwasm-std/src/types/ibc/core/commitment/v1.rs +++ b/packages/provwasm-std/src/types/ibc/core/commitment/v1.rs @@ -82,6 +82,5 @@ pub struct MerklePath { #[proto_message(type_url = "/ibc.core.commitment.v1.MerkleProof")] pub struct MerkleProof { #[prost(message, repeated, tag = "1")] - pub proofs: - ::prost::alloc::vec::Vec, + pub proofs: ::prost::alloc::vec::Vec, } diff --git a/packages/provwasm-std/src/types/ibc/core/connection/v1.rs b/packages/provwasm-std/src/types/ibc/core/connection/v1.rs index 1bd832a4..9efcaecc 100644 --- a/packages/provwasm-std/src/types/ibc/core/connection/v1.rs +++ b/packages/provwasm-std/src/types/ibc/core/connection/v1.rs @@ -683,13 +683,6 @@ pub struct MsgConnectionOpenTry { pub consensus_height: ::core::option::Option, #[prost(string, tag = "12")] pub signer: ::prost::alloc::string::String, - /// optional proof data for host state machines that are unable to introspect their own consensus state - #[prost(bytes = "vec", tag = "13")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub host_consensus_state_proof: ::prost::alloc::vec::Vec, } /// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. #[allow(clippy::derive_partial_eq_without_eq)] @@ -756,13 +749,6 @@ pub struct MsgConnectionOpenAck { pub consensus_height: ::core::option::Option, #[prost(string, tag = "10")] pub signer: ::prost::alloc::string::String, - /// optional proof data for host state machines that are unable to introspect their own consensus state - #[prost(bytes = "vec", tag = "11")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub host_consensus_state_proof: ::prost::alloc::vec::Vec, } /// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. #[allow(clippy::derive_partial_eq_without_eq)] @@ -822,43 +808,6 @@ pub struct MsgConnectionOpenConfirm { )] #[proto_message(type_url = "/ibc.core.connection.v1.MsgConnectionOpenConfirmResponse")] pub struct MsgConnectionOpenConfirmResponse {} -/// MsgUpdateParams defines the sdk.Msg type to update the connection parameters. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.connection.v1.MsgUpdateParams")] -pub struct MsgUpdateParams { - /// signer address - #[prost(string, tag = "1")] - pub signer: ::prost::alloc::string::String, - /// params defines the connection parameters to update. - /// - /// NOTE: All parameters must be supplied. - #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, -} -/// MsgUpdateParamsResponse defines the MsgUpdateParams response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.core.connection.v1.MsgUpdateParamsResponse")] -pub struct MsgUpdateParamsResponse {} pub struct ConnectionQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } diff --git a/packages/provwasm-std/src/types/ibc/lightclients/localhost/mod.rs b/packages/provwasm-std/src/types/ibc/lightclients/localhost/mod.rs index 7083bd82..a3a6d96c 100644 --- a/packages/provwasm-std/src/types/ibc/lightclients/localhost/mod.rs +++ b/packages/provwasm-std/src/types/ibc/lightclients/localhost/mod.rs @@ -1 +1 @@ -pub mod v2; +pub mod v1; diff --git a/packages/provwasm-std/src/types/ibc/lightclients/localhost/v1.rs b/packages/provwasm-std/src/types/ibc/lightclients/localhost/v1.rs new file mode 100644 index 00000000..74af41aa --- /dev/null +++ b/packages/provwasm-std/src/types/ibc/lightclients/localhost/v1.rs @@ -0,0 +1,23 @@ +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; +/// ClientState defines a loopback (localhost) client. It requires (read-only) +/// access to keys outside the client prefix. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.localhost.v1.ClientState")] +pub struct ClientState { + /// self chain ID + #[prost(string, tag = "1")] + pub chain_id: ::prost::alloc::string::String, + /// self latest block height + #[prost(message, optional, tag = "2")] + pub height: ::core::option::Option, +} diff --git a/packages/provwasm-std/src/types/ibc/lightclients/localhost/v2.rs b/packages/provwasm-std/src/types/ibc/lightclients/localhost/v2.rs deleted file mode 100644 index 69dcbe98..00000000 --- a/packages/provwasm-std/src/types/ibc/lightclients/localhost/v2.rs +++ /dev/null @@ -1,19 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// ClientState defines the 09-localhost client state -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.lightclients.localhost.v2.ClientState")] -pub struct ClientState { - /// the latest block height - #[prost(message, optional, tag = "1")] - pub latest_height: ::core::option::Option, -} diff --git a/packages/provwasm-std/src/types/ibc/lightclients/mod.rs b/packages/provwasm-std/src/types/ibc/lightclients/mod.rs index c8725b46..971b50e8 100644 --- a/packages/provwasm-std/src/types/ibc/lightclients/mod.rs +++ b/packages/provwasm-std/src/types/ibc/lightclients/mod.rs @@ -1,4 +1,3 @@ pub mod localhost; pub mod solomachine; pub mod tendermint; -pub mod wasm; diff --git a/packages/provwasm-std/src/types/ibc/lightclients/solomachine/mod.rs b/packages/provwasm-std/src/types/ibc/lightclients/solomachine/mod.rs index e55f7d1f..ae6adc7c 100644 --- a/packages/provwasm-std/src/types/ibc/lightclients/solomachine/mod.rs +++ b/packages/provwasm-std/src/types/ibc/lightclients/solomachine/mod.rs @@ -1,2 +1,2 @@ +pub mod v1; pub mod v2; -pub mod v3; diff --git a/packages/provwasm-std/src/types/ibc/lightclients/solomachine/v1.rs b/packages/provwasm-std/src/types/ibc/lightclients/solomachine/v1.rs new file mode 100644 index 00000000..7bffaee2 --- /dev/null +++ b/packages/provwasm-std/src/types/ibc/lightclients/solomachine/v1.rs @@ -0,0 +1,531 @@ +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; +/// ClientState defines a solo machine client that tracks the current consensus +/// state and if the client is frozen. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.ClientState")] +pub struct ClientState { + /// latest sequence of the client state + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, + /// frozen sequence of the solo machine + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub frozen_sequence: u64, + #[prost(message, optional, tag = "3")] + pub consensus_state: ::core::option::Option, + /// when set to true, will allow governance to update a solo machine client. + /// The client will be unfrozen if it is frozen. + #[prost(bool, tag = "4")] + pub allow_update_after_proposal: bool, +} +/// ConsensusState defines a solo machine consensus state. The sequence of a +/// consensus state is contained in the "height" key used in storing the +/// consensus state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.ConsensusState")] +pub struct ConsensusState { + /// public key of the solo machine + #[prost(message, optional, tag = "1")] + pub public_key: ::core::option::Option, + /// diversifier allows the same public key to be re-used across different solo + /// machine clients (potentially on different chains) without being considered + /// misbehaviour. + #[prost(string, tag = "2")] + pub diversifier: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timestamp: u64, +} +/// Header defines a solo machine consensus header +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.Header")] +pub struct Header { + /// sequence to update solo machine public key at + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timestamp: u64, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub signature: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "4")] + pub new_public_key: ::core::option::Option, + #[prost(string, tag = "5")] + pub new_diversifier: ::prost::alloc::string::String, +} +/// Misbehaviour defines misbehaviour for a solo machine which consists +/// of a sequence and two signatures over different messages at that sequence. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.Misbehaviour")] +pub struct Misbehaviour { + #[prost(string, tag = "1")] + pub client_id: ::prost::alloc::string::String, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, + #[prost(message, optional, tag = "3")] + pub signature_one: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub signature_two: ::core::option::Option, +} +/// SignatureAndData contains a signature and the data signed over to create that +/// signature. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.SignatureAndData")] +pub struct SignatureAndData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub signature: ::prost::alloc::vec::Vec, + #[prost(enumeration = "DataType", tag = "2")] + #[serde( + serialize_with = "DataType::serialize", + deserialize_with = "DataType::deserialize" + )] + pub data_type: i32, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, + #[prost(uint64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timestamp: u64, +} +/// TimestampedSignatureData contains the signature data and the timestamp of the +/// signature. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.TimestampedSignatureData")] +pub struct TimestampedSignatureData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub signature_data: ::prost::alloc::vec::Vec, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timestamp: u64, +} +/// SignBytes defines the signed bytes used for signature verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.SignBytes")] +pub struct SignBytes { + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timestamp: u64, + #[prost(string, tag = "3")] + pub diversifier: ::prost::alloc::string::String, + /// type of the data used + #[prost(enumeration = "DataType", tag = "4")] + #[serde( + serialize_with = "DataType::serialize", + deserialize_with = "DataType::deserialize" + )] + pub data_type: i32, + /// marshaled data + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +/// HeaderData returns the SignBytes data for update verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.HeaderData")] +pub struct HeaderData { + /// header public key + #[prost(message, optional, tag = "1")] + pub new_pub_key: ::core::option::Option, + /// header diversifier + #[prost(string, tag = "2")] + pub new_diversifier: ::prost::alloc::string::String, +} +/// ClientStateData returns the SignBytes data for client state verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.ClientStateData")] +pub struct ClientStateData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub client_state: ::core::option::Option, +} +/// ConsensusStateData returns the SignBytes data for consensus state +/// verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.ConsensusStateData")] +pub struct ConsensusStateData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub consensus_state: ::core::option::Option, +} +/// ConnectionStateData returns the SignBytes data for connection state +/// verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.ConnectionStateData")] +pub struct ConnectionStateData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub connection: + ::core::option::Option, +} +/// ChannelStateData returns the SignBytes data for channel state +/// verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.ChannelStateData")] +pub struct ChannelStateData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub channel: ::core::option::Option, +} +/// PacketCommitmentData returns the SignBytes data for packet commitment +/// verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.PacketCommitmentData")] +pub struct PacketCommitmentData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub commitment: ::prost::alloc::vec::Vec, +} +/// PacketAcknowledgementData returns the SignBytes data for acknowledgement +/// verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.PacketAcknowledgementData")] +pub struct PacketAcknowledgementData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub acknowledgement: ::prost::alloc::vec::Vec, +} +/// PacketReceiptAbsenceData returns the SignBytes data for +/// packet receipt absence verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData")] +pub struct PacketReceiptAbsenceData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, +} +/// NextSequenceRecvData returns the SignBytes data for verification of the next +/// sequence to be received. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.NextSequenceRecvData")] +pub struct NextSequenceRecvData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub next_seq_recv: u64, +} +/// DataType defines the type of solo machine proof being created. This is done +/// to preserve uniqueness of different data sign byte encodings. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] +pub enum DataType { + /// Default State + UninitializedUnspecified = 0, + /// Data type for client state verification + ClientState = 1, + /// Data type for consensus state verification + ConsensusState = 2, + /// Data type for connection state verification + ConnectionState = 3, + /// Data type for channel state verification + ChannelState = 4, + /// Data type for packet commitment verification + PacketCommitment = 5, + /// Data type for packet acknowledgement verification + PacketAcknowledgement = 6, + /// Data type for packet receipt absence verification + PacketReceiptAbsence = 7, + /// Data type for next sequence recv verification + NextSequenceRecv = 8, + /// Data type for header verification + Header = 9, +} +impl DataType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + DataType::UninitializedUnspecified => "DATA_TYPE_UNINITIALIZED_UNSPECIFIED", + DataType::ClientState => "DATA_TYPE_CLIENT_STATE", + DataType::ConsensusState => "DATA_TYPE_CONSENSUS_STATE", + DataType::ConnectionState => "DATA_TYPE_CONNECTION_STATE", + DataType::ChannelState => "DATA_TYPE_CHANNEL_STATE", + DataType::PacketCommitment => "DATA_TYPE_PACKET_COMMITMENT", + DataType::PacketAcknowledgement => "DATA_TYPE_PACKET_ACKNOWLEDGEMENT", + DataType::PacketReceiptAbsence => "DATA_TYPE_PACKET_RECEIPT_ABSENCE", + DataType::NextSequenceRecv => "DATA_TYPE_NEXT_SEQUENCE_RECV", + DataType::Header => "DATA_TYPE_HEADER", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "DATA_TYPE_UNINITIALIZED_UNSPECIFIED" => Some(Self::UninitializedUnspecified), + "DATA_TYPE_CLIENT_STATE" => Some(Self::ClientState), + "DATA_TYPE_CONSENSUS_STATE" => Some(Self::ConsensusState), + "DATA_TYPE_CONNECTION_STATE" => Some(Self::ConnectionState), + "DATA_TYPE_CHANNEL_STATE" => Some(Self::ChannelState), + "DATA_TYPE_PACKET_COMMITMENT" => Some(Self::PacketCommitment), + "DATA_TYPE_PACKET_ACKNOWLEDGEMENT" => Some(Self::PacketAcknowledgement), + "DATA_TYPE_PACKET_RECEIPT_ABSENCE" => Some(Self::PacketReceiptAbsence), + "DATA_TYPE_NEXT_SEQUENCE_RECV" => Some(Self::NextSequenceRecv), + "DATA_TYPE_HEADER" => Some(Self::Header), + _ => None, + } + } +} diff --git a/packages/provwasm-std/src/types/ibc/lightclients/solomachine/v3.rs b/packages/provwasm-std/src/types/ibc/lightclients/solomachine/v3.rs deleted file mode 100644 index 8e244294..00000000 --- a/packages/provwasm-std/src/types/ibc/lightclients/solomachine/v3.rs +++ /dev/null @@ -1,252 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// ClientState defines a solo machine client that tracks the current consensus -/// state and if the client is frozen. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.lightclients.solomachine.v3.ClientState")] -pub struct ClientState { - /// latest sequence of the client state - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub sequence: u64, - /// frozen sequence of the solo machine - #[prost(bool, tag = "2")] - pub is_frozen: bool, - #[prost(message, optional, tag = "3")] - pub consensus_state: ::core::option::Option, -} -/// ConsensusState defines a solo machine consensus state. The sequence of a -/// consensus state is contained in the "height" key used in storing the -/// consensus state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.lightclients.solomachine.v3.ConsensusState")] -pub struct ConsensusState { - /// public key of the solo machine - #[prost(message, optional, tag = "1")] - pub public_key: ::core::option::Option, - /// diversifier allows the same public key to be re-used across different solo - /// machine clients (potentially on different chains) without being considered - /// misbehaviour. - #[prost(string, tag = "2")] - pub diversifier: ::prost::alloc::string::String, - #[prost(uint64, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub timestamp: u64, -} -/// Header defines a solo machine consensus header -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.lightclients.solomachine.v3.Header")] -pub struct Header { - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub timestamp: u64, - #[prost(bytes = "vec", tag = "2")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub signature: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "3")] - pub new_public_key: ::core::option::Option, - #[prost(string, tag = "4")] - pub new_diversifier: ::prost::alloc::string::String, -} -/// Misbehaviour defines misbehaviour for a solo machine which consists -/// of a sequence and two signatures over different messages at that sequence. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.lightclients.solomachine.v3.Misbehaviour")] -pub struct Misbehaviour { - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub sequence: u64, - #[prost(message, optional, tag = "2")] - pub signature_one: ::core::option::Option, - #[prost(message, optional, tag = "3")] - pub signature_two: ::core::option::Option, -} -/// SignatureAndData contains a signature and the data signed over to create that -/// signature. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.lightclients.solomachine.v3.SignatureAndData")] -pub struct SignatureAndData { - #[prost(bytes = "vec", tag = "1")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub signature: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "2")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub path: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "3")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub data: ::prost::alloc::vec::Vec, - #[prost(uint64, tag = "4")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub timestamp: u64, -} -/// TimestampedSignatureData contains the signature data and the timestamp of the -/// signature. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.lightclients.solomachine.v3.TimestampedSignatureData")] -pub struct TimestampedSignatureData { - #[prost(bytes = "vec", tag = "1")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub signature_data: ::prost::alloc::vec::Vec, - #[prost(uint64, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub timestamp: u64, -} -/// SignBytes defines the signed bytes used for signature verification. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.lightclients.solomachine.v3.SignBytes")] -pub struct SignBytes { - /// the sequence number - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub sequence: u64, - /// the proof timestamp - #[prost(uint64, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub timestamp: u64, - /// the public key diversifier - #[prost(string, tag = "3")] - pub diversifier: ::prost::alloc::string::String, - /// the standardised path bytes - #[prost(bytes = "vec", tag = "4")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub path: ::prost::alloc::vec::Vec, - /// the marshaled data bytes - #[prost(bytes = "vec", tag = "5")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub data: ::prost::alloc::vec::Vec, -} -/// HeaderData returns the SignBytes data for update verification. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.lightclients.solomachine.v3.HeaderData")] -pub struct HeaderData { - /// header public key - #[prost(message, optional, tag = "1")] - pub new_pub_key: ::core::option::Option, - /// header diversifier - #[prost(string, tag = "2")] - pub new_diversifier: ::prost::alloc::string::String, -} diff --git a/packages/provwasm-std/src/types/ibc/lightclients/tendermint/v1.rs b/packages/provwasm-std/src/types/ibc/lightclients/tendermint/v1.rs index e2a36145..d6da76e1 100644 --- a/packages/provwasm-std/src/types/ibc/lightclients/tendermint/v1.rs +++ b/packages/provwasm-std/src/types/ibc/lightclients/tendermint/v1.rs @@ -36,8 +36,7 @@ pub struct ClientState { pub latest_height: ::core::option::Option, /// Proof specifications used in verifying counterparty state #[prost(message, repeated, tag = "8")] - pub proof_specs: - ::prost::alloc::vec::Vec, + pub proof_specs: ::prost::alloc::vec::Vec, /// Path at which next upgraded client will be committed. /// Each element corresponds to the key for a single CommitmentProof in the /// chained proof. NOTE: ClientState must stored under @@ -99,8 +98,6 @@ pub struct ConsensusState { )] #[proto_message(type_url = "/ibc.lightclients.tendermint.v1.Misbehaviour")] pub struct Misbehaviour { - /// ClientID is deprecated - #[deprecated] #[prost(string, tag = "1")] pub client_id: ::prost::alloc::string::String, #[prost(message, optional, tag = "2")] diff --git a/packages/provwasm-std/src/types/ibc/lightclients/wasm/mod.rs b/packages/provwasm-std/src/types/ibc/lightclients/wasm/mod.rs deleted file mode 100644 index a3a6d96c..00000000 --- a/packages/provwasm-std/src/types/ibc/lightclients/wasm/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/provwasm-std/src/types/ibc/lightclients/wasm/v1.rs b/packages/provwasm-std/src/types/ibc/lightclients/wasm/v1.rs deleted file mode 100644 index 2c69dc7c..00000000 --- a/packages/provwasm-std/src/types/ibc/lightclients/wasm/v1.rs +++ /dev/null @@ -1,384 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// GenesisState defines 08-wasm's keeper genesis state -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.lightclients.wasm.v1.GenesisState")] -pub struct GenesisState { - /// uploaded light client wasm contracts - #[prost(message, repeated, tag = "1")] - pub contracts: ::prost::alloc::vec::Vec, -} -/// Contract stores contract code -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.lightclients.wasm.v1.Contract")] -pub struct Contract { - /// contract byte code - #[prost(bytes = "vec", tag = "1")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub code_bytes: ::prost::alloc::vec::Vec, -} -/// QueryChecksumsRequest is the request type for the Query/Checksums RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.lightclients.wasm.v1.QueryChecksumsRequest")] -#[proto_query( - path = "/ibc.lightclients.wasm.v1.Query/Checksums", - response_type = QueryChecksumsResponse -)] -pub struct QueryChecksumsRequest { - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "1")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageRequest, - >, -} -/// QueryChecksumsResponse is the response type for the Query/Checksums RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.lightclients.wasm.v1.QueryChecksumsResponse")] -pub struct QueryChecksumsResponse { - /// checksums is a list of the hex encoded checksums of all wasm codes stored. - #[prost(string, repeated, tag = "1")] - pub checksums: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageResponse, - >, -} -/// QueryCodeRequest is the request type for the Query/Code RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.lightclients.wasm.v1.QueryCodeRequest")] -#[proto_query( - path = "/ibc.lightclients.wasm.v1.Query/Code", - response_type = QueryCodeResponse -)] -pub struct QueryCodeRequest { - /// checksum is a hex encoded string of the code stored. - #[prost(string, tag = "1")] - pub checksum: ::prost::alloc::string::String, -} -/// QueryCodeResponse is the response type for the Query/Code RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.lightclients.wasm.v1.QueryCodeResponse")] -pub struct QueryCodeResponse { - #[prost(bytes = "vec", tag = "1")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub data: ::prost::alloc::vec::Vec, -} -/// MsgStoreCode defines the request type for the StoreCode rpc. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.lightclients.wasm.v1.MsgStoreCode")] -pub struct MsgStoreCode { - /// signer address - #[prost(string, tag = "1")] - pub signer: ::prost::alloc::string::String, - /// wasm byte code of light client contract. It can be raw or gzip compressed - #[prost(bytes = "vec", tag = "2")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub wasm_byte_code: ::prost::alloc::vec::Vec, -} -/// MsgStoreCodeResponse defines the response type for the StoreCode rpc -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.lightclients.wasm.v1.MsgStoreCodeResponse")] -pub struct MsgStoreCodeResponse { - /// checksum is the sha256 hash of the stored code - #[prost(bytes = "vec", tag = "1")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub checksum: ::prost::alloc::vec::Vec, -} -/// MsgRemoveChecksum defines the request type for the MsgRemoveChecksum rpc. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.lightclients.wasm.v1.MsgRemoveChecksum")] -pub struct MsgRemoveChecksum { - /// signer address - #[prost(string, tag = "1")] - pub signer: ::prost::alloc::string::String, - /// checksum is the sha256 hash to be removed from the store - #[prost(bytes = "vec", tag = "2")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub checksum: ::prost::alloc::vec::Vec, -} -/// MsgStoreChecksumResponse defines the response type for the StoreCode rpc -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.lightclients.wasm.v1.MsgRemoveChecksumResponse")] -pub struct MsgRemoveChecksumResponse {} -/// MsgMigrateContract defines the request type for the MigrateContract rpc. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.lightclients.wasm.v1.MsgMigrateContract")] -pub struct MsgMigrateContract { - /// signer address - #[prost(string, tag = "1")] - pub signer: ::prost::alloc::string::String, - /// the client id of the contract - #[prost(string, tag = "2")] - pub client_id: ::prost::alloc::string::String, - /// checksum is the sha256 hash of the new wasm byte code for the contract - #[prost(bytes = "vec", tag = "3")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub checksum: ::prost::alloc::vec::Vec, - /// the json encoded message to be passed to the contract on migration - #[prost(bytes = "vec", tag = "4")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub msg: ::prost::alloc::vec::Vec, -} -/// MsgMigrateContractResponse defines the response type for the MigrateContract rpc -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.lightclients.wasm.v1.MsgMigrateContractResponse")] -pub struct MsgMigrateContractResponse {} -/// Wasm light client's Client state -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.lightclients.wasm.v1.ClientState")] -pub struct ClientState { - /// bytes encoding the client state of the underlying light client - /// implemented as a Wasm contract. - #[prost(bytes = "vec", tag = "1")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub data: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "2")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub checksum: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "3")] - pub latest_height: ::core::option::Option, -} -/// Wasm light client's ConsensusState -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.lightclients.wasm.v1.ConsensusState")] -pub struct ConsensusState { - /// bytes encoding the consensus state of the underlying light client - /// implemented as a Wasm contract. - #[prost(bytes = "vec", tag = "1")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub data: ::prost::alloc::vec::Vec, -} -/// Wasm light client message (either header(s) or misbehaviour) -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.lightclients.wasm.v1.ClientMessage")] -pub struct ClientMessage { - #[prost(bytes = "vec", tag = "1")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub data: ::prost::alloc::vec::Vec, -} -/// Checksums defines a list of all checksums that are stored -/// -/// Deprecated: This message is deprecated in favor of storing the checksums -/// using a Collections.KeySet. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/ibc.lightclients.wasm.v1.Checksums")] -#[deprecated] -pub struct Checksums { - #[prost(bytes = "vec", repeated, tag = "1")] - pub checksums: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, -} -pub struct WasmQuerier<'a, Q: cosmwasm_std::CustomQuery> { - querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, -} -impl<'a, Q: cosmwasm_std::CustomQuery> WasmQuerier<'a, Q> { - pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { - Self { querier } - } - pub fn checksums( - &self, - pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageRequest, - >, - ) -> Result { - QueryChecksumsRequest { pagination }.query(self.querier) - } - pub fn code( - &self, - checksum: ::prost::alloc::string::String, - ) -> Result { - QueryCodeRequest { checksum }.query(self.querier) - } -} diff --git a/packages/provwasm-std/src/types/cosmos/ics23/v1.rs b/packages/provwasm-std/src/types/ics23.rs similarity index 94% rename from packages/provwasm-std/src/types/cosmos/ics23/v1.rs rename to packages/provwasm-std/src/types/ics23.rs index 63a9497b..5770637c 100644 --- a/packages/provwasm-std/src/types/cosmos/ics23/v1.rs +++ b/packages/provwasm-std/src/types/ics23.rs @@ -30,7 +30,7 @@ use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.ics23.v1.ExistenceProof")] +#[proto_message(type_url = "/ics23.ExistenceProof")] pub struct ExistenceProof { #[prost(bytes = "vec", tag = "1")] #[serde( @@ -64,7 +64,7 @@ pub struct ExistenceProof { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.ics23.v1.NonExistenceProof")] +#[proto_message(type_url = "/ics23.NonExistenceProof")] pub struct NonExistenceProof { /// TODO: remove this as unnecessary??? we prove a range #[prost(bytes = "vec", tag = "1")] @@ -91,7 +91,7 @@ pub struct NonExistenceProof { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.ics23.v1.CommitmentProof")] +#[proto_message(type_url = "/ics23.CommitmentProof")] pub struct CommitmentProof { #[prost(oneof = "commitment_proof::Proof", tags = "1, 2, 3, 4")] pub proof: ::core::option::Option, @@ -146,7 +146,7 @@ pub mod commitment_proof { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.ics23.v1.LeafOp")] +#[proto_message(type_url = "/ics23.LeafOp")] pub struct LeafOp { #[prost(enumeration = "HashOp", tag = "1")] #[serde( @@ -208,7 +208,7 @@ pub struct LeafOp { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.ics23.v1.InnerOp")] +#[proto_message(type_url = "/ics23.InnerOp")] pub struct InnerOp { #[prost(enumeration = "HashOp", tag = "1")] #[serde( @@ -251,7 +251,7 @@ pub struct InnerOp { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.ics23.v1.ProofSpec")] +#[proto_message(type_url = "/ics23.ProofSpec")] pub struct ProofSpec { /// any field in the ExistenceProof must be the same as in this spec. /// except Prefix, which is just the first bytes of prefix (spec can be longer) @@ -265,11 +265,6 @@ pub struct ProofSpec { /// min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) #[prost(int32, tag = "4")] pub min_depth: i32, - /// prehash_key_before_comparison is a flag that indicates whether to use the - /// prehash_key specified by LeafOp to compare lexical ordering of keys for - /// non-existence proofs. - #[prost(bool, tag = "5")] - pub prehash_key_before_comparison: bool, } /// /// InnerSpec contains all store-specific structure info to determine if two proofs from a @@ -291,7 +286,7 @@ pub struct ProofSpec { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.ics23.v1.InnerSpec")] +#[proto_message(type_url = "/ics23.InnerSpec")] pub struct InnerSpec { /// Child order is the ordering of the children node, must count from 0 /// iavl tree is \[0, 1\] (left then right) @@ -332,7 +327,7 @@ pub struct InnerSpec { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.ics23.v1.BatchProof")] +#[proto_message(type_url = "/ics23.BatchProof")] pub struct BatchProof { #[prost(message, repeated, tag = "1")] pub entries: ::prost::alloc::vec::Vec, @@ -349,7 +344,7 @@ pub struct BatchProof { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.ics23.v1.BatchEntry")] +#[proto_message(type_url = "/ics23.BatchEntry")] pub struct BatchEntry { #[prost(oneof = "batch_entry::Proof", tags = "1, 2")] pub proof: ::core::option::Option, @@ -385,7 +380,7 @@ pub mod batch_entry { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.ics23.v1.CompressedBatchProof")] +#[proto_message(type_url = "/ics23.CompressedBatchProof")] pub struct CompressedBatchProof { #[prost(message, repeated, tag = "1")] pub entries: ::prost::alloc::vec::Vec, @@ -404,7 +399,7 @@ pub struct CompressedBatchProof { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.ics23.v1.CompressedBatchEntry")] +#[proto_message(type_url = "/ics23.CompressedBatchEntry")] pub struct CompressedBatchEntry { #[prost(oneof = "compressed_batch_entry::Proof", tags = "1, 2")] pub proof: ::core::option::Option, @@ -440,7 +435,7 @@ pub mod compressed_batch_entry { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.ics23.v1.CompressedExistenceProof")] +#[proto_message(type_url = "/ics23.CompressedExistenceProof")] pub struct CompressedExistenceProof { #[prost(bytes = "vec", tag = "1")] #[serde( @@ -471,7 +466,7 @@ pub struct CompressedExistenceProof { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.ics23.v1.CompressedNonExistenceProof")] +#[proto_message(type_url = "/ics23.CompressedNonExistenceProof")] pub struct CompressedNonExistenceProof { /// TODO: remove this as unnecessary??? we prove a range #[prost(bytes = "vec", tag = "1")] diff --git a/packages/provwasm-std/src/types/mod.rs b/packages/provwasm-std/src/types/mod.rs index 27f93290..8288f58e 100644 --- a/packages/provwasm-std/src/types/mod.rs +++ b/packages/provwasm-std/src/types/mod.rs @@ -1,12 +1,6 @@ -#[cfg(feature = "capability")] -pub mod capability; -#[cfg(feature = "cosmos")] pub mod cosmos; -#[cfg(feature = "cosmwasm")] pub mod cosmwasm; -#[cfg(feature = "ibc")] pub mod ibc; -#[cfg(feature = "provenance")] +pub mod ics23; pub mod provenance; -#[cfg(feature = "tendermint")] pub mod tendermint; diff --git a/packages/provwasm-std/src/types/provenance/attribute/v1.rs b/packages/provwasm-std/src/types/provenance/attribute/v1/mod.rs similarity index 95% rename from packages/provwasm-std/src/types/provenance/attribute/v1.rs rename to packages/provwasm-std/src/types/provenance/attribute/v1/mod.rs index b43ceea9..e9f9f662 100644 --- a/packages/provwasm-std/src/types/provenance/attribute/v1.rs +++ b/packages/provwasm-std/src/types/provenance/attribute/v1/mod.rs @@ -1,3 +1,4 @@ +pub mod tonic; use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Params defines the set of params for the attribute module. #[allow(clippy::derive_partial_eq_without_eq)] @@ -226,23 +227,6 @@ pub struct EventAccountDataUpdated { #[prost(string, tag = "1")] pub account: ::prost::alloc::string::String, } -/// EventAttributeParamsUpdated event emitted when attribute params are updated. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.attribute.v1.EventAttributeParamsUpdated")] -pub struct EventAttributeParamsUpdated { - #[prost(string, tag = "1")] - pub max_value_length: ::prost::alloc::string::String, -} /// AttributeType defines the type of the data stored in the attribute value #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] @@ -895,41 +879,7 @@ pub struct MsgSetAccountDataRequest { )] #[proto_message(type_url = "/provenance.attribute.v1.MsgSetAccountDataResponse")] pub struct MsgSetAccountDataResponse {} -/// MsgUpdateParamsRequest is a request message for the UpdateParams endpoint. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.attribute.v1.MsgUpdateParamsRequest")] -pub struct MsgUpdateParamsRequest { - /// authority should be the governance module account address. - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// params are the new param values to set. - #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, -} -/// MsgUpdateParamsResponse is a response message for the UpdateParams endpoint. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.attribute.v1.MsgUpdateParamsResponse")] -pub struct MsgUpdateParamsResponse {} +include!("provenance.attribute.v1.tonic.rs"); pub struct AttributeQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } diff --git a/packages/provwasm-std/src/types/provenance/attribute/v1/tonic.rs b/packages/provwasm-std/src/types/provenance/attribute/v1/tonic.rs new file mode 100644 index 00000000..ff21f71d --- /dev/null +++ b/packages/provwasm-std/src/types/provenance/attribute/v1/tonic.rs @@ -0,0 +1,1192 @@ +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; +/// 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 provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + 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 the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.attribute.v1.Query/Params"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.attribute.v1.Query", "Params")); + self.inner.unary(req, path, codec).await + } + pub async fn attribute( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.attribute.v1.Query/Attribute"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.attribute.v1.Query", + "Attribute", + )); + self.inner.unary(req, path, codec).await + } + pub async fn attributes( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.attribute.v1.Query/Attributes"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.attribute.v1.Query", + "Attributes", + )); + self.inner.unary(req, path, codec).await + } + pub async fn scan( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.attribute.v1.Query/Scan"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.attribute.v1.Query", "Scan")); + self.inner.unary(req, path, codec).await + } + pub async fn attribute_accounts( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.attribute.v1.Query/AttributeAccounts", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.attribute.v1.Query", + "AttributeAccounts", + )); + self.inner.unary(req, path, codec).await + } + pub async fn account_data( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.attribute.v1.Query/AccountData"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.attribute.v1.Query", + "AccountData", + )); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + async fn params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn attribute( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn attributes( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn scan( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn attribute_accounts( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn account_data( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/provenance.attribute.v1.Query/Params" => { + #[allow(non_camel_case_types)] + struct ParamsSvc(pub Arc); + impl tonic::server::UnaryService for ParamsSvc { + type Response = super::QueryParamsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::params(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.attribute.v1.Query/Attribute" => { + #[allow(non_camel_case_types)] + struct AttributeSvc(pub Arc); + impl tonic::server::UnaryService for AttributeSvc { + type Response = super::QueryAttributeResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::attribute(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AttributeSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.attribute.v1.Query/Attributes" => { + #[allow(non_camel_case_types)] + struct AttributesSvc(pub Arc); + impl tonic::server::UnaryService for AttributesSvc { + type Response = super::QueryAttributesResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::attributes(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AttributesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.attribute.v1.Query/Scan" => { + #[allow(non_camel_case_types)] + struct ScanSvc(pub Arc); + impl tonic::server::UnaryService for ScanSvc { + type Response = super::QueryScanResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::scan(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ScanSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.attribute.v1.Query/AttributeAccounts" => { + #[allow(non_camel_case_types)] + struct AttributeAccountsSvc(pub Arc); + impl tonic::server::UnaryService + for AttributeAccountsSvc + { + type Response = super::QueryAttributeAccountsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::attribute_accounts(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AttributeAccountsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.attribute.v1.Query/AccountData" => { + #[allow(non_camel_case_types)] + struct AccountDataSvc(pub Arc); + impl tonic::server::UnaryService for AccountDataSvc { + type Response = super::QueryAccountDataResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::account_data(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AccountDataSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "provenance.attribute.v1.Query"; + } +} +/// 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 provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + 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 the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn add_attribute( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.attribute.v1.Msg/AddAttribute"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.attribute.v1.Msg", + "AddAttribute", + )); + self.inner.unary(req, path, codec).await + } + pub async fn update_attribute( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.attribute.v1.Msg/UpdateAttribute", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.attribute.v1.Msg", + "UpdateAttribute", + )); + self.inner.unary(req, path, codec).await + } + pub async fn update_attribute_expiration( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.attribute.v1.Msg/UpdateAttributeExpiration", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.attribute.v1.Msg", + "UpdateAttributeExpiration", + )); + self.inner.unary(req, path, codec).await + } + pub async fn delete_attribute( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.attribute.v1.Msg/DeleteAttribute", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.attribute.v1.Msg", + "DeleteAttribute", + )); + self.inner.unary(req, path, codec).await + } + pub async fn delete_distinct_attribute( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.attribute.v1.Msg/DeleteDistinctAttribute", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.attribute.v1.Msg", + "DeleteDistinctAttribute", + )); + self.inner.unary(req, path, codec).await + } + pub async fn set_account_data( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.attribute.v1.Msg/SetAccountData"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.attribute.v1.Msg", + "SetAccountData", + )); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + async fn add_attribute( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn update_attribute( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn update_attribute_expiration( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn delete_attribute( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn delete_distinct_attribute( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn set_account_data( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/provenance.attribute.v1.Msg/AddAttribute" => { + #[allow(non_camel_case_types)] + struct AddAttributeSvc(pub Arc); + impl tonic::server::UnaryService for AddAttributeSvc { + type Response = super::MsgAddAttributeResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::add_attribute(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AddAttributeSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.attribute.v1.Msg/UpdateAttribute" => { + #[allow(non_camel_case_types)] + struct UpdateAttributeSvc(pub Arc); + impl tonic::server::UnaryService + for UpdateAttributeSvc + { + type Response = super::MsgUpdateAttributeResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::update_attribute(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateAttributeSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.attribute.v1.Msg/UpdateAttributeExpiration" => { + #[allow(non_camel_case_types)] + struct UpdateAttributeExpirationSvc(pub Arc); + impl + tonic::server::UnaryService + for UpdateAttributeExpirationSvc + { + type Response = super::MsgUpdateAttributeExpirationResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_attribute_expiration(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateAttributeExpirationSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.attribute.v1.Msg/DeleteAttribute" => { + #[allow(non_camel_case_types)] + struct DeleteAttributeSvc(pub Arc); + impl tonic::server::UnaryService + for DeleteAttributeSvc + { + type Response = super::MsgDeleteAttributeResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::delete_attribute(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeleteAttributeSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.attribute.v1.Msg/DeleteDistinctAttribute" => { + #[allow(non_camel_case_types)] + struct DeleteDistinctAttributeSvc(pub Arc); + impl + tonic::server::UnaryService + for DeleteDistinctAttributeSvc + { + type Response = super::MsgDeleteDistinctAttributeResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::delete_distinct_attribute(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeleteDistinctAttributeSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.attribute.v1.Msg/SetAccountData" => { + #[allow(non_camel_case_types)] + struct SetAccountDataSvc(pub Arc); + impl tonic::server::UnaryService for SetAccountDataSvc { + type Response = super::MsgSetAccountDataResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::set_account_data(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SetAccountDataSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "provenance.attribute.v1.Msg"; + } +} diff --git a/packages/provwasm-std/src/types/provenance/exchange/v1.rs b/packages/provwasm-std/src/types/provenance/exchange/v1/mod.rs similarity index 98% rename from packages/provwasm-std/src/types/provenance/exchange/v1.rs rename to packages/provwasm-std/src/types/provenance/exchange/v1/mod.rs index 3e0298ab..b31f4c6e 100644 --- a/packages/provwasm-std/src/types/provenance/exchange/v1.rs +++ b/packages/provwasm-std/src/types/provenance/exchange/v1/mod.rs @@ -1,3 +1,4 @@ +pub mod tonic; use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Commitment contains information on committed funds. #[allow(clippy::derive_partial_eq_without_eq)] @@ -2206,9 +2207,6 @@ pub struct MsgMarketManageReqAttrsRequest { #[proto_message(type_url = "/provenance.exchange.v1.MsgMarketManageReqAttrsResponse")] pub struct MsgMarketManageReqAttrsResponse {} /// MsgCreatePaymentRequest is a request message for the CreatePayment endpoint. -/// -/// The signer is the payment.source, but we can't define that using the cosmos.msg.v1.signer option. -/// So signers for this msg are defined in code using a custom get-signers function. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2241,9 +2239,6 @@ pub struct MsgCreatePaymentRequest { #[proto_message(type_url = "/provenance.exchange.v1.MsgCreatePaymentResponse")] pub struct MsgCreatePaymentResponse {} /// MsgAcceptPaymentRequest is a request message for the AcceptPayment endpoint. -/// -/// The signer is the payment.target, but we can't define that using the cosmos.msg.v1.signer option. -/// So signers for this msg are defined in code using a custom get-signers function. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2589,7 +2584,6 @@ pub struct MsgGovCloseMarketRequest { #[proto_message(type_url = "/provenance.exchange.v1.MsgGovCloseMarketResponse")] pub struct MsgGovCloseMarketResponse {} /// MsgGovUpdateParamsRequest is a request message for the GovUpdateParams endpoint. -/// Deprecated: Use MsgUpdateParamsRequest instead. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2602,7 +2596,6 @@ pub struct MsgGovCloseMarketResponse {} CosmwasmExt, )] #[proto_message(type_url = "/provenance.exchange.v1.MsgGovUpdateParamsRequest")] -#[deprecated] pub struct MsgGovUpdateParamsRequest { /// authority should be the governance module account address. #[prost(string, tag = "1")] @@ -2612,7 +2605,6 @@ pub struct MsgGovUpdateParamsRequest { pub params: ::core::option::Option, } /// MsgGovUpdateParamsResponse is a response message for the GovUpdateParams endpoint. -/// Deprecated: Use MsgUpdateParamsResponse instead. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2625,43 +2617,7 @@ pub struct MsgGovUpdateParamsRequest { CosmwasmExt, )] #[proto_message(type_url = "/provenance.exchange.v1.MsgGovUpdateParamsResponse")] -#[deprecated] pub struct MsgGovUpdateParamsResponse {} -/// MsgGovUpdateParamsRequest is a request message for the GovUpdateParams endpoint. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.exchange.v1.MsgUpdateParamsRequest")] -pub struct MsgUpdateParamsRequest { - /// authority should be the governance module account address. - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// params are the new param values to set - #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, -} -/// MsgUpdateParamsResponse is a response message for the GovUpdateParams endpoint. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.exchange.v1.MsgUpdateParamsResponse")] -pub struct MsgUpdateParamsResponse {} /// QueryOrderFeeCalcRequest is a request message for the OrderFeeCalc query. /// Exactly one of ask_order or bid_order must be provided. #[allow(clippy::derive_partial_eq_without_eq)] @@ -3752,6 +3708,7 @@ pub struct QueryPaymentFeeCalcResponse { #[prost(message, repeated, tag = "2")] pub fee_accept: ::prost::alloc::vec::Vec, } +include!("provenance.exchange.v1.tonic.rs"); pub struct ExchangeQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } diff --git a/packages/provwasm-std/src/types/provenance/exchange/v1/tonic.rs b/packages/provwasm-std/src/types/provenance/exchange/v1/tonic.rs new file mode 100644 index 00000000..623405e8 --- /dev/null +++ b/packages/provwasm-std/src/types/provenance/exchange/v1/tonic.rs @@ -0,0 +1,3939 @@ +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; +/// 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 provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + 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 the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn create_ask( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.exchange.v1.Msg/CreateAsk"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.exchange.v1.Msg", "CreateAsk")); + self.inner.unary(req, path, codec).await + } + pub async fn create_bid( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.exchange.v1.Msg/CreateBid"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.exchange.v1.Msg", "CreateBid")); + self.inner.unary(req, path, codec).await + } + pub async fn commit_funds( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.exchange.v1.Msg/CommitFunds"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.exchange.v1.Msg", "CommitFunds")); + self.inner.unary(req, path, codec).await + } + pub async fn cancel_order( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.exchange.v1.Msg/CancelOrder"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.exchange.v1.Msg", "CancelOrder")); + self.inner.unary(req, path, codec).await + } + pub async fn fill_bids( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.exchange.v1.Msg/FillBids"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.exchange.v1.Msg", "FillBids")); + self.inner.unary(req, path, codec).await + } + pub async fn fill_asks( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.exchange.v1.Msg/FillAsks"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.exchange.v1.Msg", "FillAsks")); + self.inner.unary(req, path, codec).await + } + pub async fn market_settle( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.exchange.v1.Msg/MarketSettle"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Msg", + "MarketSettle", + )); + self.inner.unary(req, path, codec).await + } + pub async fn market_commitment_settle( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.exchange.v1.Msg/MarketCommitmentSettle", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Msg", + "MarketCommitmentSettle", + )); + self.inner.unary(req, path, codec).await + } + pub async fn market_release_commitments( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.exchange.v1.Msg/MarketReleaseCommitments", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Msg", + "MarketReleaseCommitments", + )); + self.inner.unary(req, path, codec).await + } + pub async fn market_set_order_external_id( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.exchange.v1.Msg/MarketSetOrderExternalID", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Msg", + "MarketSetOrderExternalID", + )); + self.inner.unary(req, path, codec).await + } + pub async fn market_withdraw( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.exchange.v1.Msg/MarketWithdraw"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Msg", + "MarketWithdraw", + )); + self.inner.unary(req, path, codec).await + } + pub async fn market_update_details( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.exchange.v1.Msg/MarketUpdateDetails", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Msg", + "MarketUpdateDetails", + )); + self.inner.unary(req, path, codec).await + } + pub async fn market_update_enabled( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.exchange.v1.Msg/MarketUpdateEnabled", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Msg", + "MarketUpdateEnabled", + )); + self.inner.unary(req, path, codec).await + } + pub async fn market_update_accepting_orders( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.exchange.v1.Msg/MarketUpdateAcceptingOrders", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Msg", + "MarketUpdateAcceptingOrders", + )); + self.inner.unary(req, path, codec).await + } + pub async fn market_update_user_settle( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.exchange.v1.Msg/MarketUpdateUserSettle", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Msg", + "MarketUpdateUserSettle", + )); + self.inner.unary(req, path, codec).await + } + pub async fn market_update_accepting_commitments( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.exchange.v1.Msg/MarketUpdateAcceptingCommitments", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Msg", + "MarketUpdateAcceptingCommitments", + )); + self.inner.unary(req, path, codec).await + } + pub async fn market_update_intermediary_denom( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.exchange.v1.Msg/MarketUpdateIntermediaryDenom", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Msg", + "MarketUpdateIntermediaryDenom", + )); + self.inner.unary(req, path, codec).await + } + pub async fn market_manage_permissions( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.exchange.v1.Msg/MarketManagePermissions", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Msg", + "MarketManagePermissions", + )); + self.inner.unary(req, path, codec).await + } + pub async fn market_manage_req_attrs( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.exchange.v1.Msg/MarketManageReqAttrs", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Msg", + "MarketManageReqAttrs", + )); + self.inner.unary(req, path, codec).await + } + pub async fn create_payment( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.exchange.v1.Msg/CreatePayment"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Msg", + "CreatePayment", + )); + self.inner.unary(req, path, codec).await + } + pub async fn accept_payment( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.exchange.v1.Msg/AcceptPayment"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Msg", + "AcceptPayment", + )); + self.inner.unary(req, path, codec).await + } + pub async fn reject_payment( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.exchange.v1.Msg/RejectPayment"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Msg", + "RejectPayment", + )); + self.inner.unary(req, path, codec).await + } + pub async fn reject_payments( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.exchange.v1.Msg/RejectPayments"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Msg", + "RejectPayments", + )); + self.inner.unary(req, path, codec).await + } + pub async fn cancel_payments( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.exchange.v1.Msg/CancelPayments"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Msg", + "CancelPayments", + )); + self.inner.unary(req, path, codec).await + } + pub async fn change_payment_target( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.exchange.v1.Msg/ChangePaymentTarget", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Msg", + "ChangePaymentTarget", + )); + self.inner.unary(req, path, codec).await + } + pub async fn gov_create_market( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.exchange.v1.Msg/GovCreateMarket"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Msg", + "GovCreateMarket", + )); + self.inner.unary(req, path, codec).await + } + pub async fn gov_manage_fees( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.exchange.v1.Msg/GovManageFees"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Msg", + "GovManageFees", + )); + self.inner.unary(req, path, codec).await + } + pub async fn gov_close_market( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.exchange.v1.Msg/GovCloseMarket"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Msg", + "GovCloseMarket", + )); + self.inner.unary(req, path, codec).await + } + pub async fn gov_update_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.exchange.v1.Msg/GovUpdateParams"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Msg", + "GovUpdateParams", + )); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + async fn create_ask( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn create_bid( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn commit_funds( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn cancel_order( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn fill_bids( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn fill_asks( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn market_settle( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn market_commitment_settle( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn market_release_commitments( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn market_set_order_external_id( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn market_withdraw( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn market_update_details( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn market_update_enabled( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn market_update_accepting_orders( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn market_update_user_settle( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn market_update_accepting_commitments( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn market_update_intermediary_denom( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn market_manage_permissions( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn market_manage_req_attrs( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn create_payment( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn accept_payment( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn reject_payment( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn reject_payments( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn cancel_payments( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn change_payment_target( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn gov_create_market( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn gov_manage_fees( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn gov_close_market( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn gov_update_params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/provenance.exchange.v1.Msg/CreateAsk" => { + #[allow(non_camel_case_types)] + struct CreateAskSvc(pub Arc); + impl tonic::server::UnaryService for CreateAskSvc { + type Response = super::MsgCreateAskResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::create_ask(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CreateAskSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Msg/CreateBid" => { + #[allow(non_camel_case_types)] + struct CreateBidSvc(pub Arc); + impl tonic::server::UnaryService for CreateBidSvc { + type Response = super::MsgCreateBidResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::create_bid(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CreateBidSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Msg/CommitFunds" => { + #[allow(non_camel_case_types)] + struct CommitFundsSvc(pub Arc); + impl tonic::server::UnaryService for CommitFundsSvc { + type Response = super::MsgCommitFundsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::commit_funds(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CommitFundsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Msg/CancelOrder" => { + #[allow(non_camel_case_types)] + struct CancelOrderSvc(pub Arc); + impl tonic::server::UnaryService for CancelOrderSvc { + type Response = super::MsgCancelOrderResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::cancel_order(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CancelOrderSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Msg/FillBids" => { + #[allow(non_camel_case_types)] + struct FillBidsSvc(pub Arc); + impl tonic::server::UnaryService for FillBidsSvc { + type Response = super::MsgFillBidsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::fill_bids(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = FillBidsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Msg/FillAsks" => { + #[allow(non_camel_case_types)] + struct FillAsksSvc(pub Arc); + impl tonic::server::UnaryService for FillAsksSvc { + type Response = super::MsgFillAsksResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::fill_asks(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = FillAsksSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Msg/MarketSettle" => { + #[allow(non_camel_case_types)] + struct MarketSettleSvc(pub Arc); + impl tonic::server::UnaryService for MarketSettleSvc { + type Response = super::MsgMarketSettleResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::market_settle(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = MarketSettleSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Msg/MarketCommitmentSettle" => { + #[allow(non_camel_case_types)] + struct MarketCommitmentSettleSvc(pub Arc); + impl + tonic::server::UnaryService + for MarketCommitmentSettleSvc + { + type Response = super::MsgMarketCommitmentSettleResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::market_commitment_settle(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = MarketCommitmentSettleSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Msg/MarketReleaseCommitments" => { + #[allow(non_camel_case_types)] + struct MarketReleaseCommitmentsSvc(pub Arc); + impl + tonic::server::UnaryService + for MarketReleaseCommitmentsSvc + { + type Response = super::MsgMarketReleaseCommitmentsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::market_release_commitments(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = MarketReleaseCommitmentsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Msg/MarketSetOrderExternalID" => { + #[allow(non_camel_case_types)] + struct MarketSetOrderExternalIDSvc(pub Arc); + impl + tonic::server::UnaryService + for MarketSetOrderExternalIDSvc + { + type Response = super::MsgMarketSetOrderExternalIdResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::market_set_order_external_id(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = MarketSetOrderExternalIDSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Msg/MarketWithdraw" => { + #[allow(non_camel_case_types)] + struct MarketWithdrawSvc(pub Arc); + impl tonic::server::UnaryService for MarketWithdrawSvc { + type Response = super::MsgMarketWithdrawResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::market_withdraw(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = MarketWithdrawSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Msg/MarketUpdateDetails" => { + #[allow(non_camel_case_types)] + struct MarketUpdateDetailsSvc(pub Arc); + impl tonic::server::UnaryService + for MarketUpdateDetailsSvc + { + type Response = super::MsgMarketUpdateDetailsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::market_update_details(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = MarketUpdateDetailsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Msg/MarketUpdateEnabled" => { + #[allow(non_camel_case_types)] + struct MarketUpdateEnabledSvc(pub Arc); + impl tonic::server::UnaryService + for MarketUpdateEnabledSvc + { + type Response = super::MsgMarketUpdateEnabledResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::market_update_enabled(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = MarketUpdateEnabledSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Msg/MarketUpdateAcceptingOrders" => { + #[allow(non_camel_case_types)] + struct MarketUpdateAcceptingOrdersSvc(pub Arc); + impl + tonic::server::UnaryService + for MarketUpdateAcceptingOrdersSvc + { + type Response = super::MsgMarketUpdateAcceptingOrdersResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::market_update_accepting_orders(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = MarketUpdateAcceptingOrdersSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Msg/MarketUpdateUserSettle" => { + #[allow(non_camel_case_types)] + struct MarketUpdateUserSettleSvc(pub Arc); + impl + tonic::server::UnaryService + for MarketUpdateUserSettleSvc + { + type Response = super::MsgMarketUpdateUserSettleResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::market_update_user_settle(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = MarketUpdateUserSettleSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Msg/MarketUpdateAcceptingCommitments" => { + #[allow(non_camel_case_types)] + struct MarketUpdateAcceptingCommitmentsSvc(pub Arc); + impl + tonic::server::UnaryService< + super::MsgMarketUpdateAcceptingCommitmentsRequest, + > for MarketUpdateAcceptingCommitmentsSvc + { + type Response = super::MsgMarketUpdateAcceptingCommitmentsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request< + super::MsgMarketUpdateAcceptingCommitmentsRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::market_update_accepting_commitments(&inner, request) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = MarketUpdateAcceptingCommitmentsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Msg/MarketUpdateIntermediaryDenom" => { + #[allow(non_camel_case_types)] + struct MarketUpdateIntermediaryDenomSvc(pub Arc); + impl + tonic::server::UnaryService + for MarketUpdateIntermediaryDenomSvc + { + type Response = super::MsgMarketUpdateIntermediaryDenomResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::market_update_intermediary_denom(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = MarketUpdateIntermediaryDenomSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Msg/MarketManagePermissions" => { + #[allow(non_camel_case_types)] + struct MarketManagePermissionsSvc(pub Arc); + impl + tonic::server::UnaryService + for MarketManagePermissionsSvc + { + type Response = super::MsgMarketManagePermissionsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::market_manage_permissions(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = MarketManagePermissionsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Msg/MarketManageReqAttrs" => { + #[allow(non_camel_case_types)] + struct MarketManageReqAttrsSvc(pub Arc); + impl tonic::server::UnaryService + for MarketManageReqAttrsSvc + { + type Response = super::MsgMarketManageReqAttrsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::market_manage_req_attrs(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = MarketManageReqAttrsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Msg/CreatePayment" => { + #[allow(non_camel_case_types)] + struct CreatePaymentSvc(pub Arc); + impl tonic::server::UnaryService for CreatePaymentSvc { + type Response = super::MsgCreatePaymentResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::create_payment(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CreatePaymentSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Msg/AcceptPayment" => { + #[allow(non_camel_case_types)] + struct AcceptPaymentSvc(pub Arc); + impl tonic::server::UnaryService for AcceptPaymentSvc { + type Response = super::MsgAcceptPaymentResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::accept_payment(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AcceptPaymentSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Msg/RejectPayment" => { + #[allow(non_camel_case_types)] + struct RejectPaymentSvc(pub Arc); + impl tonic::server::UnaryService for RejectPaymentSvc { + type Response = super::MsgRejectPaymentResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::reject_payment(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = RejectPaymentSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Msg/RejectPayments" => { + #[allow(non_camel_case_types)] + struct RejectPaymentsSvc(pub Arc); + impl tonic::server::UnaryService for RejectPaymentsSvc { + type Response = super::MsgRejectPaymentsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::reject_payments(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = RejectPaymentsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Msg/CancelPayments" => { + #[allow(non_camel_case_types)] + struct CancelPaymentsSvc(pub Arc); + impl tonic::server::UnaryService for CancelPaymentsSvc { + type Response = super::MsgCancelPaymentsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::cancel_payments(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CancelPaymentsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Msg/ChangePaymentTarget" => { + #[allow(non_camel_case_types)] + struct ChangePaymentTargetSvc(pub Arc); + impl tonic::server::UnaryService + for ChangePaymentTargetSvc + { + type Response = super::MsgChangePaymentTargetResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::change_payment_target(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ChangePaymentTargetSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Msg/GovCreateMarket" => { + #[allow(non_camel_case_types)] + struct GovCreateMarketSvc(pub Arc); + impl tonic::server::UnaryService + for GovCreateMarketSvc + { + type Response = super::MsgGovCreateMarketResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::gov_create_market(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GovCreateMarketSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Msg/GovManageFees" => { + #[allow(non_camel_case_types)] + struct GovManageFeesSvc(pub Arc); + impl tonic::server::UnaryService for GovManageFeesSvc { + type Response = super::MsgGovManageFeesResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::gov_manage_fees(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GovManageFeesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Msg/GovCloseMarket" => { + #[allow(non_camel_case_types)] + struct GovCloseMarketSvc(pub Arc); + impl tonic::server::UnaryService for GovCloseMarketSvc { + type Response = super::MsgGovCloseMarketResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::gov_close_market(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GovCloseMarketSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Msg/GovUpdateParams" => { + #[allow(non_camel_case_types)] + struct GovUpdateParamsSvc(pub Arc); + impl tonic::server::UnaryService + for GovUpdateParamsSvc + { + type Response = super::MsgGovUpdateParamsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::gov_update_params(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GovUpdateParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "provenance.exchange.v1.Msg"; + } +} +/// 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 provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + 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 the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn order_fee_calc( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.exchange.v1.Query/OrderFeeCalc"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Query", + "OrderFeeCalc", + )); + self.inner.unary(req, path, codec).await + } + pub async fn get_order( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.exchange.v1.Query/GetOrder"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.exchange.v1.Query", "GetOrder")); + self.inner.unary(req, path, codec).await + } + pub async fn get_order_by_external_id( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.exchange.v1.Query/GetOrderByExternalID", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Query", + "GetOrderByExternalID", + )); + self.inner.unary(req, path, codec).await + } + pub async fn get_market_orders( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.exchange.v1.Query/GetMarketOrders", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Query", + "GetMarketOrders", + )); + self.inner.unary(req, path, codec).await + } + pub async fn get_owner_orders( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.exchange.v1.Query/GetOwnerOrders", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Query", + "GetOwnerOrders", + )); + self.inner.unary(req, path, codec).await + } + pub async fn get_asset_orders( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.exchange.v1.Query/GetAssetOrders", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Query", + "GetAssetOrders", + )); + self.inner.unary(req, path, codec).await + } + pub async fn get_all_orders( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.exchange.v1.Query/GetAllOrders"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Query", + "GetAllOrders", + )); + self.inner.unary(req, path, codec).await + } + pub async fn get_commitment( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.exchange.v1.Query/GetCommitment"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Query", + "GetCommitment", + )); + self.inner.unary(req, path, codec).await + } + pub async fn get_account_commitments( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.exchange.v1.Query/GetAccountCommitments", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Query", + "GetAccountCommitments", + )); + self.inner.unary(req, path, codec).await + } + pub async fn get_market_commitments( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.exchange.v1.Query/GetMarketCommitments", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Query", + "GetMarketCommitments", + )); + self.inner.unary(req, path, codec).await + } + pub async fn get_all_commitments( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.exchange.v1.Query/GetAllCommitments", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Query", + "GetAllCommitments", + )); + self.inner.unary(req, path, codec).await + } + pub async fn get_market( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.exchange.v1.Query/GetMarket"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.exchange.v1.Query", "GetMarket")); + self.inner.unary(req, path, codec).await + } + pub async fn get_all_markets( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.exchange.v1.Query/GetAllMarkets"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Query", + "GetAllMarkets", + )); + self.inner.unary(req, path, codec).await + } + pub async fn params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.exchange.v1.Query/Params"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.exchange.v1.Query", "Params")); + self.inner.unary(req, path, codec).await + } + pub async fn commitment_settlement_fee_calc( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.exchange.v1.Query/CommitmentSettlementFeeCalc", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Query", + "CommitmentSettlementFeeCalc", + )); + self.inner.unary(req, path, codec).await + } + pub async fn validate_create_market( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.exchange.v1.Query/ValidateCreateMarket", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Query", + "ValidateCreateMarket", + )); + self.inner.unary(req, path, codec).await + } + pub async fn validate_market( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.exchange.v1.Query/ValidateMarket", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Query", + "ValidateMarket", + )); + self.inner.unary(req, path, codec).await + } + pub async fn validate_manage_fees( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.exchange.v1.Query/ValidateManageFees", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Query", + "ValidateManageFees", + )); + self.inner.unary(req, path, codec).await + } + pub async fn get_payment( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.exchange.v1.Query/GetPayment"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Query", + "GetPayment", + )); + self.inner.unary(req, path, codec).await + } + pub async fn get_payments_with_source( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.exchange.v1.Query/GetPaymentsWithSource", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Query", + "GetPaymentsWithSource", + )); + self.inner.unary(req, path, codec).await + } + pub async fn get_payments_with_target( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.exchange.v1.Query/GetPaymentsWithTarget", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Query", + "GetPaymentsWithTarget", + )); + self.inner.unary(req, path, codec).await + } + pub async fn get_all_payments( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.exchange.v1.Query/GetAllPayments", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Query", + "GetAllPayments", + )); + self.inner.unary(req, path, codec).await + } + pub async fn payment_fee_calc( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.exchange.v1.Query/PaymentFeeCalc", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.exchange.v1.Query", + "PaymentFeeCalc", + )); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + async fn order_fee_calc( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn get_order( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn get_order_by_external_id( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn get_market_orders( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn get_owner_orders( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn get_asset_orders( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn get_all_orders( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn get_commitment( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn get_account_commitments( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn get_market_commitments( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn get_all_commitments( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn get_market( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn get_all_markets( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn commitment_settlement_fee_calc( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn validate_create_market( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn validate_market( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn validate_manage_fees( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn get_payment( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn get_payments_with_source( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn get_payments_with_target( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn get_all_payments( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn payment_fee_calc( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/provenance.exchange.v1.Query/OrderFeeCalc" => { + #[allow(non_camel_case_types)] + struct OrderFeeCalcSvc(pub Arc); + impl tonic::server::UnaryService for OrderFeeCalcSvc { + type Response = super::QueryOrderFeeCalcResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::order_fee_calc(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = OrderFeeCalcSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Query/GetOrder" => { + #[allow(non_camel_case_types)] + struct GetOrderSvc(pub Arc); + impl tonic::server::UnaryService for GetOrderSvc { + type Response = super::QueryGetOrderResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::get_order(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetOrderSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Query/GetOrderByExternalID" => { + #[allow(non_camel_case_types)] + struct GetOrderByExternalIDSvc(pub Arc); + impl + tonic::server::UnaryService + for GetOrderByExternalIDSvc + { + type Response = super::QueryGetOrderByExternalIdResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_order_by_external_id(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetOrderByExternalIDSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Query/GetMarketOrders" => { + #[allow(non_camel_case_types)] + struct GetMarketOrdersSvc(pub Arc); + impl tonic::server::UnaryService + for GetMarketOrdersSvc + { + type Response = super::QueryGetMarketOrdersResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_market_orders(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetMarketOrdersSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Query/GetOwnerOrders" => { + #[allow(non_camel_case_types)] + struct GetOwnerOrdersSvc(pub Arc); + impl tonic::server::UnaryService + for GetOwnerOrdersSvc + { + type Response = super::QueryGetOwnerOrdersResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_owner_orders(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetOwnerOrdersSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Query/GetAssetOrders" => { + #[allow(non_camel_case_types)] + struct GetAssetOrdersSvc(pub Arc); + impl tonic::server::UnaryService + for GetAssetOrdersSvc + { + type Response = super::QueryGetAssetOrdersResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_asset_orders(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetAssetOrdersSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Query/GetAllOrders" => { + #[allow(non_camel_case_types)] + struct GetAllOrdersSvc(pub Arc); + impl tonic::server::UnaryService for GetAllOrdersSvc { + type Response = super::QueryGetAllOrdersResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::get_all_orders(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetAllOrdersSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Query/GetCommitment" => { + #[allow(non_camel_case_types)] + struct GetCommitmentSvc(pub Arc); + impl tonic::server::UnaryService + for GetCommitmentSvc + { + type Response = super::QueryGetCommitmentResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::get_commitment(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetCommitmentSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Query/GetAccountCommitments" => { + #[allow(non_camel_case_types)] + struct GetAccountCommitmentsSvc(pub Arc); + impl + tonic::server::UnaryService + for GetAccountCommitmentsSvc + { + type Response = super::QueryGetAccountCommitmentsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_account_commitments(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetAccountCommitmentsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Query/GetMarketCommitments" => { + #[allow(non_camel_case_types)] + struct GetMarketCommitmentsSvc(pub Arc); + impl + tonic::server::UnaryService + for GetMarketCommitmentsSvc + { + type Response = super::QueryGetMarketCommitmentsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_market_commitments(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetMarketCommitmentsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Query/GetAllCommitments" => { + #[allow(non_camel_case_types)] + struct GetAllCommitmentsSvc(pub Arc); + impl tonic::server::UnaryService + for GetAllCommitmentsSvc + { + type Response = super::QueryGetAllCommitmentsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_all_commitments(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetAllCommitmentsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Query/GetMarket" => { + #[allow(non_camel_case_types)] + struct GetMarketSvc(pub Arc); + impl tonic::server::UnaryService for GetMarketSvc { + type Response = super::QueryGetMarketResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::get_market(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetMarketSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Query/GetAllMarkets" => { + #[allow(non_camel_case_types)] + struct GetAllMarketsSvc(pub Arc); + impl tonic::server::UnaryService + for GetAllMarketsSvc + { + type Response = super::QueryGetAllMarketsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::get_all_markets(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetAllMarketsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Query/Params" => { + #[allow(non_camel_case_types)] + struct ParamsSvc(pub Arc); + impl tonic::server::UnaryService for ParamsSvc { + type Response = super::QueryParamsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::params(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Query/CommitmentSettlementFeeCalc" => { + #[allow(non_camel_case_types)] + struct CommitmentSettlementFeeCalcSvc(pub Arc); + impl + tonic::server::UnaryService + for CommitmentSettlementFeeCalcSvc + { + type Response = super::QueryCommitmentSettlementFeeCalcResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::commitment_settlement_fee_calc(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CommitmentSettlementFeeCalcSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Query/ValidateCreateMarket" => { + #[allow(non_camel_case_types)] + struct ValidateCreateMarketSvc(pub Arc); + impl + tonic::server::UnaryService + for ValidateCreateMarketSvc + { + type Response = super::QueryValidateCreateMarketResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::validate_create_market(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ValidateCreateMarketSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Query/ValidateMarket" => { + #[allow(non_camel_case_types)] + struct ValidateMarketSvc(pub Arc); + impl tonic::server::UnaryService + for ValidateMarketSvc + { + type Response = super::QueryValidateMarketResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::validate_market(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ValidateMarketSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Query/ValidateManageFees" => { + #[allow(non_camel_case_types)] + struct ValidateManageFeesSvc(pub Arc); + impl + tonic::server::UnaryService + for ValidateManageFeesSvc + { + type Response = super::QueryValidateManageFeesResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::validate_manage_fees(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ValidateManageFeesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Query/GetPayment" => { + #[allow(non_camel_case_types)] + struct GetPaymentSvc(pub Arc); + impl tonic::server::UnaryService for GetPaymentSvc { + type Response = super::QueryGetPaymentResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::get_payment(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetPaymentSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Query/GetPaymentsWithSource" => { + #[allow(non_camel_case_types)] + struct GetPaymentsWithSourceSvc(pub Arc); + impl + tonic::server::UnaryService + for GetPaymentsWithSourceSvc + { + type Response = super::QueryGetPaymentsWithSourceResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_payments_with_source(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetPaymentsWithSourceSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Query/GetPaymentsWithTarget" => { + #[allow(non_camel_case_types)] + struct GetPaymentsWithTargetSvc(pub Arc); + impl + tonic::server::UnaryService + for GetPaymentsWithTargetSvc + { + type Response = super::QueryGetPaymentsWithTargetResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_payments_with_target(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetPaymentsWithTargetSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Query/GetAllPayments" => { + #[allow(non_camel_case_types)] + struct GetAllPaymentsSvc(pub Arc); + impl tonic::server::UnaryService + for GetAllPaymentsSvc + { + type Response = super::QueryGetAllPaymentsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_all_payments(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetAllPaymentsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.exchange.v1.Query/PaymentFeeCalc" => { + #[allow(non_camel_case_types)] + struct PaymentFeeCalcSvc(pub Arc); + impl tonic::server::UnaryService + for PaymentFeeCalcSvc + { + type Response = super::QueryPaymentFeeCalcResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::payment_fee_calc(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = PaymentFeeCalcSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "provenance.exchange.v1.Query"; + } +} diff --git a/packages/provwasm-std/src/types/provenance/hold/v1.rs b/packages/provwasm-std/src/types/provenance/hold/v1/mod.rs similarity index 99% rename from packages/provwasm-std/src/types/provenance/hold/v1.rs rename to packages/provwasm-std/src/types/provenance/hold/v1/mod.rs index e6103c74..5c0009d3 100644 --- a/packages/provwasm-std/src/types/provenance/hold/v1.rs +++ b/packages/provwasm-std/src/types/provenance/hold/v1/mod.rs @@ -1,3 +1,4 @@ +pub mod tonic; use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// EventHoldAdded is an event indicating that some funds were placed on hold in an account. #[allow(clippy::derive_partial_eq_without_eq)] @@ -168,6 +169,7 @@ pub struct GetAllHoldsResponse { pub pagination: ::core::option::Option, } +include!("provenance.hold.v1.tonic.rs"); pub struct HoldQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } diff --git a/packages/provwasm-std/src/types/provenance/hold/v1/tonic.rs b/packages/provwasm-std/src/types/provenance/hold/v1/tonic.rs new file mode 100644 index 00000000..590265eb --- /dev/null +++ b/packages/provwasm-std/src/types/provenance/hold/v1/tonic.rs @@ -0,0 +1,322 @@ +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; +/// 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 provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + 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 the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn get_holds( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.hold.v1.Query/GetHolds"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.hold.v1.Query", "GetHolds")); + self.inner.unary(req, path, codec).await + } + pub async fn get_all_holds( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.hold.v1.Query/GetAllHolds"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.hold.v1.Query", "GetAllHolds")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + async fn get_holds( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn get_all_holds( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/provenance.hold.v1.Query/GetHolds" => { + #[allow(non_camel_case_types)] + struct GetHoldsSvc(pub Arc); + impl tonic::server::UnaryService for GetHoldsSvc { + type Response = super::GetHoldsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::get_holds(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetHoldsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.hold.v1.Query/GetAllHolds" => { + #[allow(non_camel_case_types)] + struct GetAllHoldsSvc(pub Arc); + impl tonic::server::UnaryService for GetAllHoldsSvc { + type Response = super::GetAllHoldsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::get_all_holds(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetAllHoldsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "provenance.hold.v1.Query"; + } +} diff --git a/packages/provwasm-std/src/types/provenance/ibchooks/v1.rs b/packages/provwasm-std/src/types/provenance/ibchooks/v1.rs deleted file mode 100644 index 5954ec30..00000000 --- a/packages/provwasm-std/src/types/provenance/ibchooks/v1.rs +++ /dev/null @@ -1,178 +0,0 @@ -use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// EventIBCHooksParamsUpdated defines the event emitted after updating ibchooks parameters. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.ibchooks.v1.EventIBCHooksParamsUpdated")] -pub struct EventIbcHooksParamsUpdated { - #[prost(string, repeated, tag = "1")] - pub allowed_async_ack_contracts: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// Params defines the allowed async ack contracts -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.ibchooks.v1.Params")] -pub struct Params { - #[prost(string, repeated, tag = "1")] - pub allowed_async_ack_contracts: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// GenesisState is the IBC Hooks genesis state (params) -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.ibchooks.v1.GenesisState")] -pub struct GenesisState { - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, -} -/// QueryParamsRequest is the request type for the Query/Params RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.ibchooks.v1.QueryParamsRequest")] -#[proto_query( - path = "/provenance.ibchooks.v1.Query/Params", - response_type = QueryParamsResponse -)] -pub struct QueryParamsRequest {} -/// QueryParamsResponse is the response type for the Query/Params RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.ibchooks.v1.QueryParamsResponse")] -pub struct QueryParamsResponse { - /// params defines the parameters of the module. - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, -} -/// MsgEmitIBCAck is the IBC Acknowledgement -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.ibchooks.v1.MsgEmitIBCAck")] -pub struct MsgEmitIbcAck { - #[prost(string, tag = "1")] - pub sender: ::prost::alloc::string::String, - #[prost(uint64, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub packet_sequence: u64, - #[prost(string, tag = "3")] - pub channel: ::prost::alloc::string::String, -} -/// MsgEmitIBCAckResponse is the IBC Acknowledgement response -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.ibchooks.v1.MsgEmitIBCAckResponse")] -pub struct MsgEmitIbcAckResponse { - #[prost(string, tag = "1")] - pub contract_result: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub ibc_ack: ::prost::alloc::string::String, -} -/// MsgUpdateParamsRequest is a request message for the UpdateParams endpoint. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.ibchooks.v1.MsgUpdateParamsRequest")] -pub struct MsgUpdateParamsRequest { - /// authority should be the governance module account address. - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// params are the new param values to set. - #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, -} -/// MsgUpdateParamsResponse is a response message for the UpdateParams endpoint. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.ibchooks.v1.MsgUpdateParamsResponse")] -pub struct MsgUpdateParamsResponse {} -pub struct IbchooksQuerier<'a, Q: cosmwasm_std::CustomQuery> { - querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, -} -impl<'a, Q: cosmwasm_std::CustomQuery> IbchooksQuerier<'a, Q> { - pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { - Self { querier } - } - pub fn params(&self) -> Result { - QueryParamsRequest {}.query(self.querier) - } -} diff --git a/packages/provwasm-std/src/types/provenance/ibchooks/v1/mod.rs b/packages/provwasm-std/src/types/provenance/ibchooks/v1/mod.rs new file mode 100644 index 00000000..42f2d7f5 --- /dev/null +++ b/packages/provwasm-std/src/types/provenance/ibchooks/v1/mod.rs @@ -0,0 +1,81 @@ +pub mod tonic; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; +/// Params defines the allowed async ack contracts +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.ibchooks.v1.Params")] +pub struct Params { + #[prost(string, repeated, tag = "1")] + pub allowed_async_ack_contracts: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// GenesisState is the IBC Hooks genesis state (params) +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.ibchooks.v1.GenesisState")] +pub struct GenesisState { + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +/// MsgEmitIBCAck is the IBC Acknowledgement +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.ibchooks.v1.MsgEmitIBCAck")] +pub struct MsgEmitIbcAck { + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub packet_sequence: u64, + #[prost(string, tag = "3")] + pub channel: ::prost::alloc::string::String, +} +/// MsgEmitIBCAckResponse is the IBC Acknowledgement response +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.ibchooks.v1.MsgEmitIBCAckResponse")] +pub struct MsgEmitIbcAckResponse { + #[prost(string, tag = "1")] + pub contract_result: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub ibc_ack: ::prost::alloc::string::String, +} +include!("provenance.ibchooks.v1.tonic.rs"); diff --git a/packages/provwasm-std/src/types/provenance/ibchooks/v1/tonic.rs b/packages/provwasm-std/src/types/provenance/ibchooks/v1/tonic.rs new file mode 100644 index 00000000..15263b54 --- /dev/null +++ b/packages/provwasm-std/src/types/provenance/ibchooks/v1/tonic.rs @@ -0,0 +1,260 @@ +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; +/// 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 provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + 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 the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn emit_ibc_ack( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.ibchooks.v1.Msg/EmitIBCAck"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.ibchooks.v1.Msg", "EmitIBCAck")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + async fn emit_ibc_ack( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/provenance.ibchooks.v1.Msg/EmitIBCAck" => { + #[allow(non_camel_case_types)] + struct EmitIBCAckSvc(pub Arc); + impl tonic::server::UnaryService for EmitIBCAckSvc { + type Response = super::MsgEmitIbcAckResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::emit_ibc_ack(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = EmitIBCAckSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "provenance.ibchooks.v1.Msg"; + } +} diff --git a/packages/provwasm-std/src/types/provenance/ibcratelimit/v1.rs b/packages/provwasm-std/src/types/provenance/ibcratelimit/v1/mod.rs similarity index 81% rename from packages/provwasm-std/src/types/provenance/ibcratelimit/v1.rs rename to packages/provwasm-std/src/types/provenance/ibcratelimit/v1/mod.rs index e7132a42..885f693a 100644 --- a/packages/provwasm-std/src/types/provenance/ibcratelimit/v1.rs +++ b/packages/provwasm-std/src/types/provenance/ibcratelimit/v1/mod.rs @@ -1,3 +1,4 @@ +pub mod tonic; use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// EventAckRevertFailure is emitted when an Ack revert fails #[allow(clippy::derive_partial_eq_without_eq)] @@ -131,7 +132,6 @@ pub struct ParamsResponse { pub params: ::core::option::Option, } /// MsgGovUpdateParamsRequest is a request message for the GovUpdateParams endpoint. -/// Deprecated: Use MsgUpdateParamsRequest instead. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -144,17 +144,15 @@ pub struct ParamsResponse { CosmwasmExt, )] #[proto_message(type_url = "/provenance.ibcratelimit.v1.MsgGovUpdateParamsRequest")] -#[deprecated] pub struct MsgGovUpdateParamsRequest { /// authority should be the governance module account address. #[prost(string, tag = "1")] pub authority: ::prost::alloc::string::String, - /// params are the new param values to set. + /// params are the new param values to set #[prost(message, optional, tag = "2")] pub params: ::core::option::Option, } /// MsgGovUpdateParamsResponse is a response message for the GovUpdateParams endpoint. -/// Deprecated: Use MsgUpdateParamsResponse instead. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -167,43 +165,8 @@ pub struct MsgGovUpdateParamsRequest { CosmwasmExt, )] #[proto_message(type_url = "/provenance.ibcratelimit.v1.MsgGovUpdateParamsResponse")] -#[deprecated] pub struct MsgGovUpdateParamsResponse {} -/// MsgUpdateParamsRequest is a request message for the UpdateParams endpoint. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.ibcratelimit.v1.MsgUpdateParamsRequest")] -pub struct MsgUpdateParamsRequest { - /// authority should be the governance module account address. - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// params are the new param values to set. - #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, -} -/// MsgUpdateParamsResponse is a response message for the UpdateParams endpoint. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.ibcratelimit.v1.MsgUpdateParamsResponse")] -pub struct MsgUpdateParamsResponse {} +include!("provenance.ibcratelimit.v1.tonic.rs"); pub struct IbcratelimitQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } diff --git a/packages/provwasm-std/src/types/provenance/ibcratelimit/v1/tonic.rs b/packages/provwasm-std/src/types/provenance/ibcratelimit/v1/tonic.rs new file mode 100644 index 00000000..e8b67716 --- /dev/null +++ b/packages/provwasm-std/src/types/provenance/ibcratelimit/v1/tonic.rs @@ -0,0 +1,531 @@ +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; +/// 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 provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + 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 the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.ibcratelimit.v1.Query/Params"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.ibcratelimit.v1.Query", + "Params", + )); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + async fn params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/provenance.ibcratelimit.v1.Query/Params" => { + #[allow(non_camel_case_types)] + struct ParamsSvc(pub Arc); + impl tonic::server::UnaryService for ParamsSvc { + type Response = super::ParamsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::params(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "provenance.ibcratelimit.v1.Query"; + } +} +/// 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 provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + 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 the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + /** GovUpdateParams is a governance proposal endpoint for updating the exchange module's params. + */ + pub async fn gov_update_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.ibcratelimit.v1.Msg/GovUpdateParams", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.ibcratelimit.v1.Msg", + "GovUpdateParams", + )); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + /** GovUpdateParams is a governance proposal endpoint for updating the exchange module's params. + */ + async fn gov_update_params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/provenance.ibcratelimit.v1.Msg/GovUpdateParams" => { + #[allow(non_camel_case_types)] + struct GovUpdateParamsSvc(pub Arc); + impl tonic::server::UnaryService + for GovUpdateParamsSvc + { + type Response = super::MsgGovUpdateParamsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::gov_update_params(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GovUpdateParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "provenance.ibcratelimit.v1.Msg"; + } +} diff --git a/packages/provwasm-std/src/types/provenance/marker/v1.rs b/packages/provwasm-std/src/types/provenance/marker/v1/mod.rs similarity index 87% rename from packages/provwasm-std/src/types/provenance/marker/v1.rs rename to packages/provwasm-std/src/types/provenance/marker/v1/mod.rs index c69a112f..d237297b 100644 --- a/packages/provwasm-std/src/types/provenance/marker/v1.rs +++ b/packages/provwasm-std/src/types/provenance/marker/v1/mod.rs @@ -1,3 +1,4 @@ +pub mod tonic; use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// AccessGrant associates a collection of permissions with an address for delegated marker account control. #[allow(clippy::derive_partial_eq_without_eq)] @@ -561,27 +562,6 @@ pub struct EventSetNetAssetValue { #[prost(string, tag = "4")] pub source: ::prost::alloc::string::String, } -/// EventMarkerParamsUpdated event emitted when marker params are updated. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.marker.v1.EventMarkerParamsUpdated")] -pub struct EventMarkerParamsUpdated { - #[prost(string, tag = "1")] - pub enable_governance: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub unrestricted_denom_regex: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub max_supply: ::prost::alloc::string::String, -} /// MarkerType defines the types of marker #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] @@ -779,9 +759,6 @@ pub struct AddMarkerProposal { } /// SupplyIncreaseProposal defines a governance proposal to administer a marker and increase total supply of the marker /// through minting coin and placing it within the marker or assigning it directly to an account -/// Deprecated: This message is no longer usable. It is only still included for -/// backwards compatibility (e.g. looking up old governance proposals). -/// It is replaced by providing a MsgSupplyIncreaseProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -794,7 +771,6 @@ pub struct AddMarkerProposal { CosmwasmExt, )] #[proto_message(type_url = "/provenance.marker.v1.SupplyIncreaseProposal")] -#[deprecated] pub struct SupplyIncreaseProposal { #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, @@ -808,9 +784,6 @@ pub struct SupplyIncreaseProposal { } /// SupplyDecreaseProposal defines a governance proposal to administer a marker and decrease the total supply through /// burning coin held within the marker -/// Deprecated: This message is no longer usable. It is only still included for -/// backwards compatibility (e.g. looking up old governance proposals). -/// It is replaced by providing a MsgSupplyDecreaseProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -823,7 +796,6 @@ pub struct SupplyIncreaseProposal { CosmwasmExt, )] #[proto_message(type_url = "/provenance.marker.v1.SupplyDecreaseProposal")] -#[deprecated] pub struct SupplyDecreaseProposal { #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, @@ -834,9 +806,6 @@ pub struct SupplyDecreaseProposal { } /// SetAdministratorProposal defines a governance proposal to administer a marker and set administrators with specific /// access on the marker -/// Deprecated: This message is no longer usable. It is only still included for -/// backwards compatibility (e.g. looking up old governance proposals). -/// It is replaced by providing a MsgSetAdministratorProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -849,7 +818,6 @@ pub struct SupplyDecreaseProposal { CosmwasmExt, )] #[proto_message(type_url = "/provenance.marker.v1.SetAdministratorProposal")] -#[deprecated] pub struct SetAdministratorProposal { #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, @@ -862,9 +830,6 @@ pub struct SetAdministratorProposal { } /// RemoveAdministratorProposal defines a governance proposal to administer a marker and remove all permissions for a /// given address -/// Deprecated: This message is no longer usable. It is only still included for -/// backwards compatibility (e.g. looking up old governance proposals). -/// It is replaced by providing a MsgRemoveAdministratorProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -877,7 +842,6 @@ pub struct SetAdministratorProposal { CosmwasmExt, )] #[proto_message(type_url = "/provenance.marker.v1.RemoveAdministratorProposal")] -#[deprecated] pub struct RemoveAdministratorProposal { #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, @@ -889,9 +853,6 @@ pub struct RemoveAdministratorProposal { pub removed_address: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } /// ChangeStatusProposal defines a governance proposal to administer a marker to change its status -/// Deprecated: This message is no longer usable. It is only still included for -/// backwards compatibility (e.g. looking up old governance proposals). -/// It is replaced by providing a MsgChangeStatusProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -904,7 +865,6 @@ pub struct RemoveAdministratorProposal { CosmwasmExt, )] #[proto_message(type_url = "/provenance.marker.v1.ChangeStatusProposal")] -#[deprecated] pub struct ChangeStatusProposal { #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, @@ -920,9 +880,6 @@ pub struct ChangeStatusProposal { pub new_status: i32, } /// WithdrawEscrowProposal defines a governance proposal to withdraw escrow coins from a marker -/// Deprecated: This message is no longer usable. It is only still included for -/// backwards compatibility (e.g. looking up old governance proposals). -/// It is replaced by providing a MsgWithdrawEscrowProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -935,7 +892,6 @@ pub struct ChangeStatusProposal { CosmwasmExt, )] #[proto_message(type_url = "/provenance.marker.v1.WithdrawEscrowProposal")] -#[deprecated] pub struct WithdrawEscrowProposal { #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, @@ -949,9 +905,6 @@ pub struct WithdrawEscrowProposal { pub target_address: ::prost::alloc::string::String, } /// SetDenomMetadataProposal defines a governance proposal to set the metadata for a denom -/// Deprecated: This message is no longer usable. It is only still included for -/// backwards compatibility (e.g. looking up old governance proposals). -/// It is replaced by providing a MsgSetDenomMetadataProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -964,7 +917,6 @@ pub struct WithdrawEscrowProposal { CosmwasmExt, )] #[proto_message(type_url = "/provenance.marker.v1.SetDenomMetadataProposal")] -#[deprecated] pub struct SetDenomMetadataProposal { #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, @@ -2143,40 +2095,6 @@ pub struct MsgSupplyIncreaseProposalRequest { )] #[proto_message(type_url = "/provenance.marker.v1.MsgSupplyIncreaseProposalResponse")] pub struct MsgSupplyIncreaseProposalResponse {} -/// MsgSupplyDecreaseProposalRequest defines a governance proposal to decrease total supply of the marker -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.marker.v1.MsgSupplyDecreaseProposalRequest")] -pub struct MsgSupplyDecreaseProposalRequest { - #[prost(message, optional, tag = "1")] - pub amount: ::core::option::Option, - /// signer of the proposal - #[prost(string, tag = "2")] - pub authority: ::prost::alloc::string::String, -} -/// MsgSupplyIncreaseProposalResponse defines the Msg/SupplyDecreaseProposal response type -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.marker.v1.MsgSupplyDecreaseProposalResponse")] -pub struct MsgSupplyDecreaseProposalResponse {} /// MsgUpdateRequiredAttributesRequest defines a msg to update/add/remove required attributes from a resticted marker /// signer must have transfer authority to change attributes, to update attribute add current to remove list and new to /// add list @@ -2375,225 +2293,7 @@ pub struct MsgAddNetAssetValuesRequest { )] #[proto_message(type_url = "/provenance.marker.v1.MsgAddNetAssetValuesResponse")] pub struct MsgAddNetAssetValuesResponse {} -/// MsgSetAdministratorProposalRequest defines the Msg/SetAdministratorProposal request type -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.marker.v1.MsgSetAdministratorProposalRequest")] -pub struct MsgSetAdministratorProposalRequest { - #[prost(string, tag = "1")] - pub denom: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub access: ::prost::alloc::vec::Vec, - /// The signer of the message. Must have admin authority to marker or be governance module account address. - #[prost(string, tag = "3")] - pub authority: ::prost::alloc::string::String, -} -/// MsgSetAdministratorProposalResponse defines the Msg/SetAdministratorProposal response type -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.marker.v1.MsgSetAdministratorProposalResponse")] -pub struct MsgSetAdministratorProposalResponse {} -/// MsgRemoveAdministratorProposalRequest defines the Msg/RemoveAdministratorProposal request type -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.marker.v1.MsgRemoveAdministratorProposalRequest")] -pub struct MsgRemoveAdministratorProposalRequest { - #[prost(string, tag = "1")] - pub denom: ::prost::alloc::string::String, - #[prost(string, repeated, tag = "2")] - pub removed_address: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// The signer of the message. Must have admin authority to marker or be governance module account address. - #[prost(string, tag = "3")] - pub authority: ::prost::alloc::string::String, -} -/// MsgRemoveAdministratorProposalResponse defines the Msg/RemoveAdministratorProposal response type -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.marker.v1.MsgRemoveAdministratorProposalResponse")] -pub struct MsgRemoveAdministratorProposalResponse {} -/// MsgChangeStatusProposalRequest defines the Msg/ChangeStatusProposal request type -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.marker.v1.MsgChangeStatusProposalRequest")] -pub struct MsgChangeStatusProposalRequest { - #[prost(string, tag = "1")] - pub denom: ::prost::alloc::string::String, - #[prost(enumeration = "MarkerStatus", tag = "2")] - #[serde( - serialize_with = "MarkerStatus::serialize", - deserialize_with = "MarkerStatus::deserialize" - )] - pub new_status: i32, - /// The signer of the message. Must have admin authority to marker or be governance module account address. - #[prost(string, tag = "3")] - pub authority: ::prost::alloc::string::String, -} -/// MsgChangeStatusProposalResponse defines the Msg/ChangeStatusProposal response type -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.marker.v1.MsgChangeStatusProposalResponse")] -pub struct MsgChangeStatusProposalResponse {} -/// MsgWithdrawEscrowProposalRequest defines the Msg/WithdrawEscrowProposal request type -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.marker.v1.MsgWithdrawEscrowProposalRequest")] -pub struct MsgWithdrawEscrowProposalRequest { - #[prost(string, tag = "1")] - pub denom: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub amount: ::prost::alloc::vec::Vec, - #[prost(string, tag = "3")] - pub target_address: ::prost::alloc::string::String, - /// The signer of the message. Must have admin authority to marker or be governance module account address. - #[prost(string, tag = "4")] - pub authority: ::prost::alloc::string::String, -} -/// MsgWithdrawEscrowProposalResponse defines the Msg/WithdrawEscrowProposal response type -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.marker.v1.MsgWithdrawEscrowProposalResponse")] -pub struct MsgWithdrawEscrowProposalResponse {} -/// MsgSetDenomMetadataProposalRequest defines the Msg/SetDenomMetadataProposal request type -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.marker.v1.MsgSetDenomMetadataProposalRequest")] -pub struct MsgSetDenomMetadataProposalRequest { - #[prost(message, optional, tag = "1")] - pub metadata: ::core::option::Option, - /// The signer of the message. Must have admin authority to marker or be governance module account address. - #[prost(string, tag = "2")] - pub authority: ::prost::alloc::string::String, -} -/// MsgSetDenomMetadataProposalResponse defines the Msg/SetDenomMetadataProposal response type -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.marker.v1.MsgSetDenomMetadataProposalResponse")] -pub struct MsgSetDenomMetadataProposalResponse {} -/// MsgUpdateParamsRequest is a request message for the UpdateParams endpoint. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.marker.v1.MsgUpdateParamsRequest")] -pub struct MsgUpdateParamsRequest { - /// authority should be the governance module account address. - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// params are the new param values to set. - #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, -} -/// MsgUpdateParamsResponse is a response message for the UpdateParams endpoint. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.marker.v1.MsgUpdateParamsResponse")] -pub struct MsgUpdateParamsResponse {} +include!("provenance.marker.v1.tonic.rs"); pub struct MarkerQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } diff --git a/packages/provwasm-std/src/types/provenance/marker/v1/tonic.rs b/packages/provwasm-std/src/types/provenance/marker/v1/tonic.rs new file mode 100644 index 00000000..4f9bbcdb --- /dev/null +++ b/packages/provwasm-std/src/types/provenance/marker/v1/tonic.rs @@ -0,0 +1,2360 @@ +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; +/// 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 provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + 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 the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.marker.v1.Query/Params"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Query", "Params")); + self.inner.unary(req, path, codec).await + } + pub async fn all_markers( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.marker.v1.Query/AllMarkers"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Query", "AllMarkers")); + self.inner.unary(req, path, codec).await + } + pub async fn marker( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.marker.v1.Query/Marker"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Query", "Marker")); + self.inner.unary(req, path, codec).await + } + pub async fn holding( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.marker.v1.Query/Holding"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Query", "Holding")); + self.inner.unary(req, path, codec).await + } + pub async fn supply( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.marker.v1.Query/Supply"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Query", "Supply")); + self.inner.unary(req, path, codec).await + } + pub async fn escrow( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.marker.v1.Query/Escrow"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Query", "Escrow")); + self.inner.unary(req, path, codec).await + } + pub async fn access( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.marker.v1.Query/Access"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Query", "Access")); + self.inner.unary(req, path, codec).await + } + pub async fn denom_metadata( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.marker.v1.Query/DenomMetadata"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.marker.v1.Query", + "DenomMetadata", + )); + self.inner.unary(req, path, codec).await + } + pub async fn account_data( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.marker.v1.Query/AccountData"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Query", "AccountData")); + self.inner.unary(req, path, codec).await + } + pub async fn net_asset_values( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.marker.v1.Query/NetAssetValues"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.marker.v1.Query", + "NetAssetValues", + )); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + async fn params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn all_markers( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn marker( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn holding( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn supply( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn escrow( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn access( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn denom_metadata( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn account_data( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn net_asset_values( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/provenance.marker.v1.Query/Params" => { + #[allow(non_camel_case_types)] + struct ParamsSvc(pub Arc); + impl tonic::server::UnaryService for ParamsSvc { + type Response = super::QueryParamsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::params(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Query/AllMarkers" => { + #[allow(non_camel_case_types)] + struct AllMarkersSvc(pub Arc); + impl tonic::server::UnaryService for AllMarkersSvc { + type Response = super::QueryAllMarkersResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::all_markers(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AllMarkersSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Query/Marker" => { + #[allow(non_camel_case_types)] + struct MarkerSvc(pub Arc); + impl tonic::server::UnaryService for MarkerSvc { + type Response = super::QueryMarkerResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::marker(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = MarkerSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Query/Holding" => { + #[allow(non_camel_case_types)] + struct HoldingSvc(pub Arc); + impl tonic::server::UnaryService for HoldingSvc { + type Response = super::QueryHoldingResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::holding(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = HoldingSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Query/Supply" => { + #[allow(non_camel_case_types)] + struct SupplySvc(pub Arc); + impl tonic::server::UnaryService for SupplySvc { + type Response = super::QuerySupplyResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::supply(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SupplySvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Query/Escrow" => { + #[allow(non_camel_case_types)] + struct EscrowSvc(pub Arc); + impl tonic::server::UnaryService for EscrowSvc { + type Response = super::QueryEscrowResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::escrow(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = EscrowSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Query/Access" => { + #[allow(non_camel_case_types)] + struct AccessSvc(pub Arc); + impl tonic::server::UnaryService for AccessSvc { + type Response = super::QueryAccessResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::access(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AccessSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Query/DenomMetadata" => { + #[allow(non_camel_case_types)] + struct DenomMetadataSvc(pub Arc); + impl tonic::server::UnaryService + for DenomMetadataSvc + { + type Response = super::QueryDenomMetadataResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::denom_metadata(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DenomMetadataSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Query/AccountData" => { + #[allow(non_camel_case_types)] + struct AccountDataSvc(pub Arc); + impl tonic::server::UnaryService for AccountDataSvc { + type Response = super::QueryAccountDataResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::account_data(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AccountDataSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Query/NetAssetValues" => { + #[allow(non_camel_case_types)] + struct NetAssetValuesSvc(pub Arc); + impl tonic::server::UnaryService + for NetAssetValuesSvc + { + type Response = super::QueryNetAssetValuesResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::net_asset_values(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = NetAssetValuesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "provenance.marker.v1.Query"; + } +} +/// 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 provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + 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 the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn finalize( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.marker.v1.Msg/Finalize"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Msg", "Finalize")); + self.inner.unary(req, path, codec).await + } + pub async fn activate( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.marker.v1.Msg/Activate"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Msg", "Activate")); + self.inner.unary(req, path, codec).await + } + pub async fn cancel( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.marker.v1.Msg/Cancel"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Msg", "Cancel")); + self.inner.unary(req, path, codec).await + } + pub async fn delete( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.marker.v1.Msg/Delete"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Msg", "Delete")); + self.inner.unary(req, path, codec).await + } + pub async fn mint( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.marker.v1.Msg/Mint"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Msg", "Mint")); + self.inner.unary(req, path, codec).await + } + pub async fn burn( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.marker.v1.Msg/Burn"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Msg", "Burn")); + self.inner.unary(req, path, codec).await + } + pub async fn add_access( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.marker.v1.Msg/AddAccess"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Msg", "AddAccess")); + self.inner.unary(req, path, codec).await + } + pub async fn delete_access( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.marker.v1.Msg/DeleteAccess"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Msg", "DeleteAccess")); + self.inner.unary(req, path, codec).await + } + pub async fn withdraw( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.marker.v1.Msg/Withdraw"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Msg", "Withdraw")); + self.inner.unary(req, path, codec).await + } + pub async fn add_marker( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.marker.v1.Msg/AddMarker"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Msg", "AddMarker")); + self.inner.unary(req, path, codec).await + } + pub async fn transfer( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.marker.v1.Msg/Transfer"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Msg", "Transfer")); + self.inner.unary(req, path, codec).await + } + pub async fn ibc_transfer( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.marker.v1.Msg/IbcTransfer"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.marker.v1.Msg", "IbcTransfer")); + self.inner.unary(req, path, codec).await + } + pub async fn set_denom_metadata( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.marker.v1.Msg/SetDenomMetadata"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.marker.v1.Msg", + "SetDenomMetadata", + )); + self.inner.unary(req, path, codec).await + } + pub async fn grant_allowance( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.marker.v1.Msg/GrantAllowance"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.marker.v1.Msg", + "GrantAllowance", + )); + self.inner.unary(req, path, codec).await + } + pub async fn add_finalize_activate_marker( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.marker.v1.Msg/AddFinalizeActivateMarker", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.marker.v1.Msg", + "AddFinalizeActivateMarker", + )); + self.inner.unary(req, path, codec).await + } + pub async fn supply_increase_proposal( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.marker.v1.Msg/SupplyIncreaseProposal", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.marker.v1.Msg", + "SupplyIncreaseProposal", + )); + self.inner.unary(req, path, codec).await + } + pub async fn update_required_attributes( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.marker.v1.Msg/UpdateRequiredAttributes", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.marker.v1.Msg", + "UpdateRequiredAttributes", + )); + self.inner.unary(req, path, codec).await + } + pub async fn update_forced_transfer( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.marker.v1.Msg/UpdateForcedTransfer", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.marker.v1.Msg", + "UpdateForcedTransfer", + )); + self.inner.unary(req, path, codec).await + } + pub async fn set_account_data( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.marker.v1.Msg/SetAccountData"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.marker.v1.Msg", + "SetAccountData", + )); + self.inner.unary(req, path, codec).await + } + pub async fn update_send_deny_list( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.marker.v1.Msg/UpdateSendDenyList", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.marker.v1.Msg", + "UpdateSendDenyList", + )); + self.inner.unary(req, path, codec).await + } + pub async fn add_net_asset_values( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.marker.v1.Msg/AddNetAssetValues"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.marker.v1.Msg", + "AddNetAssetValues", + )); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + async fn finalize( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn activate( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn cancel( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn delete( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn mint( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn burn( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn add_access( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn delete_access( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn withdraw( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn add_marker( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn transfer( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn ibc_transfer( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn set_denom_metadata( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn grant_allowance( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn add_finalize_activate_marker( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn supply_increase_proposal( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn update_required_attributes( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn update_forced_transfer( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn set_account_data( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn update_send_deny_list( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn add_net_asset_values( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/provenance.marker.v1.Msg/Finalize" => { + #[allow(non_camel_case_types)] + struct FinalizeSvc(pub Arc); + impl tonic::server::UnaryService for FinalizeSvc { + type Response = super::MsgFinalizeResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::finalize(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = FinalizeSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/Activate" => { + #[allow(non_camel_case_types)] + struct ActivateSvc(pub Arc); + impl tonic::server::UnaryService for ActivateSvc { + type Response = super::MsgActivateResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::activate(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ActivateSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/Cancel" => { + #[allow(non_camel_case_types)] + struct CancelSvc(pub Arc); + impl tonic::server::UnaryService for CancelSvc { + type Response = super::MsgCancelResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::cancel(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CancelSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/Delete" => { + #[allow(non_camel_case_types)] + struct DeleteSvc(pub Arc); + impl tonic::server::UnaryService for DeleteSvc { + type Response = super::MsgDeleteResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::delete(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeleteSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/Mint" => { + #[allow(non_camel_case_types)] + struct MintSvc(pub Arc); + impl tonic::server::UnaryService for MintSvc { + type Response = super::MsgMintResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::mint(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = MintSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/Burn" => { + #[allow(non_camel_case_types)] + struct BurnSvc(pub Arc); + impl tonic::server::UnaryService for BurnSvc { + type Response = super::MsgBurnResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::burn(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = BurnSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/AddAccess" => { + #[allow(non_camel_case_types)] + struct AddAccessSvc(pub Arc); + impl tonic::server::UnaryService for AddAccessSvc { + type Response = super::MsgAddAccessResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::add_access(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AddAccessSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/DeleteAccess" => { + #[allow(non_camel_case_types)] + struct DeleteAccessSvc(pub Arc); + impl tonic::server::UnaryService for DeleteAccessSvc { + type Response = super::MsgDeleteAccessResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::delete_access(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeleteAccessSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/Withdraw" => { + #[allow(non_camel_case_types)] + struct WithdrawSvc(pub Arc); + impl tonic::server::UnaryService for WithdrawSvc { + type Response = super::MsgWithdrawResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::withdraw(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = WithdrawSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/AddMarker" => { + #[allow(non_camel_case_types)] + struct AddMarkerSvc(pub Arc); + impl tonic::server::UnaryService for AddMarkerSvc { + type Response = super::MsgAddMarkerResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::add_marker(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AddMarkerSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/Transfer" => { + #[allow(non_camel_case_types)] + struct TransferSvc(pub Arc); + impl tonic::server::UnaryService for TransferSvc { + type Response = super::MsgTransferResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::transfer(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = TransferSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/IbcTransfer" => { + #[allow(non_camel_case_types)] + struct IbcTransferSvc(pub Arc); + impl tonic::server::UnaryService for IbcTransferSvc { + type Response = super::MsgIbcTransferResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::ibc_transfer(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = IbcTransferSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/SetDenomMetadata" => { + #[allow(non_camel_case_types)] + struct SetDenomMetadataSvc(pub Arc); + impl tonic::server::UnaryService + for SetDenomMetadataSvc + { + type Response = super::MsgSetDenomMetadataResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::set_denom_metadata(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SetDenomMetadataSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/GrantAllowance" => { + #[allow(non_camel_case_types)] + struct GrantAllowanceSvc(pub Arc); + impl tonic::server::UnaryService for GrantAllowanceSvc { + type Response = super::MsgGrantAllowanceResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::grant_allowance(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GrantAllowanceSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/AddFinalizeActivateMarker" => { + #[allow(non_camel_case_types)] + struct AddFinalizeActivateMarkerSvc(pub Arc); + impl + tonic::server::UnaryService + for AddFinalizeActivateMarkerSvc + { + type Response = super::MsgAddFinalizeActivateMarkerResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::add_finalize_activate_marker(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AddFinalizeActivateMarkerSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/SupplyIncreaseProposal" => { + #[allow(non_camel_case_types)] + struct SupplyIncreaseProposalSvc(pub Arc); + impl + tonic::server::UnaryService + for SupplyIncreaseProposalSvc + { + type Response = super::MsgSupplyIncreaseProposalResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::supply_increase_proposal(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SupplyIncreaseProposalSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/UpdateRequiredAttributes" => { + #[allow(non_camel_case_types)] + struct UpdateRequiredAttributesSvc(pub Arc); + impl + tonic::server::UnaryService + for UpdateRequiredAttributesSvc + { + type Response = super::MsgUpdateRequiredAttributesResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_required_attributes(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateRequiredAttributesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/UpdateForcedTransfer" => { + #[allow(non_camel_case_types)] + struct UpdateForcedTransferSvc(pub Arc); + impl tonic::server::UnaryService + for UpdateForcedTransferSvc + { + type Response = super::MsgUpdateForcedTransferResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_forced_transfer(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateForcedTransferSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/SetAccountData" => { + #[allow(non_camel_case_types)] + struct SetAccountDataSvc(pub Arc); + impl tonic::server::UnaryService for SetAccountDataSvc { + type Response = super::MsgSetAccountDataResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::set_account_data(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SetAccountDataSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/UpdateSendDenyList" => { + #[allow(non_camel_case_types)] + struct UpdateSendDenyListSvc(pub Arc); + impl tonic::server::UnaryService + for UpdateSendDenyListSvc + { + type Response = super::MsgUpdateSendDenyListResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_send_deny_list(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateSendDenyListSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.marker.v1.Msg/AddNetAssetValues" => { + #[allow(non_camel_case_types)] + struct AddNetAssetValuesSvc(pub Arc); + impl tonic::server::UnaryService + for AddNetAssetValuesSvc + { + type Response = super::MsgAddNetAssetValuesResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::add_net_asset_values(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AddNetAssetValuesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "provenance.marker.v1.Msg"; + } +} diff --git a/packages/provwasm-std/src/types/provenance/metadata/v1/mod.rs b/packages/provwasm-std/src/types/provenance/metadata/v1/mod.rs index 14be3770..667e197a 100644 --- a/packages/provwasm-std/src/types/provenance/metadata/v1/mod.rs +++ b/packages/provwasm-std/src/types/provenance/metadata/v1/mod.rs @@ -1,4 +1,5 @@ pub mod p8e; +pub mod tonic; use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// EventTxCompleted is an event message indicating that a TX has completed. #[allow(clippy::derive_partial_eq_without_eq)] @@ -786,7 +787,7 @@ pub struct ScopeSpecification { #[prost(string, repeated, tag = "3")] pub owner_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, /// A list of parties that must be present on a scope (and their associated roles) - #[prost(enumeration = "PartyType", repeated, tag = "4")] + #[prost(enumeration = "PartyType", repeated, packed = "false", tag = "4")] pub parties_involved: ::prost::alloc::vec::Vec, /// A list of contract specification ids allowed for a scope based on this specification. #[prost(bytes = "vec", repeated, tag = "5")] @@ -824,7 +825,7 @@ pub struct ContractSpecification { #[prost(string, repeated, tag = "3")] pub owner_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, /// a list of party roles that must be fullfilled when signing a transaction for this contract specification - #[prost(enumeration = "PartyType", repeated, tag = "4")] + #[prost(enumeration = "PartyType", repeated, packed = "false", tag = "4")] pub parties_involved: ::prost::alloc::vec::Vec, /// name of the class/type of this contract executable #[prost(string, tag = "7")] @@ -896,7 +897,7 @@ pub struct RecordSpecification { )] pub result_type: i32, /// Type of party responsible for this record - #[prost(enumeration = "PartyType", repeated, tag = "6")] + #[prost(enumeration = "PartyType", repeated, packed = "false", tag = "6")] pub responsible_parties: ::prost::alloc::vec::Vec, } /// InputSpecification defines a name, type_name, and source reference (either on or off chain) to define an input @@ -4206,6 +4207,7 @@ pub struct MsgAddNetAssetValuesRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.MsgAddNetAssetValuesResponse")] pub struct MsgAddNetAssetValuesResponse {} +include!("provenance.metadata.v1.tonic.rs"); pub struct MetadataQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } diff --git a/packages/provwasm-std/src/types/provenance/metadata/v1/tonic.rs b/packages/provwasm-std/src/types/provenance/metadata/v1/tonic.rs new file mode 100644 index 00000000..d7894af4 --- /dev/null +++ b/packages/provwasm-std/src/types/provenance/metadata/v1/tonic.rs @@ -0,0 +1,3630 @@ +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; +/// 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 provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + 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 the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.metadata.v1.Query/Params"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.metadata.v1.Query", "Params")); + self.inner.unary(req, path, codec).await + } + pub async fn scope( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.metadata.v1.Query/Scope"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.metadata.v1.Query", "Scope")); + self.inner.unary(req, path, codec).await + } + pub async fn scopes_all( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.metadata.v1.Query/ScopesAll"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.metadata.v1.Query", "ScopesAll")); + self.inner.unary(req, path, codec).await + } + pub async fn sessions( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.metadata.v1.Query/Sessions"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.metadata.v1.Query", "Sessions")); + self.inner.unary(req, path, codec).await + } + pub async fn sessions_all( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.metadata.v1.Query/SessionsAll"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "SessionsAll", + )); + self.inner.unary(req, path, codec).await + } + pub async fn records( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.metadata.v1.Query/Records"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.metadata.v1.Query", "Records")); + self.inner.unary(req, path, codec).await + } + pub async fn records_all( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.metadata.v1.Query/RecordsAll"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "RecordsAll", + )); + self.inner.unary(req, path, codec).await + } + pub async fn ownership( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.metadata.v1.Query/Ownership"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.metadata.v1.Query", "Ownership")); + self.inner.unary(req, path, codec).await + } + pub async fn value_ownership( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.metadata.v1.Query/ValueOwnership", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "ValueOwnership", + )); + self.inner.unary(req, path, codec).await + } + pub async fn scope_specification( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.metadata.v1.Query/ScopeSpecification", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "ScopeSpecification", + )); + self.inner.unary(req, path, codec).await + } + pub async fn scope_specifications_all( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.metadata.v1.Query/ScopeSpecificationsAll", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "ScopeSpecificationsAll", + )); + self.inner.unary(req, path, codec).await + } + pub async fn contract_specification( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.metadata.v1.Query/ContractSpecification", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "ContractSpecification", + )); + self.inner.unary(req, path, codec).await + } + pub async fn contract_specifications_all( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.metadata.v1.Query/ContractSpecificationsAll", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "ContractSpecificationsAll", + )); + self.inner.unary(req, path, codec).await + } + pub async fn record_specifications_for_contract_specification( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.metadata.v1.Query/RecordSpecificationsForContractSpecification", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "RecordSpecificationsForContractSpecification", + )); + self.inner.unary(req, path, codec).await + } + pub async fn record_specification( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.metadata.v1.Query/RecordSpecification", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "RecordSpecification", + )); + self.inner.unary(req, path, codec).await + } + pub async fn record_specifications_all( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.metadata.v1.Query/RecordSpecificationsAll", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "RecordSpecificationsAll", + )); + self.inner.unary(req, path, codec).await + } + pub async fn get_by_addr( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.metadata.v1.Query/GetByAddr"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.metadata.v1.Query", "GetByAddr")); + self.inner.unary(req, path, codec).await + } + pub async fn os_locator_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.metadata.v1.Query/OSLocatorParams", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "OSLocatorParams", + )); + self.inner.unary(req, path, codec).await + } + pub async fn os_locator( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.metadata.v1.Query/OSLocator"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.metadata.v1.Query", "OSLocator")); + self.inner.unary(req, path, codec).await + } + pub async fn os_locators_by_uri( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.metadata.v1.Query/OSLocatorsByURI", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "OSLocatorsByURI", + )); + self.inner.unary(req, path, codec).await + } + pub async fn os_locators_by_scope( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.metadata.v1.Query/OSLocatorsByScope", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "OSLocatorsByScope", + )); + self.inner.unary(req, path, codec).await + } + pub async fn os_all_locators( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.metadata.v1.Query/OSAllLocators"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "OSAllLocators", + )); + self.inner.unary(req, path, codec).await + } + pub async fn account_data( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.metadata.v1.Query/AccountData"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "AccountData", + )); + self.inner.unary(req, path, codec).await + } + pub async fn scope_net_asset_values( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.metadata.v1.Query/ScopeNetAssetValues", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Query", + "ScopeNetAssetValues", + )); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + async fn params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn scope( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn scopes_all( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn sessions( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn sessions_all( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn records( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn records_all( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn ownership( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn value_ownership( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn scope_specification( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn scope_specifications_all( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn contract_specification( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn contract_specifications_all( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn record_specifications_for_contract_specification( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn record_specification( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn record_specifications_all( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn get_by_addr( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn os_locator_params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn os_locator( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn os_locators_by_uri( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn os_locators_by_scope( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn os_all_locators( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn account_data( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn scope_net_asset_values( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/provenance.metadata.v1.Query/Params" => { + #[allow(non_camel_case_types)] + struct ParamsSvc(pub Arc); + impl tonic::server::UnaryService for ParamsSvc { + type Response = super::QueryParamsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::params(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Query/Scope" => { + #[allow(non_camel_case_types)] + struct ScopeSvc(pub Arc); + impl tonic::server::UnaryService for ScopeSvc { + type Response = super::ScopeResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::scope(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ScopeSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Query/ScopesAll" => { + #[allow(non_camel_case_types)] + struct ScopesAllSvc(pub Arc); + impl tonic::server::UnaryService for ScopesAllSvc { + type Response = super::ScopesAllResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::scopes_all(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ScopesAllSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Query/Sessions" => { + #[allow(non_camel_case_types)] + struct SessionsSvc(pub Arc); + impl tonic::server::UnaryService for SessionsSvc { + type Response = super::SessionsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::sessions(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SessionsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Query/SessionsAll" => { + #[allow(non_camel_case_types)] + struct SessionsAllSvc(pub Arc); + impl tonic::server::UnaryService for SessionsAllSvc { + type Response = super::SessionsAllResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::sessions_all(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SessionsAllSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Query/Records" => { + #[allow(non_camel_case_types)] + struct RecordsSvc(pub Arc); + impl tonic::server::UnaryService for RecordsSvc { + type Response = super::RecordsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::records(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = RecordsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Query/RecordsAll" => { + #[allow(non_camel_case_types)] + struct RecordsAllSvc(pub Arc); + impl tonic::server::UnaryService for RecordsAllSvc { + type Response = super::RecordsAllResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::records_all(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = RecordsAllSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Query/Ownership" => { + #[allow(non_camel_case_types)] + struct OwnershipSvc(pub Arc); + impl tonic::server::UnaryService for OwnershipSvc { + type Response = super::OwnershipResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::ownership(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = OwnershipSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Query/ValueOwnership" => { + #[allow(non_camel_case_types)] + struct ValueOwnershipSvc(pub Arc); + impl tonic::server::UnaryService for ValueOwnershipSvc { + type Response = super::ValueOwnershipResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::value_ownership(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ValueOwnershipSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Query/ScopeSpecification" => { + #[allow(non_camel_case_types)] + struct ScopeSpecificationSvc(pub Arc); + impl tonic::server::UnaryService + for ScopeSpecificationSvc + { + type Response = super::ScopeSpecificationResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::scope_specification(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ScopeSpecificationSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Query/ScopeSpecificationsAll" => { + #[allow(non_camel_case_types)] + struct ScopeSpecificationsAllSvc(pub Arc); + impl tonic::server::UnaryService + for ScopeSpecificationsAllSvc + { + type Response = super::ScopeSpecificationsAllResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::scope_specifications_all(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ScopeSpecificationsAllSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Query/ContractSpecification" => { + #[allow(non_camel_case_types)] + struct ContractSpecificationSvc(pub Arc); + impl tonic::server::UnaryService + for ContractSpecificationSvc + { + type Response = super::ContractSpecificationResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::contract_specification(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ContractSpecificationSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Query/ContractSpecificationsAll" => { + #[allow(non_camel_case_types)] + struct ContractSpecificationsAllSvc(pub Arc); + impl + tonic::server::UnaryService + for ContractSpecificationsAllSvc + { + type Response = super::ContractSpecificationsAllResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::contract_specifications_all(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ContractSpecificationsAllSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Query/RecordSpecificationsForContractSpecification" => { + #[allow(non_camel_case_types)] + struct RecordSpecificationsForContractSpecificationSvc(pub Arc); + impl + tonic::server::UnaryService< + super::RecordSpecificationsForContractSpecificationRequest, + > for RecordSpecificationsForContractSpecificationSvc + { + type Response = super::RecordSpecificationsForContractSpecificationResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request< + super::RecordSpecificationsForContractSpecificationRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::record_specifications_for_contract_specification( + &inner, request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = RecordSpecificationsForContractSpecificationSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Query/RecordSpecification" => { + #[allow(non_camel_case_types)] + struct RecordSpecificationSvc(pub Arc); + impl tonic::server::UnaryService + for RecordSpecificationSvc + { + type Response = super::RecordSpecificationResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::record_specification(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = RecordSpecificationSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Query/RecordSpecificationsAll" => { + #[allow(non_camel_case_types)] + struct RecordSpecificationsAllSvc(pub Arc); + impl + tonic::server::UnaryService + for RecordSpecificationsAllSvc + { + type Response = super::RecordSpecificationsAllResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::record_specifications_all(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = RecordSpecificationsAllSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Query/GetByAddr" => { + #[allow(non_camel_case_types)] + struct GetByAddrSvc(pub Arc); + impl tonic::server::UnaryService for GetByAddrSvc { + type Response = super::GetByAddrResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::get_by_addr(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetByAddrSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Query/OSLocatorParams" => { + #[allow(non_camel_case_types)] + struct OSLocatorParamsSvc(pub Arc); + impl tonic::server::UnaryService + for OSLocatorParamsSvc + { + type Response = super::OsLocatorParamsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::os_locator_params(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = OSLocatorParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Query/OSLocator" => { + #[allow(non_camel_case_types)] + struct OSLocatorSvc(pub Arc); + impl tonic::server::UnaryService for OSLocatorSvc { + type Response = super::OsLocatorResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::os_locator(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = OSLocatorSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Query/OSLocatorsByURI" => { + #[allow(non_camel_case_types)] + struct OSLocatorsByURISvc(pub Arc); + impl tonic::server::UnaryService + for OSLocatorsByURISvc + { + type Response = super::OsLocatorsByUriResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::os_locators_by_uri(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = OSLocatorsByURISvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Query/OSLocatorsByScope" => { + #[allow(non_camel_case_types)] + struct OSLocatorsByScopeSvc(pub Arc); + impl tonic::server::UnaryService + for OSLocatorsByScopeSvc + { + type Response = super::OsLocatorsByScopeResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::os_locators_by_scope(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = OSLocatorsByScopeSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Query/OSAllLocators" => { + #[allow(non_camel_case_types)] + struct OSAllLocatorsSvc(pub Arc); + impl tonic::server::UnaryService for OSAllLocatorsSvc { + type Response = super::OsAllLocatorsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::os_all_locators(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = OSAllLocatorsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Query/AccountData" => { + #[allow(non_camel_case_types)] + struct AccountDataSvc(pub Arc); + impl tonic::server::UnaryService for AccountDataSvc { + type Response = super::AccountDataResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::account_data(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AccountDataSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Query/ScopeNetAssetValues" => { + #[allow(non_camel_case_types)] + struct ScopeNetAssetValuesSvc(pub Arc); + impl + tonic::server::UnaryService + for ScopeNetAssetValuesSvc + { + type Response = super::QueryScopeNetAssetValuesResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::scope_net_asset_values(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ScopeNetAssetValuesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "provenance.metadata.v1.Query"; + } +} +/// 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 provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + 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 the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn write_scope( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.metadata.v1.Msg/WriteScope"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.metadata.v1.Msg", "WriteScope")); + self.inner.unary(req, path, codec).await + } + pub async fn delete_scope( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.metadata.v1.Msg/DeleteScope"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.metadata.v1.Msg", "DeleteScope")); + self.inner.unary(req, path, codec).await + } + pub async fn add_scope_data_access( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.metadata.v1.Msg/AddScopeDataAccess", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "AddScopeDataAccess", + )); + self.inner.unary(req, path, codec).await + } + pub async fn delete_scope_data_access( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.metadata.v1.Msg/DeleteScopeDataAccess", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "DeleteScopeDataAccess", + )); + self.inner.unary(req, path, codec).await + } + pub async fn add_scope_owner( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.metadata.v1.Msg/AddScopeOwner"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "AddScopeOwner", + )); + self.inner.unary(req, path, codec).await + } + pub async fn delete_scope_owner( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.metadata.v1.Msg/DeleteScopeOwner", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "DeleteScopeOwner", + )); + self.inner.unary(req, path, codec).await + } + pub async fn update_value_owners( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.metadata.v1.Msg/UpdateValueOwners", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "UpdateValueOwners", + )); + self.inner.unary(req, path, codec).await + } + pub async fn migrate_value_owner( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.metadata.v1.Msg/MigrateValueOwner", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "MigrateValueOwner", + )); + self.inner.unary(req, path, codec).await + } + pub async fn write_session( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.metadata.v1.Msg/WriteSession"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "WriteSession", + )); + self.inner.unary(req, path, codec).await + } + pub async fn write_record( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.metadata.v1.Msg/WriteRecord"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.metadata.v1.Msg", "WriteRecord")); + self.inner.unary(req, path, codec).await + } + pub async fn delete_record( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.metadata.v1.Msg/DeleteRecord"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "DeleteRecord", + )); + self.inner.unary(req, path, codec).await + } + pub async fn write_scope_specification( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.metadata.v1.Msg/WriteScopeSpecification", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "WriteScopeSpecification", + )); + self.inner.unary(req, path, codec).await + } + pub async fn delete_scope_specification( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.metadata.v1.Msg/DeleteScopeSpecification", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "DeleteScopeSpecification", + )); + self.inner.unary(req, path, codec).await + } + pub async fn write_contract_specification( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.metadata.v1.Msg/WriteContractSpecification", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "WriteContractSpecification", + )); + self.inner.unary(req, path, codec).await + } + pub async fn delete_contract_specification( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.metadata.v1.Msg/DeleteContractSpecification", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "DeleteContractSpecification", + )); + self.inner.unary(req, path, codec).await + } + pub async fn add_contract_spec_to_scope_spec( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.metadata.v1.Msg/AddContractSpecToScopeSpec", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "AddContractSpecToScopeSpec", + )); + self.inner.unary(req, path, codec).await + } + pub async fn delete_contract_spec_from_scope_spec( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.metadata.v1.Msg/DeleteContractSpecFromScopeSpec", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "DeleteContractSpecFromScopeSpec", + )); + self.inner.unary(req, path, codec).await + } + pub async fn write_record_specification( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.metadata.v1.Msg/WriteRecordSpecification", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "WriteRecordSpecification", + )); + self.inner.unary(req, path, codec).await + } + pub async fn delete_record_specification( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.metadata.v1.Msg/DeleteRecordSpecification", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "DeleteRecordSpecification", + )); + self.inner.unary(req, path, codec).await + } + pub async fn bind_os_locator( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.metadata.v1.Msg/BindOSLocator"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "BindOSLocator", + )); + self.inner.unary(req, path, codec).await + } + pub async fn delete_os_locator( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.metadata.v1.Msg/DeleteOSLocator"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "DeleteOSLocator", + )); + self.inner.unary(req, path, codec).await + } + pub async fn modify_os_locator( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.metadata.v1.Msg/ModifyOSLocator"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "ModifyOSLocator", + )); + self.inner.unary(req, path, codec).await + } + pub async fn set_account_data( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.metadata.v1.Msg/SetAccountData"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "SetAccountData", + )); + self.inner.unary(req, path, codec).await + } + pub async fn add_net_asset_values( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.metadata.v1.Msg/AddNetAssetValues", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.metadata.v1.Msg", + "AddNetAssetValues", + )); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + async fn write_scope( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn delete_scope( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn add_scope_data_access( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn delete_scope_data_access( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn add_scope_owner( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn delete_scope_owner( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn update_value_owners( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn migrate_value_owner( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn write_session( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn write_record( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn delete_record( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn write_scope_specification( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn delete_scope_specification( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn write_contract_specification( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn delete_contract_specification( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn add_contract_spec_to_scope_spec( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn delete_contract_spec_from_scope_spec( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn write_record_specification( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn delete_record_specification( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn bind_os_locator( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn delete_os_locator( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn modify_os_locator( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn set_account_data( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn add_net_asset_values( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/provenance.metadata.v1.Msg/WriteScope" => { + #[allow(non_camel_case_types)] + struct WriteScopeSvc(pub Arc); + impl tonic::server::UnaryService for WriteScopeSvc { + type Response = super::MsgWriteScopeResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::write_scope(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = WriteScopeSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Msg/DeleteScope" => { + #[allow(non_camel_case_types)] + struct DeleteScopeSvc(pub Arc); + impl tonic::server::UnaryService for DeleteScopeSvc { + type Response = super::MsgDeleteScopeResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::delete_scope(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeleteScopeSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Msg/AddScopeDataAccess" => { + #[allow(non_camel_case_types)] + struct AddScopeDataAccessSvc(pub Arc); + impl tonic::server::UnaryService + for AddScopeDataAccessSvc + { + type Response = super::MsgAddScopeDataAccessResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::add_scope_data_access(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AddScopeDataAccessSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Msg/DeleteScopeDataAccess" => { + #[allow(non_camel_case_types)] + struct DeleteScopeDataAccessSvc(pub Arc); + impl tonic::server::UnaryService + for DeleteScopeDataAccessSvc + { + type Response = super::MsgDeleteScopeDataAccessResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::delete_scope_data_access(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeleteScopeDataAccessSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Msg/AddScopeOwner" => { + #[allow(non_camel_case_types)] + struct AddScopeOwnerSvc(pub Arc); + impl tonic::server::UnaryService for AddScopeOwnerSvc { + type Response = super::MsgAddScopeOwnerResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::add_scope_owner(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AddScopeOwnerSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Msg/DeleteScopeOwner" => { + #[allow(non_camel_case_types)] + struct DeleteScopeOwnerSvc(pub Arc); + impl tonic::server::UnaryService + for DeleteScopeOwnerSvc + { + type Response = super::MsgDeleteScopeOwnerResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::delete_scope_owner(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeleteScopeOwnerSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Msg/UpdateValueOwners" => { + #[allow(non_camel_case_types)] + struct UpdateValueOwnersSvc(pub Arc); + impl tonic::server::UnaryService + for UpdateValueOwnersSvc + { + type Response = super::MsgUpdateValueOwnersResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_value_owners(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateValueOwnersSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Msg/MigrateValueOwner" => { + #[allow(non_camel_case_types)] + struct MigrateValueOwnerSvc(pub Arc); + impl tonic::server::UnaryService + for MigrateValueOwnerSvc + { + type Response = super::MsgMigrateValueOwnerResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::migrate_value_owner(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = MigrateValueOwnerSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Msg/WriteSession" => { + #[allow(non_camel_case_types)] + struct WriteSessionSvc(pub Arc); + impl tonic::server::UnaryService for WriteSessionSvc { + type Response = super::MsgWriteSessionResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::write_session(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = WriteSessionSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Msg/WriteRecord" => { + #[allow(non_camel_case_types)] + struct WriteRecordSvc(pub Arc); + impl tonic::server::UnaryService for WriteRecordSvc { + type Response = super::MsgWriteRecordResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::write_record(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = WriteRecordSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Msg/DeleteRecord" => { + #[allow(non_camel_case_types)] + struct DeleteRecordSvc(pub Arc); + impl tonic::server::UnaryService for DeleteRecordSvc { + type Response = super::MsgDeleteRecordResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::delete_record(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeleteRecordSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Msg/WriteScopeSpecification" => { + #[allow(non_camel_case_types)] + struct WriteScopeSpecificationSvc(pub Arc); + impl + tonic::server::UnaryService + for WriteScopeSpecificationSvc + { + type Response = super::MsgWriteScopeSpecificationResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::write_scope_specification(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = WriteScopeSpecificationSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Msg/DeleteScopeSpecification" => { + #[allow(non_camel_case_types)] + struct DeleteScopeSpecificationSvc(pub Arc); + impl + tonic::server::UnaryService + for DeleteScopeSpecificationSvc + { + type Response = super::MsgDeleteScopeSpecificationResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::delete_scope_specification(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeleteScopeSpecificationSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Msg/WriteContractSpecification" => { + #[allow(non_camel_case_types)] + struct WriteContractSpecificationSvc(pub Arc); + impl + tonic::server::UnaryService + for WriteContractSpecificationSvc + { + type Response = super::MsgWriteContractSpecificationResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::write_contract_specification(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = WriteContractSpecificationSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Msg/DeleteContractSpecification" => { + #[allow(non_camel_case_types)] + struct DeleteContractSpecificationSvc(pub Arc); + impl + tonic::server::UnaryService + for DeleteContractSpecificationSvc + { + type Response = super::MsgDeleteContractSpecificationResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::delete_contract_specification(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeleteContractSpecificationSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Msg/AddContractSpecToScopeSpec" => { + #[allow(non_camel_case_types)] + struct AddContractSpecToScopeSpecSvc(pub Arc); + impl + tonic::server::UnaryService + for AddContractSpecToScopeSpecSvc + { + type Response = super::MsgAddContractSpecToScopeSpecResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::add_contract_spec_to_scope_spec(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AddContractSpecToScopeSpecSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Msg/DeleteContractSpecFromScopeSpec" => { + #[allow(non_camel_case_types)] + struct DeleteContractSpecFromScopeSpecSvc(pub Arc); + impl + tonic::server::UnaryService< + super::MsgDeleteContractSpecFromScopeSpecRequest, + > for DeleteContractSpecFromScopeSpecSvc + { + type Response = super::MsgDeleteContractSpecFromScopeSpecResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request< + super::MsgDeleteContractSpecFromScopeSpecRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::delete_contract_spec_from_scope_spec(&inner, request) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeleteContractSpecFromScopeSpecSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Msg/WriteRecordSpecification" => { + #[allow(non_camel_case_types)] + struct WriteRecordSpecificationSvc(pub Arc); + impl + tonic::server::UnaryService + for WriteRecordSpecificationSvc + { + type Response = super::MsgWriteRecordSpecificationResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::write_record_specification(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = WriteRecordSpecificationSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Msg/DeleteRecordSpecification" => { + #[allow(non_camel_case_types)] + struct DeleteRecordSpecificationSvc(pub Arc); + impl + tonic::server::UnaryService + for DeleteRecordSpecificationSvc + { + type Response = super::MsgDeleteRecordSpecificationResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::delete_record_specification(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeleteRecordSpecificationSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Msg/BindOSLocator" => { + #[allow(non_camel_case_types)] + struct BindOSLocatorSvc(pub Arc); + impl tonic::server::UnaryService for BindOSLocatorSvc { + type Response = super::MsgBindOsLocatorResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::bind_os_locator(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = BindOSLocatorSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Msg/DeleteOSLocator" => { + #[allow(non_camel_case_types)] + struct DeleteOSLocatorSvc(pub Arc); + impl tonic::server::UnaryService + for DeleteOSLocatorSvc + { + type Response = super::MsgDeleteOsLocatorResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::delete_os_locator(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeleteOSLocatorSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Msg/ModifyOSLocator" => { + #[allow(non_camel_case_types)] + struct ModifyOSLocatorSvc(pub Arc); + impl tonic::server::UnaryService + for ModifyOSLocatorSvc + { + type Response = super::MsgModifyOsLocatorResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::modify_os_locator(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ModifyOSLocatorSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Msg/SetAccountData" => { + #[allow(non_camel_case_types)] + struct SetAccountDataSvc(pub Arc); + impl tonic::server::UnaryService for SetAccountDataSvc { + type Response = super::MsgSetAccountDataResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::set_account_data(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SetAccountDataSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.metadata.v1.Msg/AddNetAssetValues" => { + #[allow(non_camel_case_types)] + struct AddNetAssetValuesSvc(pub Arc); + impl tonic::server::UnaryService + for AddNetAssetValuesSvc + { + type Response = super::MsgAddNetAssetValuesResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::add_net_asset_values(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AddNetAssetValuesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "provenance.metadata.v1.Msg"; + } +} diff --git a/packages/provwasm-std/src/types/provenance/mod.rs b/packages/provwasm-std/src/types/provenance/mod.rs index 8ee0d80e..91028e9c 100644 --- a/packages/provwasm-std/src/types/provenance/mod.rs +++ b/packages/provwasm-std/src/types/provenance/mod.rs @@ -8,4 +8,5 @@ pub mod metadata; pub mod msgfees; pub mod name; pub mod oracle; +pub mod reward; pub mod trigger; diff --git a/packages/provwasm-std/src/types/provenance/msgfees/v1.rs b/packages/provwasm-std/src/types/provenance/msgfees/v1/mod.rs similarity index 89% rename from packages/provwasm-std/src/types/provenance/msgfees/v1.rs rename to packages/provwasm-std/src/types/provenance/msgfees/v1/mod.rs index 2056dd14..8974f066 100644 --- a/packages/provwasm-std/src/types/provenance/msgfees/v1.rs +++ b/packages/provwasm-std/src/types/provenance/msgfees/v1/mod.rs @@ -1,3 +1,4 @@ +pub mod tonic; use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Params defines the set of params for the msgfees module. #[allow(clippy::derive_partial_eq_without_eq)] @@ -35,7 +36,12 @@ pub struct Params { #[prost(string, tag = "4")] pub conversion_fee_denom: ::prost::alloc::string::String, } -/// MsgFee is the core of what gets stored on the blockchain to define a msg-based fee. +/// MsgFee is the core of what gets stored on the blockchain +/// it consists of four parts +/// 1. the msg type url, i.e. /cosmos.bank.v1beta1.MsgSend +/// 2. minimum additional fees(can be of any denom) +/// 3. optional recipient of fee based on `recipient_basis_points` +/// 4. if recipient is declared they will recieve the basis points of the fee (0-10,000) #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -49,23 +55,15 @@ pub struct Params { )] #[proto_message(type_url = "/provenance.msgfees.v1.MsgFee")] pub struct MsgFee { - /// msg_type_url is the type-url of the message with the added fee, e.g. "/cosmos.bank.v1beta1.MsgSend". #[prost(string, tag = "1")] pub msg_type_url: ::prost::alloc::string::String, - /// additional_fee is the extra fee that is required for the given message type (can be in any denom). + /// additional_fee can pay in any Coin( basically a Denom and Amount, Amount can be zero) #[prost(message, optional, tag = "2")] pub additional_fee: ::core::option::Option, - /// recipient is an option address that will receive a portion of the additional fee. - /// There can only be a recipient if the recipient_basis_points is not zero. + /// optional recipient address, the amount is split between recipient and fee module #[prost(string, tag = "3")] pub recipient: ::prost::alloc::string::String, - /// recipient_basis_points is an optional portion of the additional fee to be sent to the recipient. - /// Must be between 0 and 10,000 (inclusive). - /// - /// If there is a recipient, this must not be zero. If there is not a recipient, this must be zero. - /// - /// The recipient will receive additional_fee * recipient_basis_points / 10,000. - /// The fee collector will receive the rest, i.e. additional_fee * (10,000 - recipient_basis_points) / 10,000. + /// optional split of funds between the recipient and fee module defaults to 50:50, #[prost(uint32, tag = "4")] pub recipient_basis_points: u32, } @@ -131,9 +129,6 @@ pub struct GenesisState { pub msg_fees: ::prost::alloc::vec::Vec, } /// AddMsgFeeProposal defines a governance proposal to add additional msg based fee -/// Deprecated: This message is no longer usable. It is only still included for -/// backwards compatibility (e.g. looking up old governance proposals). -/// It is replaced by providing a MsgAddMsgFeeProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -146,7 +141,6 @@ pub struct GenesisState { CosmwasmExt, )] #[proto_message(type_url = "/provenance.msgfees.v1.AddMsgFeeProposal")] -#[deprecated] pub struct AddMsgFeeProposal { /// propsal title #[prost(string, tag = "1")] @@ -168,9 +162,6 @@ pub struct AddMsgFeeProposal { pub recipient_basis_points: ::prost::alloc::string::String, } /// UpdateMsgFeeProposal defines a governance proposal to update a current msg based fee -/// Deprecated: This message is no longer usable. It is only still included for -/// backwards compatibility (e.g. looking up old governance proposals). -/// It is replaced by providing a MsgUpdateMsgFeeProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -183,7 +174,6 @@ pub struct AddMsgFeeProposal { CosmwasmExt, )] #[proto_message(type_url = "/provenance.msgfees.v1.UpdateMsgFeeProposal")] -#[deprecated] pub struct UpdateMsgFeeProposal { /// propsal title #[prost(string, tag = "1")] @@ -205,9 +195,6 @@ pub struct UpdateMsgFeeProposal { pub recipient_basis_points: ::prost::alloc::string::String, } /// RemoveMsgFeeProposal defines a governance proposal to delete a current msg based fee -/// Deprecated: This message is no longer usable. It is only still included for -/// backwards compatibility (e.g. looking up old governance proposals). -/// It is replaced by providing a MsgRemoveMsgFeeProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -220,7 +207,6 @@ pub struct UpdateMsgFeeProposal { CosmwasmExt, )] #[proto_message(type_url = "/provenance.msgfees.v1.RemoveMsgFeeProposal")] -#[deprecated] pub struct RemoveMsgFeeProposal { /// propsal title #[prost(string, tag = "1")] @@ -233,9 +219,6 @@ pub struct RemoveMsgFeeProposal { pub msg_type_url: ::prost::alloc::string::String, } /// UpdateNhashPerUsdMilProposal defines a governance proposal to update the nhash per usd mil param -/// Deprecated: This message is no longer usable. It is only still included for -/// backwards compatibility (e.g. looking up old governance proposals). -/// It is replaced by providing a MsgUpdateNhashPerUsdMilProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -248,7 +231,6 @@ pub struct RemoveMsgFeeProposal { CosmwasmExt, )] #[proto_message(type_url = "/provenance.msgfees.v1.UpdateNhashPerUsdMilProposal")] -#[deprecated] pub struct UpdateNhashPerUsdMilProposal { /// proposal title #[prost(string, tag = "1")] @@ -265,9 +247,6 @@ pub struct UpdateNhashPerUsdMilProposal { pub nhash_per_usd_mil: u64, } /// UpdateConversionFeeDenomProposal defines a governance proposal to update the msg fee conversion denom -/// Deprecated: This message is no longer usable. It is only still included for -/// backwards compatibility (e.g. looking up old governance proposals). -/// It is replaced by providing a MsgUpdateConversionFeeDenomProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -280,7 +259,6 @@ pub struct UpdateNhashPerUsdMilProposal { CosmwasmExt, )] #[proto_message(type_url = "/provenance.msgfees.v1.UpdateConversionFeeDenomProposal")] -#[deprecated] pub struct UpdateConversionFeeDenomProposal { /// proposal title #[prost(string, tag = "1")] @@ -480,7 +458,7 @@ pub struct MsgUpdateMsgFeeProposalRequest { /// additional fee for msg type #[prost(message, optional, tag = "2")] pub additional_fee: ::core::option::Option, - /// optional recipient to receive basis points + /// optional recipient to recieve basis points #[prost(string, tag = "3")] pub recipient: ::prost::alloc::string::String, /// basis points to use when recipient is present (1 - 10,000) @@ -619,6 +597,7 @@ pub struct MsgUpdateConversionFeeDenomProposalRequest { )] #[proto_message(type_url = "/provenance.msgfees.v1.MsgUpdateConversionFeeDenomProposalResponse")] pub struct MsgUpdateConversionFeeDenomProposalResponse {} +include!("provenance.msgfees.v1.tonic.rs"); pub struct MsgfeesQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } diff --git a/packages/provwasm-std/src/types/provenance/msgfees/v1/tonic.rs b/packages/provwasm-std/src/types/provenance/msgfees/v1/tonic.rs new file mode 100644 index 00000000..75c10983 --- /dev/null +++ b/packages/provwasm-std/src/types/provenance/msgfees/v1/tonic.rs @@ -0,0 +1,1028 @@ +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; +/// 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 provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + 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 the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.msgfees.v1.Query/Params"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.msgfees.v1.Query", "Params")); + self.inner.unary(req, path, codec).await + } + pub async fn query_all_msg_fees( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.msgfees.v1.Query/QueryAllMsgFees", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.msgfees.v1.Query", + "QueryAllMsgFees", + )); + self.inner.unary(req, path, codec).await + } + pub async fn calculate_tx_fees( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.msgfees.v1.Query/CalculateTxFees", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.msgfees.v1.Query", + "CalculateTxFees", + )); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + async fn params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn query_all_msg_fees( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn calculate_tx_fees( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/provenance.msgfees.v1.Query/Params" => { + #[allow(non_camel_case_types)] + struct ParamsSvc(pub Arc); + impl tonic::server::UnaryService for ParamsSvc { + type Response = super::QueryParamsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::params(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.msgfees.v1.Query/QueryAllMsgFees" => { + #[allow(non_camel_case_types)] + struct QueryAllMsgFeesSvc(pub Arc); + impl tonic::server::UnaryService + for QueryAllMsgFeesSvc + { + type Response = super::QueryAllMsgFeesResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::query_all_msg_fees(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = QueryAllMsgFeesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.msgfees.v1.Query/CalculateTxFees" => { + #[allow(non_camel_case_types)] + struct CalculateTxFeesSvc(pub Arc); + impl tonic::server::UnaryService + for CalculateTxFeesSvc + { + type Response = super::CalculateTxFeesResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::calculate_tx_fees(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CalculateTxFeesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "provenance.msgfees.v1.Query"; + } +} +/// 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 provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + 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 the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn assess_custom_msg_fee( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.msgfees.v1.Msg/AssessCustomMsgFee", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.msgfees.v1.Msg", + "AssessCustomMsgFee", + )); + self.inner.unary(req, path, codec).await + } + pub async fn add_msg_fee_proposal( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.msgfees.v1.Msg/AddMsgFeeProposal", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.msgfees.v1.Msg", + "AddMsgFeeProposal", + )); + self.inner.unary(req, path, codec).await + } + pub async fn update_msg_fee_proposal( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.msgfees.v1.Msg/UpdateMsgFeeProposal", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.msgfees.v1.Msg", + "UpdateMsgFeeProposal", + )); + self.inner.unary(req, path, codec).await + } + pub async fn remove_msg_fee_proposal( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.msgfees.v1.Msg/RemoveMsgFeeProposal", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.msgfees.v1.Msg", + "RemoveMsgFeeProposal", + )); + self.inner.unary(req, path, codec).await + } + pub async fn update_nhash_per_usd_mil_proposal( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.msgfees.v1.Msg/UpdateNhashPerUsdMilProposal", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.msgfees.v1.Msg", + "UpdateNhashPerUsdMilProposal", + )); + self.inner.unary(req, path, codec).await + } + pub async fn update_conversion_fee_denom_proposal( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.msgfees.v1.Msg/UpdateConversionFeeDenomProposal", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.msgfees.v1.Msg", + "UpdateConversionFeeDenomProposal", + )); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + async fn assess_custom_msg_fee( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn add_msg_fee_proposal( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn update_msg_fee_proposal( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn remove_msg_fee_proposal( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn update_nhash_per_usd_mil_proposal( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn update_conversion_fee_denom_proposal( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/provenance.msgfees.v1.Msg/AssessCustomMsgFee" => { + #[allow(non_camel_case_types)] + struct AssessCustomMsgFeeSvc(pub Arc); + impl tonic::server::UnaryService + for AssessCustomMsgFeeSvc + { + type Response = super::MsgAssessCustomMsgFeeResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::assess_custom_msg_fee(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AssessCustomMsgFeeSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.msgfees.v1.Msg/AddMsgFeeProposal" => { + #[allow(non_camel_case_types)] + struct AddMsgFeeProposalSvc(pub Arc); + impl tonic::server::UnaryService + for AddMsgFeeProposalSvc + { + type Response = super::MsgAddMsgFeeProposalResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::add_msg_fee_proposal(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AddMsgFeeProposalSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.msgfees.v1.Msg/UpdateMsgFeeProposal" => { + #[allow(non_camel_case_types)] + struct UpdateMsgFeeProposalSvc(pub Arc); + impl tonic::server::UnaryService + for UpdateMsgFeeProposalSvc + { + type Response = super::MsgUpdateMsgFeeProposalResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_msg_fee_proposal(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateMsgFeeProposalSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.msgfees.v1.Msg/RemoveMsgFeeProposal" => { + #[allow(non_camel_case_types)] + struct RemoveMsgFeeProposalSvc(pub Arc); + impl tonic::server::UnaryService + for RemoveMsgFeeProposalSvc + { + type Response = super::MsgRemoveMsgFeeProposalResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::remove_msg_fee_proposal(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = RemoveMsgFeeProposalSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.msgfees.v1.Msg/UpdateNhashPerUsdMilProposal" => { + #[allow(non_camel_case_types)] + struct UpdateNhashPerUsdMilProposalSvc(pub Arc); + impl + tonic::server::UnaryService + for UpdateNhashPerUsdMilProposalSvc + { + type Response = super::MsgUpdateNhashPerUsdMilProposalResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_nhash_per_usd_mil_proposal(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateNhashPerUsdMilProposalSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.msgfees.v1.Msg/UpdateConversionFeeDenomProposal" => { + #[allow(non_camel_case_types)] + struct UpdateConversionFeeDenomProposalSvc(pub Arc); + impl + tonic::server::UnaryService< + super::MsgUpdateConversionFeeDenomProposalRequest, + > for UpdateConversionFeeDenomProposalSvc + { + type Response = super::MsgUpdateConversionFeeDenomProposalResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request< + super::MsgUpdateConversionFeeDenomProposalRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_conversion_fee_denom_proposal(&inner, request) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateConversionFeeDenomProposalSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "provenance.msgfees.v1.Msg"; + } +} diff --git a/packages/provwasm-std/src/types/provenance/name/v1.rs b/packages/provwasm-std/src/types/provenance/name/v1/mod.rs similarity index 88% rename from packages/provwasm-std/src/types/provenance/name/v1.rs rename to packages/provwasm-std/src/types/provenance/name/v1/mod.rs index 66bc347e..85e08c05 100644 --- a/packages/provwasm-std/src/types/provenance/name/v1.rs +++ b/packages/provwasm-std/src/types/provenance/name/v1/mod.rs @@ -1,3 +1,4 @@ +pub mod tonic; use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Params defines the set of params for the name module. #[allow(clippy::derive_partial_eq_without_eq)] @@ -53,8 +54,6 @@ pub struct NameRecord { /// CreateRootNameProposal details a proposal to create a new root name /// that is controlled by a given owner and optionally restricted to the owner /// for the sole creation of sub names. -/// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov -/// proposals, see MsgCreateRootNameRequest. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -67,7 +66,6 @@ pub struct NameRecord { CosmwasmExt, )] #[proto_message(type_url = "/provenance.name.v1.CreateRootNameProposal")] -#[deprecated] pub struct CreateRootNameProposal { /// proposal title #[prost(string, tag = "1")] @@ -148,29 +146,6 @@ pub struct EventNameUpdate { #[prost(bool, tag = "3")] pub restricted: bool, } -/// EventNameParamsUpdated event emitted when name params are updated. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.name.v1.EventNameParamsUpdated")] -pub struct EventNameParamsUpdated { - #[prost(string, tag = "1")] - pub allow_unrestricted_names: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub max_name_levels: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub min_segment_length: ::prost::alloc::string::String, - #[prost(string, tag = "4")] - pub max_segment_length: ::prost::alloc::string::String, -} /// GenesisState defines the name module's genesis state. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -462,41 +437,7 @@ pub struct MsgModifyNameRequest { )] #[proto_message(type_url = "/provenance.name.v1.MsgModifyNameResponse")] pub struct MsgModifyNameResponse {} -/// MsgUpdateParamsRequest is a request message for the UpdateParams endpoint. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.name.v1.MsgUpdateParamsRequest")] -pub struct MsgUpdateParamsRequest { - /// authority should be the governance module account address. - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// params are the new param values to set. - #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, -} -/// MsgUpdateParamsResponse is a response message for the UpdateParams endpoint. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.name.v1.MsgUpdateParamsResponse")] -pub struct MsgUpdateParamsResponse {} +include!("provenance.name.v1.tonic.rs"); pub struct NameQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } diff --git a/packages/provwasm-std/src/types/provenance/name/v1/tonic.rs b/packages/provwasm-std/src/types/provenance/name/v1/tonic.rs new file mode 100644 index 00000000..a1694a8b --- /dev/null +++ b/packages/provwasm-std/src/types/provenance/name/v1/tonic.rs @@ -0,0 +1,824 @@ +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; +/// 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 provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + 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 the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.name.v1.Query/Params"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.name.v1.Query", "Params")); + self.inner.unary(req, path, codec).await + } + pub async fn resolve( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.name.v1.Query/Resolve"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.name.v1.Query", "Resolve")); + self.inner.unary(req, path, codec).await + } + pub async fn reverse_lookup( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.name.v1.Query/ReverseLookup"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.name.v1.Query", "ReverseLookup")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + async fn params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn resolve( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn reverse_lookup( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/provenance.name.v1.Query/Params" => { + #[allow(non_camel_case_types)] + struct ParamsSvc(pub Arc); + impl tonic::server::UnaryService for ParamsSvc { + type Response = super::QueryParamsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::params(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.name.v1.Query/Resolve" => { + #[allow(non_camel_case_types)] + struct ResolveSvc(pub Arc); + impl tonic::server::UnaryService for ResolveSvc { + type Response = super::QueryResolveResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::resolve(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ResolveSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.name.v1.Query/ReverseLookup" => { + #[allow(non_camel_case_types)] + struct ReverseLookupSvc(pub Arc); + impl tonic::server::UnaryService + for ReverseLookupSvc + { + type Response = super::QueryReverseLookupResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::reverse_lookup(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ReverseLookupSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "provenance.name.v1.Query"; + } +} +/// 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 provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + 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 the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn bind_name( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.name.v1.Msg/BindName"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.name.v1.Msg", "BindName")); + self.inner.unary(req, path, codec).await + } + pub async fn delete_name( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.name.v1.Msg/DeleteName"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.name.v1.Msg", "DeleteName")); + self.inner.unary(req, path, codec).await + } + pub async fn modify_name( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.name.v1.Msg/ModifyName"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.name.v1.Msg", "ModifyName")); + self.inner.unary(req, path, codec).await + } + pub async fn create_root_name( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.name.v1.Msg/CreateRootName"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.name.v1.Msg", "CreateRootName")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + async fn bind_name( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn delete_name( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn modify_name( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn create_root_name( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/provenance.name.v1.Msg/BindName" => { + #[allow(non_camel_case_types)] + struct BindNameSvc(pub Arc); + impl tonic::server::UnaryService for BindNameSvc { + type Response = super::MsgBindNameResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::bind_name(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = BindNameSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.name.v1.Msg/DeleteName" => { + #[allow(non_camel_case_types)] + struct DeleteNameSvc(pub Arc); + impl tonic::server::UnaryService for DeleteNameSvc { + type Response = super::MsgDeleteNameResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::delete_name(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeleteNameSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.name.v1.Msg/ModifyName" => { + #[allow(non_camel_case_types)] + struct ModifyNameSvc(pub Arc); + impl tonic::server::UnaryService for ModifyNameSvc { + type Response = super::MsgModifyNameResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::modify_name(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ModifyNameSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.name.v1.Msg/CreateRootName" => { + #[allow(non_camel_case_types)] + struct CreateRootNameSvc(pub Arc); + impl tonic::server::UnaryService for CreateRootNameSvc { + type Response = super::MsgCreateRootNameResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::create_root_name(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CreateRootNameSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "provenance.name.v1.Msg"; + } +} diff --git a/packages/provwasm-std/src/types/provenance/oracle/v1.rs b/packages/provwasm-std/src/types/provenance/oracle/v1/mod.rs similarity index 99% rename from packages/provwasm-std/src/types/provenance/oracle/v1.rs rename to packages/provwasm-std/src/types/provenance/oracle/v1/mod.rs index f245bd78..006a6b8a 100644 --- a/packages/provwasm-std/src/types/provenance/oracle/v1.rs +++ b/packages/provwasm-std/src/types/provenance/oracle/v1/mod.rs @@ -1,3 +1,4 @@ +pub mod tonic; use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// EventOracleQuerySuccess is an event for when the chain receives a successful response from an oracle query #[allow(clippy::derive_partial_eq_without_eq)] @@ -258,6 +259,7 @@ pub struct MsgUpdateOracleRequest { )] #[proto_message(type_url = "/provenance.oracle.v1.MsgUpdateOracleResponse")] pub struct MsgUpdateOracleResponse {} +include!("provenance.oracle.v1.tonic.rs"); pub struct OracleQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } diff --git a/packages/provwasm-std/src/types/provenance/oracle/v1/tonic.rs b/packages/provwasm-std/src/types/provenance/oracle/v1/tonic.rs new file mode 100644 index 00000000..7f697523 --- /dev/null +++ b/packages/provwasm-std/src/types/provenance/oracle/v1/tonic.rs @@ -0,0 +1,652 @@ +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; +/// 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 provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + 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 the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn oracle_address( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.oracle.v1.Query/OracleAddress"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.oracle.v1.Query", + "OracleAddress", + )); + self.inner.unary(req, path, codec).await + } + pub async fn oracle( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.oracle.v1.Query/Oracle"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.oracle.v1.Query", "Oracle")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + async fn oracle_address( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn oracle( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/provenance.oracle.v1.Query/OracleAddress" => { + #[allow(non_camel_case_types)] + struct OracleAddressSvc(pub Arc); + impl tonic::server::UnaryService + for OracleAddressSvc + { + type Response = super::QueryOracleAddressResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::oracle_address(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = OracleAddressSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.oracle.v1.Query/Oracle" => { + #[allow(non_camel_case_types)] + struct OracleSvc(pub Arc); + impl tonic::server::UnaryService for OracleSvc { + type Response = super::QueryOracleResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::oracle(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = OracleSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "provenance.oracle.v1.Query"; + } +} +/// 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 provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + 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 the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn update_oracle( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.oracle.v1.Msg/UpdateOracle"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.oracle.v1.Msg", "UpdateOracle")); + self.inner.unary(req, path, codec).await + } + pub async fn send_query_oracle( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.oracle.v1.Msg/SendQueryOracle"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.oracle.v1.Msg", + "SendQueryOracle", + )); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + async fn update_oracle( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn send_query_oracle( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/provenance.oracle.v1.Msg/UpdateOracle" => { + #[allow(non_camel_case_types)] + struct UpdateOracleSvc(pub Arc); + impl tonic::server::UnaryService for UpdateOracleSvc { + type Response = super::MsgUpdateOracleResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::update_oracle(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateOracleSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.oracle.v1.Msg/SendQueryOracle" => { + #[allow(non_camel_case_types)] + struct SendQueryOracleSvc(pub Arc); + impl tonic::server::UnaryService + for SendQueryOracleSvc + { + type Response = super::MsgSendQueryOracleResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::send_query_oracle(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SendQueryOracleSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "provenance.oracle.v1.Msg"; + } +} diff --git a/packages/provwasm-std/src/types/cosmos/auth/module/mod.rs b/packages/provwasm-std/src/types/provenance/reward/mod.rs similarity index 100% rename from packages/provwasm-std/src/types/cosmos/auth/module/mod.rs rename to packages/provwasm-std/src/types/provenance/reward/mod.rs diff --git a/packages/provwasm-std/src/types/provenance/reward/v1/mod.rs b/packages/provwasm-std/src/types/provenance/reward/v1/mod.rs new file mode 100644 index 00000000..0fab018c --- /dev/null +++ b/packages/provwasm-std/src/types/provenance/reward/v1/mod.rs @@ -0,0 +1,1205 @@ +pub mod tonic; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; +/// RewardProgram +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.RewardProgram")] +pub struct RewardProgram { + /// An integer to uniquely identify the reward program. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub id: u64, + /// Name to help identify the Reward Program.(MaxTitleLength=140) + #[prost(string, tag = "2")] + pub title: ::prost::alloc::string::String, + /// Short summary describing the Reward Program.(MaxDescriptionLength=10000) + #[prost(string, tag = "3")] + pub description: ::prost::alloc::string::String, + /// address that provides funds for the total reward pool. + #[prost(string, tag = "4")] + pub distribute_from_address: ::prost::alloc::string::String, + /// The total amount of funding given to the RewardProgram. + #[prost(message, optional, tag = "5")] + pub total_reward_pool: ::core::option::Option, + /// The remaining funds available to distribute after n claim periods have passed. + #[prost(message, optional, tag = "6")] + pub remaining_pool_balance: + ::core::option::Option, + /// The total amount of all funds claimed by participants for all past claim periods. + #[prost(message, optional, tag = "7")] + pub claimed_amount: ::core::option::Option, + /// Maximum reward per claim period per address. + #[prost(message, optional, tag = "8")] + pub max_reward_by_address: + ::core::option::Option, + /// Minimum amount of coins for a program to rollover. + #[prost(message, optional, tag = "9")] + pub minimum_rollover_amount: + ::core::option::Option, + /// Number of seconds that a claim period lasts. + #[prost(uint64, tag = "10")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub claim_period_seconds: u64, + /// Time that a RewardProgram should start and switch to STARTED state. + #[prost(message, optional, tag = "11")] + pub program_start_time: ::core::option::Option, + /// Time that a RewardProgram is expected to end, based on data when it was setup. + #[prost(message, optional, tag = "12")] + pub expected_program_end_time: ::core::option::Option, + /// Time that a RewardProgram MUST end. + #[prost(message, optional, tag = "13")] + pub program_end_time_max: ::core::option::Option, + /// Used internally to calculate and track the current claim period's ending time. + #[prost(message, optional, tag = "14")] + pub claim_period_end_time: ::core::option::Option, + /// Time the RewardProgram switched to FINISHED state. Initially set as empty. + #[prost(message, optional, tag = "15")] + pub actual_program_end_time: ::core::option::Option, + /// Number of claim periods this program will run for. + #[prost(uint64, tag = "16")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub claim_periods: u64, + /// Current claim period of the RewardProgram. Uses 1-based indexing. + #[prost(uint64, tag = "17")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub current_claim_period: u64, + /// maximum number of claim periods a reward program can rollover. + #[prost(uint64, tag = "18")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub max_rollover_claim_periods: u64, + /// Current state of the RewardProgram. + #[prost(enumeration = "reward_program::State", tag = "19")] + #[serde( + serialize_with = "reward_program::State::serialize", + deserialize_with = "reward_program::State::deserialize" + )] + pub state: i32, + /// Grace period after a RewardProgram FINISHED. It is the number of seconds until a RewardProgram enters the EXPIRED + /// state. + #[prost(uint64, tag = "20")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub expiration_offset: u64, + /// Actions that count towards the reward. + #[prost(message, repeated, tag = "21")] + pub qualifying_actions: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `RewardProgram`. +pub mod reward_program { + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + /// State is the state of the reward program + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] + pub enum State { + /// undefined program state + Unspecified = 0, + /// pending state of reward program + Pending = 1, + /// started state of reward program + Started = 2, + /// finished state of reward program + Finished = 3, + /// expired state of reward program + Expired = 4, + } + impl State { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + State::Unspecified => "STATE_UNSPECIFIED", + State::Pending => "STATE_PENDING", + State::Started => "STATE_STARTED", + State::Finished => "STATE_FINISHED", + State::Expired => "STATE_EXPIRED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "STATE_UNSPECIFIED" => Some(Self::Unspecified), + "STATE_PENDING" => Some(Self::Pending), + "STATE_STARTED" => Some(Self::Started), + "STATE_FINISHED" => Some(Self::Finished), + "STATE_EXPIRED" => Some(Self::Expired), + _ => None, + } + } + } +} +/// ClaimPeriodRewardDistribution, this is updated at the end of every claim period. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.ClaimPeriodRewardDistribution")] +pub struct ClaimPeriodRewardDistribution { + /// The claim period id. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub claim_period_id: u64, + /// The id of the reward program that this reward belongs to. + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub reward_program_id: u64, + /// The sum of all the granted rewards for this claim period. + #[prost(message, optional, tag = "3")] + pub total_rewards_pool_for_claim_period: + ::core::option::Option, + /// The final allocated rewards for this claim period. + #[prost(message, optional, tag = "4")] + pub rewards_pool: ::core::option::Option, + /// The total number of granted shares for this claim period. + #[prost(int64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub total_shares: i64, + /// A flag representing if the claim period for this reward has ended. + #[prost(bool, tag = "6")] + pub claim_period_ended: bool, +} +/// RewardAccountState contains state at the claim period level for a specific address. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.RewardAccountState")] +pub struct RewardAccountState { + /// The id of the reward program that this share belongs to. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub reward_program_id: u64, + /// The id of the claim period that the share belongs to. + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub claim_period_id: u64, + /// Owner of the reward account state. + #[prost(string, tag = "3")] + pub address: ::prost::alloc::string::String, + /// The number of actions performed by this account, mapped by action type. + #[prost(message, repeated, tag = "4")] + pub action_counter: ::prost::alloc::vec::Vec, + /// The amount of granted shares for the address in the reward program's claim period. + #[prost(uint64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub shares_earned: u64, + /// The status of the claim. + #[prost(enumeration = "reward_account_state::ClaimStatus", tag = "6")] + #[serde( + serialize_with = "reward_account_state::ClaimStatus::serialize", + deserialize_with = "reward_account_state::ClaimStatus::deserialize" + )] + pub claim_status: i32, +} +/// Nested message and enum types in `RewardAccountState`. +pub mod reward_account_state { + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + /// ClaimStatus is the state a claim is in + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] + pub enum ClaimStatus { + /// undefined state + Unspecified = 0, + /// unclaimable status + Unclaimable = 1, + /// unclaimable claimable + Claimable = 2, + /// unclaimable claimed + Claimed = 3, + /// unclaimable expired + Expired = 4, + } + impl ClaimStatus { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + ClaimStatus::Unspecified => "CLAIM_STATUS_UNSPECIFIED", + ClaimStatus::Unclaimable => "CLAIM_STATUS_UNCLAIMABLE", + ClaimStatus::Claimable => "CLAIM_STATUS_CLAIMABLE", + ClaimStatus::Claimed => "CLAIM_STATUS_CLAIMED", + ClaimStatus::Expired => "CLAIM_STATUS_EXPIRED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "CLAIM_STATUS_UNSPECIFIED" => Some(Self::Unspecified), + "CLAIM_STATUS_UNCLAIMABLE" => Some(Self::Unclaimable), + "CLAIM_STATUS_CLAIMABLE" => Some(Self::Claimable), + "CLAIM_STATUS_CLAIMED" => Some(Self::Claimed), + "CLAIM_STATUS_EXPIRED" => Some(Self::Expired), + _ => None, + } + } + } +} +/// QualifyingAction can be one of many action types. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.QualifyingAction")] +pub struct QualifyingAction { + /// type of action to process + #[prost(oneof = "qualifying_action::Type", tags = "1, 2, 3")] + pub r#type: ::core::option::Option, +} +/// Nested message and enum types in `QualifyingAction`. +pub mod qualifying_action { + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + /// type of action to process + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive( + Clone, + PartialEq, + Eq, + ::prost::Oneof, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + )] + pub enum Type { + #[prost(message, tag = "1")] + Delegate(super::ActionDelegate), + #[prost(message, tag = "2")] + Transfer(super::ActionTransfer), + #[prost(message, tag = "3")] + Vote(super::ActionVote), + } +} +/// QualifyingActions contains a list of QualifyingActions. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.QualifyingActions")] +pub struct QualifyingActions { + /// The actions that count towards the reward. + #[prost(message, repeated, tag = "1")] + pub qualifying_actions: ::prost::alloc::vec::Vec, +} +/// ActionDelegate represents the delegate action and its required eligibility criteria. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.ActionDelegate")] +pub struct ActionDelegate { + /// Minimum number of successful delegates. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub minimum_actions: u64, + /// Maximum number of successful delegates. + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub maximum_actions: u64, + /// Minimum amount that the user must have currently delegated on the validator. + #[prost(message, optional, tag = "3")] + pub minimum_delegation_amount: + ::core::option::Option, + /// Maximum amount that the user must have currently delegated on the validator. + #[prost(message, optional, tag = "4")] + pub maximum_delegation_amount: + ::core::option::Option, + /// Minimum percentile that can be below the validator's power ranking. + #[prost(string, tag = "5")] + pub minimum_active_stake_percentile: ::prost::alloc::string::String, + /// Maximum percentile that can be below the validator's power ranking. + #[prost(string, tag = "6")] + pub maximum_active_stake_percentile: ::prost::alloc::string::String, +} +/// ActionTransfer represents the transfer action and its required eligibility criteria. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.ActionTransfer")] +pub struct ActionTransfer { + /// Minimum number of successful transfers. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub minimum_actions: u64, + /// Maximum number of successful transfers. + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub maximum_actions: u64, + /// Minimum delegation amount the account must have across all validators, for the transfer action to be counted. + #[prost(message, optional, tag = "3")] + pub minimum_delegation_amount: + ::core::option::Option, +} +/// ActionVote represents the voting action and its required eligibility criteria. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.ActionVote")] +pub struct ActionVote { + /// Minimum number of successful votes. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub minimum_actions: u64, + /// Maximum number of successful votes. + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub maximum_actions: u64, + /// Minimum delegation amount the account must have across all validators, for the vote action to be counted. + #[prost(message, optional, tag = "3")] + pub minimum_delegation_amount: + ::core::option::Option, + /// Positive multiplier that is applied to the shares awarded by the vote action when conditions + /// are met(for now the only condition is the current vote is a validator vote). A value of zero will behave the same + /// as one + #[prost(uint64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub validator_multiplier: u64, +} +/// ActionCounter is a key-value pair that maps action type to the number of times it was performed. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.ActionCounter")] +pub struct ActionCounter { + /// The type of action performed. + #[prost(string, tag = "1")] + pub action_type: ::prost::alloc::string::String, + /// The number of times this action has been performed + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub number_of_actions: u64, +} +/// GenesisState defines the reward module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.GenesisState")] +pub struct GenesisState { + /// Reward program id is the next auto incremented id to be assigned to the next created reward program + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub reward_program_id: u64, + /// Reward programs to initially start with. + #[prost(message, repeated, tag = "2")] + pub reward_programs: ::prost::alloc::vec::Vec, + /// Claim period reward distributions to initially start with. + #[prost(message, repeated, tag = "3")] + pub claim_period_reward_distributions: ::prost::alloc::vec::Vec, + /// Reward account states to initially start with. + #[prost(message, repeated, tag = "4")] + pub reward_account_states: ::prost::alloc::vec::Vec, +} +/// QueryRewardProgramByIDRequest queries for the Reward Program with an identifier of id +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.QueryRewardProgramByIDRequest")] +#[proto_query( + path = "/provenance.reward.v1.Query/RewardProgramByID", + response_type = QueryRewardProgramByIdResponse +)] +pub struct QueryRewardProgramByIdRequest { + /// The id of the reward program to query. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub id: u64, +} +/// QueryRewardProgramByIDResponse contains the requested RewardProgram +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.QueryRewardProgramByIDResponse")] +pub struct QueryRewardProgramByIdResponse { + /// The reward program object that was queried for. + #[prost(message, optional, tag = "1")] + pub reward_program: ::core::option::Option, +} +/// QueryRewardProgramsRequest queries for all reward programs matching the query_type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.QueryRewardProgramsRequest")] +#[proto_query( + path = "/provenance.reward.v1.Query/RewardPrograms", + response_type = QueryRewardProgramsResponse +)] +pub struct QueryRewardProgramsRequest { + /// A filter on the types of reward programs. + #[prost(enumeration = "query_reward_programs_request::QueryType", tag = "1")] + #[serde( + serialize_with = "query_reward_programs_request::QueryType::serialize", + deserialize_with = "query_reward_programs_request::QueryType::deserialize" + )] + pub query_type: i32, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// Nested message and enum types in `QueryRewardProgramsRequest`. +pub mod query_reward_programs_request { + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + /// QueryType is the state of reward program to query + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] + pub enum QueryType { + /// unspecified type + Unspecified = 0, + /// all reward programs states + All = 1, + /// pending reward program state= + Pending = 2, + /// active reward program state + Active = 3, + /// pending and active reward program states + Outstanding = 4, + /// finished reward program state + Finished = 5, + } + impl QueryType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + QueryType::Unspecified => "QUERY_TYPE_UNSPECIFIED", + QueryType::All => "QUERY_TYPE_ALL", + QueryType::Pending => "QUERY_TYPE_PENDING", + QueryType::Active => "QUERY_TYPE_ACTIVE", + QueryType::Outstanding => "QUERY_TYPE_OUTSTANDING", + QueryType::Finished => "QUERY_TYPE_FINISHED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "QUERY_TYPE_UNSPECIFIED" => Some(Self::Unspecified), + "QUERY_TYPE_ALL" => Some(Self::All), + "QUERY_TYPE_PENDING" => Some(Self::Pending), + "QUERY_TYPE_ACTIVE" => Some(Self::Active), + "QUERY_TYPE_OUTSTANDING" => Some(Self::Outstanding), + "QUERY_TYPE_FINISHED" => Some(Self::Finished), + _ => None, + } + } + } +} +/// QueryRewardProgramsResponse contains the list of RewardPrograms matching the query +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.QueryRewardProgramsResponse")] +pub struct QueryRewardProgramsResponse { + /// List of RewardProgram objects matching the query_type. + #[prost(message, repeated, tag = "1")] + pub reward_programs: ::prost::alloc::vec::Vec, + /// pagination defines an optional pagination for the response. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// QueryClaimPeriodRewardDistributionsRequest queries for all the ClaimPeriodRewardDistributions with pagination. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.QueryClaimPeriodRewardDistributionsRequest")] +#[proto_query( + path = "/provenance.reward.v1.Query/ClaimPeriodRewardDistributions", + response_type = QueryClaimPeriodRewardDistributionsResponse +)] +pub struct QueryClaimPeriodRewardDistributionsRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// QueryClaimPeriodRewardDistributionsResponse returns the list of paginated ClaimPeriodRewardDistributions +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.QueryClaimPeriodRewardDistributionsResponse")] +pub struct QueryClaimPeriodRewardDistributionsResponse { + /// List of all ClaimPeriodRewardDistribution objects queried for. + #[prost(message, repeated, tag = "1")] + pub claim_period_reward_distributions: ::prost::alloc::vec::Vec, + /// pagination defines an optional pagination for the response. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// QueryClaimPeriodRewardDistributionsByIDRequest queries for a single ClaimPeriodRewardDistribution +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.QueryClaimPeriodRewardDistributionsByIDRequest")] +#[proto_query( + path = "/provenance.reward.v1.Query/ClaimPeriodRewardDistributionsByID", + response_type = QueryClaimPeriodRewardDistributionsByIdResponse +)] +pub struct QueryClaimPeriodRewardDistributionsByIdRequest { + /// The reward program that the claim period reward distribution belongs to. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub reward_id: u64, + /// The claim period that the claim period reward distribution was created for. + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub claim_period_id: u64, +} +/// QueryClaimPeriodRewardDistributionsByIDResponse returns the requested ClaimPeriodRewardDistribution +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.QueryClaimPeriodRewardDistributionsByIDResponse")] +pub struct QueryClaimPeriodRewardDistributionsByIdResponse { + /// The ClaimPeriodRewardDistribution object that was queried for. + #[prost(message, optional, tag = "1")] + pub claim_period_reward_distribution: ::core::option::Option, +} +/// QueryRewardDistributionsByAddressRequest queries for reward claims by address that match the claim_status. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.QueryRewardDistributionsByAddressRequest")] +#[proto_query( + path = "/provenance.reward.v1.Query/RewardDistributionsByAddress", + response_type = QueryRewardDistributionsByAddressResponse +)] +pub struct QueryRewardDistributionsByAddressRequest { + /// The address that the claim belongs to. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// The status that the reward account must have. + #[prost(enumeration = "reward_account_state::ClaimStatus", tag = "2")] + #[serde( + serialize_with = "reward_account_state::ClaimStatus::serialize", + deserialize_with = "reward_account_state::ClaimStatus::deserialize" + )] + pub claim_status: i32, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// QueryRewardDistributionsByAddressResponse returns the reward claims for an address that match the claim_status. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.QueryRewardDistributionsByAddressResponse")] +pub struct QueryRewardDistributionsByAddressResponse { + /// The address that the reward account belongs to. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// List of RewardAccounts queried for. + #[prost(message, repeated, tag = "2")] + pub reward_account_state: ::prost::alloc::vec::Vec, + /// pagination defines an optional pagination for the response. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// RewardAccountResponse is an address' reward claim for a reward program's claim period. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.RewardAccountResponse")] +pub struct RewardAccountResponse { + /// The id of the reward program that this claim belongs to. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub reward_program_id: u64, + /// total rewards claimed for all eligible claim periods in program. + #[prost(message, optional, tag = "2")] + pub total_reward_claim: + ::core::option::Option, + /// The status of the claim. + #[prost(enumeration = "reward_account_state::ClaimStatus", tag = "3")] + #[serde( + serialize_with = "reward_account_state::ClaimStatus::serialize", + deserialize_with = "reward_account_state::ClaimStatus::deserialize" + )] + pub claim_status: i32, + /// The claim period that the claim belongs to. + #[prost(uint64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub claim_id: u64, +} +/// MsgCreateRewardProgramRequest is the request type for creating a reward program RPC +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.MsgCreateRewardProgramRequest")] +pub struct MsgCreateRewardProgramRequest { + /// title for the reward program. + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + /// description for the reward program. + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// provider address for the reward program funds and signer of message. + #[prost(string, tag = "3")] + pub distribute_from_address: ::prost::alloc::string::String, + /// total reward pool for the reward program. + #[prost(message, optional, tag = "4")] + pub total_reward_pool: ::core::option::Option, + /// maximum amount of funds an address can be rewarded per claim period. + #[prost(message, optional, tag = "5")] + pub max_reward_per_claim_address: + ::core::option::Option, + /// start time of the reward program. + #[prost(message, optional, tag = "6")] + pub program_start_time: ::core::option::Option, + /// number of claim periods the reward program runs for. + #[prost(uint64, tag = "7")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub claim_periods: u64, + /// number of days a claim period will exist. + #[prost(uint64, tag = "8")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub claim_period_days: u64, + /// maximum number of claim periods a reward program can rollover. + #[prost(uint64, tag = "9")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub max_rollover_claim_periods: u64, + /// number of days before a reward program will expire after it has ended. + #[prost(uint64, tag = "10")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub expire_days: u64, + /// actions that count towards the reward. + #[prost(message, repeated, tag = "11")] + pub qualifying_actions: ::prost::alloc::vec::Vec, +} +/// MsgCreateRewardProgramResponse is the response type for creating a reward program RPC +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.MsgCreateRewardProgramResponse")] +pub struct MsgCreateRewardProgramResponse { + /// reward program id that is generated on creation. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub id: u64, +} +/// MsgEndRewardProgramRequest is the request type for ending a reward program RPC +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.MsgEndRewardProgramRequest")] +pub struct MsgEndRewardProgramRequest { + /// reward program id to end. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub reward_program_id: u64, + /// owner of the reward program that funds were distributed from. + #[prost(string, tag = "2")] + pub program_owner_address: ::prost::alloc::string::String, +} +/// MsgEndRewardProgramResponse is the response type for ending a reward program RPC +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.MsgEndRewardProgramResponse")] +pub struct MsgEndRewardProgramResponse {} +/// MsgClaimRewardsRequest is the request type for claiming reward from reward program RPC +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.MsgClaimRewardsRequest")] +pub struct MsgClaimRewardsRequest { + /// reward program id to claim rewards. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub reward_program_id: u64, + /// reward address and signer of msg to send claimed rewards to. + #[prost(string, tag = "2")] + pub reward_address: ::prost::alloc::string::String, +} +/// MsgClaimRewardsResponse is the response type for claiming reward from reward program RPC +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.MsgClaimRewardsResponse")] +pub struct MsgClaimRewardsResponse { + /// details about acquired rewards from reward program. + #[prost(message, optional, tag = "1")] + pub claim_details: ::core::option::Option, +} +/// MsgClaimRewardsResponse is the request type for claiming rewards from all reward programs RPC +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.MsgClaimAllRewardsRequest")] +pub struct MsgClaimAllRewardsRequest { + /// reward address and signer of msg to send claimed rewards to. + #[prost(string, tag = "1")] + pub reward_address: ::prost::alloc::string::String, +} +/// MsgClaimRewardsResponse is the response type for claiming rewards from all reward programs RPC +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.MsgClaimAllRewardsResponse")] +pub struct MsgClaimAllRewardsResponse { + /// total rewards claimed for all eligible claim periods in all programs. + #[prost(message, repeated, tag = "1")] + pub total_reward_claim: + ::prost::alloc::vec::Vec, + /// details about acquired rewards from a reward program. + #[prost(message, repeated, tag = "2")] + pub claim_details: ::prost::alloc::vec::Vec, +} +/// ClaimedRewardPeriodDetail is information regarding an addresses' shares and reward for a claim period. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.ClaimedRewardPeriodDetail")] +pub struct ClaimedRewardPeriodDetail { + /// claim period id + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub claim_period_id: u64, + /// total shares accumulated for claim period + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub total_shares: u64, + /// total rewards for claim period + #[prost(message, optional, tag = "3")] + pub claim_period_reward: + ::core::option::Option, +} +/// RewardProgramClaimDetail is the response object regarding an address's shares and reward for a reward program. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.reward.v1.RewardProgramClaimDetail")] +pub struct RewardProgramClaimDetail { + /// reward program id. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub reward_program_id: u64, + /// total rewards claimed for all eligible claim periods in program. + #[prost(message, optional, tag = "2")] + pub total_reward_claim: + ::core::option::Option, + /// claim period details. + #[prost(message, repeated, tag = "3")] + pub claimed_reward_period_details: ::prost::alloc::vec::Vec, +} +include!("provenance.reward.v1.tonic.rs"); +pub struct RewardQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> RewardQuerier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn reward_program_by_id( + &self, + id: u64, + ) -> Result { + QueryRewardProgramByIdRequest { id }.query(self.querier) + } + pub fn reward_programs( + &self, + query_type: i32, + pagination: ::core::option::Option< + super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryRewardProgramsRequest { + query_type, + pagination, + } + .query(self.querier) + } + pub fn claim_period_reward_distributions( + &self, + pagination: ::core::option::Option< + super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryClaimPeriodRewardDistributionsRequest { pagination }.query(self.querier) + } + pub fn claim_period_reward_distributions_by_id( + &self, + reward_id: u64, + claim_period_id: u64, + ) -> Result { + QueryClaimPeriodRewardDistributionsByIdRequest { + reward_id, + claim_period_id, + } + .query(self.querier) + } + pub fn reward_distributions_by_address( + &self, + address: ::prost::alloc::string::String, + claim_status: i32, + pagination: ::core::option::Option< + super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryRewardDistributionsByAddressRequest { + address, + claim_status, + pagination, + } + .query(self.querier) + } +} diff --git a/packages/provwasm-std/src/types/provenance/reward/v1/tonic.rs b/packages/provwasm-std/src/types/provenance/reward/v1/tonic.rs new file mode 100644 index 00000000..7c1662ca --- /dev/null +++ b/packages/provwasm-std/src/types/provenance/reward/v1/tonic.rs @@ -0,0 +1,1039 @@ +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; +/// 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 provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + 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 the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn reward_program_by_id( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.reward.v1.Query/RewardProgramByID", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.reward.v1.Query", + "RewardProgramByID", + )); + self.inner.unary(req, path, codec).await + } + pub async fn reward_programs( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.reward.v1.Query/RewardPrograms"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.reward.v1.Query", + "RewardPrograms", + )); + self.inner.unary(req, path, codec).await + } + pub async fn claim_period_reward_distributions( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.reward.v1.Query/ClaimPeriodRewardDistributions", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.reward.v1.Query", + "ClaimPeriodRewardDistributions", + )); + self.inner.unary(req, path, codec).await + } + pub async fn claim_period_reward_distributions_by_id( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.reward.v1.Query/ClaimPeriodRewardDistributionsByID", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.reward.v1.Query", + "ClaimPeriodRewardDistributionsByID", + )); + self.inner.unary(req, path, codec).await + } + pub async fn reward_distributions_by_address( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.reward.v1.Query/RewardDistributionsByAddress", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.reward.v1.Query", + "RewardDistributionsByAddress", + )); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + async fn reward_program_by_id( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn reward_programs( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn claim_period_reward_distributions( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn claim_period_reward_distributions_by_id( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn reward_distributions_by_address( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/provenance.reward.v1.Query/RewardProgramByID" => { + #[allow(non_camel_case_types)] + struct RewardProgramByIDSvc(pub Arc); + impl tonic::server::UnaryService + for RewardProgramByIDSvc + { + type Response = super::QueryRewardProgramByIdResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::reward_program_by_id(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = RewardProgramByIDSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.reward.v1.Query/RewardPrograms" => { + #[allow(non_camel_case_types)] + struct RewardProgramsSvc(pub Arc); + impl tonic::server::UnaryService + for RewardProgramsSvc + { + type Response = super::QueryRewardProgramsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::reward_programs(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = RewardProgramsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.reward.v1.Query/ClaimPeriodRewardDistributions" => { + #[allow(non_camel_case_types)] + struct ClaimPeriodRewardDistributionsSvc(pub Arc); + impl + tonic::server::UnaryService< + super::QueryClaimPeriodRewardDistributionsRequest, + > for ClaimPeriodRewardDistributionsSvc + { + type Response = super::QueryClaimPeriodRewardDistributionsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request< + super::QueryClaimPeriodRewardDistributionsRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::claim_period_reward_distributions(&inner, request) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ClaimPeriodRewardDistributionsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.reward.v1.Query/ClaimPeriodRewardDistributionsByID" => { + #[allow(non_camel_case_types)] + struct ClaimPeriodRewardDistributionsByIDSvc(pub Arc); + impl + tonic::server::UnaryService< + super::QueryClaimPeriodRewardDistributionsByIdRequest, + > for ClaimPeriodRewardDistributionsByIDSvc + { + type Response = super::QueryClaimPeriodRewardDistributionsByIdResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request< + super::QueryClaimPeriodRewardDistributionsByIdRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::claim_period_reward_distributions_by_id( + &inner, request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ClaimPeriodRewardDistributionsByIDSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.reward.v1.Query/RewardDistributionsByAddress" => { + #[allow(non_camel_case_types)] + struct RewardDistributionsByAddressSvc(pub Arc); + impl + tonic::server::UnaryService + for RewardDistributionsByAddressSvc + { + type Response = super::QueryRewardDistributionsByAddressResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request< + super::QueryRewardDistributionsByAddressRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::reward_distributions_by_address(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = RewardDistributionsByAddressSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "provenance.reward.v1.Query"; + } +} +/// 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 provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + 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 the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn create_reward_program( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/provenance.reward.v1.Msg/CreateRewardProgram", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.reward.v1.Msg", + "CreateRewardProgram", + )); + self.inner.unary(req, path, codec).await + } + pub async fn end_reward_program( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.reward.v1.Msg/EndRewardProgram"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.reward.v1.Msg", + "EndRewardProgram", + )); + self.inner.unary(req, path, codec).await + } + pub async fn claim_rewards( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.reward.v1.Msg/ClaimRewards"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.reward.v1.Msg", "ClaimRewards")); + self.inner.unary(req, path, codec).await + } + pub async fn claim_all_rewards( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.reward.v1.Msg/ClaimAllRewards"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.reward.v1.Msg", + "ClaimAllRewards", + )); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + async fn create_reward_program( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn end_reward_program( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn claim_rewards( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn claim_all_rewards( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/provenance.reward.v1.Msg/CreateRewardProgram" => { + #[allow(non_camel_case_types)] + struct CreateRewardProgramSvc(pub Arc); + impl tonic::server::UnaryService + for CreateRewardProgramSvc + { + type Response = super::MsgCreateRewardProgramResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::create_reward_program(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CreateRewardProgramSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.reward.v1.Msg/EndRewardProgram" => { + #[allow(non_camel_case_types)] + struct EndRewardProgramSvc(pub Arc); + impl tonic::server::UnaryService + for EndRewardProgramSvc + { + type Response = super::MsgEndRewardProgramResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::end_reward_program(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = EndRewardProgramSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.reward.v1.Msg/ClaimRewards" => { + #[allow(non_camel_case_types)] + struct ClaimRewardsSvc(pub Arc); + impl tonic::server::UnaryService for ClaimRewardsSvc { + type Response = super::MsgClaimRewardsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::claim_rewards(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ClaimRewardsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.reward.v1.Msg/ClaimAllRewards" => { + #[allow(non_camel_case_types)] + struct ClaimAllRewardsSvc(pub Arc); + impl tonic::server::UnaryService + for ClaimAllRewardsSvc + { + type Response = super::MsgClaimAllRewardsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::claim_all_rewards(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ClaimAllRewardsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "provenance.reward.v1.Msg"; + } +} diff --git a/packages/provwasm-std/src/types/provenance/trigger/v1.rs b/packages/provwasm-std/src/types/provenance/trigger/v1/mod.rs similarity index 99% rename from packages/provwasm-std/src/types/provenance/trigger/v1.rs rename to packages/provwasm-std/src/types/provenance/trigger/v1/mod.rs index d8ddcd03..e617805b 100644 --- a/packages/provwasm-std/src/types/provenance/trigger/v1.rs +++ b/packages/provwasm-std/src/types/provenance/trigger/v1/mod.rs @@ -1,3 +1,4 @@ +pub mod tonic; use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// EventTriggerCreated is an event for when a trigger is created #[allow(clippy::derive_partial_eq_without_eq)] @@ -459,6 +460,7 @@ pub struct MsgDestroyTriggerRequest { )] #[proto_message(type_url = "/provenance.trigger.v1.MsgDestroyTriggerResponse")] pub struct MsgDestroyTriggerResponse {} +include!("provenance.trigger.v1.tonic.rs"); pub struct TriggerQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } diff --git a/packages/provwasm-std/src/types/provenance/trigger/v1/tonic.rs b/packages/provwasm-std/src/types/provenance/trigger/v1/tonic.rs new file mode 100644 index 00000000..45c7f4c7 --- /dev/null +++ b/packages/provwasm-std/src/types/provenance/trigger/v1/tonic.rs @@ -0,0 +1,651 @@ +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; +/// 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 provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + 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 the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn trigger_by_id( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.trigger.v1.Query/TriggerByID"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.trigger.v1.Query", + "TriggerByID", + )); + self.inner.unary(req, path, codec).await + } + pub async fn triggers( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.trigger.v1.Query/Triggers"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("provenance.trigger.v1.Query", "Triggers")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + async fn trigger_by_id( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn triggers( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/provenance.trigger.v1.Query/TriggerByID" => { + #[allow(non_camel_case_types)] + struct TriggerByIDSvc(pub Arc); + impl tonic::server::UnaryService for TriggerByIDSvc { + type Response = super::QueryTriggerByIdResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::trigger_by_id(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = TriggerByIDSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.trigger.v1.Query/Triggers" => { + #[allow(non_camel_case_types)] + struct TriggersSvc(pub Arc); + impl tonic::server::UnaryService for TriggersSvc { + type Response = super::QueryTriggersResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { ::triggers(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = TriggersSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "provenance.trigger.v1.Query"; + } +} +/// 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 provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + 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 the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn create_trigger( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.trigger.v1.Msg/CreateTrigger"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.trigger.v1.Msg", + "CreateTrigger", + )); + self.inner.unary(req, path, codec).await + } + pub async fn destroy_trigger( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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("/provenance.trigger.v1.Msg/DestroyTrigger"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "provenance.trigger.v1.Msg", + "DestroyTrigger", + )); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + async fn create_trigger( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn destroy_trigger( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/provenance.trigger.v1.Msg/CreateTrigger" => { + #[allow(non_camel_case_types)] + struct CreateTriggerSvc(pub Arc); + impl tonic::server::UnaryService for CreateTriggerSvc { + type Response = super::MsgCreateTriggerResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::create_trigger(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CreateTriggerSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/provenance.trigger.v1.Msg/DestroyTrigger" => { + #[allow(non_camel_case_types)] + struct DestroyTriggerSvc(pub Arc); + impl tonic::server::UnaryService for DestroyTriggerSvc { + type Response = super::MsgDestroyTriggerResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { ::destroy_trigger(&inner, request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DestroyTriggerSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "provenance.trigger.v1.Msg"; + } +} diff --git a/packages/provwasm-std/src/types/tendermint/abci.rs b/packages/provwasm-std/src/types/tendermint/abci.rs index 3540ff93..6d3ef936 100644 --- a/packages/provwasm-std/src/types/tendermint/abci.rs +++ b/packages/provwasm-std/src/types/tendermint/abci.rs @@ -14,7 +14,7 @@ use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; pub struct Request { #[prost( oneof = "request::Value", - tags = "1, 2, 3, 5, 6, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20" + tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15" )] pub value: ::core::option::Option, } @@ -38,12 +38,20 @@ pub mod request { Flush(super::RequestFlush), #[prost(message, tag = "3")] Info(super::RequestInfo), + #[prost(message, tag = "4")] + SetOption(super::RequestSetOption), #[prost(message, tag = "5")] InitChain(super::RequestInitChain), #[prost(message, tag = "6")] Query(super::RequestQuery), + #[prost(message, tag = "7")] + BeginBlock(super::RequestBeginBlock), #[prost(message, tag = "8")] CheckTx(super::RequestCheckTx), + #[prost(message, tag = "9")] + DeliverTx(super::RequestDeliverTx), + #[prost(message, tag = "10")] + EndBlock(super::RequestEndBlock), #[prost(message, tag = "11")] Commit(super::RequestCommit), #[prost(message, tag = "12")] @@ -54,16 +62,6 @@ pub mod request { LoadSnapshotChunk(super::RequestLoadSnapshotChunk), #[prost(message, tag = "15")] ApplySnapshotChunk(super::RequestApplySnapshotChunk), - #[prost(message, tag = "16")] - PrepareProposal(super::RequestPrepareProposal), - #[prost(message, tag = "17")] - ProcessProposal(super::RequestProcessProposal), - #[prost(message, tag = "18")] - ExtendVote(super::RequestExtendVote), - #[prost(message, tag = "19")] - VerifyVoteExtension(super::RequestVerifyVoteExtension), - #[prost(message, tag = "20")] - FinalizeBlock(super::RequestFinalizeBlock), } } #[allow(clippy::derive_partial_eq_without_eq)] @@ -122,8 +120,25 @@ pub struct RequestInfo { deserialize_with = "crate::serde::as_str::deserialize" )] pub p2p_version: u64, - #[prost(string, tag = "4")] - pub abci_version: ::prost::alloc::string::String, +} +/// nondeterministic +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.RequestSetOption")] +pub struct RequestSetOption { + #[prost(string, tag = "1")] + pub key: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub value: ::prost::alloc::string::String, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -143,7 +158,7 @@ pub struct RequestInitChain { #[prost(string, tag = "2")] pub chain_id: ::prost::alloc::string::String, #[prost(message, optional, tag = "3")] - pub consensus_params: ::core::option::Option, + pub consensus_params: ::core::option::Option, #[prost(message, repeated, tag = "4")] pub validators: ::prost::alloc::vec::Vec, #[prost(bytes = "vec", tag = "5")] @@ -200,20 +215,20 @@ pub struct RequestQuery { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/tendermint.abci.RequestCheckTx")] -pub struct RequestCheckTx { +#[proto_message(type_url = "/tendermint.abci.RequestBeginBlock")] +pub struct RequestBeginBlock { #[prost(bytes = "vec", tag = "1")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] - pub tx: ::prost::alloc::vec::Vec, - #[prost(enumeration = "CheckTxType", tag = "2")] - #[serde( - serialize_with = "CheckTxType::serialize", - deserialize_with = "CheckTxType::deserialize" - )] - pub r#type: i32, + pub hash: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub header: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub last_commit_info: ::core::option::Option, + #[prost(message, repeated, tag = "4")] + pub byzantine_validators: ::prost::alloc::vec::Vec, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -226,48 +241,21 @@ pub struct RequestCheckTx { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/tendermint.abci.RequestCommit")] -pub struct RequestCommit {} -/// lists available snapshots -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/tendermint.abci.RequestListSnapshots")] -pub struct RequestListSnapshots {} -/// offers a snapshot to the application -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/tendermint.abci.RequestOfferSnapshot")] -pub struct RequestOfferSnapshot { - /// snapshot offered by peers - #[prost(message, optional, tag = "1")] - pub snapshot: ::core::option::Option, - /// light client-verified app hash for snapshot height - #[prost(bytes = "vec", tag = "2")] +#[proto_message(type_url = "/tendermint.abci.RequestCheckTx")] +pub struct RequestCheckTx { + #[prost(bytes = "vec", tag = "1")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] - pub app_hash: ::prost::alloc::vec::Vec, + pub tx: ::prost::alloc::vec::Vec, + #[prost(enumeration = "CheckTxType", tag = "2")] + #[serde( + serialize_with = "CheckTxType::serialize", + deserialize_with = "CheckTxType::deserialize" + )] + pub r#type: i32, } -/// loads a snapshot chunk #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -279,20 +267,15 @@ pub struct RequestOfferSnapshot { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/tendermint.abci.RequestLoadSnapshotChunk")] -pub struct RequestLoadSnapshotChunk { - #[prost(uint64, tag = "1")] +#[proto_message(type_url = "/tendermint.abci.RequestDeliverTx")] +pub struct RequestDeliverTx { + #[prost(bytes = "vec", tag = "1")] #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] - pub height: u64, - #[prost(uint32, tag = "2")] - pub format: u32, - #[prost(uint32, tag = "3")] - pub chunk: u32, + pub tx: ::prost::alloc::vec::Vec, } -/// Applies a snapshot chunk #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -304,18 +287,14 @@ pub struct RequestLoadSnapshotChunk { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/tendermint.abci.RequestApplySnapshotChunk")] -pub struct RequestApplySnapshotChunk { - #[prost(uint32, tag = "1")] - pub index: u32, - #[prost(bytes = "vec", tag = "2")] +#[proto_message(type_url = "/tendermint.abci.RequestEndBlock")] +pub struct RequestEndBlock { + #[prost(int64, tag = "1")] #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" )] - pub chunk: ::prost::alloc::vec::Vec, - #[prost(string, tag = "3")] - pub sender: ::prost::alloc::string::String, + pub height: i64, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -328,45 +307,9 @@ pub struct RequestApplySnapshotChunk { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/tendermint.abci.RequestPrepareProposal")] -pub struct RequestPrepareProposal { - /// the modified transactions cannot exceed this size. - #[prost(int64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub max_tx_bytes: i64, - /// txs is an array of transactions that will be included in a block, - /// sent to the app for possible modifications. - #[prost(bytes = "vec", repeated, tag = "2")] - pub txs: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, - #[prost(message, optional, tag = "3")] - pub local_last_commit: ::core::option::Option, - #[prost(message, repeated, tag = "4")] - pub misbehavior: ::prost::alloc::vec::Vec, - #[prost(int64, tag = "5")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub height: i64, - #[prost(message, optional, tag = "6")] - pub time: ::core::option::Option, - #[prost(bytes = "vec", tag = "7")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub next_validators_hash: ::prost::alloc::vec::Vec, - /// address of the public key of the validator proposing the block. - #[prost(bytes = "vec", tag = "8")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub proposer_address: ::prost::alloc::vec::Vec, -} +#[proto_message(type_url = "/tendermint.abci.RequestCommit")] +pub struct RequestCommit {} +/// lists available snapshots #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -378,44 +321,9 @@ pub struct RequestPrepareProposal { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/tendermint.abci.RequestProcessProposal")] -pub struct RequestProcessProposal { - #[prost(bytes = "vec", repeated, tag = "1")] - pub txs: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, - #[prost(message, optional, tag = "2")] - pub proposed_last_commit: ::core::option::Option, - #[prost(message, repeated, tag = "3")] - pub misbehavior: ::prost::alloc::vec::Vec, - /// hash is the merkle root hash of the fields of the proposed block. - #[prost(bytes = "vec", tag = "4")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub hash: ::prost::alloc::vec::Vec, - #[prost(int64, tag = "5")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub height: i64, - #[prost(message, optional, tag = "6")] - pub time: ::core::option::Option, - #[prost(bytes = "vec", tag = "7")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub next_validators_hash: ::prost::alloc::vec::Vec, - /// address of the public key of the original proposer of the block. - #[prost(bytes = "vec", tag = "8")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub proposer_address: ::prost::alloc::vec::Vec, -} -/// Extends a vote with application-injected data +#[proto_message(type_url = "/tendermint.abci.RequestListSnapshots")] +pub struct RequestListSnapshots {} +/// offers a snapshot to the application #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -427,46 +335,20 @@ pub struct RequestProcessProposal { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/tendermint.abci.RequestExtendVote")] -pub struct RequestExtendVote { - /// the hash of the block that this vote may be referring to - #[prost(bytes = "vec", tag = "1")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub hash: ::prost::alloc::vec::Vec, - /// the height of the extended vote - #[prost(int64, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub height: i64, - /// info of the block that this vote may be referring to - #[prost(message, optional, tag = "3")] - pub time: ::core::option::Option, - #[prost(bytes = "vec", repeated, tag = "4")] - pub txs: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, - #[prost(message, optional, tag = "5")] - pub proposed_last_commit: ::core::option::Option, - #[prost(message, repeated, tag = "6")] - pub misbehavior: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "7")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub next_validators_hash: ::prost::alloc::vec::Vec, - /// address of the public key of the original proposer of the block. - #[prost(bytes = "vec", tag = "8")] +#[proto_message(type_url = "/tendermint.abci.RequestOfferSnapshot")] +pub struct RequestOfferSnapshot { + /// snapshot offered by peers + #[prost(message, optional, tag = "1")] + pub snapshot: ::core::option::Option, + /// light client-verified app hash for snapshot height + #[prost(bytes = "vec", tag = "2")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] - pub proposer_address: ::prost::alloc::vec::Vec, + pub app_hash: ::prost::alloc::vec::Vec, } -/// Verify the vote extension +/// loads a snapshot chunk #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -478,35 +360,20 @@ pub struct RequestExtendVote { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/tendermint.abci.RequestVerifyVoteExtension")] -pub struct RequestVerifyVoteExtension { - /// the hash of the block that this received vote corresponds to - #[prost(bytes = "vec", tag = "1")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub hash: ::prost::alloc::vec::Vec, - /// the validator that signed the vote extension - #[prost(bytes = "vec", tag = "2")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub validator_address: ::prost::alloc::vec::Vec, - #[prost(int64, tag = "3")] +#[proto_message(type_url = "/tendermint.abci.RequestLoadSnapshotChunk")] +pub struct RequestLoadSnapshotChunk { + #[prost(uint64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] - pub height: i64, - #[prost(bytes = "vec", tag = "4")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub vote_extension: ::prost::alloc::vec::Vec, + pub height: u64, + #[prost(uint32, tag = "2")] + pub format: u32, + #[prost(uint32, tag = "3")] + pub chunk: u32, } +/// Applies a snapshot chunk #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -518,42 +385,18 @@ pub struct RequestVerifyVoteExtension { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/tendermint.abci.RequestFinalizeBlock")] -pub struct RequestFinalizeBlock { - #[prost(bytes = "vec", repeated, tag = "1")] - pub txs: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, - #[prost(message, optional, tag = "2")] - pub decided_last_commit: ::core::option::Option, - #[prost(message, repeated, tag = "3")] - pub misbehavior: ::prost::alloc::vec::Vec, - /// hash is the merkle root hash of the fields of the decided block. - #[prost(bytes = "vec", tag = "4")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub hash: ::prost::alloc::vec::Vec, - #[prost(int64, tag = "5")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub height: i64, - #[prost(message, optional, tag = "6")] - pub time: ::core::option::Option, - #[prost(bytes = "vec", tag = "7")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub next_validators_hash: ::prost::alloc::vec::Vec, - /// proposer_address is the address of the public key of the original proposer of the block. - #[prost(bytes = "vec", tag = "8")] +#[proto_message(type_url = "/tendermint.abci.RequestApplySnapshotChunk")] +pub struct RequestApplySnapshotChunk { + #[prost(uint32, tag = "1")] + pub index: u32, + #[prost(bytes = "vec", tag = "2")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] - pub proposer_address: ::prost::alloc::vec::Vec, + pub chunk: ::prost::alloc::vec::Vec, + #[prost(string, tag = "3")] + pub sender: ::prost::alloc::string::String, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -570,7 +413,7 @@ pub struct RequestFinalizeBlock { pub struct Response { #[prost( oneof = "response::Value", - tags = "1, 2, 3, 4, 6, 7, 9, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21" + tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16" )] pub value: ::core::option::Option, } @@ -596,12 +439,20 @@ pub mod response { Flush(super::ResponseFlush), #[prost(message, tag = "4")] Info(super::ResponseInfo), + #[prost(message, tag = "5")] + SetOption(super::ResponseSetOption), #[prost(message, tag = "6")] InitChain(super::ResponseInitChain), #[prost(message, tag = "7")] Query(super::ResponseQuery), + #[prost(message, tag = "8")] + BeginBlock(super::ResponseBeginBlock), #[prost(message, tag = "9")] CheckTx(super::ResponseCheckTx), + #[prost(message, tag = "10")] + DeliverTx(super::ResponseDeliverTx), + #[prost(message, tag = "11")] + EndBlock(super::ResponseEndBlock), #[prost(message, tag = "12")] Commit(super::ResponseCommit), #[prost(message, tag = "13")] @@ -612,16 +463,6 @@ pub mod response { LoadSnapshotChunk(super::ResponseLoadSnapshotChunk), #[prost(message, tag = "16")] ApplySnapshotChunk(super::ResponseApplySnapshotChunk), - #[prost(message, tag = "17")] - PrepareProposal(super::ResponsePrepareProposal), - #[prost(message, tag = "18")] - ProcessProposal(super::ResponseProcessProposal), - #[prost(message, tag = "19")] - ExtendVote(super::ResponseExtendVote), - #[prost(message, tag = "20")] - VerifyVoteExtension(super::ResponseVerifyVoteExtension), - #[prost(message, tag = "21")] - FinalizeBlock(super::ResponseFinalizeBlock), } } /// nondeterministic @@ -706,6 +547,28 @@ pub struct ResponseInfo { )] pub last_block_app_hash: ::prost::alloc::vec::Vec, } +/// nondeterministic +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.ResponseSetOption")] +pub struct ResponseSetOption { + #[prost(uint32, tag = "1")] + pub code: u32, + /// bytes data = 2; + #[prost(string, tag = "3")] + pub log: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub info: ::prost::alloc::string::String, +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -720,7 +583,7 @@ pub struct ResponseInfo { #[proto_message(type_url = "/tendermint.abci.ResponseInitChain")] pub struct ResponseInitChain { #[prost(message, optional, tag = "1")] - pub consensus_params: ::core::option::Option, + pub consensus_params: ::core::option::Option, #[prost(message, repeated, tag = "2")] pub validators: ::prost::alloc::vec::Vec, #[prost(bytes = "vec", tag = "3")] @@ -770,17 +633,89 @@ pub struct ResponseQuery { serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] - pub value: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "8")] - pub proof_ops: ::core::option::Option, - #[prost(int64, tag = "9")] + pub value: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "8")] + pub proof_ops: ::core::option::Option, + #[prost(int64, tag = "9")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + #[prost(string, tag = "10")] + pub codespace: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.ResponseBeginBlock")] +pub struct ResponseBeginBlock { + #[prost(message, repeated, tag = "1")] + pub events: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.ResponseCheckTx")] +pub struct ResponseCheckTx { + #[prost(uint32, tag = "1")] + pub code: u32, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, + /// nondeterministic + #[prost(string, tag = "3")] + pub log: ::prost::alloc::string::String, + /// nondeterministic + #[prost(string, tag = "4")] + pub info: ::prost::alloc::string::String, + #[prost(int64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub gas_wanted: i64, + #[prost(int64, tag = "6")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] - pub height: i64, - #[prost(string, tag = "10")] + pub gas_used: i64, + #[prost(message, repeated, tag = "7")] + pub events: ::prost::alloc::vec::Vec, + #[prost(string, tag = "8")] pub codespace: ::prost::alloc::string::String, + #[prost(string, tag = "9")] + pub sender: ::prost::alloc::string::String, + #[prost(int64, tag = "10")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub priority: i64, + /// mempool_error is set by CometBFT. + /// ABCI applictions creating a ResponseCheckTX should not set mempool_error. + #[prost(string, tag = "11")] + pub mempool_error: ::prost::alloc::string::String, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -793,8 +728,8 @@ pub struct ResponseQuery { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/tendermint.abci.ResponseCheckTx")] -pub struct ResponseCheckTx { +#[proto_message(type_url = "/tendermint.abci.ResponseDeliverTx")] +pub struct ResponseDeliverTx { #[prost(uint32, tag = "1")] pub code: u32, #[prost(bytes = "vec", tag = "2")] @@ -821,6 +756,7 @@ pub struct ResponseCheckTx { deserialize_with = "crate::serde::as_str::deserialize" )] pub gas_used: i64, + /// nondeterministic #[prost(message, repeated, tag = "7")] pub events: ::prost::alloc::vec::Vec, #[prost(string, tag = "8")] @@ -837,8 +773,35 @@ pub struct ResponseCheckTx { ::schemars::JsonSchema, CosmwasmExt, )] +#[proto_message(type_url = "/tendermint.abci.ResponseEndBlock")] +pub struct ResponseEndBlock { + #[prost(message, repeated, tag = "1")] + pub validator_updates: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub consensus_param_updates: ::core::option::Option, + #[prost(message, repeated, tag = "3")] + pub events: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] #[proto_message(type_url = "/tendermint.abci.ResponseCommit")] pub struct ResponseCommit { + /// reserve 1 + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, #[prost(int64, tag = "3")] #[serde( serialize_with = "crate::serde::as_str::serialize", @@ -1026,6 +989,8 @@ pub mod response_apply_snapshot_chunk { } } } +/// ConsensusParams contains all consensus-relevant parameters +/// that can be adjusted by the abci app #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1037,85 +1002,18 @@ pub mod response_apply_snapshot_chunk { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/tendermint.abci.ResponsePrepareProposal")] -pub struct ResponsePrepareProposal { - #[prost(bytes = "vec", repeated, tag = "1")] - pub txs: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/tendermint.abci.ResponseProcessProposal")] -pub struct ResponseProcessProposal { - #[prost(enumeration = "response_process_proposal::ProposalStatus", tag = "1")] - #[serde( - serialize_with = "response_process_proposal::ProposalStatus::serialize", - deserialize_with = "response_process_proposal::ProposalStatus::deserialize" - )] - pub status: i32, -} -/// Nested message and enum types in `ResponseProcessProposal`. -pub mod response_process_proposal { - use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; - #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] - #[repr(i32)] - #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] - pub enum ProposalStatus { - Unknown = 0, - Accept = 1, - Reject = 2, - } - impl ProposalStatus { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - ProposalStatus::Unknown => "UNKNOWN", - ProposalStatus::Accept => "ACCEPT", - ProposalStatus::Reject => "REJECT", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "UNKNOWN" => Some(Self::Unknown), - "ACCEPT" => Some(Self::Accept), - "REJECT" => Some(Self::Reject), - _ => None, - } - } - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/tendermint.abci.ResponseExtendVote")] -pub struct ResponseExtendVote { - #[prost(bytes = "vec", tag = "1")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub vote_extension: ::prost::alloc::vec::Vec, +#[proto_message(type_url = "/tendermint.abci.ConsensusParams")] +pub struct ConsensusParams { + #[prost(message, optional, tag = "1")] + pub block: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub evidence: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub validator: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub version: ::core::option::Option, } +/// BlockParams contains limits on the block size. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1127,90 +1025,22 @@ pub struct ResponseExtendVote { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/tendermint.abci.ResponseVerifyVoteExtension")] -pub struct ResponseVerifyVoteExtension { - #[prost( - enumeration = "response_verify_vote_extension::VerifyStatus", - tag = "1" - )] +#[proto_message(type_url = "/tendermint.abci.BlockParams")] +pub struct BlockParams { + /// Note: must be greater than 0 + #[prost(int64, tag = "1")] #[serde( - serialize_with = "response_verify_vote_extension::VerifyStatus::serialize", - deserialize_with = "response_verify_vote_extension::VerifyStatus::deserialize" + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" )] - pub status: i32, -} -/// Nested message and enum types in `ResponseVerifyVoteExtension`. -pub mod response_verify_vote_extension { - use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; - #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] - #[repr(i32)] - #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] - pub enum VerifyStatus { - Unknown = 0, - Accept = 1, - /// Rejecting the vote extension will reject the entire precommit by the sender. - /// Incorrectly implementing this thus has liveness implications as it may affect - /// CometBFT's ability to receive 2/3+ valid votes to finalize the block. - /// Honest nodes should never be rejected. - Reject = 2, - } - impl VerifyStatus { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - VerifyStatus::Unknown => "UNKNOWN", - VerifyStatus::Accept => "ACCEPT", - VerifyStatus::Reject => "REJECT", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "UNKNOWN" => Some(Self::Unknown), - "ACCEPT" => Some(Self::Accept), - "REJECT" => Some(Self::Reject), - _ => None, - } - } - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/tendermint.abci.ResponseFinalizeBlock")] -pub struct ResponseFinalizeBlock { - /// set of block events emmitted as part of executing the block - #[prost(message, repeated, tag = "1")] - pub events: ::prost::alloc::vec::Vec, - /// the result of executing each transaction including the events - /// the particular transction emitted. This should match the order - /// of the transactions delivered in the block itself - #[prost(message, repeated, tag = "2")] - pub tx_results: ::prost::alloc::vec::Vec, - /// a list of updates to the validator set. These will reflect the validator set at current height + 2. - #[prost(message, repeated, tag = "3")] - pub validator_updates: ::prost::alloc::vec::Vec, - /// updates to the consensus params, if any. - #[prost(message, optional, tag = "4")] - pub consensus_param_updates: ::core::option::Option, - /// app_hash is the hash of the applications' state which is used to confirm that execution of the transactions was deterministic. It is up to the application to decide which algorithm to use. - #[prost(bytes = "vec", tag = "5")] + pub max_bytes: i64, + /// Note: must be greater or equal to -1 + #[prost(int64, tag = "2")] #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" )] - pub app_hash: ::prost::alloc::vec::Vec, + pub max_gas: i64, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -1223,39 +1053,15 @@ pub struct ResponseFinalizeBlock { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/tendermint.abci.CommitInfo")] -pub struct CommitInfo { +#[proto_message(type_url = "/tendermint.abci.LastCommitInfo")] +pub struct LastCommitInfo { #[prost(int32, tag = "1")] pub round: i32, #[prost(message, repeated, tag = "2")] pub votes: ::prost::alloc::vec::Vec, } -/// ExtendedCommitInfo is similar to CommitInfo except that it is only used in -/// the PrepareProposal request such that CometBFT can provide vote extensions -/// to the application. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/tendermint.abci.ExtendedCommitInfo")] -pub struct ExtendedCommitInfo { - /// The round at which the block proposer decided in the previous height. - #[prost(int32, tag = "1")] - pub round: i32, - /// List of validators' addresses in the last validator set with their voting - /// information, including vote extensions. - #[prost(message, repeated, tag = "2")] - pub votes: ::prost::alloc::vec::Vec, -} /// Event allows application developers to attach additional information to -/// ResponseFinalizeBlock and ResponseCheckTx. +/// ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. /// Later, transactions may be queried using these events. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -1289,61 +1095,21 @@ pub struct Event { )] #[proto_message(type_url = "/tendermint.abci.EventAttribute")] pub struct EventAttribute { - #[prost(string, tag = "1")] - pub key: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub value: ::prost::alloc::string::String, - /// nondeterministic - #[prost(bool, tag = "3")] - pub index: bool, -} -/// ExecTxResult contains results of executing one individual transaction. -/// -/// * Its structure is equivalent to #ResponseDeliverTx which will be deprecated/deleted -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/tendermint.abci.ExecTxResult")] -pub struct ExecTxResult { - #[prost(uint32, tag = "1")] - pub code: u32, - #[prost(bytes = "vec", tag = "2")] + #[prost(bytes = "vec", tag = "1")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] - pub data: ::prost::alloc::vec::Vec, - /// nondeterministic - #[prost(string, tag = "3")] - pub log: ::prost::alloc::string::String, - /// nondeterministic - #[prost(string, tag = "4")] - pub info: ::prost::alloc::string::String, - #[prost(int64, tag = "5")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub gas_wanted: i64, - #[prost(int64, tag = "6")] + pub key: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "2")] #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] - pub gas_used: i64, + pub value: ::prost::alloc::vec::Vec, /// nondeterministic - #[prost(message, repeated, tag = "7")] - pub events: ::prost::alloc::vec::Vec, - #[prost(string, tag = "8")] - pub codespace: ::prost::alloc::string::String, + #[prost(bool, tag = "3")] + pub index: bool, } /// TxResult contains results of executing the transaction. /// @@ -1376,8 +1142,9 @@ pub struct TxResult { )] pub tx: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "4")] - pub result: ::core::option::Option, + pub result: ::core::option::Option, } +/// Validator #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1408,6 +1175,7 @@ pub struct Validator { )] pub power: i64, } +/// ValidatorUpdate #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1430,6 +1198,7 @@ pub struct ValidatorUpdate { )] pub power: i64, } +/// VoteInfo #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1445,50 +1214,8 @@ pub struct ValidatorUpdate { pub struct VoteInfo { #[prost(message, optional, tag = "1")] pub validator: ::core::option::Option, - #[prost(enumeration = "super::types::BlockIdFlag", tag = "3")] - #[serde( - serialize_with = "super::types::BlockIdFlag::serialize", - deserialize_with = "super::types::BlockIdFlag::deserialize" - )] - pub block_id_flag: i32, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/tendermint.abci.ExtendedVoteInfo")] -pub struct ExtendedVoteInfo { - /// The validator that sent the vote. - #[prost(message, optional, tag = "1")] - pub validator: ::core::option::Option, - /// Non-deterministic extension provided by the sending validator's application. - #[prost(bytes = "vec", tag = "3")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub vote_extension: ::prost::alloc::vec::Vec, - /// Vote extension signature created by CometBFT - #[prost(bytes = "vec", tag = "4")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub extension_signature: ::prost::alloc::vec::Vec, - /// block_id_flag indicates whether the validator voted for a block, nil, or did not vote at all - #[prost(enumeration = "super::types::BlockIdFlag", tag = "5")] - #[serde( - serialize_with = "super::types::BlockIdFlag::serialize", - deserialize_with = "super::types::BlockIdFlag::deserialize" - )] - pub block_id_flag: i32, + #[prost(bool, tag = "2")] + pub signed_last_block: bool, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -1501,12 +1228,12 @@ pub struct ExtendedVoteInfo { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/tendermint.abci.Misbehavior")] -pub struct Misbehavior { - #[prost(enumeration = "MisbehaviorType", tag = "1")] +#[proto_message(type_url = "/tendermint.abci.Evidence")] +pub struct Evidence { + #[prost(enumeration = "EvidenceType", tag = "1")] #[serde( - serialize_with = "MisbehaviorType::serialize", - deserialize_with = "MisbehaviorType::deserialize" + serialize_with = "EvidenceType::serialize", + deserialize_with = "EvidenceType::deserialize" )] pub r#type: i32, /// The offending validator @@ -1603,21 +1330,21 @@ impl CheckTxType { #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] -pub enum MisbehaviorType { +pub enum EvidenceType { Unknown = 0, DuplicateVote = 1, LightClientAttack = 2, } -impl MisbehaviorType { +impl EvidenceType { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - MisbehaviorType::Unknown => "UNKNOWN", - MisbehaviorType::DuplicateVote => "DUPLICATE_VOTE", - MisbehaviorType::LightClientAttack => "LIGHT_CLIENT_ATTACK", + EvidenceType::Unknown => "UNKNOWN", + EvidenceType::DuplicateVote => "DUPLICATE_VOTE", + EvidenceType::LightClientAttack => "LIGHT_CLIENT_ATTACK", } } /// Creates an enum from field names used in the ProtoBuf definition. diff --git a/packages/provwasm-std/src/types/tendermint/blocksync.rs b/packages/provwasm-std/src/types/tendermint/blockchain.rs similarity index 87% rename from packages/provwasm-std/src/types/tendermint/blocksync.rs rename to packages/provwasm-std/src/types/tendermint/blockchain.rs index 059e30d3..a43b5f54 100644 --- a/packages/provwasm-std/src/types/tendermint/blocksync.rs +++ b/packages/provwasm-std/src/types/tendermint/blockchain.rs @@ -11,7 +11,7 @@ use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/tendermint.blocksync.BlockRequest")] +#[proto_message(type_url = "/tendermint.blockchain.BlockRequest")] pub struct BlockRequest { #[prost(int64, tag = "1")] #[serde( @@ -32,7 +32,7 @@ pub struct BlockRequest { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/tendermint.blocksync.NoBlockResponse")] +#[proto_message(type_url = "/tendermint.blockchain.NoBlockResponse")] pub struct NoBlockResponse { #[prost(int64, tag = "1")] #[serde( @@ -53,12 +53,10 @@ pub struct NoBlockResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/tendermint.blocksync.BlockResponse")] +#[proto_message(type_url = "/tendermint.blockchain.BlockResponse")] pub struct BlockResponse { #[prost(message, optional, tag = "1")] pub block: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub ext_commit: ::core::option::Option, } /// StatusRequest requests the status of a peer. #[allow(clippy::derive_partial_eq_without_eq)] @@ -72,7 +70,7 @@ pub struct BlockResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/tendermint.blocksync.StatusRequest")] +#[proto_message(type_url = "/tendermint.blockchain.StatusRequest")] pub struct StatusRequest {} /// StatusResponse is a peer response to inform their status. #[allow(clippy::derive_partial_eq_without_eq)] @@ -86,7 +84,7 @@ pub struct StatusRequest {} ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/tendermint.blocksync.StatusResponse")] +#[proto_message(type_url = "/tendermint.blockchain.StatusResponse")] pub struct StatusResponse { #[prost(int64, tag = "1")] #[serde( @@ -112,7 +110,7 @@ pub struct StatusResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/tendermint.blocksync.Message")] +#[proto_message(type_url = "/tendermint.blockchain.Message")] pub struct Message { #[prost(oneof = "message::Sum", tags = "1, 2, 3, 4, 5")] pub sum: ::core::option::Option, diff --git a/packages/provwasm-std/src/types/tendermint/mod.rs b/packages/provwasm-std/src/types/tendermint/mod.rs index 09b25428..010a2a17 100644 --- a/packages/provwasm-std/src/types/tendermint/mod.rs +++ b/packages/provwasm-std/src/types/tendermint/mod.rs @@ -1,5 +1,5 @@ pub mod abci; -pub mod blocksync; +pub mod blockchain; pub mod consensus; pub mod crypto; pub mod libs; diff --git a/packages/provwasm-std/src/types/tendermint/rpc/grpc.rs b/packages/provwasm-std/src/types/tendermint/rpc/grpc.rs index 2a567370..3f841d74 100644 --- a/packages/provwasm-std/src/types/tendermint/rpc/grpc.rs +++ b/packages/provwasm-std/src/types/tendermint/rpc/grpc.rs @@ -61,5 +61,5 @@ pub struct ResponseBroadcastTx { #[prost(message, optional, tag = "1")] pub check_tx: ::core::option::Option, #[prost(message, optional, tag = "2")] - pub tx_result: ::core::option::Option, + pub deliver_tx: ::core::option::Option, } diff --git a/packages/provwasm-std/src/types/tendermint/state.rs b/packages/provwasm-std/src/types/tendermint/state.rs index 49c60857..3ea2cd48 100644 --- a/packages/provwasm-std/src/types/tendermint/state.rs +++ b/packages/provwasm-std/src/types/tendermint/state.rs @@ -1,8 +1,7 @@ use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// LegacyABCIResponses retains the responses -/// of the legacy ABCI calls during block processing. -/// Note ReponseDeliverTx is renamed to ExecTxResult but they are semantically the same -/// Kept for backwards compatibility for versions prior to v0.38 +/// ABCIResponses retains the responses +/// of the various ABCI calls during block processing. +/// It is persisted to disk for each height before calling Commit. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -14,52 +13,14 @@ use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/tendermint.state.LegacyABCIResponses")] -pub struct LegacyAbciResponses { +#[proto_message(type_url = "/tendermint.state.ABCIResponses")] +pub struct AbciResponses { #[prost(message, repeated, tag = "1")] - pub deliver_txs: ::prost::alloc::vec::Vec, + pub deliver_txs: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "2")] - pub end_block: ::core::option::Option, + pub end_block: ::core::option::Option, #[prost(message, optional, tag = "3")] - pub begin_block: ::core::option::Option, -} -/// ResponseBeginBlock is kept for backwards compatibility for versions prior to v0.38 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/tendermint.state.ResponseBeginBlock")] -pub struct ResponseBeginBlock { - #[prost(message, repeated, tag = "1")] - pub events: ::prost::alloc::vec::Vec, -} -/// ResponseEndBlock is kept for backwards compatibility for versions prior to v0.38 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/tendermint.state.ResponseEndBlock")] -pub struct ResponseEndBlock { - #[prost(message, repeated, tag = "1")] - pub validator_updates: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "2")] - pub consensus_param_updates: ::core::option::Option, - #[prost(message, repeated, tag = "3")] - pub events: ::prost::alloc::vec::Vec, + pub begin_block: ::core::option::Option, } /// ValidatorsInfo represents the latest validator set, or the last height it changed #[allow(clippy::derive_partial_eq_without_eq)] @@ -121,15 +82,13 @@ pub struct ConsensusParamsInfo { #[proto_message(type_url = "/tendermint.state.ABCIResponsesInfo")] pub struct AbciResponsesInfo { #[prost(message, optional, tag = "1")] - pub legacy_abci_responses: ::core::option::Option, + pub abci_responses: ::core::option::Option, #[prost(int64, tag = "2")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub height: i64, - #[prost(message, optional, tag = "3")] - pub response_finalize_block: ::core::option::Option, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/tendermint/types.rs b/packages/provwasm-std/src/types/tendermint/types.rs index 4580259c..1ff6c918 100644 --- a/packages/provwasm-std/src/types/tendermint/types.rs +++ b/packages/provwasm-std/src/types/tendermint/types.rs @@ -1,200 +1,4 @@ use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; -/// ConsensusParams contains consensus critical parameters that determine the -/// validity of blocks. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/tendermint.types.ConsensusParams")] -pub struct ConsensusParams { - #[prost(message, optional, tag = "1")] - pub block: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub evidence: ::core::option::Option, - #[prost(message, optional, tag = "3")] - pub validator: ::core::option::Option, - #[prost(message, optional, tag = "4")] - pub version: ::core::option::Option, - #[prost(message, optional, tag = "5")] - pub abci: ::core::option::Option, -} -/// BlockParams contains limits on the block size. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/tendermint.types.BlockParams")] -pub struct BlockParams { - /// Max block size, in bytes. - /// Note: must be greater than 0 - #[prost(int64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub max_bytes: i64, - /// Max gas per block. - /// Note: must be greater or equal to -1 - #[prost(int64, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub max_gas: i64, -} -/// EvidenceParams determine how we handle evidence of malfeasance. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/tendermint.types.EvidenceParams")] -pub struct EvidenceParams { - /// Max age of evidence, in blocks. - /// - /// The basic formula for calculating this is: MaxAgeDuration / {average block - /// time}. - #[prost(int64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub max_age_num_blocks: i64, - /// Max age of evidence, in time. - /// - /// It should correspond with an app's "unbonding period" or other similar - /// mechanism for handling [Nothing-At-Stake - /// attacks](). - #[prost(message, optional, tag = "2")] - pub max_age_duration: ::core::option::Option, - /// This sets the maximum size of total evidence in bytes that can be committed in a single block. - /// and should fall comfortably under the max block bytes. - /// Default is 1048576 or 1MB - #[prost(int64, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub max_bytes: i64, -} -/// ValidatorParams restrict the public key types validators can use. -/// NOTE: uses ABCI pubkey naming, not Amino names. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/tendermint.types.ValidatorParams")] -pub struct ValidatorParams { - #[prost(string, repeated, tag = "1")] - pub pub_key_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// VersionParams contains the ABCI application version. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/tendermint.types.VersionParams")] -pub struct VersionParams { - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub app: u64, -} -/// HashedParams is a subset of ConsensusParams. -/// -/// It is hashed into the Header.ConsensusHash. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/tendermint.types.HashedParams")] -pub struct HashedParams { - #[prost(int64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub block_max_bytes: i64, - #[prost(int64, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub block_max_gas: i64, -} -/// ABCIParams configure functionality specific to the Application Blockchain Interface. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/tendermint.types.ABCIParams")] -pub struct AbciParams { - /// vote_extensions_enable_height configures the first height during which - /// vote extensions will be enabled. During this specified height, and for all - /// subsequent heights, precommit messages that do not contain valid extension data - /// will be considered invalid. Prior to this height, vote extensions will not - /// be used or accepted by validators on the network. - /// - /// Once enabled, vote extensions will be created by the application in ExtendVote, - /// passed to the application for validation in VerifyVoteExtension and given - /// to the application to use when proposing a block during PrepareProposal. - #[prost(int64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub vote_extensions_enable_height: i64, -} #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -275,44 +79,6 @@ pub struct SimpleValidator { )] pub voting_power: i64, } -/// BlockIdFlag indicates which BlockID the signature is for -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] -pub enum BlockIdFlag { - /// indicates an error condition - Unknown = 0, - /// the vote was not received - Absent = 1, - /// voted for the block that received the majority - Commit = 2, - /// voted for nil - Nil = 3, -} -impl BlockIdFlag { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - BlockIdFlag::Unknown => "BLOCK_ID_FLAG_UNKNOWN", - BlockIdFlag::Absent => "BLOCK_ID_FLAG_ABSENT", - BlockIdFlag::Commit => "BLOCK_ID_FLAG_COMMIT", - BlockIdFlag::Nil => "BLOCK_ID_FLAG_NIL", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "BLOCK_ID_FLAG_UNKNOWN" => Some(Self::Unknown), - "BLOCK_ID_FLAG_ABSENT" => Some(Self::Absent), - "BLOCK_ID_FLAG_COMMIT" => Some(Self::Commit), - "BLOCK_ID_FLAG_NIL" => Some(Self::Nil), - _ => None, - } - } -} /// PartsetHeader #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -503,7 +269,7 @@ pub struct Data { #[prost(bytes = "vec", repeated, tag = "1")] pub txs: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, } -/// Vote represents a prevote or precommit vote from validators for +/// Vote represents a prevote, precommit, or commit vote from validators for /// consensus. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -536,103 +302,23 @@ pub struct Vote { #[prost(message, optional, tag = "4")] pub block_id: ::core::option::Option, #[prost(message, optional, tag = "5")] - pub timestamp: ::core::option::Option, - #[prost(bytes = "vec", tag = "6")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub validator_address: ::prost::alloc::vec::Vec, - #[prost(int32, tag = "7")] - pub validator_index: i32, - /// Vote signature by the validator if they participated in consensus for the - /// associated block. - #[prost(bytes = "vec", tag = "8")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub signature: ::prost::alloc::vec::Vec, - /// Vote extension provided by the application. Only valid for precommit - /// messages. - #[prost(bytes = "vec", tag = "9")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub extension: ::prost::alloc::vec::Vec, - /// Vote extension signature by the validator if they participated in - /// consensus for the associated block. - /// Only valid for precommit messages. - #[prost(bytes = "vec", tag = "10")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub extension_signature: ::prost::alloc::vec::Vec, -} -/// Commit contains the evidence that a block was committed by a set of validators. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/tendermint.types.Commit")] -pub struct Commit { - #[prost(int64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub height: i64, - #[prost(int32, tag = "2")] - pub round: i32, - #[prost(message, optional, tag = "3")] - pub block_id: ::core::option::Option, - #[prost(message, repeated, tag = "4")] - pub signatures: ::prost::alloc::vec::Vec, -} -/// CommitSig is a part of the Vote included in a Commit. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/tendermint.types.CommitSig")] -pub struct CommitSig { - #[prost(enumeration = "BlockIdFlag", tag = "1")] - #[serde( - serialize_with = "BlockIdFlag::serialize", - deserialize_with = "BlockIdFlag::deserialize" - )] - pub block_id_flag: i32, - #[prost(bytes = "vec", tag = "2")] + pub timestamp: ::core::option::Option, + #[prost(bytes = "vec", tag = "6")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] pub validator_address: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "3")] - pub timestamp: ::core::option::Option, - #[prost(bytes = "vec", tag = "4")] + #[prost(int32, tag = "7")] + pub validator_index: i32, + #[prost(bytes = "vec", tag = "8")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] pub signature: ::prost::alloc::vec::Vec, } +/// Commit contains the evidence that a block was committed by a set of validators. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -644,8 +330,8 @@ pub struct CommitSig { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/tendermint.types.ExtendedCommit")] -pub struct ExtendedCommit { +#[proto_message(type_url = "/tendermint.types.Commit")] +pub struct Commit { #[prost(int64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", @@ -657,11 +343,9 @@ pub struct ExtendedCommit { #[prost(message, optional, tag = "3")] pub block_id: ::core::option::Option, #[prost(message, repeated, tag = "4")] - pub extended_signatures: ::prost::alloc::vec::Vec, + pub signatures: ::prost::alloc::vec::Vec, } -/// ExtendedCommitSig retains all the same fields as CommitSig but adds vote -/// extension-related fields. We use two signatures to ensure backwards compatibility. -/// That is the digest of the original signature is still the same in prior versions +/// CommitSig is a part of the Vote included in a Commit. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -673,8 +357,8 @@ pub struct ExtendedCommit { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/tendermint.types.ExtendedCommitSig")] -pub struct ExtendedCommitSig { +#[proto_message(type_url = "/tendermint.types.CommitSig")] +pub struct CommitSig { #[prost(enumeration = "BlockIdFlag", tag = "1")] #[serde( serialize_with = "BlockIdFlag::serialize", @@ -695,20 +379,6 @@ pub struct ExtendedCommitSig { deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] pub signature: ::prost::alloc::vec::Vec, - /// Vote extension data - #[prost(bytes = "vec", tag = "5")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub extension: ::prost::alloc::vec::Vec, - /// Vote extension signature - #[prost(bytes = "vec", tag = "6")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub extension_signature: ::prost::alloc::vec::Vec, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -845,6 +515,40 @@ pub struct TxProof { #[prost(message, optional, tag = "3")] pub proof: ::core::option::Option, } +/// BlockIdFlag indicates which BlcokID the signature is for +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] +pub enum BlockIdFlag { + Unknown = 0, + Absent = 1, + Commit = 2, + Nil = 3, +} +impl BlockIdFlag { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + BlockIdFlag::Unknown => "BLOCK_ID_FLAG_UNKNOWN", + BlockIdFlag::Absent => "BLOCK_ID_FLAG_ABSENT", + BlockIdFlag::Commit => "BLOCK_ID_FLAG_COMMIT", + BlockIdFlag::Nil => "BLOCK_ID_FLAG_NIL", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "BLOCK_ID_FLAG_UNKNOWN" => Some(Self::Unknown), + "BLOCK_ID_FLAG_ABSENT" => Some(Self::Absent), + "BLOCK_ID_FLAG_COMMIT" => Some(Self::Commit), + "BLOCK_ID_FLAG_NIL" => Some(Self::Nil), + _ => None, + } + } +} /// SignedMsgType is a type of signed message in the consensus. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] @@ -881,6 +585,180 @@ impl SignedMsgType { } } } +/// ConsensusParams contains consensus critical parameters that determine the +/// validity of blocks. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.ConsensusParams")] +pub struct ConsensusParams { + #[prost(message, optional, tag = "1")] + pub block: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub evidence: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub validator: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub version: ::core::option::Option, +} +/// BlockParams contains limits on the block size. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.BlockParams")] +pub struct BlockParams { + /// Max block size, in bytes. + /// Note: must be greater than 0 + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub max_bytes: i64, + /// Max gas per block. + /// Note: must be greater or equal to -1 + #[prost(int64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub max_gas: i64, + /// Minimum time increment between consecutive blocks (in milliseconds) If the + /// block header timestamp is ahead of the system clock, decrease this value. + /// + /// Not exposed to the application. + #[prost(int64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub time_iota_ms: i64, +} +/// EvidenceParams determine how we handle evidence of malfeasance. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.EvidenceParams")] +pub struct EvidenceParams { + /// Max age of evidence, in blocks. + /// + /// The basic formula for calculating this is: MaxAgeDuration / {average block + /// time}. + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub max_age_num_blocks: i64, + /// Max age of evidence, in time. + /// + /// It should correspond with an app's "unbonding period" or other similar + /// mechanism for handling [Nothing-At-Stake + /// attacks](). + #[prost(message, optional, tag = "2")] + pub max_age_duration: ::core::option::Option, + /// This sets the maximum size of total evidence in bytes that can be committed in a single block. + /// and should fall comfortably under the max block bytes. + /// Default is 1048576 or 1MB + #[prost(int64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub max_bytes: i64, +} +/// ValidatorParams restrict the public key types validators can use. +/// NOTE: uses ABCI pubkey naming, not Amino names. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.ValidatorParams")] +pub struct ValidatorParams { + #[prost(string, repeated, tag = "1")] + pub pub_key_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// VersionParams contains the ABCI application version. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.VersionParams")] +pub struct VersionParams { + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub app_version: u64, +} +/// HashedParams is a subset of ConsensusParams. +/// +/// It is hashed into the Header.ConsensusHash. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.HashedParams")] +pub struct HashedParams { + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub block_max_bytes: i64, + #[prost(int64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub block_max_gas: i64, +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1177,39 +1055,3 @@ pub struct CanonicalVote { #[prost(string, tag = "6")] pub chain_id: ::prost::alloc::string::String, } -/// CanonicalVoteExtension provides us a way to serialize a vote extension from -/// a particular validator such that we can sign over those serialized bytes. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/tendermint.types.CanonicalVoteExtension")] -pub struct CanonicalVoteExtension { - #[prost(bytes = "vec", tag = "1")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub extension: ::prost::alloc::vec::Vec, - #[prost(sfixed64, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub height: i64, - #[prost(sfixed64, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub round: i64, - #[prost(string, tag = "4")] - pub chain_id: ::prost::alloc::string::String, -}