diff --git a/.changelog/unreleased/breaking-changes/187-cosmos-sdk-proto.md b/.changelog/unreleased/breaking-changes/187-cosmos-sdk-proto.md new file mode 100644 index 00000000..8536f255 --- /dev/null +++ b/.changelog/unreleased/breaking-changes/187-cosmos-sdk-proto.md @@ -0,0 +1,3 @@ +- Cosmos SDK protos are now re-exported from the `cosmos_sdk_proto` + crate instead of being generated as part of `ibc-proto` + ([\#187](https://github.com/cosmos/ibc-proto-rs/pull/187)) \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cfbe4f93..254b3021 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,6 +24,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - uses: arduino/setup-protoc@v2 - uses: actions-rs/toolchain@v1 with: toolchain: stable diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c047df97..65ae555c 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -48,6 +48,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: arduino/setup-protoc@v2 - uses: actions-rs/toolchain@v1 with: toolchain: stable @@ -63,6 +64,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: arduino/setup-protoc@v2 - uses: actions-rs/toolchain@v1 with: toolchain: stable @@ -78,6 +80,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: arduino/setup-protoc@v2 - uses: actions-rs/toolchain@v1 with: toolchain: stable @@ -92,6 +95,7 @@ jobs: timeout-minutes: 30 steps: - uses: actions/checkout@v2 + - uses: arduino/setup-protoc@v2 - uses: actions-rs/toolchain@v1 with: toolchain: stable @@ -110,6 +114,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: arduino/setup-protoc@v2 - uses: actions-rs/toolchain@v1 with: toolchain: stable @@ -127,6 +132,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: arduino/setup-protoc@v2 - uses: actions-rs/toolchain@v1 with: toolchain: stable @@ -143,6 +149,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: arduino/setup-protoc@v2 - uses: actions-rs/toolchain@v1 with: toolchain: stable diff --git a/Cargo.toml b/Cargo.toml index 7b5a868c..7d939c32 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,14 +43,18 @@ informalsystems-pbjson = { version = "0.7.0", optional = true, default-features version = "0.39" default-features = false +[dependencies.cosmos-sdk-proto] +version = "0.25.0" +default-features = false + [dev-dependencies] serde_json = "1.0.107" [features] default = ["std", "client"] -std = ["prost/std", "bytes/std", "subtle-encoding/std", "base64/std", "flex-error/std", "ics23/std", "informalsystems-pbjson/std"] -serde = ["dep:serde", "ics23/serde", "informalsystems-pbjson"] -client = ["std", "dep:tonic", "tonic/codegen", "tonic/transport", "tonic/prost"] +std = ["cosmos-sdk-proto/std", "prost/std", "bytes/std", "subtle-encoding/std", "base64/std", "flex-error/std", "ics23/std", "informalsystems-pbjson/std"] +serde = ["dep:serde", "dep:informalsystems-pbjson", "ics23/serde", "cosmos-sdk-proto/serde"] +client = ["std", "dep:tonic", "tonic/codegen", "tonic/transport", "tonic/prost", "cosmos-sdk-proto/grpc-transport"] json-schema = ["std", "serde", "dep:schemars"] server = ["std", "dep:tonic", "tonic/codegen", "tonic/transport", "tonic/prost"] parity-scale-codec = ["tendermint-proto/parity-scale-codec"] diff --git a/scripts/sync-protobuf.sh b/scripts/sync-protobuf.sh index 46200757..b3e91d04 100755 --- a/scripts/sync-protobuf.sh +++ b/scripts/sync-protobuf.sh @@ -5,7 +5,6 @@ set -eou pipefail # syn-protobuf.sh is a bash script to sync the protobuf # files using ibc-proto-compiler. This script will checkout # the protobuf files from the git versions specified in -# proto/src/prost/COSMOS_SDK_COMMIT and # proto/src/prost/IBC_GO_COMMIT. If you want to sync # the protobuf files to a newer version, modify the # corresponding of those 2 files by specifying the commit ID @@ -23,17 +22,14 @@ set -eou pipefail # the script is called. CACHE_PATH="${XDG_CACHE_HOME:-$HOME/.cache}"/ibc-proto-rs-build -COSMOS_SDK_GIT="${COSMOS_SDK_GIT:-$CACHE_PATH/cosmos-sdk.git}" IBC_GO_GIT="${IBC_GO_GIT:-$CACHE_PATH/ibc-go.git}" COSMOS_ICS_GIT="${COSMOS_ICS_GIT:-$CACHE_PATH/interchain-security.git}" NFT_TRANSFER_GIT="${NFT_TRANSFER_GIT:-$CACHE_PATH/nft-transfer.git}" -COSMOS_SDK_COMMIT="$(cat src/COSMOS_SDK_COMMIT)" IBC_GO_COMMIT="$(cat src/IBC_GO_COMMIT)" INTERCHAIN_SECURITY_COMMIT="$(cat src/INTERCHAIN_SECURITY_COMMIT)" NFT_TRANSFER_COMMIT="$(cat src/NFT_TRANSFER_COMMIT)" -echo "COSMOS_SDK_COMMIT: $COSMOS_SDK_COMMIT" echo "IBC_GO_COMMIT: $IBC_GO_COMMIT" echo "INTERCHAIN_SECURITY_COMMIT: $INTERCHAIN_SECURITY_COMMIT" echo "NFT_TRANSFER_COMMIT: $NFT_TRANSFER_COMMIT" @@ -61,29 +57,10 @@ else echo "Using existing interchain-security bare git repository at $COSMOS_ICS_GIT" fi -# Use either --sdk-commit flag for commit ID, -# or --sdk-tag for git tag. Because we can't modify -# proto-compiler to have smart detection on that. - -if [[ "$COSMOS_SDK_COMMIT" =~ ^[a-zA-Z0-9]{40}$ ]] -then - SDK_COMMIT_OPTION="--sdk-commit" -else - SDK_COMMIT_OPTION="--sdk-tag" -fi - # If the git directories does not exist, clone them as # bare git repositories so that no local modification # can be done there. -if [[ ! -e "$COSMOS_SDK_GIT" ]] -then - echo "Cloning cosmos-sdk source code to as bare git repository to $COSMOS_SDK_GIT" - git clone --mirror https://github.com/cosmos/cosmos-sdk.git "$COSMOS_SDK_GIT" -else - echo "Using existing cosmos-sdk bare git repository at $COSMOS_SDK_GIT" -fi - if [[ ! -e "$IBC_GO_GIT" ]] then echo "Cloning ibc-go source code to as bare git repository to $IBC_GO_GIT" @@ -107,10 +84,6 @@ pushd "$COSMOS_ICS_GIT" git fetch popd -pushd "$COSMOS_SDK_GIT" -git fetch -popd - pushd "$IBC_GO_GIT" git fetch popd @@ -135,33 +108,6 @@ buf mod update buf export -v -o ../proto-include popd -COSMOS_SDK_DIR=$(mktemp -d /tmp/cosmos-sdk-XXXXXXXX) - -pushd "$COSMOS_SDK_DIR" -git clone "$COSMOS_SDK_GIT" . -git checkout "$COSMOS_SDK_COMMIT" - -cd proto -buf mod prune -buf mod update -buf export -v -o ../proto-include -popd - -cat << "EOF" >> "$COSMOS_SDK_DIR/proto-include/cosmos/staking/v1beta1/staking.proto" - -// InfractionType indicates the infraction type a validator commited. -enum InfractionType { - option (gogoproto.goproto_enum_prefix) = false; - - // UNSPECIFIED defines an empty infraction type. - INFRACTION_TYPE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "InfractionEmpty"]; - // DOUBLE_SIGN defines a validator that double-signs a block. - INFRACTION_TYPE_DOUBLE_SIGN = 1 [(gogoproto.enumvalue_customname) = "DoubleSign"]; - // DOWNTIME defines a validator that missed signing too many blocks. - INFRACTION_TYPE_DOWNTIME = 2 [(gogoproto.enumvalue_customname) = "Downtime"]; -} -EOF - IBC_GO_DIR=$(mktemp -d /tmp/ibc-go-XXXXXXXX) pushd "$IBC_GO_DIR" @@ -200,7 +146,6 @@ cargo build cargo run -- compile \ --ics "$COSMOS_ICS_DIR/proto-include" \ - --sdk "$COSMOS_SDK_DIR/proto-include" \ --ibc "$IBC_GO_DIR/proto-include" \ --nft "$NFT_TRANSFER_DIR/proto-include" \ --out ../../src/prost @@ -211,15 +156,19 @@ cd ../.. # we instead re-exports the `ics23` crate type definitions. rm -f src/prost/cosmos.ics23.v1.rs -# Remove `cosmos.base.store` module as it does not compile -# out of the box and we do not have a use for it at the moment. +# Remove leftover Cosmos SDK modules. rm -f src/prost/cosmos.base.store.v1beta1.rs +rm -f src/prost/cosmos.auth.v1beta1.rs +rm -f src/prost/cosmos.base.query.v1beta1.rs +rm -f src/prost/cosmos.base.v1beta1.rs +rm -f src/prost/cosmos.staking.v1beta1.rs +rm -f src/prost/cosmos.upgrade.v1beta1.rs +rm -f src/prost/cosmos_proto.rs # The Tendermint ABCI protos are unused from within ibc-proto rm -f src/prost/tendermint.abci.rs # Remove the temporary checkouts of the repositories rm -rf "$COSMOS_ICS_DIR" -rm -rf "$COSMOS_SDK_DIR" rm -rf "$IBC_GO_DIR" rm -rf "$NFT_TRANSFER_DIR" diff --git a/src/COSMOS_SDK_COMMIT b/src/COSMOS_SDK_COMMIT deleted file mode 100644 index 1eef4d5b..00000000 --- a/src/COSMOS_SDK_COMMIT +++ /dev/null @@ -1 +0,0 @@ -2e9e5d6eea24d6c11eddc9c002c66e89ae036187 diff --git a/src/lib.rs b/src/lib.rs index d55f3dbd..a3d7b552 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -28,9 +28,6 @@ macro_rules! include_proto { }; } -/// The version (commit hash) of the Cosmos SDK used when generating this library. -pub const COSMOS_SDK_COMMIT: &str = include_str!("COSMOS_SDK_COMMIT"); - /// The version (commit hash) of IBC Go used when generating this library. pub const IBC_GO_COMMIT: &str = include_str!("IBC_GO_COMMIT"); @@ -44,217 +41,11 @@ pub const NFT_TRANSFER_COMMIT: &str = include_str!("NFT_TRANSFER_COMMIT"); #[cfg(feature = "proto-descriptor")] pub const FILE_DESCRIPTOR_SET: &[u8] = include_bytes!("prost/proto_descriptor.bin"); -pub mod cosmos { - pub mod app { - pub mod v1alpha1 { - include_proto!("cosmos.app.v1alpha1.rs"); - #[cfg(feature = "serde")] - include_proto!("cosmos.app.v1alpha1.serde.rs"); - } - } - pub mod auth { - pub mod v1beta1 { - include_proto!("cosmos.auth.v1beta1.rs"); - #[cfg(feature = "serde")] - include_proto!("cosmos.auth.v1beta1.serde.rs"); - /// EthAccount defines an Ethermint account. - /// TODO: remove when/if a canonical `EthAccount` - /// lands in the next Cosmos SDK release - /// (note https://github.com/cosmos/cosmos-sdk/pull/9981 - /// only adds the PubKey type) - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct EthAccount { - #[prost(message, optional, tag = "1")] - pub base_account: ::core::option::Option, - #[prost(bytes = "vec", tag = "2")] - pub code_hash: ::prost::alloc::vec::Vec, - } - } - pub mod module { - pub mod v1 { - include_proto!("cosmos.auth.module.v1.rs"); - #[cfg(feature = "serde")] - include_proto!("cosmos.auth.module.v1.serde.rs"); - } - } - } - pub mod staking { - pub mod v1beta1 { - include_proto!("cosmos.staking.v1beta1.rs"); - #[cfg(feature = "serde")] - include_proto!("cosmos.staking.v1beta1.serde.rs"); - } - pub mod module { - pub mod v1 { - include_proto!("cosmos.staking.module.v1.rs"); - #[cfg(feature = "serde")] - include_proto!("cosmos.staking.module.v1.serde.rs"); - } - } - } - pub mod bank { - pub mod v1beta1 { - include_proto!("cosmos.bank.v1beta1.rs"); - #[cfg(feature = "serde")] - include_proto!("cosmos.bank.v1beta1.serde.rs"); - } - pub mod module { - pub mod v1 { - include_proto!("cosmos.bank.module.v1.rs"); - #[cfg(feature = "serde")] - include_proto!("cosmos.bank.module.v1.serde.rs"); - } - } - } - pub mod base { - pub mod abci { - pub mod v1beta1 { - include_proto!("cosmos.base.abci.v1beta1.rs"); - } - } - pub mod node { - pub mod v1beta1 { - include_proto!("cosmos.base.node.v1beta1.rs"); - #[cfg(feature = "serde")] - include_proto!("cosmos.base.node.v1beta1.serde.rs"); - } - } - pub mod query { - pub mod v1beta1 { - include_proto!("cosmos.base.query.v1beta1.rs"); - #[cfg(feature = "serde")] - include_proto!("cosmos.base.query.v1beta1.serde.rs"); - } - } - pub mod reflection { - pub mod v1beta1 { - include_proto!("cosmos.base.reflection.v1beta1.rs"); - #[cfg(feature = "serde")] - include_proto!("cosmos.base.reflection.v1beta1.serde.rs"); - } - } - pub mod v1beta1 { - include_proto!("cosmos.base.v1beta1.rs"); - #[cfg(feature = "serde")] - include_proto!("cosmos.base.v1beta1.serde.rs"); - } - pub mod tendermint { - pub mod v1beta1 { - include_proto!("cosmos.base.tendermint.v1beta1.rs"); - } - } - pub mod kv { - pub mod v1beta1 { - include_proto!("cosmos.base.kv.v1beta1.rs"); - #[cfg(feature = "serde")] - include_proto!("cosmos.base.kv.v1beta1.serde.rs"); - } - } - pub mod snapshots { - pub mod v1beta1 { - include_proto!("cosmos.base.snapshots.v1beta1.rs"); - #[cfg(feature = "serde")] - include_proto!("cosmos.base.snapshots.v1beta1.serde.rs"); - } - } - } - pub mod crypto { - pub mod multisig { - pub mod v1beta1 { - include_proto!("cosmos.crypto.multisig.v1beta1.rs"); - #[cfg(feature = "serde")] - include_proto!("cosmos.crypto.multisig.v1beta1.serde.rs"); - } - include_proto!("cosmos.crypto.multisig.rs"); - #[cfg(feature = "serde")] - include_proto!("cosmos.crypto.multisig.serde.rs"); - } - pub mod ed25519 { - include_proto!("cosmos.crypto.ed25519.rs"); - #[cfg(feature = "serde")] - include_proto!("cosmos.crypto.ed25519.serde.rs"); - } - pub mod secp256k1 { - include_proto!("cosmos.crypto.secp256k1.rs"); - #[cfg(feature = "serde")] - include_proto!("cosmos.crypto.secp256k1.serde.rs"); - } - pub mod secp256r1 { - include_proto!("cosmos.crypto.secp256r1.rs"); - #[cfg(feature = "serde")] - include_proto!("cosmos.crypto.secp256r1.serde.rs"); - } - pub mod keyring { - pub mod v1 { - include_proto!("cosmos.crypto.keyring.v1.rs"); - #[cfg(feature = "serde")] - include_proto!("cosmos.crypto.keyring.v1.serde.rs"); - } - } - pub mod hd { - pub mod v1 { - include_proto!("cosmos.crypto.hd.v1.rs"); - #[cfg(feature = "serde")] - include_proto!("cosmos.crypto.hd.v1.serde.rs"); - } - } - } - pub mod tx { - pub mod config { - pub mod v1 { - include_proto!("cosmos.tx.config.v1.rs"); - #[cfg(feature = "serde")] - include_proto!("cosmos.tx.config.v1.serde.rs"); - } - } - pub mod signing { - pub mod v1beta1 { - include_proto!("cosmos.tx.signing.v1beta1.rs"); - #[cfg(feature = "serde")] - include_proto!("cosmos.tx.signing.v1beta1.serde.rs"); - } - } - pub mod v1beta1 { - include_proto!("cosmos.tx.v1beta1.rs"); - } - } - pub mod upgrade { - pub mod v1beta1 { - include_proto!("cosmos.upgrade.v1beta1.rs"); - #[cfg(feature = "serde")] - include_proto!("cosmos.upgrade.v1beta1.serde.rs"); - } - pub mod module { - pub mod v1 { - include_proto!("cosmos.upgrade.module.v1.rs"); - #[cfg(feature = "serde")] - include_proto!("cosmos.upgrade.module.v1.serde.rs"); - } - } - } - pub mod gov { - pub mod v1 { - include_proto!("cosmos.gov.v1.rs"); - #[cfg(feature = "serde")] - include_proto!("cosmos.gov.v1.serde.rs"); - } - pub mod v1beta1 { - include_proto!("cosmos.gov.v1beta1.rs"); - #[cfg(feature = "serde")] - include_proto!("cosmos.gov.v1beta1.serde.rs"); - } - pub mod module { - pub mod v1 { - include_proto!("cosmos.gov.module.v1.rs"); - #[cfg(feature = "serde")] - include_proto!("cosmos.gov.module.v1.serde.rs"); - } - } - } - pub mod ics23 { - pub use ics23 as v1; - } -} +// Re-export Cosmos SDK protos from the `cosmos_sdk_proto` crate +pub use cosmos_sdk_proto::cosmos; + +// Re-export the ICS23 proto from the `ics23` crate +pub use ics23; pub mod ibc { #[deprecated(since = "0.15.0", note = "Use `ibc_proto::ibc::applications` instead")] @@ -389,9 +180,6 @@ pub mod ibc { } } -// Re-export `ics23` definitions for backward compatibility -pub use ics23; - pub mod interchain_security { pub mod ccv { #[allow(clippy::match_single_binding)] diff --git a/src/prost/cosmos.app.v1alpha1.rs b/src/prost/cosmos.app.v1alpha1.rs deleted file mode 100644 index 805d54b1..00000000 --- a/src/prost/cosmos.app.v1alpha1.rs +++ /dev/null @@ -1,111 +0,0 @@ -// This file is @generated by prost-build. -/// ModuleDescriptor describes an app module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ModuleDescriptor { - /// go_import names the package that should be imported by an app to load the - /// module in the runtime module registry. It is required to make debugging - /// of configuration errors easier for users. - #[prost(string, tag = "1")] - pub go_import: ::prost::alloc::string::String, - /// use_package refers to a protobuf package that this module - /// uses and exposes to the world. In an app, only one module should "use" - /// or own a single protobuf package. It is assumed that the module uses - /// all of the .proto files in a single package. - #[prost(message, repeated, tag = "2")] - pub use_package: ::prost::alloc::vec::Vec, - /// can_migrate_from defines which module versions this module can migrate - /// state from. The framework will check that one module version is able to - /// migrate from a previous module version before attempting to update its - /// config. It is assumed that modules can transitively migrate from earlier - /// versions. For instance if v3 declares it can migrate from v2, and v2 - /// declares it can migrate from v1, the framework knows how to migrate - /// from v1 to v3, assuming all 3 module versions are registered at runtime. - #[prost(message, repeated, tag = "3")] - pub can_migrate_from: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for ModuleDescriptor { - const NAME: &'static str = "ModuleDescriptor"; - const PACKAGE: &'static str = "cosmos.app.v1alpha1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.app.v1alpha1.ModuleDescriptor".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.app.v1alpha1.ModuleDescriptor".into() - } -} -/// PackageReference is a reference to a protobuf package used by a module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PackageReference { - /// name is the fully-qualified name of the package. - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - /// revision is the optional revision of the package that is being used. - /// Protobuf packages used in Cosmos should generally have a major version - /// as the last part of the package name, ex. foo.bar.baz.v1. - /// The revision of a package can be thought of as the minor version of a - /// package which has additional backwards compatible definitions that weren't - /// present in a previous version. - /// - /// A package should indicate its revision with a source code comment - /// above the package declaration in one of its files containing the - /// text "Revision N" where N is an integer revision. All packages start - /// at revision 0 the first time they are released in a module. - /// - /// 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. - /// - /// When the module runtime starts up, it will check the pinned proto - /// image and panic if there are runtime protobuf definitions that are not - /// in the pinned descriptor which do not have - /// a "Since Revision N" comment or have a "Since Revision N" comment where - /// N is <= to the revision specified here. This indicates that the protobuf - /// files have been updated, but the pinned file descriptor hasn't. - /// - /// If there are items in the pinned file descriptor with a revision - /// greater than the value indicated here, this will also cause a panic - /// as it may mean that the pinned descriptor for a legacy module has been - /// improperly updated or that there is some other versioning discrepancy. - /// Runtime protobuf definitions will also be checked for compatibility - /// with pinned file descriptors to make sure there are no incompatible changes. - /// - /// This behavior ensures that: - /// * pinned proto images are up-to-date - /// * protobuf files are carefully annotated with revision comments which - /// are important good client UX - /// * protobuf files are changed in backwards and forwards compatible ways - #[prost(uint32, tag = "2")] - pub revision: u32, -} -impl ::prost::Name for PackageReference { - const NAME: &'static str = "PackageReference"; - const PACKAGE: &'static str = "cosmos.app.v1alpha1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.app.v1alpha1.PackageReference".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.app.v1alpha1.PackageReference".into() - } -} -/// MigrateFromInfo is information on a module version that a newer module -/// can migrate from. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MigrateFromInfo { - /// module is the fully-qualified protobuf name of the module config object - /// for the previous module version, ex: "cosmos.group.module.v1.Module". - #[prost(string, tag = "1")] - pub module: ::prost::alloc::string::String, -} -impl ::prost::Name for MigrateFromInfo { - const NAME: &'static str = "MigrateFromInfo"; - const PACKAGE: &'static str = "cosmos.app.v1alpha1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.app.v1alpha1.MigrateFromInfo".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.app.v1alpha1.MigrateFromInfo".into() - } -} diff --git a/src/prost/cosmos.app.v1alpha1.serde.rs b/src/prost/cosmos.app.v1alpha1.serde.rs deleted file mode 100644 index 95f7c7de..00000000 --- a/src/prost/cosmos.app.v1alpha1.serde.rs +++ /dev/null @@ -1,329 +0,0 @@ -impl serde::Serialize for MigrateFromInfo { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.app.v1alpha1.MigrateFromInfo", len)?; - if true { - struct_ser.serialize_field("module", &self.module)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MigrateFromInfo { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "module", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Module, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "module" => Ok(GeneratedField::Module), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MigrateFromInfo; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.app.v1alpha1.MigrateFromInfo") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut module__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Module => { - if module__.is_some() { - return Err(serde::de::Error::duplicate_field("module")); - } - module__ = Some(map_.next_value()?); - } - } - } - Ok(MigrateFromInfo { - module: module__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.app.v1alpha1.MigrateFromInfo", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for ModuleDescriptor { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.app.v1alpha1.ModuleDescriptor", len)?; - if true { - struct_ser.serialize_field("goImport", &self.go_import)?; - } - if true { - struct_ser.serialize_field("usePackage", &self.use_package)?; - } - if true { - struct_ser.serialize_field("canMigrateFrom", &self.can_migrate_from)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ModuleDescriptor { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "go_import", - "goImport", - "use_package", - "usePackage", - "can_migrate_from", - "canMigrateFrom", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - GoImport, - UsePackage, - CanMigrateFrom, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "goImport" | "go_import" => Ok(GeneratedField::GoImport), - "usePackage" | "use_package" => Ok(GeneratedField::UsePackage), - "canMigrateFrom" | "can_migrate_from" => Ok(GeneratedField::CanMigrateFrom), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ModuleDescriptor; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.app.v1alpha1.ModuleDescriptor") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut go_import__ = None; - let mut use_package__ = None; - let mut can_migrate_from__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::GoImport => { - if go_import__.is_some() { - return Err(serde::de::Error::duplicate_field("goImport")); - } - go_import__ = Some(map_.next_value()?); - } - GeneratedField::UsePackage => { - if use_package__.is_some() { - return Err(serde::de::Error::duplicate_field("usePackage")); - } - use_package__ = Some(map_.next_value()?); - } - GeneratedField::CanMigrateFrom => { - if can_migrate_from__.is_some() { - return Err(serde::de::Error::duplicate_field("canMigrateFrom")); - } - can_migrate_from__ = Some(map_.next_value()?); - } - } - } - Ok(ModuleDescriptor { - go_import: go_import__.unwrap_or_default(), - use_package: use_package__.unwrap_or_default(), - can_migrate_from: can_migrate_from__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.app.v1alpha1.ModuleDescriptor", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for PackageReference { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.app.v1alpha1.PackageReference", len)?; - if true { - struct_ser.serialize_field("name", &self.name)?; - } - if true { - struct_ser.serialize_field("revision", &self.revision)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for PackageReference { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "name", - "revision", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Name, - Revision, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "name" => Ok(GeneratedField::Name), - "revision" => Ok(GeneratedField::Revision), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = PackageReference; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.app.v1alpha1.PackageReference") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut name__ = None; - let mut revision__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); - } - name__ = Some(map_.next_value()?); - } - GeneratedField::Revision => { - if revision__.is_some() { - return Err(serde::de::Error::duplicate_field("revision")); - } - revision__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(PackageReference { - name: name__.unwrap_or_default(), - revision: revision__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.app.v1alpha1.PackageReference", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.auth.module.v1.rs b/src/prost/cosmos.auth.module.v1.rs deleted file mode 100644 index bc779d97..00000000 --- a/src/prost/cosmos.auth.module.v1.rs +++ /dev/null @@ -1,47 +0,0 @@ -// This file is @generated by prost-build. -/// Module is the config object for the auth module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -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, -} -impl ::prost::Name for Module { - const NAME: &'static str = "Module"; - const PACKAGE: &'static str = "cosmos.auth.module.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.auth.module.v1.Module".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.auth.module.v1.Module".into() - } -} -/// ModuleAccountPermission represents permissions for a module account. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -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>, -} -impl ::prost::Name for ModuleAccountPermission { - const NAME: &'static str = "ModuleAccountPermission"; - const PACKAGE: &'static str = "cosmos.auth.module.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.auth.module.v1.ModuleAccountPermission".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.auth.module.v1.ModuleAccountPermission".into() - } -} diff --git a/src/prost/cosmos.auth.module.v1.serde.rs b/src/prost/cosmos.auth.module.v1.serde.rs deleted file mode 100644 index 72f892f8..00000000 --- a/src/prost/cosmos.auth.module.v1.serde.rs +++ /dev/null @@ -1,235 +0,0 @@ -impl serde::Serialize for Module { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.auth.module.v1.Module", len)?; - if true { - struct_ser.serialize_field("bech32Prefix", &self.bech32_prefix)?; - } - if true { - struct_ser.serialize_field("moduleAccountPermissions", &self.module_account_permissions)?; - } - if true { - struct_ser.serialize_field("authority", &self.authority)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Module { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "bech32_prefix", - "bech32Prefix", - "module_account_permissions", - "moduleAccountPermissions", - "authority", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Bech32Prefix, - ModuleAccountPermissions, - Authority, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "bech32Prefix" | "bech32_prefix" => Ok(GeneratedField::Bech32Prefix), - "moduleAccountPermissions" | "module_account_permissions" => Ok(GeneratedField::ModuleAccountPermissions), - "authority" => Ok(GeneratedField::Authority), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Module; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.auth.module.v1.Module") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut bech32_prefix__ = None; - let mut module_account_permissions__ = None; - let mut authority__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Bech32Prefix => { - if bech32_prefix__.is_some() { - return Err(serde::de::Error::duplicate_field("bech32Prefix")); - } - bech32_prefix__ = Some(map_.next_value()?); - } - GeneratedField::ModuleAccountPermissions => { - if module_account_permissions__.is_some() { - return Err(serde::de::Error::duplicate_field("moduleAccountPermissions")); - } - module_account_permissions__ = Some(map_.next_value()?); - } - GeneratedField::Authority => { - if authority__.is_some() { - return Err(serde::de::Error::duplicate_field("authority")); - } - authority__ = Some(map_.next_value()?); - } - } - } - Ok(Module { - bech32_prefix: bech32_prefix__.unwrap_or_default(), - module_account_permissions: module_account_permissions__.unwrap_or_default(), - authority: authority__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.auth.module.v1.Module", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for ModuleAccountPermission { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.auth.module.v1.ModuleAccountPermission", len)?; - if true { - struct_ser.serialize_field("account", &self.account)?; - } - if true { - struct_ser.serialize_field("permissions", &self.permissions)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ModuleAccountPermission { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "account", - "permissions", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Account, - Permissions, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "account" => Ok(GeneratedField::Account), - "permissions" => Ok(GeneratedField::Permissions), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ModuleAccountPermission; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.auth.module.v1.ModuleAccountPermission") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut account__ = None; - let mut permissions__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Account => { - if account__.is_some() { - return Err(serde::de::Error::duplicate_field("account")); - } - account__ = Some(map_.next_value()?); - } - GeneratedField::Permissions => { - if permissions__.is_some() { - return Err(serde::de::Error::duplicate_field("permissions")); - } - permissions__ = Some(map_.next_value()?); - } - } - } - Ok(ModuleAccountPermission { - account: account__.unwrap_or_default(), - permissions: permissions__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.auth.module.v1.ModuleAccountPermission", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.auth.v1beta1.rs b/src/prost/cosmos.auth.v1beta1.rs deleted file mode 100644 index 0b886cfa..00000000 --- a/src/prost/cosmos.auth.v1beta1.rs +++ /dev/null @@ -1,1878 +0,0 @@ -// This file is @generated by prost-build. -/// BaseAccount defines a base account type. It contains all the necessary fields -/// for basic account functionality. Any custom account type should extend this -/// type for additional functionality (e.g. vesting). -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BaseAccount { - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub pub_key: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, - #[prost(uint64, tag = "3")] - pub account_number: u64, - #[prost(uint64, tag = "4")] - pub sequence: u64, -} -impl ::prost::Name for BaseAccount { - const NAME: &'static str = "BaseAccount"; - const PACKAGE: &'static str = "cosmos.auth.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.auth.v1beta1.BaseAccount".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.auth.v1beta1.BaseAccount".into() - } -} -/// ModuleAccount defines an account for modules that holds coins on a pool. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ModuleAccount { - #[prost(message, optional, tag = "1")] - pub base_account: ::core::option::Option, - #[prost(string, tag = "2")] - pub name: ::prost::alloc::string::String, - #[prost(string, repeated, tag = "3")] - pub permissions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -impl ::prost::Name for ModuleAccount { - const NAME: &'static str = "ModuleAccount"; - const PACKAGE: &'static str = "cosmos.auth.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.auth.v1beta1.ModuleAccount".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.auth.v1beta1.ModuleAccount".into() - } -} -/// 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, ::prost::Message)] -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>, -} -impl ::prost::Name for ModuleCredential { - const NAME: &'static str = "ModuleCredential"; - const PACKAGE: &'static str = "cosmos.auth.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.auth.v1beta1.ModuleCredential".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.auth.v1beta1.ModuleCredential".into() - } -} -/// Params defines the parameters for the auth module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct Params { - #[prost(uint64, tag = "1")] - pub max_memo_characters: u64, - #[prost(uint64, tag = "2")] - pub tx_sig_limit: u64, - #[prost(uint64, tag = "3")] - pub tx_size_cost_per_byte: u64, - #[prost(uint64, tag = "4")] - pub sig_verify_cost_ed25519: u64, - #[prost(uint64, tag = "5")] - pub sig_verify_cost_secp256k1: u64, -} -impl ::prost::Name for Params { - const NAME: &'static str = "Params"; - const PACKAGE: &'static str = "cosmos.auth.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.auth.v1beta1.Params".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.auth.v1beta1.Params".into() - } -} -/// MsgUpdateParams is the Msg/UpdateParams request type. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -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, -} -impl ::prost::Name for MsgUpdateParams { - const NAME: &'static str = "MsgUpdateParams"; - const PACKAGE: &'static str = "cosmos.auth.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.auth.v1beta1.MsgUpdateParams".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.auth.v1beta1.MsgUpdateParams".into() - } -} -/// MsgUpdateParamsResponse defines the response structure for executing a -/// MsgUpdateParams message. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct MsgUpdateParamsResponse {} -impl ::prost::Name for MsgUpdateParamsResponse { - const NAME: &'static str = "MsgUpdateParamsResponse"; - const PACKAGE: &'static str = "cosmos.auth.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.auth.v1beta1.MsgUpdateParamsResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.auth.v1beta1.MsgUpdateParamsResponse".into() - } -} -/// Generated client implementations. -#[cfg(feature = "client")] -pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - /// Msg defines the x/auth Msg service. - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, - } - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: 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 - } - /// UpdateParams defines a (governance) operation for updating the x/auth module - /// parameters. The authority defaults to the x/gov module account. - /// - /// Since: cosmos-sdk 0.47 - pub async fn update_params( - &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( - "/cosmos.auth.v1beta1.Msg/UpdateParams", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.auth.v1beta1.Msg", "UpdateParams")); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -#[cfg(feature = "server")] -pub mod msg_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. - #[async_trait] - pub trait Msg: Send + Sync + 'static { - /// UpdateParams defines a (governance) operation for updating the x/auth module - /// parameters. The authority defaults to the x/gov module account. - /// - /// Since: cosmos-sdk 0.47 - async fn update_params( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - /// Msg defines the x/auth Msg service. - #[derive(Debug)] - pub struct MsgServer { - inner: Arc, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - impl MsgServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - 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 { - match req.uri().path() { - "/cosmos.auth.v1beta1.Msg/UpdateParams" => { - #[allow(non_camel_case_types)] - struct UpdateParamsSvc(pub Arc); - impl tonic::server::UnaryService - for UpdateParamsSvc { - type Response = super::MsgUpdateParamsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::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 method = UpdateParamsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", tonic::Code::Unimplemented as i32) - .header( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ) - .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 tonic::server::NamedService for MsgServer { - const NAME: &'static str = "cosmos.auth.v1beta1.Msg"; - } -} -/// QueryAccountsRequest is the request type for the Query/Accounts RPC method. -/// -/// Since: cosmos-sdk 0.43 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryAccountsRequest { - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "1")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryAccountsRequest { - const NAME: &'static str = "QueryAccountsRequest"; - const PACKAGE: &'static str = "cosmos.auth.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.auth.v1beta1.QueryAccountsRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.auth.v1beta1.QueryAccountsRequest".into() - } -} -/// QueryAccountsResponse is the response type for the Query/Accounts RPC method. -/// -/// Since: cosmos-sdk 0.43 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryAccountsResponse { - /// accounts are the existing accounts - #[prost(message, repeated, tag = "1")] - pub accounts: ::prost::alloc::vec::Vec<::tendermint_proto::google::protobuf::Any>, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryAccountsResponse { - const NAME: &'static str = "QueryAccountsResponse"; - const PACKAGE: &'static str = "cosmos.auth.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.auth.v1beta1.QueryAccountsResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.auth.v1beta1.QueryAccountsResponse".into() - } -} -/// QueryAccountRequest is the request type for the Query/Account RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryAccountRequest { - /// address defines the address to query for. - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryAccountRequest { - const NAME: &'static str = "QueryAccountRequest"; - const PACKAGE: &'static str = "cosmos.auth.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.auth.v1beta1.QueryAccountRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.auth.v1beta1.QueryAccountRequest".into() - } -} -/// QueryAccountResponse is the response type for the Query/Account RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryAccountResponse { - /// account defines the account of the corresponding address. - #[prost(message, optional, tag = "1")] - pub account: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, -} -impl ::prost::Name for QueryAccountResponse { - const NAME: &'static str = "QueryAccountResponse"; - const PACKAGE: &'static str = "cosmos.auth.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.auth.v1beta1.QueryAccountResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.auth.v1beta1.QueryAccountResponse".into() - } -} -/// QueryParamsRequest is the request type for the Query/Params RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct QueryParamsRequest {} -impl ::prost::Name for QueryParamsRequest { - const NAME: &'static str = "QueryParamsRequest"; - const PACKAGE: &'static str = "cosmos.auth.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.auth.v1beta1.QueryParamsRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.auth.v1beta1.QueryParamsRequest".into() - } -} -/// QueryParamsResponse is the response type for the Query/Params RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct QueryParamsResponse { - /// params defines the parameters of the module. - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, -} -impl ::prost::Name for QueryParamsResponse { - const NAME: &'static str = "QueryParamsResponse"; - const PACKAGE: &'static str = "cosmos.auth.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.auth.v1beta1.QueryParamsResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.auth.v1beta1.QueryParamsResponse".into() - } -} -/// QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct QueryModuleAccountsRequest {} -impl ::prost::Name for QueryModuleAccountsRequest { - const NAME: &'static str = "QueryModuleAccountsRequest"; - const PACKAGE: &'static str = "cosmos.auth.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.auth.v1beta1.QueryModuleAccountsRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.auth.v1beta1.QueryModuleAccountsRequest".into() - } -} -/// QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryModuleAccountsResponse { - #[prost(message, repeated, tag = "1")] - pub accounts: ::prost::alloc::vec::Vec<::tendermint_proto::google::protobuf::Any>, -} -impl ::prost::Name for QueryModuleAccountsResponse { - const NAME: &'static str = "QueryModuleAccountsResponse"; - const PACKAGE: &'static str = "cosmos.auth.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.auth.v1beta1.QueryModuleAccountsResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.auth.v1beta1.QueryModuleAccountsResponse".into() - } -} -/// QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryModuleAccountByNameRequest { - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryModuleAccountByNameRequest { - const NAME: &'static str = "QueryModuleAccountByNameRequest"; - const PACKAGE: &'static str = "cosmos.auth.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.auth.v1beta1.QueryModuleAccountByNameRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.auth.v1beta1.QueryModuleAccountByNameRequest".into() - } -} -/// QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryModuleAccountByNameResponse { - #[prost(message, optional, tag = "1")] - pub account: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, -} -impl ::prost::Name for QueryModuleAccountByNameResponse { - const NAME: &'static str = "QueryModuleAccountByNameResponse"; - const PACKAGE: &'static str = "cosmos.auth.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.auth.v1beta1.QueryModuleAccountByNameResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.auth.v1beta1.QueryModuleAccountByNameResponse".into() - } -} -/// Bech32PrefixRequest is the request type for Bech32Prefix rpc method. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct Bech32PrefixRequest {} -impl ::prost::Name for Bech32PrefixRequest { - const NAME: &'static str = "Bech32PrefixRequest"; - const PACKAGE: &'static str = "cosmos.auth.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.auth.v1beta1.Bech32PrefixRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.auth.v1beta1.Bech32PrefixRequest".into() - } -} -/// Bech32PrefixResponse is the response type for Bech32Prefix rpc method. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Bech32PrefixResponse { - #[prost(string, tag = "1")] - pub bech32_prefix: ::prost::alloc::string::String, -} -impl ::prost::Name for Bech32PrefixResponse { - const NAME: &'static str = "Bech32PrefixResponse"; - const PACKAGE: &'static str = "cosmos.auth.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.auth.v1beta1.Bech32PrefixResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.auth.v1beta1.Bech32PrefixResponse".into() - } -} -/// AddressBytesToStringRequest is the request type for AddressString rpc method. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddressBytesToStringRequest { - #[prost(bytes = "vec", tag = "1")] - pub address_bytes: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for AddressBytesToStringRequest { - const NAME: &'static str = "AddressBytesToStringRequest"; - const PACKAGE: &'static str = "cosmos.auth.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.auth.v1beta1.AddressBytesToStringRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.auth.v1beta1.AddressBytesToStringRequest".into() - } -} -/// AddressBytesToStringResponse is the response type for AddressString rpc method. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddressBytesToStringResponse { - #[prost(string, tag = "1")] - pub address_string: ::prost::alloc::string::String, -} -impl ::prost::Name for AddressBytesToStringResponse { - const NAME: &'static str = "AddressBytesToStringResponse"; - const PACKAGE: &'static str = "cosmos.auth.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.auth.v1beta1.AddressBytesToStringResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.auth.v1beta1.AddressBytesToStringResponse".into() - } -} -/// AddressStringToBytesRequest is the request type for AccountBytes rpc method. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddressStringToBytesRequest { - #[prost(string, tag = "1")] - pub address_string: ::prost::alloc::string::String, -} -impl ::prost::Name for AddressStringToBytesRequest { - const NAME: &'static str = "AddressStringToBytesRequest"; - const PACKAGE: &'static str = "cosmos.auth.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.auth.v1beta1.AddressStringToBytesRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.auth.v1beta1.AddressStringToBytesRequest".into() - } -} -/// AddressStringToBytesResponse is the response type for AddressBytes rpc method. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddressStringToBytesResponse { - #[prost(bytes = "vec", tag = "1")] - pub address_bytes: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for AddressStringToBytesResponse { - const NAME: &'static str = "AddressStringToBytesResponse"; - const PACKAGE: &'static str = "cosmos.auth.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.auth.v1beta1.AddressStringToBytesResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.auth.v1beta1.AddressStringToBytesResponse".into() - } -} -/// QueryAccountAddressByIDRequest is the request type for AccountAddressByID rpc method -/// -/// Since: cosmos-sdk 0.46.2 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -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")] - pub id: i64, - /// account_id is the account number of the address to be queried. - /// - /// Since: cosmos-sdk 0.47 - #[prost(uint64, tag = "2")] - pub account_id: u64, -} -impl ::prost::Name for QueryAccountAddressByIdRequest { - const NAME: &'static str = "QueryAccountAddressByIDRequest"; - const PACKAGE: &'static str = "cosmos.auth.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.auth.v1beta1.QueryAccountAddressByIDRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.auth.v1beta1.QueryAccountAddressByIDRequest".into() - } -} -/// QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method -/// -/// Since: cosmos-sdk 0.46.2 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryAccountAddressByIdResponse { - #[prost(string, tag = "1")] - pub account_address: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryAccountAddressByIdResponse { - const NAME: &'static str = "QueryAccountAddressByIDResponse"; - const PACKAGE: &'static str = "cosmos.auth.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.auth.v1beta1.QueryAccountAddressByIDResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.auth.v1beta1.QueryAccountAddressByIDResponse".into() - } -} -/// QueryAccountInfoRequest is the Query/AccountInfo request type. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryAccountInfoRequest { - /// address is the account address string. - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryAccountInfoRequest { - const NAME: &'static str = "QueryAccountInfoRequest"; - const PACKAGE: &'static str = "cosmos.auth.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.auth.v1beta1.QueryAccountInfoRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.auth.v1beta1.QueryAccountInfoRequest".into() - } -} -/// QueryAccountInfoResponse is the Query/AccountInfo response type. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryAccountInfoResponse { - /// info is the account info which is represented by BaseAccount. - #[prost(message, optional, tag = "1")] - pub info: ::core::option::Option, -} -impl ::prost::Name for QueryAccountInfoResponse { - const NAME: &'static str = "QueryAccountInfoResponse"; - const PACKAGE: &'static str = "cosmos.auth.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.auth.v1beta1.QueryAccountInfoResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.auth.v1beta1.QueryAccountInfoResponse".into() - } -} -/// Generated client implementations. -#[cfg(feature = "client")] -pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - /// Query defines the gRPC querier service. - #[derive(Debug, Clone)] - pub struct QueryClient { - inner: tonic::client::Grpc, - } - impl QueryClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: 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 - } - /// Accounts returns all the existing accounts. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - /// - /// Since: cosmos-sdk 0.43 - pub async fn 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( - "/cosmos.auth.v1beta1.Query/Accounts", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.auth.v1beta1.Query", "Accounts")); - self.inner.unary(req, path, codec).await - } - /// Account returns account details based on address. - pub async fn account( - &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( - "/cosmos.auth.v1beta1.Query/Account", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.auth.v1beta1.Query", "Account")); - self.inner.unary(req, path, codec).await - } - /// AccountAddressByID returns account address based on account number. - /// - /// Since: cosmos-sdk 0.46.2 - pub async fn account_address_by_id( - &mut self, - request: impl tonic::IntoRequest, - ) -> 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( - "/cosmos.auth.v1beta1.Query/AccountAddressByID", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("cosmos.auth.v1beta1.Query", "AccountAddressByID"), - ); - self.inner.unary(req, path, codec).await - } - /// Params queries all parameters. - pub async fn params( - &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( - "/cosmos.auth.v1beta1.Query/Params", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.auth.v1beta1.Query", "Params")); - self.inner.unary(req, path, codec).await - } - /// ModuleAccounts returns all the existing module accounts. - /// - /// Since: cosmos-sdk 0.46 - pub async fn module_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( - "/cosmos.auth.v1beta1.Query/ModuleAccounts", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.auth.v1beta1.Query", "ModuleAccounts")); - self.inner.unary(req, path, codec).await - } - /// ModuleAccountByName returns the module account info by module name - pub async fn module_account_by_name( - &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( - "/cosmos.auth.v1beta1.Query/ModuleAccountByName", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("cosmos.auth.v1beta1.Query", "ModuleAccountByName"), - ); - self.inner.unary(req, path, codec).await - } - /// Bech32Prefix queries bech32Prefix - /// - /// Since: cosmos-sdk 0.46 - pub async fn bech32_prefix( - &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( - "/cosmos.auth.v1beta1.Query/Bech32Prefix", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.auth.v1beta1.Query", "Bech32Prefix")); - self.inner.unary(req, path, codec).await - } - /// AddressBytesToString converts Account Address bytes to string - /// - /// Since: cosmos-sdk 0.46 - pub async fn address_bytes_to_string( - &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( - "/cosmos.auth.v1beta1.Query/AddressBytesToString", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("cosmos.auth.v1beta1.Query", "AddressBytesToString"), - ); - self.inner.unary(req, path, codec).await - } - /// AddressStringToBytes converts Address string to bytes - /// - /// Since: cosmos-sdk 0.46 - pub async fn address_string_to_bytes( - &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( - "/cosmos.auth.v1beta1.Query/AddressStringToBytes", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("cosmos.auth.v1beta1.Query", "AddressStringToBytes"), - ); - self.inner.unary(req, path, codec).await - } - /// AccountInfo queries account info which is common to all account types. - /// - /// Since: cosmos-sdk 0.47 - pub async fn account_info( - &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( - "/cosmos.auth.v1beta1.Query/AccountInfo", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.auth.v1beta1.Query", "AccountInfo")); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -#[cfg(feature = "server")] -pub mod query_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. - #[async_trait] - pub trait Query: Send + Sync + 'static { - /// Accounts returns all the existing accounts. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - /// - /// Since: cosmos-sdk 0.43 - async fn accounts( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Account returns account details based on address. - async fn account( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// AccountAddressByID returns account address based on account number. - /// - /// Since: cosmos-sdk 0.46.2 - async fn account_address_by_id( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Params queries all parameters. - async fn params( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// ModuleAccounts returns all the existing module accounts. - /// - /// Since: cosmos-sdk 0.46 - async fn module_accounts( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// ModuleAccountByName returns the module account info by module name - async fn module_account_by_name( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Bech32Prefix queries bech32Prefix - /// - /// Since: cosmos-sdk 0.46 - async fn bech32_prefix( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// AddressBytesToString converts Account Address bytes to string - /// - /// Since: cosmos-sdk 0.46 - async fn address_bytes_to_string( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// AddressStringToBytes converts Address string to bytes - /// - /// Since: cosmos-sdk 0.46 - async fn address_string_to_bytes( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// AccountInfo queries account info which is common to all account types. - /// - /// Since: cosmos-sdk 0.47 - async fn account_info( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - /// Query defines the gRPC querier service. - #[derive(Debug)] - pub struct QueryServer { - inner: Arc, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - impl QueryServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - 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 { - match req.uri().path() { - "/cosmos.auth.v1beta1.Query/Accounts" => { - #[allow(non_camel_case_types)] - struct AccountsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for AccountsSvc { - type Response = super::QueryAccountsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::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 method = AccountsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.auth.v1beta1.Query/Account" => { - #[allow(non_camel_case_types)] - struct AccountSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for AccountSvc { - type Response = super::QueryAccountResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::account(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = AccountSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.auth.v1beta1.Query/AccountAddressByID" => { - #[allow(non_camel_case_types)] - struct AccountAddressByIDSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for AccountAddressByIDSvc { - type Response = super::QueryAccountAddressByIdResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::QueryAccountAddressByIdRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::account_address_by_id(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = AccountAddressByIDSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.auth.v1beta1.Query/Params" => { - #[allow(non_camel_case_types)] - struct ParamsSvc(pub Arc); - impl tonic::server::UnaryService - for ParamsSvc { - type Response = super::QueryParamsResponse; - type Future = BoxFuture< - tonic::Response, - 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 method = ParamsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.auth.v1beta1.Query/ModuleAccounts" => { - #[allow(non_camel_case_types)] - struct ModuleAccountsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for ModuleAccountsSvc { - type Response = super::QueryModuleAccountsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::module_accounts(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = ModuleAccountsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.auth.v1beta1.Query/ModuleAccountByName" => { - #[allow(non_camel_case_types)] - struct ModuleAccountByNameSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for ModuleAccountByNameSvc { - type Response = super::QueryModuleAccountByNameResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::QueryModuleAccountByNameRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::module_account_by_name(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = ModuleAccountByNameSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.auth.v1beta1.Query/Bech32Prefix" => { - #[allow(non_camel_case_types)] - struct Bech32PrefixSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for Bech32PrefixSvc { - type Response = super::Bech32PrefixResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::bech32_prefix(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = Bech32PrefixSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.auth.v1beta1.Query/AddressBytesToString" => { - #[allow(non_camel_case_types)] - struct AddressBytesToStringSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for AddressBytesToStringSvc { - type Response = super::AddressBytesToStringResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::address_bytes_to_string(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = AddressBytesToStringSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.auth.v1beta1.Query/AddressStringToBytes" => { - #[allow(non_camel_case_types)] - struct AddressStringToBytesSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for AddressStringToBytesSvc { - type Response = super::AddressStringToBytesResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::address_string_to_bytes(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = AddressStringToBytesSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.auth.v1beta1.Query/AccountInfo" => { - #[allow(non_camel_case_types)] - struct AccountInfoSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for AccountInfoSvc { - type Response = super::QueryAccountInfoResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::account_info(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = AccountInfoSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", tonic::Code::Unimplemented as i32) - .header( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ) - .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 tonic::server::NamedService for QueryServer { - const NAME: &'static str = "cosmos.auth.v1beta1.Query"; - } -} -/// GenesisState defines the auth module's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GenesisState { - /// params defines all the parameters of the module. - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, - /// accounts are the accounts present at genesis. - #[prost(message, repeated, tag = "2")] - pub accounts: ::prost::alloc::vec::Vec<::tendermint_proto::google::protobuf::Any>, -} -impl ::prost::Name for GenesisState { - const NAME: &'static str = "GenesisState"; - const PACKAGE: &'static str = "cosmos.auth.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.auth.v1beta1.GenesisState".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.auth.v1beta1.GenesisState".into() - } -} diff --git a/src/prost/cosmos.auth.v1beta1.serde.rs b/src/prost/cosmos.auth.v1beta1.serde.rs deleted file mode 100644 index 2a8f69cb..00000000 --- a/src/prost/cosmos.auth.v1beta1.serde.rs +++ /dev/null @@ -1,2668 +0,0 @@ -impl serde::Serialize for AddressBytesToStringRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.AddressBytesToStringRequest", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("addressBytes", pbjson::private::base64::encode(&self.address_bytes).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for AddressBytesToStringRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "address_bytes", - "addressBytes", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - AddressBytes, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "addressBytes" | "address_bytes" => Ok(GeneratedField::AddressBytes), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = AddressBytesToStringRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.auth.v1beta1.AddressBytesToStringRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut address_bytes__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::AddressBytes => { - if address_bytes__.is_some() { - return Err(serde::de::Error::duplicate_field("addressBytes")); - } - address_bytes__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - } - } - Ok(AddressBytesToStringRequest { - address_bytes: address_bytes__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.auth.v1beta1.AddressBytesToStringRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for AddressBytesToStringResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.AddressBytesToStringResponse", len)?; - if true { - struct_ser.serialize_field("addressString", &self.address_string)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for AddressBytesToStringResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "address_string", - "addressString", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - AddressString, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "addressString" | "address_string" => Ok(GeneratedField::AddressString), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = AddressBytesToStringResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.auth.v1beta1.AddressBytesToStringResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut address_string__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::AddressString => { - if address_string__.is_some() { - return Err(serde::de::Error::duplicate_field("addressString")); - } - address_string__ = Some(map_.next_value()?); - } - } - } - Ok(AddressBytesToStringResponse { - address_string: address_string__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.auth.v1beta1.AddressBytesToStringResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for AddressStringToBytesRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.AddressStringToBytesRequest", len)?; - if true { - struct_ser.serialize_field("addressString", &self.address_string)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for AddressStringToBytesRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "address_string", - "addressString", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - AddressString, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "addressString" | "address_string" => Ok(GeneratedField::AddressString), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = AddressStringToBytesRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.auth.v1beta1.AddressStringToBytesRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut address_string__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::AddressString => { - if address_string__.is_some() { - return Err(serde::de::Error::duplicate_field("addressString")); - } - address_string__ = Some(map_.next_value()?); - } - } - } - Ok(AddressStringToBytesRequest { - address_string: address_string__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.auth.v1beta1.AddressStringToBytesRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for AddressStringToBytesResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.AddressStringToBytesResponse", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("addressBytes", pbjson::private::base64::encode(&self.address_bytes).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for AddressStringToBytesResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "address_bytes", - "addressBytes", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - AddressBytes, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "addressBytes" | "address_bytes" => Ok(GeneratedField::AddressBytes), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = AddressStringToBytesResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.auth.v1beta1.AddressStringToBytesResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut address_bytes__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::AddressBytes => { - if address_bytes__.is_some() { - return Err(serde::de::Error::duplicate_field("addressBytes")); - } - address_bytes__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - } - } - Ok(AddressStringToBytesResponse { - address_bytes: address_bytes__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.auth.v1beta1.AddressStringToBytesResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for BaseAccount { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.BaseAccount", len)?; - if true { - struct_ser.serialize_field("address", &self.address)?; - } - if let Some(v) = self.pub_key.as_ref() { - struct_ser.serialize_field("pubKey", v)?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("accountNumber", ::alloc::string::ToString::to_string(&self.account_number).as_str())?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("sequence", ::alloc::string::ToString::to_string(&self.sequence).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for BaseAccount { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "address", - "pub_key", - "pubKey", - "account_number", - "accountNumber", - "sequence", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Address, - PubKey, - AccountNumber, - Sequence, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "address" => Ok(GeneratedField::Address), - "pubKey" | "pub_key" => Ok(GeneratedField::PubKey), - "accountNumber" | "account_number" => Ok(GeneratedField::AccountNumber), - "sequence" => Ok(GeneratedField::Sequence), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = BaseAccount; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.auth.v1beta1.BaseAccount") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut address__ = None; - let mut pub_key__ = None; - let mut account_number__ = None; - let mut sequence__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Address => { - if address__.is_some() { - return Err(serde::de::Error::duplicate_field("address")); - } - address__ = Some(map_.next_value()?); - } - GeneratedField::PubKey => { - if pub_key__.is_some() { - return Err(serde::de::Error::duplicate_field("pubKey")); - } - pub_key__ = map_.next_value()?; - } - GeneratedField::AccountNumber => { - if account_number__.is_some() { - return Err(serde::de::Error::duplicate_field("accountNumber")); - } - account_number__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Sequence => { - if sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("sequence")); - } - sequence__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(BaseAccount { - address: address__.unwrap_or_default(), - pub_key: pub_key__, - account_number: account_number__.unwrap_or_default(), - sequence: sequence__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.auth.v1beta1.BaseAccount", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Bech32PrefixRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.Bech32PrefixRequest", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Bech32PrefixRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Bech32PrefixRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.auth.v1beta1.Bech32PrefixRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(Bech32PrefixRequest { - }) - } - } - deserializer.deserialize_struct("cosmos.auth.v1beta1.Bech32PrefixRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Bech32PrefixResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.Bech32PrefixResponse", len)?; - if true { - struct_ser.serialize_field("bech32Prefix", &self.bech32_prefix)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Bech32PrefixResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "bech32_prefix", - "bech32Prefix", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Bech32Prefix, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "bech32Prefix" | "bech32_prefix" => Ok(GeneratedField::Bech32Prefix), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Bech32PrefixResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.auth.v1beta1.Bech32PrefixResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut bech32_prefix__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Bech32Prefix => { - if bech32_prefix__.is_some() { - return Err(serde::de::Error::duplicate_field("bech32Prefix")); - } - bech32_prefix__ = Some(map_.next_value()?); - } - } - } - Ok(Bech32PrefixResponse { - bech32_prefix: bech32_prefix__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.auth.v1beta1.Bech32PrefixResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for GenesisState { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.GenesisState", len)?; - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - if true { - struct_ser.serialize_field("accounts", &self.accounts)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GenesisState { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "params", - "accounts", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Params, - Accounts, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "params" => Ok(GeneratedField::Params), - "accounts" => Ok(GeneratedField::Accounts), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GenesisState; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.auth.v1beta1.GenesisState") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut params__ = None; - let mut accounts__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Params => { - if params__.is_some() { - return Err(serde::de::Error::duplicate_field("params")); - } - params__ = map_.next_value()?; - } - GeneratedField::Accounts => { - if accounts__.is_some() { - return Err(serde::de::Error::duplicate_field("accounts")); - } - accounts__ = Some(map_.next_value()?); - } - } - } - Ok(GenesisState { - params: params__, - accounts: accounts__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.auth.v1beta1.GenesisState", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for ModuleAccount { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.ModuleAccount", len)?; - if let Some(v) = self.base_account.as_ref() { - struct_ser.serialize_field("baseAccount", v)?; - } - if true { - struct_ser.serialize_field("name", &self.name)?; - } - if true { - struct_ser.serialize_field("permissions", &self.permissions)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ModuleAccount { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "base_account", - "baseAccount", - "name", - "permissions", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - BaseAccount, - Name, - Permissions, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "baseAccount" | "base_account" => Ok(GeneratedField::BaseAccount), - "name" => Ok(GeneratedField::Name), - "permissions" => Ok(GeneratedField::Permissions), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ModuleAccount; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.auth.v1beta1.ModuleAccount") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut base_account__ = None; - let mut name__ = None; - let mut permissions__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::BaseAccount => { - if base_account__.is_some() { - return Err(serde::de::Error::duplicate_field("baseAccount")); - } - base_account__ = map_.next_value()?; - } - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); - } - name__ = Some(map_.next_value()?); - } - GeneratedField::Permissions => { - if permissions__.is_some() { - return Err(serde::de::Error::duplicate_field("permissions")); - } - permissions__ = Some(map_.next_value()?); - } - } - } - Ok(ModuleAccount { - base_account: base_account__, - name: name__.unwrap_or_default(), - permissions: permissions__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.auth.v1beta1.ModuleAccount", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for ModuleCredential { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.ModuleCredential", len)?; - if true { - struct_ser.serialize_field("moduleName", &self.module_name)?; - } - if true { - struct_ser.serialize_field("derivationKeys", &self.derivation_keys.iter().map(pbjson::private::base64::encode).collect::<::alloc::vec::Vec<_>>())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ModuleCredential { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "module_name", - "moduleName", - "derivation_keys", - "derivationKeys", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ModuleName, - DerivationKeys, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "moduleName" | "module_name" => Ok(GeneratedField::ModuleName), - "derivationKeys" | "derivation_keys" => Ok(GeneratedField::DerivationKeys), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ModuleCredential; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.auth.v1beta1.ModuleCredential") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut module_name__ = None; - let mut derivation_keys__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ModuleName => { - if module_name__.is_some() { - return Err(serde::de::Error::duplicate_field("moduleName")); - } - module_name__ = Some(map_.next_value()?); - } - GeneratedField::DerivationKeys => { - if derivation_keys__.is_some() { - return Err(serde::de::Error::duplicate_field("derivationKeys")); - } - derivation_keys__ = - Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::BytesDeserialize<_>>>()? - .into_iter().map(|x| x.0).collect()) - ; - } - } - } - Ok(ModuleCredential { - module_name: module_name__.unwrap_or_default(), - derivation_keys: derivation_keys__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.auth.v1beta1.ModuleCredential", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgUpdateParams { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.MsgUpdateParams", len)?; - if true { - struct_ser.serialize_field("authority", &self.authority)?; - } - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgUpdateParams { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "authority", - "params", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Authority, - Params, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "authority" => Ok(GeneratedField::Authority), - "params" => Ok(GeneratedField::Params), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgUpdateParams; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.auth.v1beta1.MsgUpdateParams") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut authority__ = None; - let mut params__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Authority => { - if authority__.is_some() { - return Err(serde::de::Error::duplicate_field("authority")); - } - authority__ = Some(map_.next_value()?); - } - GeneratedField::Params => { - if params__.is_some() { - return Err(serde::de::Error::duplicate_field("params")); - } - params__ = map_.next_value()?; - } - } - } - Ok(MsgUpdateParams { - authority: authority__.unwrap_or_default(), - params: params__, - }) - } - } - deserializer.deserialize_struct("cosmos.auth.v1beta1.MsgUpdateParams", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgUpdateParamsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.MsgUpdateParamsResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgUpdateParamsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgUpdateParamsResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.auth.v1beta1.MsgUpdateParamsResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(MsgUpdateParamsResponse { - }) - } - } - deserializer.deserialize_struct("cosmos.auth.v1beta1.MsgUpdateParamsResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Params { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.Params", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("maxMemoCharacters", ::alloc::string::ToString::to_string(&self.max_memo_characters).as_str())?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("txSigLimit", ::alloc::string::ToString::to_string(&self.tx_sig_limit).as_str())?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("txSizeCostPerByte", ::alloc::string::ToString::to_string(&self.tx_size_cost_per_byte).as_str())?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("sigVerifyCostEd25519", ::alloc::string::ToString::to_string(&self.sig_verify_cost_ed25519).as_str())?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("sigVerifyCostSecp256k1", ::alloc::string::ToString::to_string(&self.sig_verify_cost_secp256k1).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Params { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "max_memo_characters", - "maxMemoCharacters", - "tx_sig_limit", - "txSigLimit", - "tx_size_cost_per_byte", - "txSizeCostPerByte", - "sig_verify_cost_ed25519", - "sigVerifyCostEd25519", - "sig_verify_cost_secp256k1", - "sigVerifyCostSecp256k1", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - MaxMemoCharacters, - TxSigLimit, - TxSizeCostPerByte, - SigVerifyCostEd25519, - SigVerifyCostSecp256k1, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "maxMemoCharacters" | "max_memo_characters" => Ok(GeneratedField::MaxMemoCharacters), - "txSigLimit" | "tx_sig_limit" => Ok(GeneratedField::TxSigLimit), - "txSizeCostPerByte" | "tx_size_cost_per_byte" => Ok(GeneratedField::TxSizeCostPerByte), - "sigVerifyCostEd25519" | "sig_verify_cost_ed25519" => Ok(GeneratedField::SigVerifyCostEd25519), - "sigVerifyCostSecp256k1" | "sig_verify_cost_secp256k1" => Ok(GeneratedField::SigVerifyCostSecp256k1), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Params; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.auth.v1beta1.Params") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut max_memo_characters__ = None; - let mut tx_sig_limit__ = None; - let mut tx_size_cost_per_byte__ = None; - let mut sig_verify_cost_ed25519__ = None; - let mut sig_verify_cost_secp256k1__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::MaxMemoCharacters => { - if max_memo_characters__.is_some() { - return Err(serde::de::Error::duplicate_field("maxMemoCharacters")); - } - max_memo_characters__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::TxSigLimit => { - if tx_sig_limit__.is_some() { - return Err(serde::de::Error::duplicate_field("txSigLimit")); - } - tx_sig_limit__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::TxSizeCostPerByte => { - if tx_size_cost_per_byte__.is_some() { - return Err(serde::de::Error::duplicate_field("txSizeCostPerByte")); - } - tx_size_cost_per_byte__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::SigVerifyCostEd25519 => { - if sig_verify_cost_ed25519__.is_some() { - return Err(serde::de::Error::duplicate_field("sigVerifyCostEd25519")); - } - sig_verify_cost_ed25519__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::SigVerifyCostSecp256k1 => { - if sig_verify_cost_secp256k1__.is_some() { - return Err(serde::de::Error::duplicate_field("sigVerifyCostSecp256k1")); - } - sig_verify_cost_secp256k1__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(Params { - max_memo_characters: max_memo_characters__.unwrap_or_default(), - tx_sig_limit: tx_sig_limit__.unwrap_or_default(), - tx_size_cost_per_byte: tx_size_cost_per_byte__.unwrap_or_default(), - sig_verify_cost_ed25519: sig_verify_cost_ed25519__.unwrap_or_default(), - sig_verify_cost_secp256k1: sig_verify_cost_secp256k1__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.auth.v1beta1.Params", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryAccountAddressByIdRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.QueryAccountAddressByIDRequest", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("id", ::alloc::string::ToString::to_string(&self.id).as_str())?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("accountId", ::alloc::string::ToString::to_string(&self.account_id).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryAccountAddressByIdRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "id", - "account_id", - "accountId", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Id, - AccountId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "id" => Ok(GeneratedField::Id), - "accountId" | "account_id" => Ok(GeneratedField::AccountId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryAccountAddressByIdRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.auth.v1beta1.QueryAccountAddressByIDRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut id__ = None; - let mut account_id__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Id => { - if id__.is_some() { - return Err(serde::de::Error::duplicate_field("id")); - } - id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::AccountId => { - if account_id__.is_some() { - return Err(serde::de::Error::duplicate_field("accountId")); - } - account_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(QueryAccountAddressByIdRequest { - id: id__.unwrap_or_default(), - account_id: account_id__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.auth.v1beta1.QueryAccountAddressByIDRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryAccountAddressByIdResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.QueryAccountAddressByIDResponse", len)?; - if true { - struct_ser.serialize_field("accountAddress", &self.account_address)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryAccountAddressByIdResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "account_address", - "accountAddress", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - AccountAddress, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "accountAddress" | "account_address" => Ok(GeneratedField::AccountAddress), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryAccountAddressByIdResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.auth.v1beta1.QueryAccountAddressByIDResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut account_address__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::AccountAddress => { - if account_address__.is_some() { - return Err(serde::de::Error::duplicate_field("accountAddress")); - } - account_address__ = Some(map_.next_value()?); - } - } - } - Ok(QueryAccountAddressByIdResponse { - account_address: account_address__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.auth.v1beta1.QueryAccountAddressByIDResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryAccountInfoRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.QueryAccountInfoRequest", len)?; - if true { - struct_ser.serialize_field("address", &self.address)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryAccountInfoRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "address", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Address, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "address" => Ok(GeneratedField::Address), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryAccountInfoRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.auth.v1beta1.QueryAccountInfoRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut address__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Address => { - if address__.is_some() { - return Err(serde::de::Error::duplicate_field("address")); - } - address__ = Some(map_.next_value()?); - } - } - } - Ok(QueryAccountInfoRequest { - address: address__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.auth.v1beta1.QueryAccountInfoRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryAccountInfoResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.QueryAccountInfoResponse", len)?; - if let Some(v) = self.info.as_ref() { - struct_ser.serialize_field("info", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryAccountInfoResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "info", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Info, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "info" => Ok(GeneratedField::Info), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryAccountInfoResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.auth.v1beta1.QueryAccountInfoResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut info__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Info => { - if info__.is_some() { - return Err(serde::de::Error::duplicate_field("info")); - } - info__ = map_.next_value()?; - } - } - } - Ok(QueryAccountInfoResponse { - info: info__, - }) - } - } - deserializer.deserialize_struct("cosmos.auth.v1beta1.QueryAccountInfoResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryAccountRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.QueryAccountRequest", len)?; - if true { - struct_ser.serialize_field("address", &self.address)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryAccountRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "address", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Address, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "address" => Ok(GeneratedField::Address), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryAccountRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.auth.v1beta1.QueryAccountRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut address__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Address => { - if address__.is_some() { - return Err(serde::de::Error::duplicate_field("address")); - } - address__ = Some(map_.next_value()?); - } - } - } - Ok(QueryAccountRequest { - address: address__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.auth.v1beta1.QueryAccountRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryAccountResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.QueryAccountResponse", len)?; - if let Some(v) = self.account.as_ref() { - struct_ser.serialize_field("account", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryAccountResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "account", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Account, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "account" => Ok(GeneratedField::Account), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryAccountResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.auth.v1beta1.QueryAccountResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut account__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Account => { - if account__.is_some() { - return Err(serde::de::Error::duplicate_field("account")); - } - account__ = map_.next_value()?; - } - } - } - Ok(QueryAccountResponse { - account: account__, - }) - } - } - deserializer.deserialize_struct("cosmos.auth.v1beta1.QueryAccountResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryAccountsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.QueryAccountsRequest", len)?; - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryAccountsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryAccountsRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.auth.v1beta1.QueryAccountsRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryAccountsRequest { - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.auth.v1beta1.QueryAccountsRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryAccountsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.QueryAccountsResponse", len)?; - if true { - struct_ser.serialize_field("accounts", &self.accounts)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryAccountsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "accounts", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Accounts, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "accounts" => Ok(GeneratedField::Accounts), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryAccountsResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.auth.v1beta1.QueryAccountsResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut accounts__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Accounts => { - if accounts__.is_some() { - return Err(serde::de::Error::duplicate_field("accounts")); - } - accounts__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryAccountsResponse { - accounts: accounts__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.auth.v1beta1.QueryAccountsResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryModuleAccountByNameRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.QueryModuleAccountByNameRequest", len)?; - if true { - struct_ser.serialize_field("name", &self.name)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryModuleAccountByNameRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "name", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Name, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "name" => Ok(GeneratedField::Name), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryModuleAccountByNameRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.auth.v1beta1.QueryModuleAccountByNameRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut name__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); - } - name__ = Some(map_.next_value()?); - } - } - } - Ok(QueryModuleAccountByNameRequest { - name: name__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.auth.v1beta1.QueryModuleAccountByNameRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryModuleAccountByNameResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.QueryModuleAccountByNameResponse", len)?; - if let Some(v) = self.account.as_ref() { - struct_ser.serialize_field("account", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryModuleAccountByNameResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "account", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Account, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "account" => Ok(GeneratedField::Account), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryModuleAccountByNameResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.auth.v1beta1.QueryModuleAccountByNameResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut account__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Account => { - if account__.is_some() { - return Err(serde::de::Error::duplicate_field("account")); - } - account__ = map_.next_value()?; - } - } - } - Ok(QueryModuleAccountByNameResponse { - account: account__, - }) - } - } - deserializer.deserialize_struct("cosmos.auth.v1beta1.QueryModuleAccountByNameResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryModuleAccountsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.QueryModuleAccountsRequest", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryModuleAccountsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryModuleAccountsRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.auth.v1beta1.QueryModuleAccountsRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(QueryModuleAccountsRequest { - }) - } - } - deserializer.deserialize_struct("cosmos.auth.v1beta1.QueryModuleAccountsRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryModuleAccountsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.QueryModuleAccountsResponse", len)?; - if true { - struct_ser.serialize_field("accounts", &self.accounts)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryModuleAccountsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "accounts", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Accounts, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "accounts" => Ok(GeneratedField::Accounts), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryModuleAccountsResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.auth.v1beta1.QueryModuleAccountsResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut accounts__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Accounts => { - if accounts__.is_some() { - return Err(serde::de::Error::duplicate_field("accounts")); - } - accounts__ = Some(map_.next_value()?); - } - } - } - Ok(QueryModuleAccountsResponse { - accounts: accounts__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.auth.v1beta1.QueryModuleAccountsResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryParamsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.QueryParamsRequest", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryParamsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryParamsRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.auth.v1beta1.QueryParamsRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(QueryParamsRequest { - }) - } - } - deserializer.deserialize_struct("cosmos.auth.v1beta1.QueryParamsRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryParamsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.QueryParamsResponse", len)?; - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryParamsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "params", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Params, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "params" => Ok(GeneratedField::Params), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryParamsResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.auth.v1beta1.QueryParamsResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut params__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Params => { - if params__.is_some() { - return Err(serde::de::Error::duplicate_field("params")); - } - params__ = map_.next_value()?; - } - } - } - Ok(QueryParamsResponse { - params: params__, - }) - } - } - deserializer.deserialize_struct("cosmos.auth.v1beta1.QueryParamsResponse", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.bank.module.v1.rs b/src/prost/cosmos.bank.module.v1.rs deleted file mode 100644 index c955d667..00000000 --- a/src/prost/cosmos.bank.module.v1.rs +++ /dev/null @@ -1,26 +0,0 @@ -// This file is @generated by prost-build. -/// Module is the config object of the bank module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Module { - /// blocked_module_accounts 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, -} -impl ::prost::Name for Module { - const NAME: &'static str = "Module"; - const PACKAGE: &'static str = "cosmos.bank.module.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.module.v1.Module".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.module.v1.Module".into() - } -} diff --git a/src/prost/cosmos.bank.module.v1.serde.rs b/src/prost/cosmos.bank.module.v1.serde.rs deleted file mode 100644 index d9196d61..00000000 --- a/src/prost/cosmos.bank.module.v1.serde.rs +++ /dev/null @@ -1,109 +0,0 @@ -impl serde::Serialize for Module { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.module.v1.Module", len)?; - if true { - struct_ser.serialize_field("blockedModuleAccountsOverride", &self.blocked_module_accounts_override)?; - } - if true { - struct_ser.serialize_field("authority", &self.authority)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Module { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "blocked_module_accounts_override", - "blockedModuleAccountsOverride", - "authority", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - BlockedModuleAccountsOverride, - Authority, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "blockedModuleAccountsOverride" | "blocked_module_accounts_override" => Ok(GeneratedField::BlockedModuleAccountsOverride), - "authority" => Ok(GeneratedField::Authority), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Module; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.module.v1.Module") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut blocked_module_accounts_override__ = None; - let mut authority__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::BlockedModuleAccountsOverride => { - if blocked_module_accounts_override__.is_some() { - return Err(serde::de::Error::duplicate_field("blockedModuleAccountsOverride")); - } - blocked_module_accounts_override__ = Some(map_.next_value()?); - } - GeneratedField::Authority => { - if authority__.is_some() { - return Err(serde::de::Error::duplicate_field("authority")); - } - authority__ = Some(map_.next_value()?); - } - } - } - Ok(Module { - blocked_module_accounts_override: blocked_module_accounts_override__.unwrap_or_default(), - authority: authority__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.bank.module.v1.Module", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.bank.v1beta1.rs b/src/prost/cosmos.bank.v1beta1.rs deleted file mode 100644 index 51256193..00000000 --- a/src/prost/cosmos.bank.v1beta1.rs +++ /dev/null @@ -1,2613 +0,0 @@ -// This file is @generated by prost-build. -/// Params defines the parameters for the bank module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Params { - /// Deprecated: Use of SendEnabled in params is deprecated. - /// For genesis, use the newly added send_enabled field in the genesis object. - /// Storage, lookup, and manipulation of this information is now in the keeper. - /// - /// As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. - #[deprecated] - #[prost(message, repeated, tag = "1")] - pub send_enabled: ::prost::alloc::vec::Vec, - #[prost(bool, tag = "2")] - pub default_send_enabled: bool, -} -impl ::prost::Name for Params { - const NAME: &'static str = "Params"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.Params".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.Params".into() - } -} -/// SendEnabled maps coin denom to a send_enabled status (whether a denom is -/// sendable). -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SendEnabled { - #[prost(string, tag = "1")] - pub denom: ::prost::alloc::string::String, - #[prost(bool, tag = "2")] - pub enabled: bool, -} -impl ::prost::Name for SendEnabled { - const NAME: &'static str = "SendEnabled"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.SendEnabled".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.SendEnabled".into() - } -} -/// Input models transaction input. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Input { - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub coins: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for Input { - const NAME: &'static str = "Input"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.Input".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.Input".into() - } -} -/// Output models transaction outputs. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Output { - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub coins: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for Output { - const NAME: &'static str = "Output"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.Output".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.Output".into() - } -} -/// Supply represents a struct that passively keeps track of the total supply -/// amounts in the network. -/// This message is deprecated now that supply is indexed by denom. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Supply { - #[prost(message, repeated, tag = "1")] - pub total: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for Supply { - const NAME: &'static str = "Supply"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.Supply".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.Supply".into() - } -} -/// DenomUnit represents a struct that describes a given -/// denomination unit of the basic token. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DenomUnit { - /// denom represents the string name of the given denom unit (e.g uatom). - #[prost(string, tag = "1")] - pub denom: ::prost::alloc::string::String, - /// exponent represents power of 10 exponent that one must - /// raise the base_denom to in order to equal the given DenomUnit's denom - /// 1 denom = 10^exponent base_denom - /// (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with - /// exponent = 6, thus: 1 atom = 10^6 uatom). - #[prost(uint32, tag = "2")] - pub exponent: u32, - /// aliases is a list of string aliases for the given denom - #[prost(string, repeated, tag = "3")] - pub aliases: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -impl ::prost::Name for DenomUnit { - const NAME: &'static str = "DenomUnit"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.DenomUnit".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.DenomUnit".into() - } -} -/// Metadata represents a struct that describes -/// a basic token. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Metadata { - #[prost(string, tag = "1")] - pub description: ::prost::alloc::string::String, - /// denom_units represents the list of DenomUnit's for a given coin - #[prost(message, repeated, tag = "2")] - pub denom_units: ::prost::alloc::vec::Vec, - /// base represents the base denom (should be the DenomUnit with exponent = 0). - #[prost(string, tag = "3")] - pub base: ::prost::alloc::string::String, - /// display indicates the suggested denom that should be - /// displayed in clients. - #[prost(string, tag = "4")] - pub display: ::prost::alloc::string::String, - /// name defines the name of the token (eg: Cosmos Atom) - /// - /// Since: cosmos-sdk 0.43 - #[prost(string, tag = "5")] - pub name: ::prost::alloc::string::String, - /// symbol is the token symbol usually shown on exchanges (eg: ATOM). This can - /// be the same as the display. - /// - /// Since: cosmos-sdk 0.43 - #[prost(string, tag = "6")] - pub symbol: ::prost::alloc::string::String, - /// URI to a document (on or off-chain) that contains additional information. Optional. - /// - /// Since: cosmos-sdk 0.46 - #[prost(string, tag = "7")] - pub uri: ::prost::alloc::string::String, - /// URIHash is a sha256 hash of a document pointed by URI. It's used to verify that - /// the document didn't change. Optional. - /// - /// Since: cosmos-sdk 0.46 - #[prost(string, tag = "8")] - pub uri_hash: ::prost::alloc::string::String, -} -impl ::prost::Name for Metadata { - const NAME: &'static str = "Metadata"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.Metadata".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.Metadata".into() - } -} -/// MsgSend represents a message to send coins from one account to another. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSend { - #[prost(string, tag = "1")] - pub from_address: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub to_address: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "3")] - pub amount: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for MsgSend { - const NAME: &'static str = "MsgSend"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.MsgSend".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.MsgSend".into() - } -} -/// MsgSendResponse defines the Msg/Send response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct MsgSendResponse {} -impl ::prost::Name for MsgSendResponse { - const NAME: &'static str = "MsgSendResponse"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.MsgSendResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.MsgSendResponse".into() - } -} -/// MsgMultiSend represents an arbitrary multi-in, multi-out send message. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -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")] - pub outputs: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for MsgMultiSend { - const NAME: &'static str = "MsgMultiSend"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.MsgMultiSend".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.MsgMultiSend".into() - } -} -/// MsgMultiSendResponse defines the Msg/MultiSend response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct MsgMultiSendResponse {} -impl ::prost::Name for MsgMultiSendResponse { - const NAME: &'static str = "MsgMultiSendResponse"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.MsgMultiSendResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.MsgMultiSendResponse".into() - } -} -/// MsgUpdateParams is the Msg/UpdateParams request type. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -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, -} -impl ::prost::Name for MsgUpdateParams { - const NAME: &'static str = "MsgUpdateParams"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.MsgUpdateParams".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.MsgUpdateParams".into() - } -} -/// MsgUpdateParamsResponse defines the response structure for executing a -/// MsgUpdateParams message. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct MsgUpdateParamsResponse {} -impl ::prost::Name for MsgUpdateParamsResponse { - const NAME: &'static str = "MsgUpdateParamsResponse"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.MsgUpdateParamsResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.MsgUpdateParamsResponse".into() - } -} -/// 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, ::prost::Message)] -pub struct MsgSetSendEnabled { - #[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>, -} -impl ::prost::Name for MsgSetSendEnabled { - const NAME: &'static str = "MsgSetSendEnabled"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.MsgSetSendEnabled".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.MsgSetSendEnabled".into() - } -} -/// MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct MsgSetSendEnabledResponse {} -impl ::prost::Name for MsgSetSendEnabledResponse { - const NAME: &'static str = "MsgSetSendEnabledResponse"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.MsgSetSendEnabledResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.MsgSetSendEnabledResponse".into() - } -} -/// Generated client implementations. -#[cfg(feature = "client")] -pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - /// Msg defines the bank Msg service. - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, - } - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: 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 - } - /// Send defines a method for sending coins from one account to another account. - pub async fn send( - &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( - "/cosmos.bank.v1beta1.Msg/Send", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.bank.v1beta1.Msg", "Send")); - self.inner.unary(req, path, codec).await - } - /// MultiSend defines a method for sending coins from some accounts to other accounts. - pub async fn multi_send( - &mut self, - request: impl tonic::IntoRequest, - ) -> 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( - "/cosmos.bank.v1beta1.Msg/MultiSend", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.bank.v1beta1.Msg", "MultiSend")); - self.inner.unary(req, path, codec).await - } - /// UpdateParams defines a governance operation for updating the x/bank module parameters. - /// The authority is defined in the keeper. - /// - /// Since: cosmos-sdk 0.47 - pub async fn update_params( - &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( - "/cosmos.bank.v1beta1.Msg/UpdateParams", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.bank.v1beta1.Msg", "UpdateParams")); - self.inner.unary(req, path, codec).await - } - /// SetSendEnabled is a governance operation for setting the SendEnabled flag - /// on any number of Denoms. Only the entries to add or update should be - /// included. Entries that already exist in the store, but that aren't - /// included in this message, will be left unchanged. - /// - /// Since: cosmos-sdk 0.47 - pub async fn set_send_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( - "/cosmos.bank.v1beta1.Msg/SetSendEnabled", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.bank.v1beta1.Msg", "SetSendEnabled")); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -#[cfg(feature = "server")] -pub mod msg_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. - #[async_trait] - pub trait Msg: Send + Sync + 'static { - /// Send defines a method for sending coins from one account to another account. - async fn send( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - /// MultiSend defines a method for sending coins from some accounts to other accounts. - async fn multi_send( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// UpdateParams defines a governance operation for updating the x/bank module parameters. - /// The authority is defined in the keeper. - /// - /// Since: cosmos-sdk 0.47 - async fn update_params( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// SetSendEnabled is a governance operation for setting the SendEnabled flag - /// on any number of Denoms. Only the entries to add or update should be - /// included. Entries that already exist in the store, but that aren't - /// included in this message, will be left unchanged. - /// - /// Since: cosmos-sdk 0.47 - async fn set_send_enabled( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - /// Msg defines the bank Msg service. - #[derive(Debug)] - pub struct MsgServer { - inner: Arc, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - impl MsgServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - 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 { - match req.uri().path() { - "/cosmos.bank.v1beta1.Msg/Send" => { - #[allow(non_camel_case_types)] - struct SendSvc(pub Arc); - impl tonic::server::UnaryService - for SendSvc { - type Response = super::MsgSendResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::send(&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 method = SendSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.bank.v1beta1.Msg/MultiSend" => { - #[allow(non_camel_case_types)] - struct MultiSendSvc(pub Arc); - impl tonic::server::UnaryService - for MultiSendSvc { - type Response = super::MsgMultiSendResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::multi_send(&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 method = MultiSendSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.bank.v1beta1.Msg/UpdateParams" => { - #[allow(non_camel_case_types)] - struct UpdateParamsSvc(pub Arc); - impl tonic::server::UnaryService - for UpdateParamsSvc { - type Response = super::MsgUpdateParamsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::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 method = UpdateParamsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.bank.v1beta1.Msg/SetSendEnabled" => { - #[allow(non_camel_case_types)] - struct SetSendEnabledSvc(pub Arc); - impl tonic::server::UnaryService - for SetSendEnabledSvc { - type Response = super::MsgSetSendEnabledResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::set_send_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 method = SetSendEnabledSvc(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", tonic::Code::Unimplemented as i32) - .header( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ) - .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 tonic::server::NamedService for MsgServer { - const NAME: &'static str = "cosmos.bank.v1beta1.Msg"; - } -} -/// QueryBalanceRequest is the request type for the Query/Balance RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryBalanceRequest { - /// 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, -} -impl ::prost::Name for QueryBalanceRequest { - const NAME: &'static str = "QueryBalanceRequest"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.QueryBalanceRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.QueryBalanceRequest".into() - } -} -/// QueryBalanceResponse is the response type for the Query/Balance RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryBalanceResponse { - /// balance is the balance of the coin. - #[prost(message, optional, tag = "1")] - pub balance: ::core::option::Option, -} -impl ::prost::Name for QueryBalanceResponse { - const NAME: &'static str = "QueryBalanceResponse"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.QueryBalanceResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.QueryBalanceResponse".into() - } -} -/// QueryBalanceRequest is the request type for the Query/AllBalances RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryAllBalancesRequest { - /// address is the address to query balances for. - #[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< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryAllBalancesRequest { - const NAME: &'static str = "QueryAllBalancesRequest"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.QueryAllBalancesRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.QueryAllBalancesRequest".into() - } -} -/// QueryAllBalancesResponse is the response type for the Query/AllBalances RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryAllBalancesResponse { - /// balances is the balances of all the coins. - #[prost(message, repeated, tag = "1")] - pub balances: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryAllBalancesResponse { - const NAME: &'static str = "QueryAllBalancesResponse"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.QueryAllBalancesResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.QueryAllBalancesResponse".into() - } -} -/// QuerySpendableBalancesRequest defines the gRPC request structure for querying -/// an account's spendable balances. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QuerySpendableBalancesRequest { - /// address is the address to query spendable balances for. - #[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< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QuerySpendableBalancesRequest { - const NAME: &'static str = "QuerySpendableBalancesRequest"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.QuerySpendableBalancesRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.QuerySpendableBalancesRequest".into() - } -} -/// QuerySpendableBalancesResponse defines the gRPC response structure for querying -/// an account's spendable balances. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QuerySpendableBalancesResponse { - /// balances is the spendable balances of all the coins. - #[prost(message, repeated, tag = "1")] - pub balances: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QuerySpendableBalancesResponse { - const NAME: &'static str = "QuerySpendableBalancesResponse"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.QuerySpendableBalancesResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.QuerySpendableBalancesResponse".into() - } -} -/// 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, ::prost::Message)] -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, -} -impl ::prost::Name for QuerySpendableBalanceByDenomRequest { - const NAME: &'static str = "QuerySpendableBalanceByDenomRequest"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest".into() - } -} -/// 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, ::prost::Message)] -pub struct QuerySpendableBalanceByDenomResponse { - /// balance is the balance of the coin. - #[prost(message, optional, tag = "1")] - pub balance: ::core::option::Option, -} -impl ::prost::Name for QuerySpendableBalanceByDenomResponse { - const NAME: &'static str = "QuerySpendableBalanceByDenomResponse"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse".into() - } -} -/// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryTotalSupplyRequest { - /// pagination defines an optional pagination for the request. - /// - /// Since: cosmos-sdk 0.43 - #[prost(message, optional, tag = "1")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryTotalSupplyRequest { - const NAME: &'static str = "QueryTotalSupplyRequest"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.QueryTotalSupplyRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.QueryTotalSupplyRequest".into() - } -} -/// QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC -/// method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryTotalSupplyResponse { - /// supply is the supply of the coins - #[prost(message, repeated, tag = "1")] - pub supply: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - /// - /// Since: cosmos-sdk 0.43 - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryTotalSupplyResponse { - const NAME: &'static str = "QueryTotalSupplyResponse"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.QueryTotalSupplyResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.QueryTotalSupplyResponse".into() - } -} -/// QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QuerySupplyOfRequest { - /// denom is the coin denom to query balances for. - #[prost(string, tag = "1")] - pub denom: ::prost::alloc::string::String, -} -impl ::prost::Name for QuerySupplyOfRequest { - const NAME: &'static str = "QuerySupplyOfRequest"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.QuerySupplyOfRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.QuerySupplyOfRequest".into() - } -} -/// QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QuerySupplyOfResponse { - /// amount is the supply of the coin. - #[prost(message, optional, tag = "1")] - pub amount: ::core::option::Option, -} -impl ::prost::Name for QuerySupplyOfResponse { - const NAME: &'static str = "QuerySupplyOfResponse"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.QuerySupplyOfResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.QuerySupplyOfResponse".into() - } -} -/// QueryParamsRequest defines the request type for querying x/bank parameters. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct QueryParamsRequest {} -impl ::prost::Name for QueryParamsRequest { - const NAME: &'static str = "QueryParamsRequest"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.QueryParamsRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.QueryParamsRequest".into() - } -} -/// QueryParamsResponse defines the response type for querying x/bank parameters. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryParamsResponse { - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, -} -impl ::prost::Name for QueryParamsResponse { - const NAME: &'static str = "QueryParamsResponse"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.QueryParamsResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.QueryParamsResponse".into() - } -} -/// QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDenomsMetadataRequest { - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "1")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryDenomsMetadataRequest { - const NAME: &'static str = "QueryDenomsMetadataRequest"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.QueryDenomsMetadataRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.QueryDenomsMetadataRequest".into() - } -} -/// QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDenomsMetadataResponse { - /// metadata provides the client information for all the registered tokens. - #[prost(message, repeated, tag = "1")] - pub metadatas: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryDenomsMetadataResponse { - const NAME: &'static str = "QueryDenomsMetadataResponse"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.QueryDenomsMetadataResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.QueryDenomsMetadataResponse".into() - } -} -/// QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDenomMetadataRequest { - /// denom is the coin denom to query the metadata for. - #[prost(string, tag = "1")] - pub denom: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryDenomMetadataRequest { - const NAME: &'static str = "QueryDenomMetadataRequest"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.QueryDenomMetadataRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.QueryDenomMetadataRequest".into() - } -} -/// QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDenomMetadataResponse { - /// metadata describes and provides all the client information for the requested token. - #[prost(message, optional, tag = "1")] - pub metadata: ::core::option::Option, -} -impl ::prost::Name for QueryDenomMetadataResponse { - const NAME: &'static str = "QueryDenomMetadataResponse"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.QueryDenomMetadataResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.QueryDenomMetadataResponse".into() - } -} -/// QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, -/// which queries for a paginated set of all account holders of a particular -/// denomination. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDenomOwnersRequest { - /// 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< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryDenomOwnersRequest { - const NAME: &'static str = "QueryDenomOwnersRequest"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.QueryDenomOwnersRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.QueryDenomOwnersRequest".into() - } -} -/// DenomOwner defines structure representing an account that owns or holds a -/// particular denominated token. It contains the account address and account -/// balance of the denominated token. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DenomOwner { - /// address defines the address that owns a particular denomination. - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - /// balance is the balance of the denominated coin for an account. - #[prost(message, optional, tag = "2")] - pub balance: ::core::option::Option, -} -impl ::prost::Name for DenomOwner { - const NAME: &'static str = "DenomOwner"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.DenomOwner".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.DenomOwner".into() - } -} -/// QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDenomOwnersResponse { - #[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< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryDenomOwnersResponse { - const NAME: &'static str = "QueryDenomOwnersResponse"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.QueryDenomOwnersResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.QueryDenomOwnersResponse".into() - } -} -/// QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -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. - #[prost(message, optional, tag = "99")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QuerySendEnabledRequest { - const NAME: &'static str = "QuerySendEnabledRequest"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.QuerySendEnabledRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.QuerySendEnabledRequest".into() - } -} -/// QuerySendEnabledResponse defines the RPC response of a SendEnable query. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -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. - #[prost(message, optional, tag = "99")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QuerySendEnabledResponse { - const NAME: &'static str = "QuerySendEnabledResponse"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.QuerySendEnabledResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.QuerySendEnabledResponse".into() - } -} -/// Generated client implementations. -#[cfg(feature = "client")] -pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - /// Query defines the gRPC querier service. - #[derive(Debug, Clone)] - pub struct QueryClient { - inner: tonic::client::Grpc, - } - impl QueryClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: 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 - } - /// Balance queries the balance of a single coin for a single account. - pub async fn balance( - &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( - "/cosmos.bank.v1beta1.Query/Balance", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.bank.v1beta1.Query", "Balance")); - self.inner.unary(req, path, codec).await - } - /// AllBalances queries the balance of all coins for a single account. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - pub async fn all_balances( - &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( - "/cosmos.bank.v1beta1.Query/AllBalances", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.bank.v1beta1.Query", "AllBalances")); - self.inner.unary(req, path, codec).await - } - /// SpendableBalances queries the spendable balance of all coins for a single - /// account. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - /// - /// Since: cosmos-sdk 0.46 - pub async fn spendable_balances( - &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( - "/cosmos.bank.v1beta1.Query/SpendableBalances", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("cosmos.bank.v1beta1.Query", "SpendableBalances"), - ); - self.inner.unary(req, path, codec).await - } - /// SpendableBalanceByDenom queries the spendable balance of a single denom for - /// a single account. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - /// - /// Since: cosmos-sdk 0.47 - pub async fn spendable_balance_by_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( - "/cosmos.bank.v1beta1.Query/SpendableBalanceByDenom", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.bank.v1beta1.Query", - "SpendableBalanceByDenom", - ), - ); - self.inner.unary(req, path, codec).await - } - /// TotalSupply queries the total supply of all coins. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - pub async fn total_supply( - &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( - "/cosmos.bank.v1beta1.Query/TotalSupply", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.bank.v1beta1.Query", "TotalSupply")); - self.inner.unary(req, path, codec).await - } - /// SupplyOf queries the supply of a single coin. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - pub async fn supply_of( - &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( - "/cosmos.bank.v1beta1.Query/SupplyOf", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.bank.v1beta1.Query", "SupplyOf")); - self.inner.unary(req, path, codec).await - } - /// Params queries the parameters of x/bank module. - pub async fn params( - &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( - "/cosmos.bank.v1beta1.Query/Params", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.bank.v1beta1.Query", "Params")); - self.inner.unary(req, path, codec).await - } - /// DenomsMetadata queries the client metadata of a given coin denomination. - pub async fn denom_metadata( - &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( - "/cosmos.bank.v1beta1.Query/DenomMetadata", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.bank.v1beta1.Query", "DenomMetadata")); - self.inner.unary(req, path, codec).await - } - /// DenomsMetadata queries the client metadata for all registered coin - /// denominations. - pub async fn denoms_metadata( - &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( - "/cosmos.bank.v1beta1.Query/DenomsMetadata", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.bank.v1beta1.Query", "DenomsMetadata")); - self.inner.unary(req, path, codec).await - } - /// DenomOwners queries for all account addresses that own a particular token - /// denomination. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - /// - /// Since: cosmos-sdk 0.46 - pub async fn denom_owners( - &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( - "/cosmos.bank.v1beta1.Query/DenomOwners", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.bank.v1beta1.Query", "DenomOwners")); - self.inner.unary(req, path, codec).await - } - /// SendEnabled queries for SendEnabled entries. - /// - /// This query only returns denominations that have specific SendEnabled settings. - /// Any denomination that does not have a specific setting will use the default - /// params.default_send_enabled, and will not be returned by this query. - /// - /// Since: cosmos-sdk 0.47 - pub async fn send_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( - "/cosmos.bank.v1beta1.Query/SendEnabled", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.bank.v1beta1.Query", "SendEnabled")); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -#[cfg(feature = "server")] -pub mod query_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. - #[async_trait] - pub trait Query: Send + Sync + 'static { - /// Balance queries the balance of a single coin for a single account. - async fn balance( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// AllBalances queries the balance of all coins for a single account. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - async fn all_balances( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// SpendableBalances queries the spendable balance of all coins for a single - /// account. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - /// - /// Since: cosmos-sdk 0.46 - async fn spendable_balances( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// SpendableBalanceByDenom queries the spendable balance of a single denom for - /// a single account. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - /// - /// Since: cosmos-sdk 0.47 - async fn spendable_balance_by_denom( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// TotalSupply queries the total supply of all coins. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - async fn total_supply( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// SupplyOf queries the supply of a single coin. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - async fn supply_of( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Params queries the parameters of x/bank module. - async fn params( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DenomsMetadata queries the client metadata of a given coin denomination. - async fn denom_metadata( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DenomsMetadata queries the client metadata for all registered coin - /// denominations. - async fn denoms_metadata( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DenomOwners queries for all account addresses that own a particular token - /// denomination. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - /// - /// Since: cosmos-sdk 0.46 - async fn denom_owners( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// SendEnabled queries for SendEnabled entries. - /// - /// This query only returns denominations that have specific SendEnabled settings. - /// Any denomination that does not have a specific setting will use the default - /// params.default_send_enabled, and will not be returned by this query. - /// - /// Since: cosmos-sdk 0.47 - async fn send_enabled( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - /// Query defines the gRPC querier service. - #[derive(Debug)] - pub struct QueryServer { - inner: Arc, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - impl QueryServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - 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 { - match req.uri().path() { - "/cosmos.bank.v1beta1.Query/Balance" => { - #[allow(non_camel_case_types)] - struct BalanceSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for BalanceSvc { - type Response = super::QueryBalanceResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::balance(&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 method = BalanceSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.bank.v1beta1.Query/AllBalances" => { - #[allow(non_camel_case_types)] - struct AllBalancesSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for AllBalancesSvc { - type Response = super::QueryAllBalancesResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::all_balances(&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 method = AllBalancesSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.bank.v1beta1.Query/SpendableBalances" => { - #[allow(non_camel_case_types)] - struct SpendableBalancesSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for SpendableBalancesSvc { - type Response = super::QuerySpendableBalancesResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::spendable_balances(&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 method = SpendableBalancesSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.bank.v1beta1.Query/SpendableBalanceByDenom" => { - #[allow(non_camel_case_types)] - struct SpendableBalanceByDenomSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService< - super::QuerySpendableBalanceByDenomRequest, - > for SpendableBalanceByDenomSvc { - type Response = super::QuerySpendableBalanceByDenomResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::QuerySpendableBalanceByDenomRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::spendable_balance_by_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 method = SpendableBalanceByDenomSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.bank.v1beta1.Query/TotalSupply" => { - #[allow(non_camel_case_types)] - struct TotalSupplySvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for TotalSupplySvc { - type Response = super::QueryTotalSupplyResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::total_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 method = TotalSupplySvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.bank.v1beta1.Query/SupplyOf" => { - #[allow(non_camel_case_types)] - struct SupplyOfSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for SupplyOfSvc { - type Response = super::QuerySupplyOfResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::supply_of(&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 method = SupplyOfSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.bank.v1beta1.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::Response, - 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 method = ParamsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.bank.v1beta1.Query/DenomMetadata" => { - #[allow(non_camel_case_types)] - struct DenomMetadataSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for DenomMetadataSvc { - type Response = super::QueryDenomMetadataResponse; - type Future = BoxFuture< - tonic::Response, - 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 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) - } - "/cosmos.bank.v1beta1.Query/DenomsMetadata" => { - #[allow(non_camel_case_types)] - struct DenomsMetadataSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for DenomsMetadataSvc { - type Response = super::QueryDenomsMetadataResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::denoms_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 method = DenomsMetadataSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.bank.v1beta1.Query/DenomOwners" => { - #[allow(non_camel_case_types)] - struct DenomOwnersSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for DenomOwnersSvc { - type Response = super::QueryDenomOwnersResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::denom_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 method = DenomOwnersSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.bank.v1beta1.Query/SendEnabled" => { - #[allow(non_camel_case_types)] - struct SendEnabledSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for SendEnabledSvc { - type Response = super::QuerySendEnabledResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::send_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 method = SendEnabledSvc(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", tonic::Code::Unimplemented as i32) - .header( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ) - .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 tonic::server::NamedService for QueryServer { - const NAME: &'static str = "cosmos.bank.v1beta1.Query"; - } -} -/// SendAuthorization allows the grantee to spend up to spend_limit coins from -/// the granter's account. -/// -/// Since: cosmos-sdk 0.43 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SendAuthorization { - #[prost(message, repeated, tag = "1")] - pub spend_limit: ::prost::alloc::vec::Vec, - /// allow_list specifies an optional list of addresses to whom the grantee can send tokens on behalf of the - /// granter. If omitted, any recipient is allowed. - /// - /// Since: cosmos-sdk 0.47 - #[prost(string, repeated, tag = "2")] - pub allow_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -impl ::prost::Name for SendAuthorization { - const NAME: &'static str = "SendAuthorization"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.SendAuthorization".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.SendAuthorization".into() - } -} -/// GenesisState defines the bank module's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GenesisState { - /// params defines all the parameters of the module. - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, - /// balances is an array containing the balances of all the accounts. - #[prost(message, repeated, tag = "2")] - pub balances: ::prost::alloc::vec::Vec, - /// supply represents the total supply. If it is left empty, then supply will be calculated based on the provided - /// balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. - #[prost(message, repeated, tag = "3")] - pub supply: ::prost::alloc::vec::Vec, - /// denom_metadata defines the metadata of the different coins. - #[prost(message, repeated, tag = "4")] - pub denom_metadata: ::prost::alloc::vec::Vec, - /// send_enabled defines the denoms where send is enabled or disabled. - /// - /// Since: cosmos-sdk 0.47 - #[prost(message, repeated, tag = "5")] - pub send_enabled: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for GenesisState { - const NAME: &'static str = "GenesisState"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.GenesisState".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.GenesisState".into() - } -} -/// Balance defines an account address and balance pair used in the bank module's -/// genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Balance { - /// address is the address of the balance holder. - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - /// coins defines the different coins this balance holds. - #[prost(message, repeated, tag = "2")] - pub coins: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for Balance { - const NAME: &'static str = "Balance"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.bank.v1beta1.Balance".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.bank.v1beta1.Balance".into() - } -} diff --git a/src/prost/cosmos.bank.v1beta1.serde.rs b/src/prost/cosmos.bank.v1beta1.serde.rs deleted file mode 100644 index 6fc304d4..00000000 --- a/src/prost/cosmos.bank.v1beta1.serde.rs +++ /dev/null @@ -1,4293 +0,0 @@ -impl serde::Serialize for Balance { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.Balance", len)?; - if true { - struct_ser.serialize_field("address", &self.address)?; - } - if true { - struct_ser.serialize_field("coins", &self.coins)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Balance { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "address", - "coins", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Address, - Coins, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "address" => Ok(GeneratedField::Address), - "coins" => Ok(GeneratedField::Coins), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Balance; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.Balance") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut address__ = None; - let mut coins__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Address => { - if address__.is_some() { - return Err(serde::de::Error::duplicate_field("address")); - } - address__ = Some(map_.next_value()?); - } - GeneratedField::Coins => { - if coins__.is_some() { - return Err(serde::de::Error::duplicate_field("coins")); - } - coins__ = Some(map_.next_value()?); - } - } - } - Ok(Balance { - address: address__.unwrap_or_default(), - coins: coins__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.Balance", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for DenomOwner { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.DenomOwner", len)?; - if true { - struct_ser.serialize_field("address", &self.address)?; - } - if let Some(v) = self.balance.as_ref() { - struct_ser.serialize_field("balance", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for DenomOwner { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "address", - "balance", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Address, - Balance, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "address" => Ok(GeneratedField::Address), - "balance" => Ok(GeneratedField::Balance), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = DenomOwner; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.DenomOwner") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut address__ = None; - let mut balance__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Address => { - if address__.is_some() { - return Err(serde::de::Error::duplicate_field("address")); - } - address__ = Some(map_.next_value()?); - } - GeneratedField::Balance => { - if balance__.is_some() { - return Err(serde::de::Error::duplicate_field("balance")); - } - balance__ = map_.next_value()?; - } - } - } - Ok(DenomOwner { - address: address__.unwrap_or_default(), - balance: balance__, - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.DenomOwner", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for DenomUnit { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.DenomUnit", len)?; - if true { - struct_ser.serialize_field("denom", &self.denom)?; - } - if true { - struct_ser.serialize_field("exponent", &self.exponent)?; - } - if true { - struct_ser.serialize_field("aliases", &self.aliases)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for DenomUnit { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "denom", - "exponent", - "aliases", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Denom, - Exponent, - Aliases, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "denom" => Ok(GeneratedField::Denom), - "exponent" => Ok(GeneratedField::Exponent), - "aliases" => Ok(GeneratedField::Aliases), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = DenomUnit; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.DenomUnit") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut denom__ = None; - let mut exponent__ = None; - let mut aliases__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Denom => { - if denom__.is_some() { - return Err(serde::de::Error::duplicate_field("denom")); - } - denom__ = Some(map_.next_value()?); - } - GeneratedField::Exponent => { - if exponent__.is_some() { - return Err(serde::de::Error::duplicate_field("exponent")); - } - exponent__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Aliases => { - if aliases__.is_some() { - return Err(serde::de::Error::duplicate_field("aliases")); - } - aliases__ = Some(map_.next_value()?); - } - } - } - Ok(DenomUnit { - denom: denom__.unwrap_or_default(), - exponent: exponent__.unwrap_or_default(), - aliases: aliases__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.DenomUnit", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for GenesisState { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.GenesisState", len)?; - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - if true { - struct_ser.serialize_field("balances", &self.balances)?; - } - if true { - struct_ser.serialize_field("supply", &self.supply)?; - } - if true { - struct_ser.serialize_field("denomMetadata", &self.denom_metadata)?; - } - if true { - struct_ser.serialize_field("sendEnabled", &self.send_enabled)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GenesisState { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "params", - "balances", - "supply", - "denom_metadata", - "denomMetadata", - "send_enabled", - "sendEnabled", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Params, - Balances, - Supply, - DenomMetadata, - SendEnabled, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "params" => Ok(GeneratedField::Params), - "balances" => Ok(GeneratedField::Balances), - "supply" => Ok(GeneratedField::Supply), - "denomMetadata" | "denom_metadata" => Ok(GeneratedField::DenomMetadata), - "sendEnabled" | "send_enabled" => Ok(GeneratedField::SendEnabled), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GenesisState; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.GenesisState") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut params__ = None; - let mut balances__ = None; - let mut supply__ = None; - let mut denom_metadata__ = None; - let mut send_enabled__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Params => { - if params__.is_some() { - return Err(serde::de::Error::duplicate_field("params")); - } - params__ = map_.next_value()?; - } - GeneratedField::Balances => { - if balances__.is_some() { - return Err(serde::de::Error::duplicate_field("balances")); - } - balances__ = Some(map_.next_value()?); - } - GeneratedField::Supply => { - if supply__.is_some() { - return Err(serde::de::Error::duplicate_field("supply")); - } - supply__ = Some(map_.next_value()?); - } - GeneratedField::DenomMetadata => { - if denom_metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("denomMetadata")); - } - denom_metadata__ = Some(map_.next_value()?); - } - GeneratedField::SendEnabled => { - if send_enabled__.is_some() { - return Err(serde::de::Error::duplicate_field("sendEnabled")); - } - send_enabled__ = Some(map_.next_value()?); - } - } - } - Ok(GenesisState { - params: params__, - balances: balances__.unwrap_or_default(), - supply: supply__.unwrap_or_default(), - denom_metadata: denom_metadata__.unwrap_or_default(), - send_enabled: send_enabled__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.GenesisState", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Input { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.Input", len)?; - if true { - struct_ser.serialize_field("address", &self.address)?; - } - if true { - struct_ser.serialize_field("coins", &self.coins)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Input { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "address", - "coins", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Address, - Coins, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "address" => Ok(GeneratedField::Address), - "coins" => Ok(GeneratedField::Coins), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Input; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.Input") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut address__ = None; - let mut coins__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Address => { - if address__.is_some() { - return Err(serde::de::Error::duplicate_field("address")); - } - address__ = Some(map_.next_value()?); - } - GeneratedField::Coins => { - if coins__.is_some() { - return Err(serde::de::Error::duplicate_field("coins")); - } - coins__ = Some(map_.next_value()?); - } - } - } - Ok(Input { - address: address__.unwrap_or_default(), - coins: coins__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.Input", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Metadata { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.Metadata", len)?; - if true { - struct_ser.serialize_field("description", &self.description)?; - } - if true { - struct_ser.serialize_field("denomUnits", &self.denom_units)?; - } - if true { - struct_ser.serialize_field("base", &self.base)?; - } - if true { - struct_ser.serialize_field("display", &self.display)?; - } - if true { - struct_ser.serialize_field("name", &self.name)?; - } - if true { - struct_ser.serialize_field("symbol", &self.symbol)?; - } - if true { - struct_ser.serialize_field("uri", &self.uri)?; - } - if true { - struct_ser.serialize_field("uriHash", &self.uri_hash)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Metadata { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "description", - "denom_units", - "denomUnits", - "base", - "display", - "name", - "symbol", - "uri", - "uri_hash", - "uriHash", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Description, - DenomUnits, - Base, - Display, - Name, - Symbol, - Uri, - UriHash, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "description" => Ok(GeneratedField::Description), - "denomUnits" | "denom_units" => Ok(GeneratedField::DenomUnits), - "base" => Ok(GeneratedField::Base), - "display" => Ok(GeneratedField::Display), - "name" => Ok(GeneratedField::Name), - "symbol" => Ok(GeneratedField::Symbol), - "uri" => Ok(GeneratedField::Uri), - "uriHash" | "uri_hash" => Ok(GeneratedField::UriHash), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Metadata; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.Metadata") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut description__ = None; - let mut denom_units__ = None; - let mut base__ = None; - let mut display__ = None; - let mut name__ = None; - let mut symbol__ = None; - let mut uri__ = None; - let mut uri_hash__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Description => { - if description__.is_some() { - return Err(serde::de::Error::duplicate_field("description")); - } - description__ = Some(map_.next_value()?); - } - GeneratedField::DenomUnits => { - if denom_units__.is_some() { - return Err(serde::de::Error::duplicate_field("denomUnits")); - } - denom_units__ = Some(map_.next_value()?); - } - GeneratedField::Base => { - if base__.is_some() { - return Err(serde::de::Error::duplicate_field("base")); - } - base__ = Some(map_.next_value()?); - } - GeneratedField::Display => { - if display__.is_some() { - return Err(serde::de::Error::duplicate_field("display")); - } - display__ = Some(map_.next_value()?); - } - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); - } - name__ = Some(map_.next_value()?); - } - GeneratedField::Symbol => { - if symbol__.is_some() { - return Err(serde::de::Error::duplicate_field("symbol")); - } - symbol__ = Some(map_.next_value()?); - } - GeneratedField::Uri => { - if uri__.is_some() { - return Err(serde::de::Error::duplicate_field("uri")); - } - uri__ = Some(map_.next_value()?); - } - GeneratedField::UriHash => { - if uri_hash__.is_some() { - return Err(serde::de::Error::duplicate_field("uriHash")); - } - uri_hash__ = Some(map_.next_value()?); - } - } - } - Ok(Metadata { - description: description__.unwrap_or_default(), - denom_units: denom_units__.unwrap_or_default(), - base: base__.unwrap_or_default(), - display: display__.unwrap_or_default(), - name: name__.unwrap_or_default(), - symbol: symbol__.unwrap_or_default(), - uri: uri__.unwrap_or_default(), - uri_hash: uri_hash__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.Metadata", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgMultiSend { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.MsgMultiSend", len)?; - if true { - struct_ser.serialize_field("inputs", &self.inputs)?; - } - if true { - struct_ser.serialize_field("outputs", &self.outputs)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgMultiSend { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "inputs", - "outputs", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Inputs, - Outputs, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "inputs" => Ok(GeneratedField::Inputs), - "outputs" => Ok(GeneratedField::Outputs), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgMultiSend; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.MsgMultiSend") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut inputs__ = None; - let mut outputs__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Inputs => { - if inputs__.is_some() { - return Err(serde::de::Error::duplicate_field("inputs")); - } - inputs__ = Some(map_.next_value()?); - } - GeneratedField::Outputs => { - if outputs__.is_some() { - return Err(serde::de::Error::duplicate_field("outputs")); - } - outputs__ = Some(map_.next_value()?); - } - } - } - Ok(MsgMultiSend { - inputs: inputs__.unwrap_or_default(), - outputs: outputs__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.MsgMultiSend", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgMultiSendResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.MsgMultiSendResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgMultiSendResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgMultiSendResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.MsgMultiSendResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(MsgMultiSendResponse { - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.MsgMultiSendResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgSend { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.MsgSend", len)?; - if true { - struct_ser.serialize_field("fromAddress", &self.from_address)?; - } - if true { - struct_ser.serialize_field("toAddress", &self.to_address)?; - } - if true { - struct_ser.serialize_field("amount", &self.amount)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgSend { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "from_address", - "fromAddress", - "to_address", - "toAddress", - "amount", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - FromAddress, - ToAddress, - Amount, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "fromAddress" | "from_address" => Ok(GeneratedField::FromAddress), - "toAddress" | "to_address" => Ok(GeneratedField::ToAddress), - "amount" => Ok(GeneratedField::Amount), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgSend; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.MsgSend") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut from_address__ = None; - let mut to_address__ = None; - let mut amount__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::FromAddress => { - if from_address__.is_some() { - return Err(serde::de::Error::duplicate_field("fromAddress")); - } - from_address__ = Some(map_.next_value()?); - } - GeneratedField::ToAddress => { - if to_address__.is_some() { - return Err(serde::de::Error::duplicate_field("toAddress")); - } - to_address__ = Some(map_.next_value()?); - } - GeneratedField::Amount => { - if amount__.is_some() { - return Err(serde::de::Error::duplicate_field("amount")); - } - amount__ = Some(map_.next_value()?); - } - } - } - Ok(MsgSend { - from_address: from_address__.unwrap_or_default(), - to_address: to_address__.unwrap_or_default(), - amount: amount__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.MsgSend", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgSendResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.MsgSendResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgSendResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgSendResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.MsgSendResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(MsgSendResponse { - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.MsgSendResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgSetSendEnabled { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.MsgSetSendEnabled", len)?; - if true { - struct_ser.serialize_field("authority", &self.authority)?; - } - if true { - struct_ser.serialize_field("sendEnabled", &self.send_enabled)?; - } - if true { - struct_ser.serialize_field("useDefaultFor", &self.use_default_for)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgSetSendEnabled { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "authority", - "send_enabled", - "sendEnabled", - "use_default_for", - "useDefaultFor", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Authority, - SendEnabled, - UseDefaultFor, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "authority" => Ok(GeneratedField::Authority), - "sendEnabled" | "send_enabled" => Ok(GeneratedField::SendEnabled), - "useDefaultFor" | "use_default_for" => Ok(GeneratedField::UseDefaultFor), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgSetSendEnabled; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.MsgSetSendEnabled") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut authority__ = None; - let mut send_enabled__ = None; - let mut use_default_for__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Authority => { - if authority__.is_some() { - return Err(serde::de::Error::duplicate_field("authority")); - } - authority__ = Some(map_.next_value()?); - } - GeneratedField::SendEnabled => { - if send_enabled__.is_some() { - return Err(serde::de::Error::duplicate_field("sendEnabled")); - } - send_enabled__ = Some(map_.next_value()?); - } - GeneratedField::UseDefaultFor => { - if use_default_for__.is_some() { - return Err(serde::de::Error::duplicate_field("useDefaultFor")); - } - use_default_for__ = Some(map_.next_value()?); - } - } - } - Ok(MsgSetSendEnabled { - authority: authority__.unwrap_or_default(), - send_enabled: send_enabled__.unwrap_or_default(), - use_default_for: use_default_for__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.MsgSetSendEnabled", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgSetSendEnabledResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.MsgSetSendEnabledResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgSetSendEnabledResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgSetSendEnabledResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.MsgSetSendEnabledResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(MsgSetSendEnabledResponse { - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.MsgSetSendEnabledResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgUpdateParams { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.MsgUpdateParams", len)?; - if true { - struct_ser.serialize_field("authority", &self.authority)?; - } - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgUpdateParams { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "authority", - "params", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Authority, - Params, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "authority" => Ok(GeneratedField::Authority), - "params" => Ok(GeneratedField::Params), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgUpdateParams; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.MsgUpdateParams") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut authority__ = None; - let mut params__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Authority => { - if authority__.is_some() { - return Err(serde::de::Error::duplicate_field("authority")); - } - authority__ = Some(map_.next_value()?); - } - GeneratedField::Params => { - if params__.is_some() { - return Err(serde::de::Error::duplicate_field("params")); - } - params__ = map_.next_value()?; - } - } - } - Ok(MsgUpdateParams { - authority: authority__.unwrap_or_default(), - params: params__, - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.MsgUpdateParams", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgUpdateParamsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.MsgUpdateParamsResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgUpdateParamsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgUpdateParamsResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.MsgUpdateParamsResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(MsgUpdateParamsResponse { - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.MsgUpdateParamsResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Output { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.Output", len)?; - if true { - struct_ser.serialize_field("address", &self.address)?; - } - if true { - struct_ser.serialize_field("coins", &self.coins)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Output { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "address", - "coins", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Address, - Coins, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "address" => Ok(GeneratedField::Address), - "coins" => Ok(GeneratedField::Coins), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Output; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.Output") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut address__ = None; - let mut coins__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Address => { - if address__.is_some() { - return Err(serde::de::Error::duplicate_field("address")); - } - address__ = Some(map_.next_value()?); - } - GeneratedField::Coins => { - if coins__.is_some() { - return Err(serde::de::Error::duplicate_field("coins")); - } - coins__ = Some(map_.next_value()?); - } - } - } - Ok(Output { - address: address__.unwrap_or_default(), - coins: coins__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.Output", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Params { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.Params", len)?; - if true { - struct_ser.serialize_field("sendEnabled", &self.send_enabled)?; - } - if true { - struct_ser.serialize_field("defaultSendEnabled", &self.default_send_enabled)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Params { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "send_enabled", - "sendEnabled", - "default_send_enabled", - "defaultSendEnabled", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - SendEnabled, - DefaultSendEnabled, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "sendEnabled" | "send_enabled" => Ok(GeneratedField::SendEnabled), - "defaultSendEnabled" | "default_send_enabled" => Ok(GeneratedField::DefaultSendEnabled), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Params; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.Params") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut send_enabled__ = None; - let mut default_send_enabled__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::SendEnabled => { - if send_enabled__.is_some() { - return Err(serde::de::Error::duplicate_field("sendEnabled")); - } - send_enabled__ = Some(map_.next_value()?); - } - GeneratedField::DefaultSendEnabled => { - if default_send_enabled__.is_some() { - return Err(serde::de::Error::duplicate_field("defaultSendEnabled")); - } - default_send_enabled__ = Some(map_.next_value()?); - } - } - } - Ok(Params { - send_enabled: send_enabled__.unwrap_or_default(), - default_send_enabled: default_send_enabled__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.Params", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryAllBalancesRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.QueryAllBalancesRequest", len)?; - if true { - struct_ser.serialize_field("address", &self.address)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryAllBalancesRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "address", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Address, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "address" => Ok(GeneratedField::Address), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryAllBalancesRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.QueryAllBalancesRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut address__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Address => { - if address__.is_some() { - return Err(serde::de::Error::duplicate_field("address")); - } - address__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryAllBalancesRequest { - address: address__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.QueryAllBalancesRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryAllBalancesResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.QueryAllBalancesResponse", len)?; - if true { - struct_ser.serialize_field("balances", &self.balances)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryAllBalancesResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "balances", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Balances, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "balances" => Ok(GeneratedField::Balances), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryAllBalancesResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.QueryAllBalancesResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut balances__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Balances => { - if balances__.is_some() { - return Err(serde::de::Error::duplicate_field("balances")); - } - balances__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryAllBalancesResponse { - balances: balances__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.QueryAllBalancesResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryBalanceRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.QueryBalanceRequest", len)?; - if true { - struct_ser.serialize_field("address", &self.address)?; - } - if true { - struct_ser.serialize_field("denom", &self.denom)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryBalanceRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "address", - "denom", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Address, - Denom, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "address" => Ok(GeneratedField::Address), - "denom" => Ok(GeneratedField::Denom), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryBalanceRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.QueryBalanceRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut address__ = None; - let mut denom__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Address => { - if address__.is_some() { - return Err(serde::de::Error::duplicate_field("address")); - } - address__ = Some(map_.next_value()?); - } - GeneratedField::Denom => { - if denom__.is_some() { - return Err(serde::de::Error::duplicate_field("denom")); - } - denom__ = Some(map_.next_value()?); - } - } - } - Ok(QueryBalanceRequest { - address: address__.unwrap_or_default(), - denom: denom__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.QueryBalanceRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryBalanceResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.QueryBalanceResponse", len)?; - if let Some(v) = self.balance.as_ref() { - struct_ser.serialize_field("balance", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryBalanceResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "balance", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Balance, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "balance" => Ok(GeneratedField::Balance), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryBalanceResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.QueryBalanceResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut balance__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Balance => { - if balance__.is_some() { - return Err(serde::de::Error::duplicate_field("balance")); - } - balance__ = map_.next_value()?; - } - } - } - Ok(QueryBalanceResponse { - balance: balance__, - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.QueryBalanceResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryDenomMetadataRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.QueryDenomMetadataRequest", len)?; - if true { - struct_ser.serialize_field("denom", &self.denom)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDenomMetadataRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "denom", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Denom, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "denom" => Ok(GeneratedField::Denom), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryDenomMetadataRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.QueryDenomMetadataRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut denom__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Denom => { - if denom__.is_some() { - return Err(serde::de::Error::duplicate_field("denom")); - } - denom__ = Some(map_.next_value()?); - } - } - } - Ok(QueryDenomMetadataRequest { - denom: denom__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.QueryDenomMetadataRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryDenomMetadataResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.QueryDenomMetadataResponse", len)?; - if let Some(v) = self.metadata.as_ref() { - struct_ser.serialize_field("metadata", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDenomMetadataResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "metadata", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Metadata, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "metadata" => Ok(GeneratedField::Metadata), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryDenomMetadataResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.QueryDenomMetadataResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut metadata__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Metadata => { - if metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("metadata")); - } - metadata__ = map_.next_value()?; - } - } - } - Ok(QueryDenomMetadataResponse { - metadata: metadata__, - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.QueryDenomMetadataResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryDenomOwnersRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.QueryDenomOwnersRequest", len)?; - if true { - struct_ser.serialize_field("denom", &self.denom)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDenomOwnersRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "denom", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Denom, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "denom" => Ok(GeneratedField::Denom), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryDenomOwnersRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.QueryDenomOwnersRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut denom__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Denom => { - if denom__.is_some() { - return Err(serde::de::Error::duplicate_field("denom")); - } - denom__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryDenomOwnersRequest { - denom: denom__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.QueryDenomOwnersRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryDenomOwnersResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.QueryDenomOwnersResponse", len)?; - if true { - struct_ser.serialize_field("denomOwners", &self.denom_owners)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDenomOwnersResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "denom_owners", - "denomOwners", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - DenomOwners, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "denomOwners" | "denom_owners" => Ok(GeneratedField::DenomOwners), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryDenomOwnersResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.QueryDenomOwnersResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut denom_owners__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::DenomOwners => { - if denom_owners__.is_some() { - return Err(serde::de::Error::duplicate_field("denomOwners")); - } - denom_owners__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryDenomOwnersResponse { - denom_owners: denom_owners__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.QueryDenomOwnersResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryDenomsMetadataRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.QueryDenomsMetadataRequest", len)?; - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDenomsMetadataRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryDenomsMetadataRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.QueryDenomsMetadataRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryDenomsMetadataRequest { - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.QueryDenomsMetadataRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryDenomsMetadataResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.QueryDenomsMetadataResponse", len)?; - if true { - struct_ser.serialize_field("metadatas", &self.metadatas)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDenomsMetadataResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "metadatas", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Metadatas, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "metadatas" => Ok(GeneratedField::Metadatas), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryDenomsMetadataResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.QueryDenomsMetadataResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut metadatas__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Metadatas => { - if metadatas__.is_some() { - return Err(serde::de::Error::duplicate_field("metadatas")); - } - metadatas__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryDenomsMetadataResponse { - metadatas: metadatas__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.QueryDenomsMetadataResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryParamsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.QueryParamsRequest", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryParamsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryParamsRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.QueryParamsRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(QueryParamsRequest { - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.QueryParamsRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryParamsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.QueryParamsResponse", len)?; - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryParamsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "params", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Params, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "params" => Ok(GeneratedField::Params), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryParamsResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.QueryParamsResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut params__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Params => { - if params__.is_some() { - return Err(serde::de::Error::duplicate_field("params")); - } - params__ = map_.next_value()?; - } - } - } - Ok(QueryParamsResponse { - params: params__, - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.QueryParamsResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QuerySendEnabledRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.QuerySendEnabledRequest", len)?; - if true { - struct_ser.serialize_field("denoms", &self.denoms)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QuerySendEnabledRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "denoms", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Denoms, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "denoms" => Ok(GeneratedField::Denoms), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QuerySendEnabledRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.QuerySendEnabledRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut denoms__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Denoms => { - if denoms__.is_some() { - return Err(serde::de::Error::duplicate_field("denoms")); - } - denoms__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QuerySendEnabledRequest { - denoms: denoms__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.QuerySendEnabledRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QuerySendEnabledResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.QuerySendEnabledResponse", len)?; - if true { - struct_ser.serialize_field("sendEnabled", &self.send_enabled)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QuerySendEnabledResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "send_enabled", - "sendEnabled", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - SendEnabled, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "sendEnabled" | "send_enabled" => Ok(GeneratedField::SendEnabled), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QuerySendEnabledResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.QuerySendEnabledResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut send_enabled__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::SendEnabled => { - if send_enabled__.is_some() { - return Err(serde::de::Error::duplicate_field("sendEnabled")); - } - send_enabled__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QuerySendEnabledResponse { - send_enabled: send_enabled__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.QuerySendEnabledResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QuerySpendableBalanceByDenomRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest", len)?; - if true { - struct_ser.serialize_field("address", &self.address)?; - } - if true { - struct_ser.serialize_field("denom", &self.denom)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QuerySpendableBalanceByDenomRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "address", - "denom", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Address, - Denom, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "address" => Ok(GeneratedField::Address), - "denom" => Ok(GeneratedField::Denom), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QuerySpendableBalanceByDenomRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut address__ = None; - let mut denom__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Address => { - if address__.is_some() { - return Err(serde::de::Error::duplicate_field("address")); - } - address__ = Some(map_.next_value()?); - } - GeneratedField::Denom => { - if denom__.is_some() { - return Err(serde::de::Error::duplicate_field("denom")); - } - denom__ = Some(map_.next_value()?); - } - } - } - Ok(QuerySpendableBalanceByDenomRequest { - address: address__.unwrap_or_default(), - denom: denom__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QuerySpendableBalanceByDenomResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse", len)?; - if let Some(v) = self.balance.as_ref() { - struct_ser.serialize_field("balance", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QuerySpendableBalanceByDenomResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "balance", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Balance, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "balance" => Ok(GeneratedField::Balance), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QuerySpendableBalanceByDenomResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut balance__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Balance => { - if balance__.is_some() { - return Err(serde::de::Error::duplicate_field("balance")); - } - balance__ = map_.next_value()?; - } - } - } - Ok(QuerySpendableBalanceByDenomResponse { - balance: balance__, - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QuerySpendableBalancesRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.QuerySpendableBalancesRequest", len)?; - if true { - struct_ser.serialize_field("address", &self.address)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QuerySpendableBalancesRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "address", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Address, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "address" => Ok(GeneratedField::Address), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QuerySpendableBalancesRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.QuerySpendableBalancesRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut address__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Address => { - if address__.is_some() { - return Err(serde::de::Error::duplicate_field("address")); - } - address__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QuerySpendableBalancesRequest { - address: address__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.QuerySpendableBalancesRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QuerySpendableBalancesResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.QuerySpendableBalancesResponse", len)?; - if true { - struct_ser.serialize_field("balances", &self.balances)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QuerySpendableBalancesResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "balances", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Balances, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "balances" => Ok(GeneratedField::Balances), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QuerySpendableBalancesResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.QuerySpendableBalancesResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut balances__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Balances => { - if balances__.is_some() { - return Err(serde::de::Error::duplicate_field("balances")); - } - balances__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QuerySpendableBalancesResponse { - balances: balances__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.QuerySpendableBalancesResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QuerySupplyOfRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.QuerySupplyOfRequest", len)?; - if true { - struct_ser.serialize_field("denom", &self.denom)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QuerySupplyOfRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "denom", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Denom, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "denom" => Ok(GeneratedField::Denom), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QuerySupplyOfRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.QuerySupplyOfRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut denom__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Denom => { - if denom__.is_some() { - return Err(serde::de::Error::duplicate_field("denom")); - } - denom__ = Some(map_.next_value()?); - } - } - } - Ok(QuerySupplyOfRequest { - denom: denom__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.QuerySupplyOfRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QuerySupplyOfResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.QuerySupplyOfResponse", len)?; - if let Some(v) = self.amount.as_ref() { - struct_ser.serialize_field("amount", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QuerySupplyOfResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "amount", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Amount, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "amount" => Ok(GeneratedField::Amount), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QuerySupplyOfResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.QuerySupplyOfResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut amount__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Amount => { - if amount__.is_some() { - return Err(serde::de::Error::duplicate_field("amount")); - } - amount__ = map_.next_value()?; - } - } - } - Ok(QuerySupplyOfResponse { - amount: amount__, - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.QuerySupplyOfResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryTotalSupplyRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.QueryTotalSupplyRequest", len)?; - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryTotalSupplyRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryTotalSupplyRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.QueryTotalSupplyRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryTotalSupplyRequest { - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.QueryTotalSupplyRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryTotalSupplyResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.QueryTotalSupplyResponse", len)?; - if true { - struct_ser.serialize_field("supply", &self.supply)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryTotalSupplyResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "supply", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Supply, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "supply" => Ok(GeneratedField::Supply), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryTotalSupplyResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.QueryTotalSupplyResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut supply__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Supply => { - if supply__.is_some() { - return Err(serde::de::Error::duplicate_field("supply")); - } - supply__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryTotalSupplyResponse { - supply: supply__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.QueryTotalSupplyResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for SendAuthorization { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.SendAuthorization", len)?; - if true { - struct_ser.serialize_field("spendLimit", &self.spend_limit)?; - } - if true { - struct_ser.serialize_field("allowList", &self.allow_list)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SendAuthorization { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "spend_limit", - "spendLimit", - "allow_list", - "allowList", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - SpendLimit, - AllowList, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "spendLimit" | "spend_limit" => Ok(GeneratedField::SpendLimit), - "allowList" | "allow_list" => Ok(GeneratedField::AllowList), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SendAuthorization; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.SendAuthorization") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut spend_limit__ = None; - let mut allow_list__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::SpendLimit => { - if spend_limit__.is_some() { - return Err(serde::de::Error::duplicate_field("spendLimit")); - } - spend_limit__ = Some(map_.next_value()?); - } - GeneratedField::AllowList => { - if allow_list__.is_some() { - return Err(serde::de::Error::duplicate_field("allowList")); - } - allow_list__ = Some(map_.next_value()?); - } - } - } - Ok(SendAuthorization { - spend_limit: spend_limit__.unwrap_or_default(), - allow_list: allow_list__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.SendAuthorization", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for SendEnabled { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.SendEnabled", len)?; - if true { - struct_ser.serialize_field("denom", &self.denom)?; - } - if true { - struct_ser.serialize_field("enabled", &self.enabled)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SendEnabled { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "denom", - "enabled", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Denom, - Enabled, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "denom" => Ok(GeneratedField::Denom), - "enabled" => Ok(GeneratedField::Enabled), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SendEnabled; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.SendEnabled") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut denom__ = None; - let mut enabled__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Denom => { - if denom__.is_some() { - return Err(serde::de::Error::duplicate_field("denom")); - } - denom__ = Some(map_.next_value()?); - } - GeneratedField::Enabled => { - if enabled__.is_some() { - return Err(serde::de::Error::duplicate_field("enabled")); - } - enabled__ = Some(map_.next_value()?); - } - } - } - Ok(SendEnabled { - denom: denom__.unwrap_or_default(), - enabled: enabled__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.SendEnabled", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Supply { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.Supply", len)?; - if true { - struct_ser.serialize_field("total", &self.total)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Supply { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "total", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Total, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "total" => Ok(GeneratedField::Total), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Supply; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.Supply") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut total__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Total => { - if total__.is_some() { - return Err(serde::de::Error::duplicate_field("total")); - } - total__ = Some(map_.next_value()?); - } - } - } - Ok(Supply { - total: total__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.bank.v1beta1.Supply", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.base.abci.v1beta1.rs b/src/prost/cosmos.base.abci.v1beta1.rs deleted file mode 100644 index 5a445a56..00000000 --- a/src/prost/cosmos.base.abci.v1beta1.rs +++ /dev/null @@ -1,284 +0,0 @@ -// This file is @generated by prost-build. -/// TxResponse defines a structure containing relevant tx data and metadata. The -/// tags are stringified and the log is JSON decoded. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TxResponse { - /// The block height - #[prost(int64, tag = "1")] - pub height: i64, - /// The transaction hash. - #[prost(string, tag = "2")] - pub txhash: ::prost::alloc::string::String, - /// Namespace for the Code - #[prost(string, tag = "3")] - pub codespace: ::prost::alloc::string::String, - /// Response code. - #[prost(uint32, tag = "4")] - pub code: u32, - /// Result bytes, if any. - #[prost(string, tag = "5")] - pub data: ::prost::alloc::string::String, - /// The output of the application's logger (raw string). May be - /// non-deterministic. - #[prost(string, tag = "6")] - pub raw_log: ::prost::alloc::string::String, - /// The output of the application's logger (typed). May be non-deterministic. - #[prost(message, repeated, tag = "7")] - pub logs: ::prost::alloc::vec::Vec, - /// Additional information. May be non-deterministic. - #[prost(string, tag = "8")] - pub info: ::prost::alloc::string::String, - /// Amount of gas requested for transaction. - #[prost(int64, tag = "9")] - pub gas_wanted: i64, - /// Amount of gas consumed by transaction. - #[prost(int64, tag = "10")] - pub gas_used: i64, - /// The request transaction bytes. - #[prost(message, optional, tag = "11")] - pub tx: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, - /// Time of the previous block. For heights > 1, it's the weighted median of - /// the timestamps of the valid votes in the block.LastCommit. For height == 1, - /// it's genesis time. - #[prost(string, tag = "12")] - pub timestamp: ::prost::alloc::string::String, - /// Events defines all the events emitted by processing a transaction. Note, - /// these events include those emitted by processing all the messages and those - /// emitted from the ante. Whereas Logs contains the events, with - /// additional metadata, emitted only by processing the messages. - /// - /// Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 - #[prost(message, repeated, tag = "13")] - pub events: ::prost::alloc::vec::Vec<::tendermint_proto::v0_34::abci::Event>, -} -impl ::prost::Name for TxResponse { - const NAME: &'static str = "TxResponse"; - const PACKAGE: &'static str = "cosmos.base.abci.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.abci.v1beta1.TxResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.abci.v1beta1.TxResponse".into() - } -} -/// ABCIMessageLog defines a structure containing an indexed tx ABCI message log. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AbciMessageLog { - #[prost(uint32, tag = "1")] - pub msg_index: u32, - #[prost(string, tag = "2")] - pub log: ::prost::alloc::string::String, - /// Events contains a slice of Event objects that were emitted during some - /// execution. - #[prost(message, repeated, tag = "3")] - pub events: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for AbciMessageLog { - const NAME: &'static str = "ABCIMessageLog"; - const PACKAGE: &'static str = "cosmos.base.abci.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.abci.v1beta1.ABCIMessageLog".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.abci.v1beta1.ABCIMessageLog".into() - } -} -/// StringEvent defines en Event object wrapper where all the attributes -/// contain key/value pairs that are strings instead of raw bytes. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct StringEvent { - #[prost(string, tag = "1")] - pub r#type: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub attributes: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for StringEvent { - const NAME: &'static str = "StringEvent"; - const PACKAGE: &'static str = "cosmos.base.abci.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.abci.v1beta1.StringEvent".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.abci.v1beta1.StringEvent".into() - } -} -/// Attribute defines an attribute wrapper where the key and value are -/// strings instead of raw bytes. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Attribute { - #[prost(string, tag = "1")] - pub key: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub value: ::prost::alloc::string::String, -} -impl ::prost::Name for Attribute { - const NAME: &'static str = "Attribute"; - const PACKAGE: &'static str = "cosmos.base.abci.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.abci.v1beta1.Attribute".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.abci.v1beta1.Attribute".into() - } -} -/// GasInfo defines tx execution gas context. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct GasInfo { - /// GasWanted is the maximum units of work we allow this tx to perform. - #[prost(uint64, tag = "1")] - pub gas_wanted: u64, - /// GasUsed is the amount of gas actually consumed. - #[prost(uint64, tag = "2")] - pub gas_used: u64, -} -impl ::prost::Name for GasInfo { - const NAME: &'static str = "GasInfo"; - const PACKAGE: &'static str = "cosmos.base.abci.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.abci.v1beta1.GasInfo".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.abci.v1beta1.GasInfo".into() - } -} -/// Result is the union of ResponseFormat and ResponseCheckTx. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Result { - /// Data is any data returned from message or handler execution. It MUST be - /// length prefixed in order to separate data from multiple message executions. - /// Deprecated. This field is still populated, but prefer msg_response instead - /// because it also contains the Msg response typeURL. - #[deprecated] - #[prost(bytes = "vec", tag = "1")] - pub data: ::prost::alloc::vec::Vec, - /// Log contains the log information from message or handler execution. - #[prost(string, tag = "2")] - pub log: ::prost::alloc::string::String, - /// Events contains a slice of Event objects that were emitted during message - /// or handler execution. - #[prost(message, repeated, tag = "3")] - pub events: ::prost::alloc::vec::Vec<::tendermint_proto::v0_34::abci::Event>, - /// msg_responses contains the Msg handler responses type packed in Anys. - /// - /// Since: cosmos-sdk 0.46 - #[prost(message, repeated, tag = "4")] - pub msg_responses: ::prost::alloc::vec::Vec< - ::tendermint_proto::google::protobuf::Any, - >, -} -impl ::prost::Name for Result { - const NAME: &'static str = "Result"; - const PACKAGE: &'static str = "cosmos.base.abci.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.abci.v1beta1.Result".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.abci.v1beta1.Result".into() - } -} -/// SimulationResponse defines the response generated when a transaction is -/// successfully simulated. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SimulationResponse { - #[prost(message, optional, tag = "1")] - pub gas_info: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub result: ::core::option::Option, -} -impl ::prost::Name for SimulationResponse { - const NAME: &'static str = "SimulationResponse"; - const PACKAGE: &'static str = "cosmos.base.abci.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.abci.v1beta1.SimulationResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.abci.v1beta1.SimulationResponse".into() - } -} -/// MsgData defines the data returned in a Result object during message -/// execution. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgData { - #[prost(string, tag = "1")] - pub msg_type: ::prost::alloc::string::String, - #[prost(bytes = "vec", tag = "2")] - pub data: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for MsgData { - const NAME: &'static str = "MsgData"; - const PACKAGE: &'static str = "cosmos.base.abci.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.abci.v1beta1.MsgData".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.abci.v1beta1.MsgData".into() - } -} -/// TxMsgData defines a list of MsgData. A transaction will have a MsgData object -/// for each message. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TxMsgData { - /// data field is deprecated and not populated. - #[deprecated] - #[prost(message, repeated, tag = "1")] - pub data: ::prost::alloc::vec::Vec, - /// msg_responses contains the Msg handler responses packed into Anys. - /// - /// Since: cosmos-sdk 0.46 - #[prost(message, repeated, tag = "2")] - pub msg_responses: ::prost::alloc::vec::Vec< - ::tendermint_proto::google::protobuf::Any, - >, -} -impl ::prost::Name for TxMsgData { - const NAME: &'static str = "TxMsgData"; - const PACKAGE: &'static str = "cosmos.base.abci.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.abci.v1beta1.TxMsgData".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.abci.v1beta1.TxMsgData".into() - } -} -/// SearchTxsResult defines a structure for querying txs pageable -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SearchTxsResult { - /// Count of all txs - #[prost(uint64, tag = "1")] - pub total_count: u64, - /// Count of txs in current page - #[prost(uint64, tag = "2")] - pub count: u64, - /// Index of current page, start from 1 - #[prost(uint64, tag = "3")] - pub page_number: u64, - /// Count of total pages - #[prost(uint64, tag = "4")] - pub page_total: u64, - /// Max count txs per page - #[prost(uint64, tag = "5")] - pub limit: u64, - /// List of txs in current page - #[prost(message, repeated, tag = "6")] - pub txs: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for SearchTxsResult { - const NAME: &'static str = "SearchTxsResult"; - const PACKAGE: &'static str = "cosmos.base.abci.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.abci.v1beta1.SearchTxsResult".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.abci.v1beta1.SearchTxsResult".into() - } -} diff --git a/src/prost/cosmos.base.kv.v1beta1.rs b/src/prost/cosmos.base.kv.v1beta1.rs deleted file mode 100644 index b0ee7493..00000000 --- a/src/prost/cosmos.base.kv.v1beta1.rs +++ /dev/null @@ -1,37 +0,0 @@ -// This file is @generated by prost-build. -/// Pairs defines a repeated slice of Pair objects. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Pairs { - #[prost(message, repeated, tag = "1")] - pub pairs: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for Pairs { - const NAME: &'static str = "Pairs"; - const PACKAGE: &'static str = "cosmos.base.kv.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.kv.v1beta1.Pairs".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.kv.v1beta1.Pairs".into() - } -} -/// Pair defines a key/value bytes tuple. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Pair { - #[prost(bytes = "vec", tag = "1")] - pub key: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "2")] - pub value: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for Pair { - const NAME: &'static str = "Pair"; - const PACKAGE: &'static str = "cosmos.base.kv.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.kv.v1beta1.Pair".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.kv.v1beta1.Pair".into() - } -} diff --git a/src/prost/cosmos.base.kv.v1beta1.serde.rs b/src/prost/cosmos.base.kv.v1beta1.serde.rs deleted file mode 100644 index 3e2ed8b5..00000000 --- a/src/prost/cosmos.base.kv.v1beta1.serde.rs +++ /dev/null @@ -1,205 +0,0 @@ -impl serde::Serialize for Pair { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.kv.v1beta1.Pair", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("value", pbjson::private::base64::encode(&self.value).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Pair { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "key", - "value", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - Value, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "key" => Ok(GeneratedField::Key), - "value" => Ok(GeneratedField::Value), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Pair; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.kv.v1beta1.Pair") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut key__ = None; - let mut value__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Key => { - if key__.is_some() { - return Err(serde::de::Error::duplicate_field("key")); - } - key__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Value => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("value")); - } - value__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - } - } - Ok(Pair { - key: key__.unwrap_or_default(), - value: value__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.kv.v1beta1.Pair", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Pairs { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.kv.v1beta1.Pairs", len)?; - if true { - struct_ser.serialize_field("pairs", &self.pairs)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Pairs { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "pairs", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Pairs, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "pairs" => Ok(GeneratedField::Pairs), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Pairs; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.kv.v1beta1.Pairs") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut pairs__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Pairs => { - if pairs__.is_some() { - return Err(serde::de::Error::duplicate_field("pairs")); - } - pairs__ = Some(map_.next_value()?); - } - } - } - Ok(Pairs { - pairs: pairs__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.kv.v1beta1.Pairs", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.base.node.v1beta1.rs b/src/prost/cosmos.base.node.v1beta1.rs deleted file mode 100644 index c67ca56b..00000000 --- a/src/prost/cosmos.base.node.v1beta1.rs +++ /dev/null @@ -1,312 +0,0 @@ -// This file is @generated by prost-build. -/// ConfigRequest defines the request structure for the Config gRPC query. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct ConfigRequest {} -impl ::prost::Name for ConfigRequest { - const NAME: &'static str = "ConfigRequest"; - const PACKAGE: &'static str = "cosmos.base.node.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.node.v1beta1.ConfigRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.node.v1beta1.ConfigRequest".into() - } -} -/// ConfigResponse defines the response structure for the Config gRPC query. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConfigResponse { - #[prost(string, tag = "1")] - pub minimum_gas_price: ::prost::alloc::string::String, -} -impl ::prost::Name for ConfigResponse { - const NAME: &'static str = "ConfigResponse"; - const PACKAGE: &'static str = "cosmos.base.node.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.node.v1beta1.ConfigResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.node.v1beta1.ConfigResponse".into() - } -} -/// Generated client implementations. -#[cfg(feature = "client")] -pub mod service_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - /// Service defines the gRPC querier service for node related queries. - #[derive(Debug, Clone)] - pub struct ServiceClient { - inner: tonic::client::Grpc, - } - impl ServiceClient { - /// 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 ServiceClient - 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, - ) -> ServiceClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + Send + Sync, - { - ServiceClient::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 - } - /// Config queries for the operator configuration. - pub async fn config( - &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( - "/cosmos.base.node.v1beta1.Service/Config", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.base.node.v1beta1.Service", "Config")); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -#[cfg(feature = "server")] -pub mod service_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with ServiceServer. - #[async_trait] - pub trait Service: Send + Sync + 'static { - /// Config queries for the operator configuration. - async fn config( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - } - /// Service defines the gRPC querier service for node related queries. - #[derive(Debug)] - pub struct ServiceServer { - inner: Arc, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - impl ServiceServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - 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 ServiceServer - where - T: Service, - 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 { - match req.uri().path() { - "/cosmos.base.node.v1beta1.Service/Config" => { - #[allow(non_camel_case_types)] - struct ConfigSvc(pub Arc); - impl tonic::server::UnaryService - for ConfigSvc { - type Response = super::ConfigResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::config(&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 method = ConfigSvc(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", tonic::Code::Unimplemented as i32) - .header( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ) - .body(empty_body()) - .unwrap(), - ) - }) - } - } - } - } - impl Clone for ServiceServer { - 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 tonic::server::NamedService for ServiceServer { - const NAME: &'static str = "cosmos.base.node.v1beta1.Service"; - } -} diff --git a/src/prost/cosmos.base.node.v1beta1.serde.rs b/src/prost/cosmos.base.node.v1beta1.serde.rs deleted file mode 100644 index 24a688cd..00000000 --- a/src/prost/cosmos.base.node.v1beta1.serde.rs +++ /dev/null @@ -1,163 +0,0 @@ -impl serde::Serialize for ConfigRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.base.node.v1beta1.ConfigRequest", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ConfigRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ConfigRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.node.v1beta1.ConfigRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(ConfigRequest { - }) - } - } - deserializer.deserialize_struct("cosmos.base.node.v1beta1.ConfigRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for ConfigResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.node.v1beta1.ConfigResponse", len)?; - if true { - struct_ser.serialize_field("minimumGasPrice", &self.minimum_gas_price)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ConfigResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "minimum_gas_price", - "minimumGasPrice", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - MinimumGasPrice, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "minimumGasPrice" | "minimum_gas_price" => Ok(GeneratedField::MinimumGasPrice), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ConfigResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.node.v1beta1.ConfigResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut minimum_gas_price__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::MinimumGasPrice => { - if minimum_gas_price__.is_some() { - return Err(serde::de::Error::duplicate_field("minimumGasPrice")); - } - minimum_gas_price__ = Some(map_.next_value()?); - } - } - } - Ok(ConfigResponse { - minimum_gas_price: minimum_gas_price__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.node.v1beta1.ConfigResponse", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.base.query.v1beta1.rs b/src/prost/cosmos.base.query.v1beta1.rs deleted file mode 100644 index dc11f529..00000000 --- a/src/prost/cosmos.base.query.v1beta1.rs +++ /dev/null @@ -1,77 +0,0 @@ -// This file is @generated by prost-build. -/// PageRequest is to be embedded in gRPC request messages for efficient -/// pagination. Ex: -/// -/// message SomeRequest { -/// Foo some_parameter = 1; -/// PageRequest pagination = 2; -/// } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PageRequest { - /// key is a value returned in PageResponse.next_key to begin - /// querying the next page most efficiently. Only one of offset or key - /// should be set. - #[prost(bytes = "vec", tag = "1")] - pub key: ::prost::alloc::vec::Vec, - /// offset is a numeric offset that can be used when key is unavailable. - /// It is less efficient than using key. Only one of offset or key should - /// be set. - #[prost(uint64, tag = "2")] - pub offset: u64, - /// limit is the total number of results to be returned in the result page. - /// If left empty it will default to a value to be set by each app. - #[prost(uint64, tag = "3")] - pub limit: u64, - /// count_total is set to true to indicate that the result set should include - /// a count of the total number of items available for pagination in UIs. - /// count_total is only respected when offset is used. It is ignored when key - /// is set. - #[prost(bool, tag = "4")] - pub count_total: bool, - /// reverse is set to true if results are to be returned in the descending order. - /// - /// Since: cosmos-sdk 0.43 - #[prost(bool, tag = "5")] - pub reverse: bool, -} -impl ::prost::Name for PageRequest { - const NAME: &'static str = "PageRequest"; - const PACKAGE: &'static str = "cosmos.base.query.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.query.v1beta1.PageRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.query.v1beta1.PageRequest".into() - } -} -/// PageResponse is to be embedded in gRPC response messages where the -/// corresponding request message has used PageRequest. -/// -/// message SomeResponse { -/// repeated Bar results = 1; -/// PageResponse page = 2; -/// } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PageResponse { - /// next_key is the key to be passed to PageRequest.key to - /// query the next page most efficiently. It will be empty if - /// there are no more results. - #[prost(bytes = "vec", tag = "1")] - pub next_key: ::prost::alloc::vec::Vec, - /// total is total number of results available if PageRequest.count_total - /// was set, its value is undefined otherwise - #[prost(uint64, tag = "2")] - pub total: u64, -} -impl ::prost::Name for PageResponse { - const NAME: &'static str = "PageResponse"; - const PACKAGE: &'static str = "cosmos.base.query.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.query.v1beta1.PageResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.query.v1beta1.PageResponse".into() - } -} diff --git a/src/prost/cosmos.base.query.v1beta1.serde.rs b/src/prost/cosmos.base.query.v1beta1.serde.rs deleted file mode 100644 index b58155f7..00000000 --- a/src/prost/cosmos.base.query.v1beta1.serde.rs +++ /dev/null @@ -1,284 +0,0 @@ -impl serde::Serialize for PageRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.query.v1beta1.PageRequest", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("offset", ::alloc::string::ToString::to_string(&self.offset).as_str())?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("limit", ::alloc::string::ToString::to_string(&self.limit).as_str())?; - } - if true { - struct_ser.serialize_field("countTotal", &self.count_total)?; - } - if true { - struct_ser.serialize_field("reverse", &self.reverse)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for PageRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "key", - "offset", - "limit", - "count_total", - "countTotal", - "reverse", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - Offset, - Limit, - CountTotal, - Reverse, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "key" => Ok(GeneratedField::Key), - "offset" => Ok(GeneratedField::Offset), - "limit" => Ok(GeneratedField::Limit), - "countTotal" | "count_total" => Ok(GeneratedField::CountTotal), - "reverse" => Ok(GeneratedField::Reverse), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = PageRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.query.v1beta1.PageRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut key__ = None; - let mut offset__ = None; - let mut limit__ = None; - let mut count_total__ = None; - let mut reverse__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Key => { - if key__.is_some() { - return Err(serde::de::Error::duplicate_field("key")); - } - key__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Offset => { - if offset__.is_some() { - return Err(serde::de::Error::duplicate_field("offset")); - } - offset__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Limit => { - if limit__.is_some() { - return Err(serde::de::Error::duplicate_field("limit")); - } - limit__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::CountTotal => { - if count_total__.is_some() { - return Err(serde::de::Error::duplicate_field("countTotal")); - } - count_total__ = Some(map_.next_value()?); - } - GeneratedField::Reverse => { - if reverse__.is_some() { - return Err(serde::de::Error::duplicate_field("reverse")); - } - reverse__ = Some(map_.next_value()?); - } - } - } - Ok(PageRequest { - key: key__.unwrap_or_default(), - offset: offset__.unwrap_or_default(), - limit: limit__.unwrap_or_default(), - count_total: count_total__.unwrap_or_default(), - reverse: reverse__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.query.v1beta1.PageRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for PageResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.query.v1beta1.PageResponse", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("nextKey", pbjson::private::base64::encode(&self.next_key).as_str())?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("total", ::alloc::string::ToString::to_string(&self.total).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for PageResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "next_key", - "nextKey", - "total", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - NextKey, - Total, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "nextKey" | "next_key" => Ok(GeneratedField::NextKey), - "total" => Ok(GeneratedField::Total), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = PageResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.query.v1beta1.PageResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut next_key__ = None; - let mut total__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::NextKey => { - if next_key__.is_some() { - return Err(serde::de::Error::duplicate_field("nextKey")); - } - next_key__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Total => { - if total__.is_some() { - return Err(serde::de::Error::duplicate_field("total")); - } - total__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(PageResponse { - next_key: next_key__.unwrap_or_default(), - total: total__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.query.v1beta1.PageResponse", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.base.reflection.v1beta1.rs b/src/prost/cosmos.base.reflection.v1beta1.rs deleted file mode 100644 index 27eaacf3..00000000 --- a/src/prost/cosmos.base.reflection.v1beta1.rs +++ /dev/null @@ -1,462 +0,0 @@ -// This file is @generated by prost-build. -/// ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct ListAllInterfacesRequest {} -impl ::prost::Name for ListAllInterfacesRequest { - const NAME: &'static str = "ListAllInterfacesRequest"; - const PACKAGE: &'static str = "cosmos.base.reflection.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v1beta1.ListAllInterfacesRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v1beta1.ListAllInterfacesRequest".into() - } -} -/// ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListAllInterfacesResponse { - /// interface_names is an array of all the registered interfaces. - #[prost(string, repeated, tag = "1")] - pub interface_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -impl ::prost::Name for ListAllInterfacesResponse { - const NAME: &'static str = "ListAllInterfacesResponse"; - const PACKAGE: &'static str = "cosmos.base.reflection.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v1beta1.ListAllInterfacesResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v1beta1.ListAllInterfacesResponse".into() - } -} -/// ListImplementationsRequest is the request type of the ListImplementations -/// RPC. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListImplementationsRequest { - /// interface_name defines the interface to query the implementations for. - #[prost(string, tag = "1")] - pub interface_name: ::prost::alloc::string::String, -} -impl ::prost::Name for ListImplementationsRequest { - const NAME: &'static str = "ListImplementationsRequest"; - const PACKAGE: &'static str = "cosmos.base.reflection.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v1beta1.ListImplementationsRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v1beta1.ListImplementationsRequest".into() - } -} -/// ListImplementationsResponse is the response type of the ListImplementations -/// RPC. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListImplementationsResponse { - #[prost(string, repeated, tag = "1")] - pub implementation_message_names: ::prost::alloc::vec::Vec< - ::prost::alloc::string::String, - >, -} -impl ::prost::Name for ListImplementationsResponse { - const NAME: &'static str = "ListImplementationsResponse"; - const PACKAGE: &'static str = "cosmos.base.reflection.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v1beta1.ListImplementationsResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v1beta1.ListImplementationsResponse".into() - } -} -/// Generated client implementations. -#[cfg(feature = "client")] -pub mod reflection_service_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - /// ReflectionService defines a service for interface reflection. - #[derive(Debug, Clone)] - pub struct ReflectionServiceClient { - inner: tonic::client::Grpc, - } - impl ReflectionServiceClient { - /// 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 ReflectionServiceClient - 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, - ) -> ReflectionServiceClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + Send + Sync, - { - ReflectionServiceClient::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 - } - /// ListAllInterfaces lists all the interfaces registered in the interface - /// registry. - pub async fn list_all_interfaces( - &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( - "/cosmos.base.reflection.v1beta1.ReflectionService/ListAllInterfaces", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.base.reflection.v1beta1.ReflectionService", - "ListAllInterfaces", - ), - ); - self.inner.unary(req, path, codec).await - } - /// ListImplementations list all the concrete types that implement a given - /// interface. - pub async fn list_implementations( - &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( - "/cosmos.base.reflection.v1beta1.ReflectionService/ListImplementations", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.base.reflection.v1beta1.ReflectionService", - "ListImplementations", - ), - ); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -#[cfg(feature = "server")] -pub mod reflection_service_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with ReflectionServiceServer. - #[async_trait] - pub trait ReflectionService: Send + Sync + 'static { - /// ListAllInterfaces lists all the interfaces registered in the interface - /// registry. - async fn list_all_interfaces( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// ListImplementations list all the concrete types that implement a given - /// interface. - async fn list_implementations( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - /// ReflectionService defines a service for interface reflection. - #[derive(Debug)] - pub struct ReflectionServiceServer { - inner: Arc, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - impl ReflectionServiceServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - 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 ReflectionServiceServer - where - T: ReflectionService, - 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 { - match req.uri().path() { - "/cosmos.base.reflection.v1beta1.ReflectionService/ListAllInterfaces" => { - #[allow(non_camel_case_types)] - struct ListAllInterfacesSvc(pub Arc); - impl< - T: ReflectionService, - > tonic::server::UnaryService - for ListAllInterfacesSvc { - type Response = super::ListAllInterfacesResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::list_all_interfaces( - &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 method = ListAllInterfacesSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.base.reflection.v1beta1.ReflectionService/ListImplementations" => { - #[allow(non_camel_case_types)] - struct ListImplementationsSvc(pub Arc); - impl< - T: ReflectionService, - > tonic::server::UnaryService - for ListImplementationsSvc { - type Response = super::ListImplementationsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::list_implementations( - &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 method = ListImplementationsSvc(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", tonic::Code::Unimplemented as i32) - .header( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ) - .body(empty_body()) - .unwrap(), - ) - }) - } - } - } - } - impl Clone for ReflectionServiceServer { - 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 tonic::server::NamedService - for ReflectionServiceServer { - const NAME: &'static str = "cosmos.base.reflection.v1beta1.ReflectionService"; - } -} diff --git a/src/prost/cosmos.base.reflection.v1beta1.serde.rs b/src/prost/cosmos.base.reflection.v1beta1.serde.rs deleted file mode 100644 index 731bbdf0..00000000 --- a/src/prost/cosmos.base.reflection.v1beta1.serde.rs +++ /dev/null @@ -1,347 +0,0 @@ -impl serde::Serialize for ListAllInterfacesRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.base.reflection.v1beta1.ListAllInterfacesRequest", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ListAllInterfacesRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ListAllInterfacesRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v1beta1.ListAllInterfacesRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(ListAllInterfacesRequest { - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v1beta1.ListAllInterfacesRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for ListAllInterfacesResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.reflection.v1beta1.ListAllInterfacesResponse", len)?; - if true { - struct_ser.serialize_field("interfaceNames", &self.interface_names)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ListAllInterfacesResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "interface_names", - "interfaceNames", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - InterfaceNames, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "interfaceNames" | "interface_names" => Ok(GeneratedField::InterfaceNames), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ListAllInterfacesResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v1beta1.ListAllInterfacesResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut interface_names__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::InterfaceNames => { - if interface_names__.is_some() { - return Err(serde::de::Error::duplicate_field("interfaceNames")); - } - interface_names__ = Some(map_.next_value()?); - } - } - } - Ok(ListAllInterfacesResponse { - interface_names: interface_names__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v1beta1.ListAllInterfacesResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for ListImplementationsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.reflection.v1beta1.ListImplementationsRequest", len)?; - if true { - struct_ser.serialize_field("interfaceName", &self.interface_name)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ListImplementationsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "interface_name", - "interfaceName", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - InterfaceName, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "interfaceName" | "interface_name" => Ok(GeneratedField::InterfaceName), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ListImplementationsRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v1beta1.ListImplementationsRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut interface_name__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::InterfaceName => { - if interface_name__.is_some() { - return Err(serde::de::Error::duplicate_field("interfaceName")); - } - interface_name__ = Some(map_.next_value()?); - } - } - } - Ok(ListImplementationsRequest { - interface_name: interface_name__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v1beta1.ListImplementationsRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for ListImplementationsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.reflection.v1beta1.ListImplementationsResponse", len)?; - if true { - struct_ser.serialize_field("implementationMessageNames", &self.implementation_message_names)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ListImplementationsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "implementation_message_names", - "implementationMessageNames", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ImplementationMessageNames, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "implementationMessageNames" | "implementation_message_names" => Ok(GeneratedField::ImplementationMessageNames), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ListImplementationsResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v1beta1.ListImplementationsResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut implementation_message_names__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ImplementationMessageNames => { - if implementation_message_names__.is_some() { - return Err(serde::de::Error::duplicate_field("implementationMessageNames")); - } - implementation_message_names__ = Some(map_.next_value()?); - } - } - } - Ok(ListImplementationsResponse { - implementation_message_names: implementation_message_names__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v1beta1.ListImplementationsResponse", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.base.reflection.v2alpha1.rs b/src/prost/cosmos.base.reflection.v2alpha1.rs deleted file mode 100644 index 59253201..00000000 --- a/src/prost/cosmos.base.reflection.v2alpha1.rs +++ /dev/null @@ -1,1260 +0,0 @@ -// This file is @generated by prost-build. -/// AppDescriptor describes a cosmos-sdk based application -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AppDescriptor { - /// AuthnDescriptor provides information on how to authenticate transactions on the application - /// NOTE: experimental and subject to change in future releases. - #[prost(message, optional, tag = "1")] - pub authn: ::core::option::Option, - /// chain provides the chain descriptor - #[prost(message, optional, tag = "2")] - pub chain: ::core::option::Option, - /// codec provides metadata information regarding codec related types - #[prost(message, optional, tag = "3")] - pub codec: ::core::option::Option, - /// configuration provides metadata information regarding the sdk.Config type - #[prost(message, optional, tag = "4")] - pub configuration: ::core::option::Option, - /// query_services provides metadata information regarding the available queriable endpoints - #[prost(message, optional, tag = "5")] - pub query_services: ::core::option::Option, - /// tx provides metadata information regarding how to send transactions to the given application - #[prost(message, optional, tag = "6")] - pub tx: ::core::option::Option, -} -impl ::prost::Name for AppDescriptor { - const NAME: &'static str = "AppDescriptor"; - const PACKAGE: &'static str = "cosmos.base.reflection.v2alpha1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v2alpha1.AppDescriptor".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v2alpha1.AppDescriptor".into() - } -} -/// TxDescriptor describes the accepted transaction type -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TxDescriptor { - /// fullname is the protobuf fullname of the raw transaction type (for instance the tx.Tx type) - /// it is not meant to support polymorphism of transaction types, it is supposed to be used by - /// reflection clients to understand if they can handle a specific transaction type in an application. - #[prost(string, tag = "1")] - pub fullname: ::prost::alloc::string::String, - /// msgs lists the accepted application messages (sdk.Msg) - #[prost(message, repeated, tag = "2")] - pub msgs: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for TxDescriptor { - const NAME: &'static str = "TxDescriptor"; - const PACKAGE: &'static str = "cosmos.base.reflection.v2alpha1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v2alpha1.TxDescriptor".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v2alpha1.TxDescriptor".into() - } -} -/// AuthnDescriptor provides information on how to sign transactions without relying -/// on the online RPCs GetTxMetadata and CombineUnsignedTxAndSignatures -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AuthnDescriptor { - /// sign_modes defines the supported signature algorithm - #[prost(message, repeated, tag = "1")] - pub sign_modes: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for AuthnDescriptor { - const NAME: &'static str = "AuthnDescriptor"; - const PACKAGE: &'static str = "cosmos.base.reflection.v2alpha1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v2alpha1.AuthnDescriptor".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v2alpha1.AuthnDescriptor".into() - } -} -/// SigningModeDescriptor provides information on a signing flow of the application -/// NOTE(fdymylja): here we could go as far as providing an entire flow on how -/// to sign a message given a SigningModeDescriptor, but it's better to think about -/// this another time -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SigningModeDescriptor { - /// name defines the unique name of the signing mode - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - /// number is the unique int32 identifier for the sign_mode enum - #[prost(int32, tag = "2")] - pub number: i32, - /// authn_info_provider_method_fullname defines the fullname of the method to call to get - /// the metadata required to authenticate using the provided sign_modes - #[prost(string, tag = "3")] - pub authn_info_provider_method_fullname: ::prost::alloc::string::String, -} -impl ::prost::Name for SigningModeDescriptor { - const NAME: &'static str = "SigningModeDescriptor"; - const PACKAGE: &'static str = "cosmos.base.reflection.v2alpha1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v2alpha1.SigningModeDescriptor".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v2alpha1.SigningModeDescriptor".into() - } -} -/// ChainDescriptor describes chain information of the application -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ChainDescriptor { - /// id is the chain id - #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, -} -impl ::prost::Name for ChainDescriptor { - const NAME: &'static str = "ChainDescriptor"; - const PACKAGE: &'static str = "cosmos.base.reflection.v2alpha1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v2alpha1.ChainDescriptor".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v2alpha1.ChainDescriptor".into() - } -} -/// CodecDescriptor describes the registered interfaces and provides metadata information on the types -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CodecDescriptor { - /// interfaces is a list of the registerted interfaces descriptors - #[prost(message, repeated, tag = "1")] - pub interfaces: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for CodecDescriptor { - const NAME: &'static str = "CodecDescriptor"; - const PACKAGE: &'static str = "cosmos.base.reflection.v2alpha1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v2alpha1.CodecDescriptor".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v2alpha1.CodecDescriptor".into() - } -} -/// InterfaceDescriptor describes the implementation of an interface -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct InterfaceDescriptor { - /// fullname is the name of the interface - #[prost(string, tag = "1")] - pub fullname: ::prost::alloc::string::String, - /// interface_accepting_messages contains information regarding the proto messages which contain the interface as - /// google.protobuf.Any field - #[prost(message, repeated, tag = "2")] - pub interface_accepting_messages: ::prost::alloc::vec::Vec< - InterfaceAcceptingMessageDescriptor, - >, - /// interface_implementers is a list of the descriptors of the interface implementers - #[prost(message, repeated, tag = "3")] - pub interface_implementers: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for InterfaceDescriptor { - const NAME: &'static str = "InterfaceDescriptor"; - const PACKAGE: &'static str = "cosmos.base.reflection.v2alpha1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v2alpha1.InterfaceDescriptor".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v2alpha1.InterfaceDescriptor".into() - } -} -/// InterfaceImplementerDescriptor describes an interface implementer -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct InterfaceImplementerDescriptor { - /// fullname is the protobuf queryable name of the interface implementer - #[prost(string, tag = "1")] - pub fullname: ::prost::alloc::string::String, - /// type_url defines the type URL used when marshalling the type as any - /// this is required so we can provide type safe google.protobuf.Any marshalling and - /// unmarshalling, making sure that we don't accept just 'any' type - /// in our interface fields - #[prost(string, tag = "2")] - pub type_url: ::prost::alloc::string::String, -} -impl ::prost::Name for InterfaceImplementerDescriptor { - const NAME: &'static str = "InterfaceImplementerDescriptor"; - const PACKAGE: &'static str = "cosmos.base.reflection.v2alpha1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v2alpha1.InterfaceImplementerDescriptor".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v2alpha1.InterfaceImplementerDescriptor".into() - } -} -/// InterfaceAcceptingMessageDescriptor describes a protobuf message which contains -/// an interface represented as a google.protobuf.Any -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct InterfaceAcceptingMessageDescriptor { - /// fullname is the protobuf fullname of the type containing the interface - #[prost(string, tag = "1")] - pub fullname: ::prost::alloc::string::String, - /// field_descriptor_names is a list of the protobuf name (not fullname) of the field - /// which contains the interface as google.protobuf.Any (the interface is the same, but - /// it can be in multiple fields of the same proto message) - #[prost(string, repeated, tag = "2")] - pub field_descriptor_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -impl ::prost::Name for InterfaceAcceptingMessageDescriptor { - const NAME: &'static str = "InterfaceAcceptingMessageDescriptor"; - const PACKAGE: &'static str = "cosmos.base.reflection.v2alpha1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v2alpha1.InterfaceAcceptingMessageDescriptor".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v2alpha1.InterfaceAcceptingMessageDescriptor".into() - } -} -/// ConfigurationDescriptor contains metadata information on the sdk.Config -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConfigurationDescriptor { - /// bech32_account_address_prefix is the account address prefix - #[prost(string, tag = "1")] - pub bech32_account_address_prefix: ::prost::alloc::string::String, -} -impl ::prost::Name for ConfigurationDescriptor { - const NAME: &'static str = "ConfigurationDescriptor"; - const PACKAGE: &'static str = "cosmos.base.reflection.v2alpha1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v2alpha1.ConfigurationDescriptor".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v2alpha1.ConfigurationDescriptor".into() - } -} -/// MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgDescriptor { - /// msg_type_url contains the TypeURL of a sdk.Msg. - #[prost(string, tag = "1")] - pub msg_type_url: ::prost::alloc::string::String, -} -impl ::prost::Name for MsgDescriptor { - const NAME: &'static str = "MsgDescriptor"; - const PACKAGE: &'static str = "cosmos.base.reflection.v2alpha1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v2alpha1.MsgDescriptor".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v2alpha1.MsgDescriptor".into() - } -} -/// GetAuthnDescriptorRequest is the request used for the GetAuthnDescriptor RPC -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct GetAuthnDescriptorRequest {} -impl ::prost::Name for GetAuthnDescriptorRequest { - const NAME: &'static str = "GetAuthnDescriptorRequest"; - const PACKAGE: &'static str = "cosmos.base.reflection.v2alpha1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v2alpha1.GetAuthnDescriptorRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v2alpha1.GetAuthnDescriptorRequest".into() - } -} -/// GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetAuthnDescriptorResponse { - /// authn describes how to authenticate to the application when sending transactions - #[prost(message, optional, tag = "1")] - pub authn: ::core::option::Option, -} -impl ::prost::Name for GetAuthnDescriptorResponse { - const NAME: &'static str = "GetAuthnDescriptorResponse"; - const PACKAGE: &'static str = "cosmos.base.reflection.v2alpha1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v2alpha1.GetAuthnDescriptorResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v2alpha1.GetAuthnDescriptorResponse".into() - } -} -/// GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct GetChainDescriptorRequest {} -impl ::prost::Name for GetChainDescriptorRequest { - const NAME: &'static str = "GetChainDescriptorRequest"; - const PACKAGE: &'static str = "cosmos.base.reflection.v2alpha1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v2alpha1.GetChainDescriptorRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v2alpha1.GetChainDescriptorRequest".into() - } -} -/// GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetChainDescriptorResponse { - /// chain describes application chain information - #[prost(message, optional, tag = "1")] - pub chain: ::core::option::Option, -} -impl ::prost::Name for GetChainDescriptorResponse { - const NAME: &'static str = "GetChainDescriptorResponse"; - const PACKAGE: &'static str = "cosmos.base.reflection.v2alpha1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v2alpha1.GetChainDescriptorResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v2alpha1.GetChainDescriptorResponse".into() - } -} -/// GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct GetCodecDescriptorRequest {} -impl ::prost::Name for GetCodecDescriptorRequest { - const NAME: &'static str = "GetCodecDescriptorRequest"; - const PACKAGE: &'static str = "cosmos.base.reflection.v2alpha1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v2alpha1.GetCodecDescriptorRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v2alpha1.GetCodecDescriptorRequest".into() - } -} -/// GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetCodecDescriptorResponse { - /// codec describes the application codec such as registered interfaces and implementations - #[prost(message, optional, tag = "1")] - pub codec: ::core::option::Option, -} -impl ::prost::Name for GetCodecDescriptorResponse { - const NAME: &'static str = "GetCodecDescriptorResponse"; - const PACKAGE: &'static str = "cosmos.base.reflection.v2alpha1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v2alpha1.GetCodecDescriptorResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v2alpha1.GetCodecDescriptorResponse".into() - } -} -/// GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct GetConfigurationDescriptorRequest {} -impl ::prost::Name for GetConfigurationDescriptorRequest { - const NAME: &'static str = "GetConfigurationDescriptorRequest"; - const PACKAGE: &'static str = "cosmos.base.reflection.v2alpha1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorRequest".into() - } -} -/// GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetConfigurationDescriptorResponse { - /// config describes the application's sdk.Config - #[prost(message, optional, tag = "1")] - pub config: ::core::option::Option, -} -impl ::prost::Name for GetConfigurationDescriptorResponse { - const NAME: &'static str = "GetConfigurationDescriptorResponse"; - const PACKAGE: &'static str = "cosmos.base.reflection.v2alpha1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorResponse".into() - } -} -/// GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct GetQueryServicesDescriptorRequest {} -impl ::prost::Name for GetQueryServicesDescriptorRequest { - const NAME: &'static str = "GetQueryServicesDescriptorRequest"; - const PACKAGE: &'static str = "cosmos.base.reflection.v2alpha1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorRequest".into() - } -} -/// GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetQueryServicesDescriptorResponse { - /// queries provides information on the available queryable services - #[prost(message, optional, tag = "1")] - pub queries: ::core::option::Option, -} -impl ::prost::Name for GetQueryServicesDescriptorResponse { - const NAME: &'static str = "GetQueryServicesDescriptorResponse"; - const PACKAGE: &'static str = "cosmos.base.reflection.v2alpha1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorResponse".into() - } -} -/// GetTxDescriptorRequest is the request used for the GetTxDescriptor RPC -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct GetTxDescriptorRequest {} -impl ::prost::Name for GetTxDescriptorRequest { - const NAME: &'static str = "GetTxDescriptorRequest"; - const PACKAGE: &'static str = "cosmos.base.reflection.v2alpha1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v2alpha1.GetTxDescriptorRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v2alpha1.GetTxDescriptorRequest".into() - } -} -/// GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetTxDescriptorResponse { - /// tx provides information on msgs that can be forwarded to the application - /// alongside the accepted transaction protobuf type - #[prost(message, optional, tag = "1")] - pub tx: ::core::option::Option, -} -impl ::prost::Name for GetTxDescriptorResponse { - const NAME: &'static str = "GetTxDescriptorResponse"; - const PACKAGE: &'static str = "cosmos.base.reflection.v2alpha1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v2alpha1.GetTxDescriptorResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v2alpha1.GetTxDescriptorResponse".into() - } -} -/// QueryServicesDescriptor contains the list of cosmos-sdk queriable services -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryServicesDescriptor { - /// query_services is a list of cosmos-sdk QueryServiceDescriptor - #[prost(message, repeated, tag = "1")] - pub query_services: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for QueryServicesDescriptor { - const NAME: &'static str = "QueryServicesDescriptor"; - const PACKAGE: &'static str = "cosmos.base.reflection.v2alpha1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v2alpha1.QueryServicesDescriptor".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v2alpha1.QueryServicesDescriptor".into() - } -} -/// QueryServiceDescriptor describes a cosmos-sdk queryable service -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryServiceDescriptor { - /// fullname is the protobuf fullname of the service descriptor - #[prost(string, tag = "1")] - pub fullname: ::prost::alloc::string::String, - /// is_module describes if this service is actually exposed by an application's module - #[prost(bool, tag = "2")] - pub is_module: bool, - /// methods provides a list of query service methods - #[prost(message, repeated, tag = "3")] - pub methods: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for QueryServiceDescriptor { - const NAME: &'static str = "QueryServiceDescriptor"; - const PACKAGE: &'static str = "cosmos.base.reflection.v2alpha1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v2alpha1.QueryServiceDescriptor".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v2alpha1.QueryServiceDescriptor".into() - } -} -/// QueryMethodDescriptor describes a queryable method of a query service -/// no other info is provided beside method name and tendermint queryable path -/// because it would be redundant with the grpc reflection service -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryMethodDescriptor { - /// name is the protobuf name (not fullname) of the method - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - /// full_query_path is the path that can be used to query - /// this method via tendermint abci.Query - #[prost(string, tag = "2")] - pub full_query_path: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryMethodDescriptor { - const NAME: &'static str = "QueryMethodDescriptor"; - const PACKAGE: &'static str = "cosmos.base.reflection.v2alpha1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.reflection.v2alpha1.QueryMethodDescriptor".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.reflection.v2alpha1.QueryMethodDescriptor".into() - } -} -/// Generated client implementations. -#[cfg(feature = "client")] -pub mod reflection_service_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - /// ReflectionService defines a service for application reflection. - #[derive(Debug, Clone)] - pub struct ReflectionServiceClient { - inner: tonic::client::Grpc, - } - impl ReflectionServiceClient { - /// 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 ReflectionServiceClient - 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, - ) -> ReflectionServiceClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + Send + Sync, - { - ReflectionServiceClient::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 - } - /// GetAuthnDescriptor returns information on how to authenticate transactions in the application - /// NOTE: this RPC is still experimental and might be subject to breaking changes or removal in - /// future releases of the cosmos-sdk. - pub async fn get_authn_descriptor( - &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( - "/cosmos.base.reflection.v2alpha1.ReflectionService/GetAuthnDescriptor", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.base.reflection.v2alpha1.ReflectionService", - "GetAuthnDescriptor", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetChainDescriptor returns the description of the chain - pub async fn get_chain_descriptor( - &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( - "/cosmos.base.reflection.v2alpha1.ReflectionService/GetChainDescriptor", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.base.reflection.v2alpha1.ReflectionService", - "GetChainDescriptor", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetCodecDescriptor returns the descriptor of the codec of the application - pub async fn get_codec_descriptor( - &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( - "/cosmos.base.reflection.v2alpha1.ReflectionService/GetCodecDescriptor", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.base.reflection.v2alpha1.ReflectionService", - "GetCodecDescriptor", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetConfigurationDescriptor returns the descriptor for the sdk.Config of the application - pub async fn get_configuration_descriptor( - &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( - "/cosmos.base.reflection.v2alpha1.ReflectionService/GetConfigurationDescriptor", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.base.reflection.v2alpha1.ReflectionService", - "GetConfigurationDescriptor", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetQueryServicesDescriptor returns the available gRPC queryable services of the application - pub async fn get_query_services_descriptor( - &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( - "/cosmos.base.reflection.v2alpha1.ReflectionService/GetQueryServicesDescriptor", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.base.reflection.v2alpha1.ReflectionService", - "GetQueryServicesDescriptor", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetTxDescriptor returns information on the used transaction object and available msgs that can be used - pub async fn get_tx_descriptor( - &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( - "/cosmos.base.reflection.v2alpha1.ReflectionService/GetTxDescriptor", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.base.reflection.v2alpha1.ReflectionService", - "GetTxDescriptor", - ), - ); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -#[cfg(feature = "server")] -pub mod reflection_service_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with ReflectionServiceServer. - #[async_trait] - pub trait ReflectionService: Send + Sync + 'static { - /// GetAuthnDescriptor returns information on how to authenticate transactions in the application - /// NOTE: this RPC is still experimental and might be subject to breaking changes or removal in - /// future releases of the cosmos-sdk. - async fn get_authn_descriptor( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetChainDescriptor returns the description of the chain - async fn get_chain_descriptor( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetCodecDescriptor returns the descriptor of the codec of the application - async fn get_codec_descriptor( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetConfigurationDescriptor returns the descriptor for the sdk.Config of the application - async fn get_configuration_descriptor( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetQueryServicesDescriptor returns the available gRPC queryable services of the application - async fn get_query_services_descriptor( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetTxDescriptor returns information on the used transaction object and available msgs that can be used - async fn get_tx_descriptor( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - /// ReflectionService defines a service for application reflection. - #[derive(Debug)] - pub struct ReflectionServiceServer { - inner: Arc, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - impl ReflectionServiceServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - 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 ReflectionServiceServer - where - T: ReflectionService, - 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 { - match req.uri().path() { - "/cosmos.base.reflection.v2alpha1.ReflectionService/GetAuthnDescriptor" => { - #[allow(non_camel_case_types)] - struct GetAuthnDescriptorSvc(pub Arc); - impl< - T: ReflectionService, - > tonic::server::UnaryService - for GetAuthnDescriptorSvc { - type Response = super::GetAuthnDescriptorResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_authn_descriptor( - &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 method = GetAuthnDescriptorSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.base.reflection.v2alpha1.ReflectionService/GetChainDescriptor" => { - #[allow(non_camel_case_types)] - struct GetChainDescriptorSvc(pub Arc); - impl< - T: ReflectionService, - > tonic::server::UnaryService - for GetChainDescriptorSvc { - type Response = super::GetChainDescriptorResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_chain_descriptor( - &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 method = GetChainDescriptorSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.base.reflection.v2alpha1.ReflectionService/GetCodecDescriptor" => { - #[allow(non_camel_case_types)] - struct GetCodecDescriptorSvc(pub Arc); - impl< - T: ReflectionService, - > tonic::server::UnaryService - for GetCodecDescriptorSvc { - type Response = super::GetCodecDescriptorResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_codec_descriptor( - &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 method = GetCodecDescriptorSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.base.reflection.v2alpha1.ReflectionService/GetConfigurationDescriptor" => { - #[allow(non_camel_case_types)] - struct GetConfigurationDescriptorSvc( - pub Arc, - ); - impl< - T: ReflectionService, - > tonic::server::UnaryService< - super::GetConfigurationDescriptorRequest, - > for GetConfigurationDescriptorSvc { - type Response = super::GetConfigurationDescriptorResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::GetConfigurationDescriptorRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_configuration_descriptor( - &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 method = GetConfigurationDescriptorSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.base.reflection.v2alpha1.ReflectionService/GetQueryServicesDescriptor" => { - #[allow(non_camel_case_types)] - struct GetQueryServicesDescriptorSvc( - pub Arc, - ); - impl< - T: ReflectionService, - > tonic::server::UnaryService< - super::GetQueryServicesDescriptorRequest, - > for GetQueryServicesDescriptorSvc { - type Response = super::GetQueryServicesDescriptorResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::GetQueryServicesDescriptorRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_query_services_descriptor( - &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 method = GetQueryServicesDescriptorSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.base.reflection.v2alpha1.ReflectionService/GetTxDescriptor" => { - #[allow(non_camel_case_types)] - struct GetTxDescriptorSvc(pub Arc); - impl< - T: ReflectionService, - > tonic::server::UnaryService - for GetTxDescriptorSvc { - type Response = super::GetTxDescriptorResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_tx_descriptor(&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 method = GetTxDescriptorSvc(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", tonic::Code::Unimplemented as i32) - .header( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ) - .body(empty_body()) - .unwrap(), - ) - }) - } - } - } - } - impl Clone for ReflectionServiceServer { - 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 tonic::server::NamedService - for ReflectionServiceServer { - const NAME: &'static str = "cosmos.base.reflection.v2alpha1.ReflectionService"; - } -} diff --git a/src/prost/cosmos.base.reflection.v2alpha1.serde.rs b/src/prost/cosmos.base.reflection.v2alpha1.serde.rs deleted file mode 100644 index 9103b97c..00000000 --- a/src/prost/cosmos.base.reflection.v2alpha1.serde.rs +++ /dev/null @@ -1,2515 +0,0 @@ -impl serde::Serialize for AppDescriptor { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.reflection.v2alpha1.AppDescriptor", len)?; - if let Some(v) = self.authn.as_ref() { - struct_ser.serialize_field("authn", v)?; - } - if let Some(v) = self.chain.as_ref() { - struct_ser.serialize_field("chain", v)?; - } - if let Some(v) = self.codec.as_ref() { - struct_ser.serialize_field("codec", v)?; - } - if let Some(v) = self.configuration.as_ref() { - struct_ser.serialize_field("configuration", v)?; - } - if let Some(v) = self.query_services.as_ref() { - struct_ser.serialize_field("queryServices", v)?; - } - if let Some(v) = self.tx.as_ref() { - struct_ser.serialize_field("tx", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for AppDescriptor { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "authn", - "chain", - "codec", - "configuration", - "query_services", - "queryServices", - "tx", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Authn, - Chain, - Codec, - Configuration, - QueryServices, - Tx, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "authn" => Ok(GeneratedField::Authn), - "chain" => Ok(GeneratedField::Chain), - "codec" => Ok(GeneratedField::Codec), - "configuration" => Ok(GeneratedField::Configuration), - "queryServices" | "query_services" => Ok(GeneratedField::QueryServices), - "tx" => Ok(GeneratedField::Tx), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = AppDescriptor; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v2alpha1.AppDescriptor") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut authn__ = None; - let mut chain__ = None; - let mut codec__ = None; - let mut configuration__ = None; - let mut query_services__ = None; - let mut tx__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Authn => { - if authn__.is_some() { - return Err(serde::de::Error::duplicate_field("authn")); - } - authn__ = map_.next_value()?; - } - GeneratedField::Chain => { - if chain__.is_some() { - return Err(serde::de::Error::duplicate_field("chain")); - } - chain__ = map_.next_value()?; - } - GeneratedField::Codec => { - if codec__.is_some() { - return Err(serde::de::Error::duplicate_field("codec")); - } - codec__ = map_.next_value()?; - } - GeneratedField::Configuration => { - if configuration__.is_some() { - return Err(serde::de::Error::duplicate_field("configuration")); - } - configuration__ = map_.next_value()?; - } - GeneratedField::QueryServices => { - if query_services__.is_some() { - return Err(serde::de::Error::duplicate_field("queryServices")); - } - query_services__ = map_.next_value()?; - } - GeneratedField::Tx => { - if tx__.is_some() { - return Err(serde::de::Error::duplicate_field("tx")); - } - tx__ = map_.next_value()?; - } - } - } - Ok(AppDescriptor { - authn: authn__, - chain: chain__, - codec: codec__, - configuration: configuration__, - query_services: query_services__, - tx: tx__, - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v2alpha1.AppDescriptor", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for AuthnDescriptor { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.reflection.v2alpha1.AuthnDescriptor", len)?; - if true { - struct_ser.serialize_field("signModes", &self.sign_modes)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for AuthnDescriptor { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "sign_modes", - "signModes", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - SignModes, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "signModes" | "sign_modes" => Ok(GeneratedField::SignModes), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = AuthnDescriptor; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v2alpha1.AuthnDescriptor") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut sign_modes__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::SignModes => { - if sign_modes__.is_some() { - return Err(serde::de::Error::duplicate_field("signModes")); - } - sign_modes__ = Some(map_.next_value()?); - } - } - } - Ok(AuthnDescriptor { - sign_modes: sign_modes__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v2alpha1.AuthnDescriptor", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for ChainDescriptor { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.reflection.v2alpha1.ChainDescriptor", len)?; - if true { - struct_ser.serialize_field("id", &self.id)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ChainDescriptor { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "id", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Id, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "id" => Ok(GeneratedField::Id), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ChainDescriptor; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v2alpha1.ChainDescriptor") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut id__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Id => { - if id__.is_some() { - return Err(serde::de::Error::duplicate_field("id")); - } - id__ = Some(map_.next_value()?); - } - } - } - Ok(ChainDescriptor { - id: id__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v2alpha1.ChainDescriptor", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for CodecDescriptor { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.reflection.v2alpha1.CodecDescriptor", len)?; - if true { - struct_ser.serialize_field("interfaces", &self.interfaces)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CodecDescriptor { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "interfaces", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Interfaces, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "interfaces" => Ok(GeneratedField::Interfaces), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CodecDescriptor; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v2alpha1.CodecDescriptor") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut interfaces__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Interfaces => { - if interfaces__.is_some() { - return Err(serde::de::Error::duplicate_field("interfaces")); - } - interfaces__ = Some(map_.next_value()?); - } - } - } - Ok(CodecDescriptor { - interfaces: interfaces__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v2alpha1.CodecDescriptor", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for ConfigurationDescriptor { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.reflection.v2alpha1.ConfigurationDescriptor", len)?; - if true { - struct_ser.serialize_field("bech32AccountAddressPrefix", &self.bech32_account_address_prefix)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ConfigurationDescriptor { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "bech32_account_address_prefix", - "bech32AccountAddressPrefix", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Bech32AccountAddressPrefix, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "bech32AccountAddressPrefix" | "bech32_account_address_prefix" => Ok(GeneratedField::Bech32AccountAddressPrefix), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ConfigurationDescriptor; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v2alpha1.ConfigurationDescriptor") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut bech32_account_address_prefix__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Bech32AccountAddressPrefix => { - if bech32_account_address_prefix__.is_some() { - return Err(serde::de::Error::duplicate_field("bech32AccountAddressPrefix")); - } - bech32_account_address_prefix__ = Some(map_.next_value()?); - } - } - } - Ok(ConfigurationDescriptor { - bech32_account_address_prefix: bech32_account_address_prefix__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v2alpha1.ConfigurationDescriptor", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for GetAuthnDescriptorRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.base.reflection.v2alpha1.GetAuthnDescriptorRequest", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GetAuthnDescriptorRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GetAuthnDescriptorRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v2alpha1.GetAuthnDescriptorRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(GetAuthnDescriptorRequest { - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v2alpha1.GetAuthnDescriptorRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for GetAuthnDescriptorResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.reflection.v2alpha1.GetAuthnDescriptorResponse", len)?; - if let Some(v) = self.authn.as_ref() { - struct_ser.serialize_field("authn", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GetAuthnDescriptorResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "authn", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Authn, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "authn" => Ok(GeneratedField::Authn), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GetAuthnDescriptorResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v2alpha1.GetAuthnDescriptorResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut authn__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Authn => { - if authn__.is_some() { - return Err(serde::de::Error::duplicate_field("authn")); - } - authn__ = map_.next_value()?; - } - } - } - Ok(GetAuthnDescriptorResponse { - authn: authn__, - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v2alpha1.GetAuthnDescriptorResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for GetChainDescriptorRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.base.reflection.v2alpha1.GetChainDescriptorRequest", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GetChainDescriptorRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GetChainDescriptorRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v2alpha1.GetChainDescriptorRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(GetChainDescriptorRequest { - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v2alpha1.GetChainDescriptorRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for GetChainDescriptorResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.reflection.v2alpha1.GetChainDescriptorResponse", len)?; - if let Some(v) = self.chain.as_ref() { - struct_ser.serialize_field("chain", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GetChainDescriptorResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "chain", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Chain, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "chain" => Ok(GeneratedField::Chain), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GetChainDescriptorResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v2alpha1.GetChainDescriptorResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut chain__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Chain => { - if chain__.is_some() { - return Err(serde::de::Error::duplicate_field("chain")); - } - chain__ = map_.next_value()?; - } - } - } - Ok(GetChainDescriptorResponse { - chain: chain__, - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v2alpha1.GetChainDescriptorResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for GetCodecDescriptorRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.base.reflection.v2alpha1.GetCodecDescriptorRequest", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GetCodecDescriptorRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GetCodecDescriptorRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v2alpha1.GetCodecDescriptorRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(GetCodecDescriptorRequest { - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v2alpha1.GetCodecDescriptorRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for GetCodecDescriptorResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.reflection.v2alpha1.GetCodecDescriptorResponse", len)?; - if let Some(v) = self.codec.as_ref() { - struct_ser.serialize_field("codec", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GetCodecDescriptorResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "codec", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Codec, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "codec" => Ok(GeneratedField::Codec), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GetCodecDescriptorResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v2alpha1.GetCodecDescriptorResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut codec__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Codec => { - if codec__.is_some() { - return Err(serde::de::Error::duplicate_field("codec")); - } - codec__ = map_.next_value()?; - } - } - } - Ok(GetCodecDescriptorResponse { - codec: codec__, - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v2alpha1.GetCodecDescriptorResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for GetConfigurationDescriptorRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorRequest", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GetConfigurationDescriptorRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GetConfigurationDescriptorRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(GetConfigurationDescriptorRequest { - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for GetConfigurationDescriptorResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorResponse", len)?; - if let Some(v) = self.config.as_ref() { - struct_ser.serialize_field("config", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GetConfigurationDescriptorResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "config", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Config, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "config" => Ok(GeneratedField::Config), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GetConfigurationDescriptorResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut config__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Config => { - if config__.is_some() { - return Err(serde::de::Error::duplicate_field("config")); - } - config__ = map_.next_value()?; - } - } - } - Ok(GetConfigurationDescriptorResponse { - config: config__, - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for GetQueryServicesDescriptorRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorRequest", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GetQueryServicesDescriptorRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GetQueryServicesDescriptorRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(GetQueryServicesDescriptorRequest { - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for GetQueryServicesDescriptorResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorResponse", len)?; - if let Some(v) = self.queries.as_ref() { - struct_ser.serialize_field("queries", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GetQueryServicesDescriptorResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "queries", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Queries, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "queries" => Ok(GeneratedField::Queries), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GetQueryServicesDescriptorResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut queries__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Queries => { - if queries__.is_some() { - return Err(serde::de::Error::duplicate_field("queries")); - } - queries__ = map_.next_value()?; - } - } - } - Ok(GetQueryServicesDescriptorResponse { - queries: queries__, - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for GetTxDescriptorRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.base.reflection.v2alpha1.GetTxDescriptorRequest", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GetTxDescriptorRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GetTxDescriptorRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v2alpha1.GetTxDescriptorRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(GetTxDescriptorRequest { - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v2alpha1.GetTxDescriptorRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for GetTxDescriptorResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.reflection.v2alpha1.GetTxDescriptorResponse", len)?; - if let Some(v) = self.tx.as_ref() { - struct_ser.serialize_field("tx", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GetTxDescriptorResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "tx", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Tx, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "tx" => Ok(GeneratedField::Tx), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GetTxDescriptorResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v2alpha1.GetTxDescriptorResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut tx__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Tx => { - if tx__.is_some() { - return Err(serde::de::Error::duplicate_field("tx")); - } - tx__ = map_.next_value()?; - } - } - } - Ok(GetTxDescriptorResponse { - tx: tx__, - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v2alpha1.GetTxDescriptorResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for InterfaceAcceptingMessageDescriptor { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.reflection.v2alpha1.InterfaceAcceptingMessageDescriptor", len)?; - if true { - struct_ser.serialize_field("fullname", &self.fullname)?; - } - if true { - struct_ser.serialize_field("fieldDescriptorNames", &self.field_descriptor_names)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for InterfaceAcceptingMessageDescriptor { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "fullname", - "field_descriptor_names", - "fieldDescriptorNames", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Fullname, - FieldDescriptorNames, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "fullname" => Ok(GeneratedField::Fullname), - "fieldDescriptorNames" | "field_descriptor_names" => Ok(GeneratedField::FieldDescriptorNames), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = InterfaceAcceptingMessageDescriptor; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v2alpha1.InterfaceAcceptingMessageDescriptor") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut fullname__ = None; - let mut field_descriptor_names__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Fullname => { - if fullname__.is_some() { - return Err(serde::de::Error::duplicate_field("fullname")); - } - fullname__ = Some(map_.next_value()?); - } - GeneratedField::FieldDescriptorNames => { - if field_descriptor_names__.is_some() { - return Err(serde::de::Error::duplicate_field("fieldDescriptorNames")); - } - field_descriptor_names__ = Some(map_.next_value()?); - } - } - } - Ok(InterfaceAcceptingMessageDescriptor { - fullname: fullname__.unwrap_or_default(), - field_descriptor_names: field_descriptor_names__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v2alpha1.InterfaceAcceptingMessageDescriptor", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for InterfaceDescriptor { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.reflection.v2alpha1.InterfaceDescriptor", len)?; - if true { - struct_ser.serialize_field("fullname", &self.fullname)?; - } - if true { - struct_ser.serialize_field("interfaceAcceptingMessages", &self.interface_accepting_messages)?; - } - if true { - struct_ser.serialize_field("interfaceImplementers", &self.interface_implementers)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for InterfaceDescriptor { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "fullname", - "interface_accepting_messages", - "interfaceAcceptingMessages", - "interface_implementers", - "interfaceImplementers", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Fullname, - InterfaceAcceptingMessages, - InterfaceImplementers, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "fullname" => Ok(GeneratedField::Fullname), - "interfaceAcceptingMessages" | "interface_accepting_messages" => Ok(GeneratedField::InterfaceAcceptingMessages), - "interfaceImplementers" | "interface_implementers" => Ok(GeneratedField::InterfaceImplementers), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = InterfaceDescriptor; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v2alpha1.InterfaceDescriptor") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut fullname__ = None; - let mut interface_accepting_messages__ = None; - let mut interface_implementers__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Fullname => { - if fullname__.is_some() { - return Err(serde::de::Error::duplicate_field("fullname")); - } - fullname__ = Some(map_.next_value()?); - } - GeneratedField::InterfaceAcceptingMessages => { - if interface_accepting_messages__.is_some() { - return Err(serde::de::Error::duplicate_field("interfaceAcceptingMessages")); - } - interface_accepting_messages__ = Some(map_.next_value()?); - } - GeneratedField::InterfaceImplementers => { - if interface_implementers__.is_some() { - return Err(serde::de::Error::duplicate_field("interfaceImplementers")); - } - interface_implementers__ = Some(map_.next_value()?); - } - } - } - Ok(InterfaceDescriptor { - fullname: fullname__.unwrap_or_default(), - interface_accepting_messages: interface_accepting_messages__.unwrap_or_default(), - interface_implementers: interface_implementers__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v2alpha1.InterfaceDescriptor", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for InterfaceImplementerDescriptor { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.reflection.v2alpha1.InterfaceImplementerDescriptor", len)?; - if true { - struct_ser.serialize_field("fullname", &self.fullname)?; - } - if true { - struct_ser.serialize_field("typeUrl", &self.type_url)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for InterfaceImplementerDescriptor { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "fullname", - "type_url", - "typeUrl", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Fullname, - TypeUrl, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "fullname" => Ok(GeneratedField::Fullname), - "typeUrl" | "type_url" => Ok(GeneratedField::TypeUrl), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = InterfaceImplementerDescriptor; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v2alpha1.InterfaceImplementerDescriptor") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut fullname__ = None; - let mut type_url__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Fullname => { - if fullname__.is_some() { - return Err(serde::de::Error::duplicate_field("fullname")); - } - fullname__ = Some(map_.next_value()?); - } - GeneratedField::TypeUrl => { - if type_url__.is_some() { - return Err(serde::de::Error::duplicate_field("typeUrl")); - } - type_url__ = Some(map_.next_value()?); - } - } - } - Ok(InterfaceImplementerDescriptor { - fullname: fullname__.unwrap_or_default(), - type_url: type_url__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v2alpha1.InterfaceImplementerDescriptor", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgDescriptor { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.reflection.v2alpha1.MsgDescriptor", len)?; - if true { - struct_ser.serialize_field("msgTypeUrl", &self.msg_type_url)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgDescriptor { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "msg_type_url", - "msgTypeUrl", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - MsgTypeUrl, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "msgTypeUrl" | "msg_type_url" => Ok(GeneratedField::MsgTypeUrl), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgDescriptor; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v2alpha1.MsgDescriptor") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut msg_type_url__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::MsgTypeUrl => { - if msg_type_url__.is_some() { - return Err(serde::de::Error::duplicate_field("msgTypeUrl")); - } - msg_type_url__ = Some(map_.next_value()?); - } - } - } - Ok(MsgDescriptor { - msg_type_url: msg_type_url__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v2alpha1.MsgDescriptor", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryMethodDescriptor { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.reflection.v2alpha1.QueryMethodDescriptor", len)?; - if true { - struct_ser.serialize_field("name", &self.name)?; - } - if true { - struct_ser.serialize_field("fullQueryPath", &self.full_query_path)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryMethodDescriptor { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "name", - "full_query_path", - "fullQueryPath", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Name, - FullQueryPath, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "name" => Ok(GeneratedField::Name), - "fullQueryPath" | "full_query_path" => Ok(GeneratedField::FullQueryPath), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryMethodDescriptor; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v2alpha1.QueryMethodDescriptor") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut name__ = None; - let mut full_query_path__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); - } - name__ = Some(map_.next_value()?); - } - GeneratedField::FullQueryPath => { - if full_query_path__.is_some() { - return Err(serde::de::Error::duplicate_field("fullQueryPath")); - } - full_query_path__ = Some(map_.next_value()?); - } - } - } - Ok(QueryMethodDescriptor { - name: name__.unwrap_or_default(), - full_query_path: full_query_path__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v2alpha1.QueryMethodDescriptor", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryServiceDescriptor { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.reflection.v2alpha1.QueryServiceDescriptor", len)?; - if true { - struct_ser.serialize_field("fullname", &self.fullname)?; - } - if true { - struct_ser.serialize_field("isModule", &self.is_module)?; - } - if true { - struct_ser.serialize_field("methods", &self.methods)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryServiceDescriptor { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "fullname", - "is_module", - "isModule", - "methods", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Fullname, - IsModule, - Methods, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "fullname" => Ok(GeneratedField::Fullname), - "isModule" | "is_module" => Ok(GeneratedField::IsModule), - "methods" => Ok(GeneratedField::Methods), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryServiceDescriptor; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v2alpha1.QueryServiceDescriptor") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut fullname__ = None; - let mut is_module__ = None; - let mut methods__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Fullname => { - if fullname__.is_some() { - return Err(serde::de::Error::duplicate_field("fullname")); - } - fullname__ = Some(map_.next_value()?); - } - GeneratedField::IsModule => { - if is_module__.is_some() { - return Err(serde::de::Error::duplicate_field("isModule")); - } - is_module__ = Some(map_.next_value()?); - } - GeneratedField::Methods => { - if methods__.is_some() { - return Err(serde::de::Error::duplicate_field("methods")); - } - methods__ = Some(map_.next_value()?); - } - } - } - Ok(QueryServiceDescriptor { - fullname: fullname__.unwrap_or_default(), - is_module: is_module__.unwrap_or_default(), - methods: methods__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v2alpha1.QueryServiceDescriptor", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryServicesDescriptor { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.reflection.v2alpha1.QueryServicesDescriptor", len)?; - if true { - struct_ser.serialize_field("queryServices", &self.query_services)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryServicesDescriptor { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "query_services", - "queryServices", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - QueryServices, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "queryServices" | "query_services" => Ok(GeneratedField::QueryServices), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryServicesDescriptor; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v2alpha1.QueryServicesDescriptor") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut query_services__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::QueryServices => { - if query_services__.is_some() { - return Err(serde::de::Error::duplicate_field("queryServices")); - } - query_services__ = Some(map_.next_value()?); - } - } - } - Ok(QueryServicesDescriptor { - query_services: query_services__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v2alpha1.QueryServicesDescriptor", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for SigningModeDescriptor { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.reflection.v2alpha1.SigningModeDescriptor", len)?; - if true { - struct_ser.serialize_field("name", &self.name)?; - } - if true { - struct_ser.serialize_field("number", &self.number)?; - } - if true { - struct_ser.serialize_field("authnInfoProviderMethodFullname", &self.authn_info_provider_method_fullname)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SigningModeDescriptor { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "name", - "number", - "authn_info_provider_method_fullname", - "authnInfoProviderMethodFullname", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Name, - Number, - AuthnInfoProviderMethodFullname, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "name" => Ok(GeneratedField::Name), - "number" => Ok(GeneratedField::Number), - "authnInfoProviderMethodFullname" | "authn_info_provider_method_fullname" => Ok(GeneratedField::AuthnInfoProviderMethodFullname), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SigningModeDescriptor; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v2alpha1.SigningModeDescriptor") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut name__ = None; - let mut number__ = None; - let mut authn_info_provider_method_fullname__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); - } - name__ = Some(map_.next_value()?); - } - GeneratedField::Number => { - if number__.is_some() { - return Err(serde::de::Error::duplicate_field("number")); - } - number__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::AuthnInfoProviderMethodFullname => { - if authn_info_provider_method_fullname__.is_some() { - return Err(serde::de::Error::duplicate_field("authnInfoProviderMethodFullname")); - } - authn_info_provider_method_fullname__ = Some(map_.next_value()?); - } - } - } - Ok(SigningModeDescriptor { - name: name__.unwrap_or_default(), - number: number__.unwrap_or_default(), - authn_info_provider_method_fullname: authn_info_provider_method_fullname__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v2alpha1.SigningModeDescriptor", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for TxDescriptor { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.reflection.v2alpha1.TxDescriptor", len)?; - if true { - struct_ser.serialize_field("fullname", &self.fullname)?; - } - if true { - struct_ser.serialize_field("msgs", &self.msgs)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for TxDescriptor { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "fullname", - "msgs", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Fullname, - Msgs, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "fullname" => Ok(GeneratedField::Fullname), - "msgs" => Ok(GeneratedField::Msgs), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TxDescriptor; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.reflection.v2alpha1.TxDescriptor") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut fullname__ = None; - let mut msgs__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Fullname => { - if fullname__.is_some() { - return Err(serde::de::Error::duplicate_field("fullname")); - } - fullname__ = Some(map_.next_value()?); - } - GeneratedField::Msgs => { - if msgs__.is_some() { - return Err(serde::de::Error::duplicate_field("msgs")); - } - msgs__ = Some(map_.next_value()?); - } - } - } - Ok(TxDescriptor { - fullname: fullname__.unwrap_or_default(), - msgs: msgs__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.reflection.v2alpha1.TxDescriptor", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.base.snapshots.v1beta1.rs b/src/prost/cosmos.base.snapshots.v1beta1.rs deleted file mode 100644 index 5dffaf63..00000000 --- a/src/prost/cosmos.base.snapshots.v1beta1.rs +++ /dev/null @@ -1,212 +0,0 @@ -// This file is @generated by prost-build. -/// Snapshot contains Tendermint state sync snapshot info. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Snapshot { - #[prost(uint64, tag = "1")] - pub height: u64, - #[prost(uint32, tag = "2")] - pub format: u32, - #[prost(uint32, tag = "3")] - pub chunks: u32, - #[prost(bytes = "vec", tag = "4")] - pub hash: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "5")] - pub metadata: ::core::option::Option, -} -impl ::prost::Name for Snapshot { - const NAME: &'static str = "Snapshot"; - const PACKAGE: &'static str = "cosmos.base.snapshots.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.snapshots.v1beta1.Snapshot".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.snapshots.v1beta1.Snapshot".into() - } -} -/// Metadata contains SDK-specific snapshot metadata. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Metadata { - /// SHA-256 chunk hashes - #[prost(bytes = "vec", repeated, tag = "1")] - pub chunk_hashes: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, -} -impl ::prost::Name for Metadata { - const NAME: &'static str = "Metadata"; - const PACKAGE: &'static str = "cosmos.base.snapshots.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.snapshots.v1beta1.Metadata".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.snapshots.v1beta1.Metadata".into() - } -} -/// SnapshotItem is an item contained in a rootmulti.Store snapshot. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SnapshotItem { - /// item is the specific type of snapshot item. - #[prost(oneof = "snapshot_item::Item", tags = "1, 2, 3, 4, 5, 6")] - pub item: ::core::option::Option, -} -/// Nested message and enum types in `SnapshotItem`. -pub mod snapshot_item { - /// item is the specific type of snapshot item. - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Item { - #[prost(message, tag = "1")] - Store(super::SnapshotStoreItem), - #[prost(message, tag = "2")] - Iavl(super::SnapshotIavlItem), - #[prost(message, tag = "3")] - Extension(super::SnapshotExtensionMeta), - #[prost(message, tag = "4")] - ExtensionPayload(super::SnapshotExtensionPayload), - #[prost(message, tag = "5")] - Kv(super::SnapshotKvItem), - #[prost(message, tag = "6")] - Schema(super::SnapshotSchema), - } -} -impl ::prost::Name for SnapshotItem { - const NAME: &'static str = "SnapshotItem"; - const PACKAGE: &'static str = "cosmos.base.snapshots.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.snapshots.v1beta1.SnapshotItem".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.snapshots.v1beta1.SnapshotItem".into() - } -} -/// SnapshotStoreItem contains metadata about a snapshotted store. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SnapshotStoreItem { - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, -} -impl ::prost::Name for SnapshotStoreItem { - const NAME: &'static str = "SnapshotStoreItem"; - const PACKAGE: &'static str = "cosmos.base.snapshots.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.snapshots.v1beta1.SnapshotStoreItem".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.snapshots.v1beta1.SnapshotStoreItem".into() - } -} -/// SnapshotIAVLItem is an exported IAVL node. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SnapshotIavlItem { - #[prost(bytes = "vec", tag = "1")] - pub key: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "2")] - pub value: ::prost::alloc::vec::Vec, - /// version is block height - #[prost(int64, tag = "3")] - pub version: i64, - /// height is depth of the tree. - #[prost(int32, tag = "4")] - pub height: i32, -} -impl ::prost::Name for SnapshotIavlItem { - const NAME: &'static str = "SnapshotIAVLItem"; - const PACKAGE: &'static str = "cosmos.base.snapshots.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.snapshots.v1beta1.SnapshotIAVLItem".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.snapshots.v1beta1.SnapshotIAVLItem".into() - } -} -/// SnapshotExtensionMeta contains metadata about an external snapshotter. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SnapshotExtensionMeta { - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - #[prost(uint32, tag = "2")] - pub format: u32, -} -impl ::prost::Name for SnapshotExtensionMeta { - const NAME: &'static str = "SnapshotExtensionMeta"; - const PACKAGE: &'static str = "cosmos.base.snapshots.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta".into() - } -} -/// SnapshotExtensionPayload contains payloads of an external snapshotter. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SnapshotExtensionPayload { - #[prost(bytes = "vec", tag = "1")] - pub payload: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for SnapshotExtensionPayload { - const NAME: &'static str = "SnapshotExtensionPayload"; - const PACKAGE: &'static str = "cosmos.base.snapshots.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload".into() - } -} -/// SnapshotKVItem is an exported Key/Value Pair -/// -/// Since: cosmos-sdk 0.46 -/// Deprecated: This message was part of store/v2alpha1 which has been deleted from v0.47. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SnapshotKvItem { - #[prost(bytes = "vec", tag = "1")] - pub key: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "2")] - pub value: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for SnapshotKvItem { - const NAME: &'static str = "SnapshotKVItem"; - const PACKAGE: &'static str = "cosmos.base.snapshots.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.snapshots.v1beta1.SnapshotKVItem".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.snapshots.v1beta1.SnapshotKVItem".into() - } -} -/// SnapshotSchema is an exported schema of smt store -/// -/// Since: cosmos-sdk 0.46 -/// Deprecated: This message was part of store/v2alpha1 which has been deleted from v0.47. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SnapshotSchema { - #[prost(bytes = "vec", repeated, tag = "1")] - pub keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, -} -impl ::prost::Name for SnapshotSchema { - const NAME: &'static str = "SnapshotSchema"; - const PACKAGE: &'static str = "cosmos.base.snapshots.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.snapshots.v1beta1.SnapshotSchema".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.snapshots.v1beta1.SnapshotSchema".into() - } -} diff --git a/src/prost/cosmos.base.snapshots.v1beta1.serde.rs b/src/prost/cosmos.base.snapshots.v1beta1.serde.rs deleted file mode 100644 index f28fcfed..00000000 --- a/src/prost/cosmos.base.snapshots.v1beta1.serde.rs +++ /dev/null @@ -1,1082 +0,0 @@ -impl serde::Serialize for Metadata { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.snapshots.v1beta1.Metadata", len)?; - if true { - struct_ser.serialize_field("chunkHashes", &self.chunk_hashes.iter().map(pbjson::private::base64::encode).collect::<::alloc::vec::Vec<_>>())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Metadata { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "chunk_hashes", - "chunkHashes", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ChunkHashes, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "chunkHashes" | "chunk_hashes" => Ok(GeneratedField::ChunkHashes), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Metadata; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.snapshots.v1beta1.Metadata") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut chunk_hashes__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ChunkHashes => { - if chunk_hashes__.is_some() { - return Err(serde::de::Error::duplicate_field("chunkHashes")); - } - chunk_hashes__ = - Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::BytesDeserialize<_>>>()? - .into_iter().map(|x| x.0).collect()) - ; - } - } - } - Ok(Metadata { - chunk_hashes: chunk_hashes__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.snapshots.v1beta1.Metadata", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Snapshot { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.snapshots.v1beta1.Snapshot", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("height", ::alloc::string::ToString::to_string(&self.height).as_str())?; - } - if true { - struct_ser.serialize_field("format", &self.format)?; - } - if true { - struct_ser.serialize_field("chunks", &self.chunks)?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("hash", pbjson::private::base64::encode(&self.hash).as_str())?; - } - if let Some(v) = self.metadata.as_ref() { - struct_ser.serialize_field("metadata", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Snapshot { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "height", - "format", - "chunks", - "hash", - "metadata", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Height, - Format, - Chunks, - Hash, - Metadata, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "height" => Ok(GeneratedField::Height), - "format" => Ok(GeneratedField::Format), - "chunks" => Ok(GeneratedField::Chunks), - "hash" => Ok(GeneratedField::Hash), - "metadata" => Ok(GeneratedField::Metadata), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Snapshot; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.snapshots.v1beta1.Snapshot") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut height__ = None; - let mut format__ = None; - let mut chunks__ = None; - let mut hash__ = None; - let mut metadata__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Height => { - if height__.is_some() { - return Err(serde::de::Error::duplicate_field("height")); - } - height__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Format => { - if format__.is_some() { - return Err(serde::de::Error::duplicate_field("format")); - } - format__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Chunks => { - if chunks__.is_some() { - return Err(serde::de::Error::duplicate_field("chunks")); - } - chunks__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Hash => { - if hash__.is_some() { - return Err(serde::de::Error::duplicate_field("hash")); - } - hash__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Metadata => { - if metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("metadata")); - } - metadata__ = map_.next_value()?; - } - } - } - Ok(Snapshot { - height: height__.unwrap_or_default(), - format: format__.unwrap_or_default(), - chunks: chunks__.unwrap_or_default(), - hash: hash__.unwrap_or_default(), - metadata: metadata__, - }) - } - } - deserializer.deserialize_struct("cosmos.base.snapshots.v1beta1.Snapshot", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for SnapshotExtensionMeta { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta", len)?; - if true { - struct_ser.serialize_field("name", &self.name)?; - } - if true { - struct_ser.serialize_field("format", &self.format)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SnapshotExtensionMeta { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "name", - "format", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Name, - Format, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "name" => Ok(GeneratedField::Name), - "format" => Ok(GeneratedField::Format), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SnapshotExtensionMeta; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut name__ = None; - let mut format__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); - } - name__ = Some(map_.next_value()?); - } - GeneratedField::Format => { - if format__.is_some() { - return Err(serde::de::Error::duplicate_field("format")); - } - format__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(SnapshotExtensionMeta { - name: name__.unwrap_or_default(), - format: format__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for SnapshotExtensionPayload { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("payload", pbjson::private::base64::encode(&self.payload).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SnapshotExtensionPayload { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "payload", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Payload, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "payload" => Ok(GeneratedField::Payload), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SnapshotExtensionPayload; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut payload__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Payload => { - if payload__.is_some() { - return Err(serde::de::Error::duplicate_field("payload")); - } - payload__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - } - } - Ok(SnapshotExtensionPayload { - payload: payload__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for SnapshotIavlItem { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotIAVLItem", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("value", pbjson::private::base64::encode(&self.value).as_str())?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("version", ::alloc::string::ToString::to_string(&self.version).as_str())?; - } - if true { - struct_ser.serialize_field("height", &self.height)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SnapshotIavlItem { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "key", - "value", - "version", - "height", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - Value, - Version, - Height, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "key" => Ok(GeneratedField::Key), - "value" => Ok(GeneratedField::Value), - "version" => Ok(GeneratedField::Version), - "height" => Ok(GeneratedField::Height), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SnapshotIavlItem; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotIAVLItem") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut key__ = None; - let mut value__ = None; - let mut version__ = None; - let mut height__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Key => { - if key__.is_some() { - return Err(serde::de::Error::duplicate_field("key")); - } - key__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Value => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("value")); - } - value__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Version => { - if version__.is_some() { - return Err(serde::de::Error::duplicate_field("version")); - } - version__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Height => { - if height__.is_some() { - return Err(serde::de::Error::duplicate_field("height")); - } - height__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(SnapshotIavlItem { - key: key__.unwrap_or_default(), - value: value__.unwrap_or_default(), - version: version__.unwrap_or_default(), - height: height__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.snapshots.v1beta1.SnapshotIAVLItem", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for SnapshotItem { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.item.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotItem", len)?; - if let Some(v) = self.item.as_ref() { - match v { - snapshot_item::Item::Store(v) => { - struct_ser.serialize_field("store", v)?; - } - snapshot_item::Item::Iavl(v) => { - struct_ser.serialize_field("iavl", v)?; - } - snapshot_item::Item::Extension(v) => { - struct_ser.serialize_field("extension", v)?; - } - snapshot_item::Item::ExtensionPayload(v) => { - struct_ser.serialize_field("extensionPayload", v)?; - } - snapshot_item::Item::Kv(v) => { - struct_ser.serialize_field("kv", v)?; - } - snapshot_item::Item::Schema(v) => { - struct_ser.serialize_field("schema", v)?; - } - } - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SnapshotItem { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "store", - "iavl", - "extension", - "extension_payload", - "extensionPayload", - "kv", - "schema", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Store, - Iavl, - Extension, - ExtensionPayload, - Kv, - Schema, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "store" => Ok(GeneratedField::Store), - "iavl" => Ok(GeneratedField::Iavl), - "extension" => Ok(GeneratedField::Extension), - "extensionPayload" | "extension_payload" => Ok(GeneratedField::ExtensionPayload), - "kv" => Ok(GeneratedField::Kv), - "schema" => Ok(GeneratedField::Schema), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SnapshotItem; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotItem") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut item__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Store => { - if item__.is_some() { - return Err(serde::de::Error::duplicate_field("store")); - } - item__ = map_.next_value::<::core::option::Option<_>>()?.map(snapshot_item::Item::Store) -; - } - GeneratedField::Iavl => { - if item__.is_some() { - return Err(serde::de::Error::duplicate_field("iavl")); - } - item__ = map_.next_value::<::core::option::Option<_>>()?.map(snapshot_item::Item::Iavl) -; - } - GeneratedField::Extension => { - if item__.is_some() { - return Err(serde::de::Error::duplicate_field("extension")); - } - item__ = map_.next_value::<::core::option::Option<_>>()?.map(snapshot_item::Item::Extension) -; - } - GeneratedField::ExtensionPayload => { - if item__.is_some() { - return Err(serde::de::Error::duplicate_field("extensionPayload")); - } - item__ = map_.next_value::<::core::option::Option<_>>()?.map(snapshot_item::Item::ExtensionPayload) -; - } - GeneratedField::Kv => { - if item__.is_some() { - return Err(serde::de::Error::duplicate_field("kv")); - } - item__ = map_.next_value::<::core::option::Option<_>>()?.map(snapshot_item::Item::Kv) -; - } - GeneratedField::Schema => { - if item__.is_some() { - return Err(serde::de::Error::duplicate_field("schema")); - } - item__ = map_.next_value::<::core::option::Option<_>>()?.map(snapshot_item::Item::Schema) -; - } - } - } - Ok(SnapshotItem { - item: item__, - }) - } - } - deserializer.deserialize_struct("cosmos.base.snapshots.v1beta1.SnapshotItem", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for SnapshotKvItem { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotKVItem", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("value", pbjson::private::base64::encode(&self.value).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SnapshotKvItem { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "key", - "value", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - Value, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "key" => Ok(GeneratedField::Key), - "value" => Ok(GeneratedField::Value), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SnapshotKvItem; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotKVItem") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut key__ = None; - let mut value__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Key => { - if key__.is_some() { - return Err(serde::de::Error::duplicate_field("key")); - } - key__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Value => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("value")); - } - value__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - } - } - Ok(SnapshotKvItem { - key: key__.unwrap_or_default(), - value: value__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.snapshots.v1beta1.SnapshotKVItem", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for SnapshotSchema { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotSchema", len)?; - if true { - struct_ser.serialize_field("keys", &self.keys.iter().map(pbjson::private::base64::encode).collect::<::alloc::vec::Vec<_>>())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SnapshotSchema { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "keys", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Keys, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "keys" => Ok(GeneratedField::Keys), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SnapshotSchema; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotSchema") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut keys__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Keys => { - if keys__.is_some() { - return Err(serde::de::Error::duplicate_field("keys")); - } - keys__ = - Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::BytesDeserialize<_>>>()? - .into_iter().map(|x| x.0).collect()) - ; - } - } - } - Ok(SnapshotSchema { - keys: keys__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.snapshots.v1beta1.SnapshotSchema", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for SnapshotStoreItem { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotStoreItem", len)?; - if true { - struct_ser.serialize_field("name", &self.name)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SnapshotStoreItem { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "name", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Name, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "name" => Ok(GeneratedField::Name), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SnapshotStoreItem; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotStoreItem") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut name__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); - } - name__ = Some(map_.next_value()?); - } - } - } - Ok(SnapshotStoreItem { - name: name__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.snapshots.v1beta1.SnapshotStoreItem", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.base.store.v1beta1.serde.rs b/src/prost/cosmos.base.store.v1beta1.serde.rs deleted file mode 100644 index 2916d33c..00000000 --- a/src/prost/cosmos.base.store.v1beta1.serde.rs +++ /dev/null @@ -1,791 +0,0 @@ -impl serde::Serialize for BlockMetadata { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.store.v1beta1.BlockMetadata", len)?; - if let Some(v) = self.request_begin_block.as_ref() { - struct_ser.serialize_field("requestBeginBlock", v)?; - } - if let Some(v) = self.response_begin_block.as_ref() { - struct_ser.serialize_field("responseBeginBlock", v)?; - } - if true { - struct_ser.serialize_field("deliverTxs", &self.deliver_txs)?; - } - if let Some(v) = self.request_end_block.as_ref() { - struct_ser.serialize_field("requestEndBlock", v)?; - } - if let Some(v) = self.response_end_block.as_ref() { - struct_ser.serialize_field("responseEndBlock", v)?; - } - if let Some(v) = self.response_commit.as_ref() { - struct_ser.serialize_field("responseCommit", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for BlockMetadata { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "request_begin_block", - "requestBeginBlock", - "response_begin_block", - "responseBeginBlock", - "deliver_txs", - "deliverTxs", - "request_end_block", - "requestEndBlock", - "response_end_block", - "responseEndBlock", - "response_commit", - "responseCommit", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - RequestBeginBlock, - ResponseBeginBlock, - DeliverTxs, - RequestEndBlock, - ResponseEndBlock, - ResponseCommit, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "requestBeginBlock" | "request_begin_block" => Ok(GeneratedField::RequestBeginBlock), - "responseBeginBlock" | "response_begin_block" => Ok(GeneratedField::ResponseBeginBlock), - "deliverTxs" | "deliver_txs" => Ok(GeneratedField::DeliverTxs), - "requestEndBlock" | "request_end_block" => Ok(GeneratedField::RequestEndBlock), - "responseEndBlock" | "response_end_block" => Ok(GeneratedField::ResponseEndBlock), - "responseCommit" | "response_commit" => Ok(GeneratedField::ResponseCommit), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = BlockMetadata; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.store.v1beta1.BlockMetadata") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut request_begin_block__ = None; - let mut response_begin_block__ = None; - let mut deliver_txs__ = None; - let mut request_end_block__ = None; - let mut response_end_block__ = None; - let mut response_commit__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::RequestBeginBlock => { - if request_begin_block__.is_some() { - return Err(serde::de::Error::duplicate_field("requestBeginBlock")); - } - request_begin_block__ = map_.next_value()?; - } - GeneratedField::ResponseBeginBlock => { - if response_begin_block__.is_some() { - return Err(serde::de::Error::duplicate_field("responseBeginBlock")); - } - response_begin_block__ = map_.next_value()?; - } - GeneratedField::DeliverTxs => { - if deliver_txs__.is_some() { - return Err(serde::de::Error::duplicate_field("deliverTxs")); - } - deliver_txs__ = Some(map_.next_value()?); - } - GeneratedField::RequestEndBlock => { - if request_end_block__.is_some() { - return Err(serde::de::Error::duplicate_field("requestEndBlock")); - } - request_end_block__ = map_.next_value()?; - } - GeneratedField::ResponseEndBlock => { - if response_end_block__.is_some() { - return Err(serde::de::Error::duplicate_field("responseEndBlock")); - } - response_end_block__ = map_.next_value()?; - } - GeneratedField::ResponseCommit => { - if response_commit__.is_some() { - return Err(serde::de::Error::duplicate_field("responseCommit")); - } - response_commit__ = map_.next_value()?; - } - } - } - Ok(BlockMetadata { - request_begin_block: request_begin_block__, - response_begin_block: response_begin_block__, - deliver_txs: deliver_txs__.unwrap_or_default(), - request_end_block: request_end_block__, - response_end_block: response_end_block__, - response_commit: response_commit__, - }) - } - } - deserializer.deserialize_struct("cosmos.base.store.v1beta1.BlockMetadata", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for block_metadata::DeliverTx { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.store.v1beta1.BlockMetadata.DeliverTx", len)?; - if let Some(v) = self.request.as_ref() { - struct_ser.serialize_field("request", v)?; - } - if let Some(v) = self.response.as_ref() { - struct_ser.serialize_field("response", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for block_metadata::DeliverTx { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "request", - "response", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Request, - Response, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "request" => Ok(GeneratedField::Request), - "response" => Ok(GeneratedField::Response), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = block_metadata::DeliverTx; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.store.v1beta1.BlockMetadata.DeliverTx") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut request__ = None; - let mut response__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Request => { - if request__.is_some() { - return Err(serde::de::Error::duplicate_field("request")); - } - request__ = map_.next_value()?; - } - GeneratedField::Response => { - if response__.is_some() { - return Err(serde::de::Error::duplicate_field("response")); - } - response__ = map_.next_value()?; - } - } - } - Ok(block_metadata::DeliverTx { - request: request__, - response: response__, - }) - } - } - deserializer.deserialize_struct("cosmos.base.store.v1beta1.BlockMetadata.DeliverTx", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for CommitId { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.store.v1beta1.CommitID", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("version", ::alloc::string::ToString::to_string(&self.version).as_str())?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("hash", pbjson::private::base64::encode(&self.hash).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CommitId { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "version", - "hash", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Version, - Hash, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "version" => Ok(GeneratedField::Version), - "hash" => Ok(GeneratedField::Hash), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CommitId; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.store.v1beta1.CommitID") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut version__ = None; - let mut hash__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Version => { - if version__.is_some() { - return Err(serde::de::Error::duplicate_field("version")); - } - version__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Hash => { - if hash__.is_some() { - return Err(serde::de::Error::duplicate_field("hash")); - } - hash__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - } - } - Ok(CommitId { - version: version__.unwrap_or_default(), - hash: hash__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.store.v1beta1.CommitID", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for CommitInfo { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.store.v1beta1.CommitInfo", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("version", ::alloc::string::ToString::to_string(&self.version).as_str())?; - } - if true { - struct_ser.serialize_field("storeInfos", &self.store_infos)?; - } - if let Some(v) = self.timestamp.as_ref() { - struct_ser.serialize_field("timestamp", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CommitInfo { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "version", - "store_infos", - "storeInfos", - "timestamp", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Version, - StoreInfos, - Timestamp, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "version" => Ok(GeneratedField::Version), - "storeInfos" | "store_infos" => Ok(GeneratedField::StoreInfos), - "timestamp" => Ok(GeneratedField::Timestamp), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CommitInfo; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.store.v1beta1.CommitInfo") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut version__ = None; - let mut store_infos__ = None; - let mut timestamp__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Version => { - if version__.is_some() { - return Err(serde::de::Error::duplicate_field("version")); - } - version__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::StoreInfos => { - if store_infos__.is_some() { - return Err(serde::de::Error::duplicate_field("storeInfos")); - } - store_infos__ = Some(map_.next_value()?); - } - GeneratedField::Timestamp => { - if timestamp__.is_some() { - return Err(serde::de::Error::duplicate_field("timestamp")); - } - timestamp__ = map_.next_value()?; - } - } - } - Ok(CommitInfo { - version: version__.unwrap_or_default(), - store_infos: store_infos__.unwrap_or_default(), - timestamp: timestamp__, - }) - } - } - deserializer.deserialize_struct("cosmos.base.store.v1beta1.CommitInfo", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for StoreInfo { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.store.v1beta1.StoreInfo", len)?; - if true { - struct_ser.serialize_field("name", &self.name)?; - } - if let Some(v) = self.commit_id.as_ref() { - struct_ser.serialize_field("commitId", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for StoreInfo { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "name", - "commit_id", - "commitId", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Name, - CommitId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "name" => Ok(GeneratedField::Name), - "commitId" | "commit_id" => Ok(GeneratedField::CommitId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = StoreInfo; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.store.v1beta1.StoreInfo") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut name__ = None; - let mut commit_id__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); - } - name__ = Some(map_.next_value()?); - } - GeneratedField::CommitId => { - if commit_id__.is_some() { - return Err(serde::de::Error::duplicate_field("commitId")); - } - commit_id__ = map_.next_value()?; - } - } - } - Ok(StoreInfo { - name: name__.unwrap_or_default(), - commit_id: commit_id__, - }) - } - } - deserializer.deserialize_struct("cosmos.base.store.v1beta1.StoreInfo", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for StoreKvPair { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.store.v1beta1.StoreKVPair", len)?; - if true { - struct_ser.serialize_field("storeKey", &self.store_key)?; - } - if true { - struct_ser.serialize_field("delete", &self.delete)?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("value", pbjson::private::base64::encode(&self.value).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for StoreKvPair { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "store_key", - "storeKey", - "delete", - "key", - "value", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - StoreKey, - Delete, - Key, - Value, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "storeKey" | "store_key" => Ok(GeneratedField::StoreKey), - "delete" => Ok(GeneratedField::Delete), - "key" => Ok(GeneratedField::Key), - "value" => Ok(GeneratedField::Value), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = StoreKvPair; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.store.v1beta1.StoreKVPair") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut store_key__ = None; - let mut delete__ = None; - let mut key__ = None; - let mut value__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::StoreKey => { - if store_key__.is_some() { - return Err(serde::de::Error::duplicate_field("storeKey")); - } - store_key__ = Some(map_.next_value()?); - } - GeneratedField::Delete => { - if delete__.is_some() { - return Err(serde::de::Error::duplicate_field("delete")); - } - delete__ = Some(map_.next_value()?); - } - GeneratedField::Key => { - if key__.is_some() { - return Err(serde::de::Error::duplicate_field("key")); - } - key__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Value => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("value")); - } - value__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - } - } - Ok(StoreKvPair { - store_key: store_key__.unwrap_or_default(), - delete: delete__.unwrap_or_default(), - key: key__.unwrap_or_default(), - value: value__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.store.v1beta1.StoreKVPair", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.base.tendermint.v1beta1.rs b/src/prost/cosmos.base.tendermint.v1beta1.rs deleted file mode 100644 index 3db44e40..00000000 --- a/src/prost/cosmos.base.tendermint.v1beta1.rs +++ /dev/null @@ -1,1305 +0,0 @@ -// This file is @generated by prost-build. -/// Block is tendermint type Block, with the Header proposer address -/// field converted to bech32 string. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Block { - #[prost(message, optional, tag = "1")] - pub header: ::core::option::Option
, - #[prost(message, optional, tag = "2")] - pub data: ::core::option::Option<::tendermint_proto::types::Data>, - #[prost(message, optional, tag = "3")] - pub evidence: ::core::option::Option<::tendermint_proto::types::EvidenceList>, - #[prost(message, optional, tag = "4")] - pub last_commit: ::core::option::Option<::tendermint_proto::types::Commit>, -} -impl ::prost::Name for Block { - const NAME: &'static str = "Block"; - const PACKAGE: &'static str = "cosmos.base.tendermint.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.tendermint.v1beta1.Block".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.tendermint.v1beta1.Block".into() - } -} -/// Header defines the structure of a Tendermint block header. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Header { - /// basic block info - #[prost(message, optional, tag = "1")] - pub version: ::core::option::Option<::tendermint_proto::version::Consensus>, - #[prost(string, tag = "2")] - pub chain_id: ::prost::alloc::string::String, - #[prost(int64, tag = "3")] - pub height: i64, - #[prost(message, optional, tag = "4")] - pub time: ::core::option::Option<::tendermint_proto::google::protobuf::Timestamp>, - /// prev block info - #[prost(message, optional, tag = "5")] - pub last_block_id: ::core::option::Option<::tendermint_proto::types::BlockId>, - /// hashes of block data - /// - /// commit from validators from the last block - #[prost(bytes = "vec", tag = "6")] - pub last_commit_hash: ::prost::alloc::vec::Vec, - /// transactions - #[prost(bytes = "vec", tag = "7")] - pub data_hash: ::prost::alloc::vec::Vec, - /// hashes from the app output from the prev block - /// - /// validators for the current block - #[prost(bytes = "vec", tag = "8")] - pub validators_hash: ::prost::alloc::vec::Vec, - /// validators for the next block - #[prost(bytes = "vec", tag = "9")] - pub next_validators_hash: ::prost::alloc::vec::Vec, - /// consensus params for current block - #[prost(bytes = "vec", tag = "10")] - pub consensus_hash: ::prost::alloc::vec::Vec, - /// state after txs from the previous block - #[prost(bytes = "vec", tag = "11")] - pub app_hash: ::prost::alloc::vec::Vec, - /// root hash of all results from the txs from the previous block - #[prost(bytes = "vec", tag = "12")] - pub last_results_hash: ::prost::alloc::vec::Vec, - /// consensus info - /// - /// evidence included in the block - #[prost(bytes = "vec", tag = "13")] - pub evidence_hash: ::prost::alloc::vec::Vec, - /// proposer_address is the original block proposer address, formatted as a Bech32 string. - /// In Tendermint, this type is `bytes`, but in the SDK, we convert it to a Bech32 string - /// for better UX. - /// - /// original proposer of the block - #[prost(string, tag = "14")] - pub proposer_address: ::prost::alloc::string::String, -} -impl ::prost::Name for Header { - const NAME: &'static str = "Header"; - const PACKAGE: &'static str = "cosmos.base.tendermint.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.tendermint.v1beta1.Header".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.tendermint.v1beta1.Header".into() - } -} -/// GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetValidatorSetByHeightRequest { - #[prost(int64, tag = "1")] - pub height: i64, - /// pagination defines an pagination for the request. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option, -} -impl ::prost::Name for GetValidatorSetByHeightRequest { - const NAME: &'static str = "GetValidatorSetByHeightRequest"; - const PACKAGE: &'static str = "cosmos.base.tendermint.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest".into() - } -} -/// GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetValidatorSetByHeightResponse { - #[prost(int64, tag = "1")] - pub block_height: i64, - #[prost(message, repeated, tag = "2")] - pub validators: ::prost::alloc::vec::Vec, - /// pagination defines an pagination for the response. - #[prost(message, optional, tag = "3")] - pub pagination: ::core::option::Option, -} -impl ::prost::Name for GetValidatorSetByHeightResponse { - const NAME: &'static str = "GetValidatorSetByHeightResponse"; - const PACKAGE: &'static str = "cosmos.base.tendermint.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse".into() - } -} -/// GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetLatestValidatorSetRequest { - /// pagination defines an pagination for the request. - #[prost(message, optional, tag = "1")] - pub pagination: ::core::option::Option, -} -impl ::prost::Name for GetLatestValidatorSetRequest { - const NAME: &'static str = "GetLatestValidatorSetRequest"; - const PACKAGE: &'static str = "cosmos.base.tendermint.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest".into() - } -} -/// GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetLatestValidatorSetResponse { - #[prost(int64, tag = "1")] - pub block_height: i64, - #[prost(message, repeated, tag = "2")] - pub validators: ::prost::alloc::vec::Vec, - /// pagination defines an pagination for the response. - #[prost(message, optional, tag = "3")] - pub pagination: ::core::option::Option, -} -impl ::prost::Name for GetLatestValidatorSetResponse { - const NAME: &'static str = "GetLatestValidatorSetResponse"; - const PACKAGE: &'static str = "cosmos.base.tendermint.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse".into() - } -} -/// Validator is the type for the validator-set. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Validator { - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub pub_key: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, - #[prost(int64, tag = "3")] - pub voting_power: i64, - #[prost(int64, tag = "4")] - pub proposer_priority: i64, -} -impl ::prost::Name for Validator { - const NAME: &'static str = "Validator"; - const PACKAGE: &'static str = "cosmos.base.tendermint.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.tendermint.v1beta1.Validator".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.tendermint.v1beta1.Validator".into() - } -} -/// GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct GetBlockByHeightRequest { - #[prost(int64, tag = "1")] - pub height: i64, -} -impl ::prost::Name for GetBlockByHeightRequest { - const NAME: &'static str = "GetBlockByHeightRequest"; - const PACKAGE: &'static str = "cosmos.base.tendermint.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest".into() - } -} -/// GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetBlockByHeightResponse { - #[prost(message, optional, tag = "1")] - pub block_id: ::core::option::Option<::tendermint_proto::types::BlockId>, - /// Deprecated: please use `sdk_block` instead - #[prost(message, optional, tag = "2")] - pub block: ::core::option::Option<::tendermint_proto::types::Block>, - /// Since: cosmos-sdk 0.47 - #[prost(message, optional, tag = "3")] - pub sdk_block: ::core::option::Option, -} -impl ::prost::Name for GetBlockByHeightResponse { - const NAME: &'static str = "GetBlockByHeightResponse"; - const PACKAGE: &'static str = "cosmos.base.tendermint.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse".into() - } -} -/// GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct GetLatestBlockRequest {} -impl ::prost::Name for GetLatestBlockRequest { - const NAME: &'static str = "GetLatestBlockRequest"; - const PACKAGE: &'static str = "cosmos.base.tendermint.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.tendermint.v1beta1.GetLatestBlockRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.tendermint.v1beta1.GetLatestBlockRequest".into() - } -} -/// GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetLatestBlockResponse { - #[prost(message, optional, tag = "1")] - pub block_id: ::core::option::Option<::tendermint_proto::types::BlockId>, - /// Deprecated: please use `sdk_block` instead - #[prost(message, optional, tag = "2")] - pub block: ::core::option::Option<::tendermint_proto::types::Block>, - /// Since: cosmos-sdk 0.47 - #[prost(message, optional, tag = "3")] - pub sdk_block: ::core::option::Option, -} -impl ::prost::Name for GetLatestBlockResponse { - const NAME: &'static str = "GetLatestBlockResponse"; - const PACKAGE: &'static str = "cosmos.base.tendermint.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.tendermint.v1beta1.GetLatestBlockResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.tendermint.v1beta1.GetLatestBlockResponse".into() - } -} -/// GetSyncingRequest is the request type for the Query/GetSyncing RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct GetSyncingRequest {} -impl ::prost::Name for GetSyncingRequest { - const NAME: &'static str = "GetSyncingRequest"; - const PACKAGE: &'static str = "cosmos.base.tendermint.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.tendermint.v1beta1.GetSyncingRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.tendermint.v1beta1.GetSyncingRequest".into() - } -} -/// GetSyncingResponse is the response type for the Query/GetSyncing RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct GetSyncingResponse { - #[prost(bool, tag = "1")] - pub syncing: bool, -} -impl ::prost::Name for GetSyncingResponse { - const NAME: &'static str = "GetSyncingResponse"; - const PACKAGE: &'static str = "cosmos.base.tendermint.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.tendermint.v1beta1.GetSyncingResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.tendermint.v1beta1.GetSyncingResponse".into() - } -} -/// GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct GetNodeInfoRequest {} -impl ::prost::Name for GetNodeInfoRequest { - const NAME: &'static str = "GetNodeInfoRequest"; - const PACKAGE: &'static str = "cosmos.base.tendermint.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.tendermint.v1beta1.GetNodeInfoRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.tendermint.v1beta1.GetNodeInfoRequest".into() - } -} -/// GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetNodeInfoResponse { - #[prost(message, optional, tag = "1")] - pub default_node_info: ::core::option::Option< - ::tendermint_proto::p2p::DefaultNodeInfo, - >, - #[prost(message, optional, tag = "2")] - pub application_version: ::core::option::Option, -} -impl ::prost::Name for GetNodeInfoResponse { - const NAME: &'static str = "GetNodeInfoResponse"; - const PACKAGE: &'static str = "cosmos.base.tendermint.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.tendermint.v1beta1.GetNodeInfoResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.tendermint.v1beta1.GetNodeInfoResponse".into() - } -} -/// VersionInfo is the type for the GetNodeInfoResponse message. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct VersionInfo { - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub app_name: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub version: ::prost::alloc::string::String, - #[prost(string, tag = "4")] - pub git_commit: ::prost::alloc::string::String, - #[prost(string, tag = "5")] - pub build_tags: ::prost::alloc::string::String, - #[prost(string, tag = "6")] - pub go_version: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "7")] - pub build_deps: ::prost::alloc::vec::Vec, - /// Since: cosmos-sdk 0.43 - #[prost(string, tag = "8")] - pub cosmos_sdk_version: ::prost::alloc::string::String, -} -impl ::prost::Name for VersionInfo { - const NAME: &'static str = "VersionInfo"; - const PACKAGE: &'static str = "cosmos.base.tendermint.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.tendermint.v1beta1.VersionInfo".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.tendermint.v1beta1.VersionInfo".into() - } -} -/// Module is the type for VersionInfo -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Module { - /// module path - #[prost(string, tag = "1")] - pub path: ::prost::alloc::string::String, - /// module version - #[prost(string, tag = "2")] - pub version: ::prost::alloc::string::String, - /// checksum - #[prost(string, tag = "3")] - pub sum: ::prost::alloc::string::String, -} -impl ::prost::Name for Module { - const NAME: &'static str = "Module"; - const PACKAGE: &'static str = "cosmos.base.tendermint.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.tendermint.v1beta1.Module".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.tendermint.v1beta1.Module".into() - } -} -/// ABCIQueryRequest defines the request structure for the ABCIQuery gRPC query. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AbciQueryRequest { - #[prost(bytes = "vec", tag = "1")] - pub data: ::prost::alloc::vec::Vec, - #[prost(string, tag = "2")] - pub path: ::prost::alloc::string::String, - #[prost(int64, tag = "3")] - pub height: i64, - #[prost(bool, tag = "4")] - pub prove: bool, -} -impl ::prost::Name for AbciQueryRequest { - const NAME: &'static str = "ABCIQueryRequest"; - const PACKAGE: &'static str = "cosmos.base.tendermint.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.tendermint.v1beta1.ABCIQueryRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.tendermint.v1beta1.ABCIQueryRequest".into() - } -} -/// ABCIQueryResponse defines the response structure for the ABCIQuery gRPC query. -/// -/// Note: This type is a duplicate of the ResponseQuery proto type defined in -/// Tendermint. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AbciQueryResponse { - #[prost(uint32, tag = "1")] - pub code: u32, - /// 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")] - pub index: i64, - #[prost(bytes = "vec", tag = "6")] - pub key: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "7")] - pub value: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "8")] - pub proof_ops: ::core::option::Option, - #[prost(int64, tag = "9")] - pub height: i64, - #[prost(string, tag = "10")] - pub codespace: ::prost::alloc::string::String, -} -impl ::prost::Name for AbciQueryResponse { - const NAME: &'static str = "ABCIQueryResponse"; - const PACKAGE: &'static str = "cosmos.base.tendermint.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.tendermint.v1beta1.ABCIQueryResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.tendermint.v1beta1.ABCIQueryResponse".into() - } -} -/// ProofOp defines an operation used for calculating Merkle root. The data could -/// be arbitrary format, providing necessary data for example neighbouring node -/// hash. -/// -/// Note: This type is a duplicate of the ProofOp proto type defined in Tendermint. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ProofOp { - #[prost(string, tag = "1")] - pub r#type: ::prost::alloc::string::String, - #[prost(bytes = "vec", tag = "2")] - pub key: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "3")] - pub data: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for ProofOp { - const NAME: &'static str = "ProofOp"; - const PACKAGE: &'static str = "cosmos.base.tendermint.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.tendermint.v1beta1.ProofOp".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.tendermint.v1beta1.ProofOp".into() - } -} -/// ProofOps is Merkle proof defined by the list of ProofOps. -/// -/// Note: This type is a duplicate of the ProofOps proto type defined in Tendermint. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ProofOps { - #[prost(message, repeated, tag = "1")] - pub ops: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for ProofOps { - const NAME: &'static str = "ProofOps"; - const PACKAGE: &'static str = "cosmos.base.tendermint.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.tendermint.v1beta1.ProofOps".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.tendermint.v1beta1.ProofOps".into() - } -} -/// Generated client implementations. -#[cfg(feature = "client")] -pub mod service_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - /// Service defines the gRPC querier service for tendermint queries. - #[derive(Debug, Clone)] - pub struct ServiceClient { - inner: tonic::client::Grpc, - } - impl ServiceClient { - /// 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 ServiceClient - 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, - ) -> ServiceClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + Send + Sync, - { - ServiceClient::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 - } - /// GetNodeInfo queries the current node info. - pub async fn get_node_info( - &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( - "/cosmos.base.tendermint.v1beta1.Service/GetNodeInfo", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.base.tendermint.v1beta1.Service", - "GetNodeInfo", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetSyncing queries node syncing. - pub async fn get_syncing( - &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( - "/cosmos.base.tendermint.v1beta1.Service/GetSyncing", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.base.tendermint.v1beta1.Service", - "GetSyncing", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetLatestBlock returns the latest block. - pub async fn get_latest_block( - &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( - "/cosmos.base.tendermint.v1beta1.Service/GetLatestBlock", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.base.tendermint.v1beta1.Service", - "GetLatestBlock", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetBlockByHeight queries block for given height. - pub async fn get_block_by_height( - &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( - "/cosmos.base.tendermint.v1beta1.Service/GetBlockByHeight", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.base.tendermint.v1beta1.Service", - "GetBlockByHeight", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetLatestValidatorSet queries latest validator-set. - pub async fn get_latest_validator_set( - &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( - "/cosmos.base.tendermint.v1beta1.Service/GetLatestValidatorSet", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.base.tendermint.v1beta1.Service", - "GetLatestValidatorSet", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetValidatorSetByHeight queries validator-set at a given height. - pub async fn get_validator_set_by_height( - &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( - "/cosmos.base.tendermint.v1beta1.Service/GetValidatorSetByHeight", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.base.tendermint.v1beta1.Service", - "GetValidatorSetByHeight", - ), - ); - self.inner.unary(req, path, codec).await - } - /// ABCIQuery defines a query handler that supports ABCI queries directly to the - /// application, bypassing Tendermint completely. The ABCI query must contain - /// a valid and supported path, including app, custom, p2p, and store. - /// - /// Since: cosmos-sdk 0.46 - pub async fn abci_query( - &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( - "/cosmos.base.tendermint.v1beta1.Service/ABCIQuery", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.base.tendermint.v1beta1.Service", - "ABCIQuery", - ), - ); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -#[cfg(feature = "server")] -pub mod service_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with ServiceServer. - #[async_trait] - pub trait Service: Send + Sync + 'static { - /// GetNodeInfo queries the current node info. - async fn get_node_info( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetSyncing queries node syncing. - async fn get_syncing( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetLatestBlock returns the latest block. - async fn get_latest_block( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetBlockByHeight queries block for given height. - async fn get_block_by_height( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetLatestValidatorSet queries latest validator-set. - async fn get_latest_validator_set( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetValidatorSetByHeight queries validator-set at a given height. - async fn get_validator_set_by_height( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// ABCIQuery defines a query handler that supports ABCI queries directly to the - /// application, bypassing Tendermint completely. The ABCI query must contain - /// a valid and supported path, including app, custom, p2p, and store. - /// - /// Since: cosmos-sdk 0.46 - async fn abci_query( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - /// Service defines the gRPC querier service for tendermint queries. - #[derive(Debug)] - pub struct ServiceServer { - inner: Arc, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - impl ServiceServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - 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 ServiceServer - where - T: Service, - 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 { - match req.uri().path() { - "/cosmos.base.tendermint.v1beta1.Service/GetNodeInfo" => { - #[allow(non_camel_case_types)] - struct GetNodeInfoSvc(pub Arc); - impl< - T: Service, - > tonic::server::UnaryService - for GetNodeInfoSvc { - type Response = super::GetNodeInfoResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_node_info(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = GetNodeInfoSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.base.tendermint.v1beta1.Service/GetSyncing" => { - #[allow(non_camel_case_types)] - struct GetSyncingSvc(pub Arc); - impl< - T: Service, - > tonic::server::UnaryService - for GetSyncingSvc { - type Response = super::GetSyncingResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_syncing(&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 method = GetSyncingSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.base.tendermint.v1beta1.Service/GetLatestBlock" => { - #[allow(non_camel_case_types)] - struct GetLatestBlockSvc(pub Arc); - impl< - T: Service, - > tonic::server::UnaryService - for GetLatestBlockSvc { - type Response = super::GetLatestBlockResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_latest_block(&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 method = GetLatestBlockSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.base.tendermint.v1beta1.Service/GetBlockByHeight" => { - #[allow(non_camel_case_types)] - struct GetBlockByHeightSvc(pub Arc); - impl< - T: Service, - > tonic::server::UnaryService - for GetBlockByHeightSvc { - type Response = super::GetBlockByHeightResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_block_by_height(&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 method = GetBlockByHeightSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.base.tendermint.v1beta1.Service/GetLatestValidatorSet" => { - #[allow(non_camel_case_types)] - struct GetLatestValidatorSetSvc(pub Arc); - impl< - T: Service, - > tonic::server::UnaryService - for GetLatestValidatorSetSvc { - type Response = super::GetLatestValidatorSetResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_latest_validator_set(&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 method = GetLatestValidatorSetSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.base.tendermint.v1beta1.Service/GetValidatorSetByHeight" => { - #[allow(non_camel_case_types)] - struct GetValidatorSetByHeightSvc(pub Arc); - impl< - T: Service, - > tonic::server::UnaryService - for GetValidatorSetByHeightSvc { - type Response = super::GetValidatorSetByHeightResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::GetValidatorSetByHeightRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_validator_set_by_height(&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 method = GetValidatorSetByHeightSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.base.tendermint.v1beta1.Service/ABCIQuery" => { - #[allow(non_camel_case_types)] - struct ABCIQuerySvc(pub Arc); - impl tonic::server::UnaryService - for ABCIQuerySvc { - type Response = super::AbciQueryResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::abci_query(&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 method = ABCIQuerySvc(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", tonic::Code::Unimplemented as i32) - .header( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ) - .body(empty_body()) - .unwrap(), - ) - }) - } - } - } - } - impl Clone for ServiceServer { - 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 tonic::server::NamedService for ServiceServer { - const NAME: &'static str = "cosmos.base.tendermint.v1beta1.Service"; - } -} diff --git a/src/prost/cosmos.base.v1beta1.rs b/src/prost/cosmos.base.v1beta1.rs deleted file mode 100644 index 057afb09..00000000 --- a/src/prost/cosmos.base.v1beta1.rs +++ /dev/null @@ -1,79 +0,0 @@ -// This file is @generated by prost-build. -/// Coin defines a token with a denomination and an amount. -/// -/// NOTE: The amount field is an Int which implements the custom method -/// signatures required by gogoproto. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Coin { - #[prost(string, tag = "1")] - pub denom: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub amount: ::prost::alloc::string::String, -} -impl ::prost::Name for Coin { - const NAME: &'static str = "Coin"; - const PACKAGE: &'static str = "cosmos.base.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.v1beta1.Coin".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.v1beta1.Coin".into() - } -} -/// DecCoin defines a token with a denomination and a decimal amount. -/// -/// NOTE: The amount field is an Dec which implements the custom method -/// signatures required by gogoproto. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DecCoin { - #[prost(string, tag = "1")] - pub denom: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub amount: ::prost::alloc::string::String, -} -impl ::prost::Name for DecCoin { - const NAME: &'static str = "DecCoin"; - const PACKAGE: &'static str = "cosmos.base.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.v1beta1.DecCoin".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.v1beta1.DecCoin".into() - } -} -/// IntProto defines a Protobuf wrapper around an Int object. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct IntProto { - #[prost(string, tag = "1")] - pub int: ::prost::alloc::string::String, -} -impl ::prost::Name for IntProto { - const NAME: &'static str = "IntProto"; - const PACKAGE: &'static str = "cosmos.base.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.v1beta1.IntProto".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.v1beta1.IntProto".into() - } -} -/// DecProto defines a Protobuf wrapper around a Dec object. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DecProto { - #[prost(string, tag = "1")] - pub dec: ::prost::alloc::string::String, -} -impl ::prost::Name for DecProto { - const NAME: &'static str = "DecProto"; - const PACKAGE: &'static str = "cosmos.base.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.base.v1beta1.DecProto".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.base.v1beta1.DecProto".into() - } -} diff --git a/src/prost/cosmos.base.v1beta1.serde.rs b/src/prost/cosmos.base.v1beta1.serde.rs deleted file mode 100644 index 91566588..00000000 --- a/src/prost/cosmos.base.v1beta1.serde.rs +++ /dev/null @@ -1,398 +0,0 @@ -impl serde::Serialize for Coin { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.v1beta1.Coin", len)?; - if true { - struct_ser.serialize_field("denom", &self.denom)?; - } - if true { - struct_ser.serialize_field("amount", &self.amount)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Coin { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "denom", - "amount", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Denom, - Amount, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "denom" => Ok(GeneratedField::Denom), - "amount" => Ok(GeneratedField::Amount), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Coin; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.v1beta1.Coin") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut denom__ = None; - let mut amount__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Denom => { - if denom__.is_some() { - return Err(serde::de::Error::duplicate_field("denom")); - } - denom__ = Some(map_.next_value()?); - } - GeneratedField::Amount => { - if amount__.is_some() { - return Err(serde::de::Error::duplicate_field("amount")); - } - amount__ = Some(map_.next_value()?); - } - } - } - Ok(Coin { - denom: denom__.unwrap_or_default(), - amount: amount__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.v1beta1.Coin", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for DecCoin { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.v1beta1.DecCoin", len)?; - if true { - struct_ser.serialize_field("denom", &self.denom)?; - } - if true { - struct_ser.serialize_field("amount", &self.amount)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for DecCoin { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "denom", - "amount", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Denom, - Amount, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "denom" => Ok(GeneratedField::Denom), - "amount" => Ok(GeneratedField::Amount), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = DecCoin; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.v1beta1.DecCoin") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut denom__ = None; - let mut amount__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Denom => { - if denom__.is_some() { - return Err(serde::de::Error::duplicate_field("denom")); - } - denom__ = Some(map_.next_value()?); - } - GeneratedField::Amount => { - if amount__.is_some() { - return Err(serde::de::Error::duplicate_field("amount")); - } - amount__ = Some(map_.next_value()?); - } - } - } - Ok(DecCoin { - denom: denom__.unwrap_or_default(), - amount: amount__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.v1beta1.DecCoin", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for DecProto { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.v1beta1.DecProto", len)?; - if true { - struct_ser.serialize_field("dec", &self.dec)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for DecProto { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "dec", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Dec, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "dec" => Ok(GeneratedField::Dec), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = DecProto; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.v1beta1.DecProto") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut dec__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Dec => { - if dec__.is_some() { - return Err(serde::de::Error::duplicate_field("dec")); - } - dec__ = Some(map_.next_value()?); - } - } - } - Ok(DecProto { - dec: dec__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.v1beta1.DecProto", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for IntProto { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.v1beta1.IntProto", len)?; - if true { - struct_ser.serialize_field("int", &self.int)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for IntProto { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "int", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Int, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "int" => Ok(GeneratedField::Int), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = IntProto; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.v1beta1.IntProto") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut int__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Int => { - if int__.is_some() { - return Err(serde::de::Error::duplicate_field("int")); - } - int__ = Some(map_.next_value()?); - } - } - } - Ok(IntProto { - int: int__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.v1beta1.IntProto", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.crypto.ed25519.rs b/src/prost/cosmos.crypto.ed25519.rs deleted file mode 100644 index 8c52ed2e..00000000 --- a/src/prost/cosmos.crypto.ed25519.rs +++ /dev/null @@ -1,40 +0,0 @@ -// This file is @generated by prost-build. -/// PubKey is an ed25519 public key for handling Tendermint keys in SDK. -/// It's needed for Any serialization and SDK compatibility. -/// It must not be used in a non Tendermint key context because it doesn't implement -/// ADR-28. Nevertheless, you will like to use ed25519 in app user level -/// then you must create a new proto message and follow ADR-28 for Address construction. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PubKey { - #[prost(bytes = "vec", tag = "1")] - pub key: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for PubKey { - const NAME: &'static str = "PubKey"; - const PACKAGE: &'static str = "cosmos.crypto.ed25519"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.crypto.ed25519.PubKey".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.crypto.ed25519.PubKey".into() - } -} -/// 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(Clone, PartialEq, ::prost::Message)] -pub struct PrivKey { - #[prost(bytes = "vec", tag = "1")] - pub key: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for PrivKey { - const NAME: &'static str = "PrivKey"; - const PACKAGE: &'static str = "cosmos.crypto.ed25519"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.crypto.ed25519.PrivKey".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.crypto.ed25519.PrivKey".into() - } -} diff --git a/src/prost/cosmos.crypto.ed25519.serde.rs b/src/prost/cosmos.crypto.ed25519.serde.rs deleted file mode 100644 index 5d4a3dc7..00000000 --- a/src/prost/cosmos.crypto.ed25519.serde.rs +++ /dev/null @@ -1,188 +0,0 @@ -impl serde::Serialize for PrivKey { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.crypto.ed25519.PrivKey", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for PrivKey { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "key", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "key" => Ok(GeneratedField::Key), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = PrivKey; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.crypto.ed25519.PrivKey") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut key__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Key => { - if key__.is_some() { - return Err(serde::de::Error::duplicate_field("key")); - } - key__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - } - } - Ok(PrivKey { - key: key__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.crypto.ed25519.PrivKey", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for PubKey { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.crypto.ed25519.PubKey", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for PubKey { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "key", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "key" => Ok(GeneratedField::Key), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = PubKey; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.crypto.ed25519.PubKey") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut key__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Key => { - if key__.is_some() { - return Err(serde::de::Error::duplicate_field("key")); - } - key__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - } - } - Ok(PubKey { - key: key__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.crypto.ed25519.PubKey", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.crypto.hd.v1.rs b/src/prost/cosmos.crypto.hd.v1.rs deleted file mode 100644 index a20ee312..00000000 --- a/src/prost/cosmos.crypto.hd.v1.rs +++ /dev/null @@ -1,32 +0,0 @@ -// This file is @generated by prost-build. -/// BIP44Params is used as path field in ledger item in Record. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct Bip44Params { - /// purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation - #[prost(uint32, tag = "1")] - pub purpose: u32, - /// coin_type is a constant that improves privacy - #[prost(uint32, tag = "2")] - pub coin_type: u32, - /// account splits the key space into independent user identities - #[prost(uint32, tag = "3")] - pub account: u32, - /// change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal - /// chain. - #[prost(bool, tag = "4")] - pub change: bool, - /// address_index is used as child index in BIP32 derivation - #[prost(uint32, tag = "5")] - pub address_index: u32, -} -impl ::prost::Name for Bip44Params { - const NAME: &'static str = "BIP44Params"; - const PACKAGE: &'static str = "cosmos.crypto.hd.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.crypto.hd.v1.BIP44Params".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.crypto.hd.v1.BIP44Params".into() - } -} diff --git a/src/prost/cosmos.crypto.hd.v1.serde.rs b/src/prost/cosmos.crypto.hd.v1.serde.rs deleted file mode 100644 index 1e466886..00000000 --- a/src/prost/cosmos.crypto.hd.v1.serde.rs +++ /dev/null @@ -1,169 +0,0 @@ -impl serde::Serialize for Bip44Params { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.crypto.hd.v1.BIP44Params", len)?; - if true { - struct_ser.serialize_field("purpose", &self.purpose)?; - } - if true { - struct_ser.serialize_field("coinType", &self.coin_type)?; - } - if true { - struct_ser.serialize_field("account", &self.account)?; - } - if true { - struct_ser.serialize_field("change", &self.change)?; - } - if true { - struct_ser.serialize_field("addressIndex", &self.address_index)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Bip44Params { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "purpose", - "coin_type", - "coinType", - "account", - "change", - "address_index", - "addressIndex", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Purpose, - CoinType, - Account, - Change, - AddressIndex, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "purpose" => Ok(GeneratedField::Purpose), - "coinType" | "coin_type" => Ok(GeneratedField::CoinType), - "account" => Ok(GeneratedField::Account), - "change" => Ok(GeneratedField::Change), - "addressIndex" | "address_index" => Ok(GeneratedField::AddressIndex), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Bip44Params; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.crypto.hd.v1.BIP44Params") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut purpose__ = None; - let mut coin_type__ = None; - let mut account__ = None; - let mut change__ = None; - let mut address_index__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Purpose => { - if purpose__.is_some() { - return Err(serde::de::Error::duplicate_field("purpose")); - } - purpose__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::CoinType => { - if coin_type__.is_some() { - return Err(serde::de::Error::duplicate_field("coinType")); - } - coin_type__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Account => { - if account__.is_some() { - return Err(serde::de::Error::duplicate_field("account")); - } - account__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Change => { - if change__.is_some() { - return Err(serde::de::Error::duplicate_field("change")); - } - change__ = Some(map_.next_value()?); - } - GeneratedField::AddressIndex => { - if address_index__.is_some() { - return Err(serde::de::Error::duplicate_field("addressIndex")); - } - address_index__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(Bip44Params { - purpose: purpose__.unwrap_or_default(), - coin_type: coin_type__.unwrap_or_default(), - account: account__.unwrap_or_default(), - change: change__.unwrap_or_default(), - address_index: address_index__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.crypto.hd.v1.BIP44Params", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.crypto.keyring.v1.rs b/src/prost/cosmos.crypto.keyring.v1.rs deleted file mode 100644 index ec40ada8..00000000 --- a/src/prost/cosmos.crypto.keyring.v1.rs +++ /dev/null @@ -1,108 +0,0 @@ -// This file is @generated by prost-build. -/// Record is used for representing a key in the keyring. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Record { - /// name represents a name of Record - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - /// pub_key represents a public key in any format - #[prost(message, optional, tag = "2")] - pub pub_key: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, - /// Record contains one of the following items - #[prost(oneof = "record::Item", tags = "3, 4, 5, 6")] - pub item: ::core::option::Option, -} -/// Nested message and enum types in `Record`. -pub mod record { - /// Item is a keyring item stored in a keyring backend. - /// Local item - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct Local { - #[prost(message, optional, tag = "1")] - pub priv_key: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, - } - impl ::prost::Name for Local { - const NAME: &'static str = "Local"; - const PACKAGE: &'static str = "cosmos.crypto.keyring.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.crypto.keyring.v1.Record.Local".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.crypto.keyring.v1.Record.Local".into() - } - } - /// Ledger item - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, Copy, PartialEq, ::prost::Message)] - pub struct Ledger { - #[prost(message, optional, tag = "1")] - pub path: ::core::option::Option, - } - impl ::prost::Name for Ledger { - const NAME: &'static str = "Ledger"; - const PACKAGE: &'static str = "cosmos.crypto.keyring.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.crypto.keyring.v1.Record.Ledger".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.crypto.keyring.v1.Record.Ledger".into() - } - } - /// Multi item - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, Copy, PartialEq, ::prost::Message)] - pub struct Multi {} - impl ::prost::Name for Multi { - const NAME: &'static str = "Multi"; - const PACKAGE: &'static str = "cosmos.crypto.keyring.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.crypto.keyring.v1.Record.Multi".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.crypto.keyring.v1.Record.Multi".into() - } - } - /// Offline item - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, Copy, PartialEq, ::prost::Message)] - pub struct Offline {} - impl ::prost::Name for Offline { - const NAME: &'static str = "Offline"; - const PACKAGE: &'static str = "cosmos.crypto.keyring.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.crypto.keyring.v1.Record.Offline".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.crypto.keyring.v1.Record.Offline".into() - } - } - /// Record contains one of the following items - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Item { - /// local stores the private key locally. - #[prost(message, tag = "3")] - Local(Local), - /// ledger stores the information about a Ledger key. - #[prost(message, tag = "4")] - Ledger(Ledger), - /// Multi does not store any other information. - #[prost(message, tag = "5")] - Multi(Multi), - /// Offline does not store any other information. - #[prost(message, tag = "6")] - Offline(Offline), - } -} -impl ::prost::Name for Record { - const NAME: &'static str = "Record"; - const PACKAGE: &'static str = "cosmos.crypto.keyring.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.crypto.keyring.v1.Record".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.crypto.keyring.v1.Record".into() - } -} diff --git a/src/prost/cosmos.crypto.keyring.v1.serde.rs b/src/prost/cosmos.crypto.keyring.v1.serde.rs deleted file mode 100644 index 1141663a..00000000 --- a/src/prost/cosmos.crypto.keyring.v1.serde.rs +++ /dev/null @@ -1,495 +0,0 @@ -impl serde::Serialize for Record { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if self.item.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.crypto.keyring.v1.Record", len)?; - if true { - struct_ser.serialize_field("name", &self.name)?; - } - if let Some(v) = self.pub_key.as_ref() { - struct_ser.serialize_field("pubKey", v)?; - } - if let Some(v) = self.item.as_ref() { - match v { - record::Item::Local(v) => { - struct_ser.serialize_field("local", v)?; - } - record::Item::Ledger(v) => { - struct_ser.serialize_field("ledger", v)?; - } - record::Item::Multi(v) => { - struct_ser.serialize_field("multi", v)?; - } - record::Item::Offline(v) => { - struct_ser.serialize_field("offline", v)?; - } - } - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Record { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "name", - "pub_key", - "pubKey", - "local", - "ledger", - "multi", - "offline", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Name, - PubKey, - Local, - Ledger, - Multi, - Offline, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "name" => Ok(GeneratedField::Name), - "pubKey" | "pub_key" => Ok(GeneratedField::PubKey), - "local" => Ok(GeneratedField::Local), - "ledger" => Ok(GeneratedField::Ledger), - "multi" => Ok(GeneratedField::Multi), - "offline" => Ok(GeneratedField::Offline), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Record; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.crypto.keyring.v1.Record") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut name__ = None; - let mut pub_key__ = None; - let mut item__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); - } - name__ = Some(map_.next_value()?); - } - GeneratedField::PubKey => { - if pub_key__.is_some() { - return Err(serde::de::Error::duplicate_field("pubKey")); - } - pub_key__ = map_.next_value()?; - } - GeneratedField::Local => { - if item__.is_some() { - return Err(serde::de::Error::duplicate_field("local")); - } - item__ = map_.next_value::<::core::option::Option<_>>()?.map(record::Item::Local) -; - } - GeneratedField::Ledger => { - if item__.is_some() { - return Err(serde::de::Error::duplicate_field("ledger")); - } - item__ = map_.next_value::<::core::option::Option<_>>()?.map(record::Item::Ledger) -; - } - GeneratedField::Multi => { - if item__.is_some() { - return Err(serde::de::Error::duplicate_field("multi")); - } - item__ = map_.next_value::<::core::option::Option<_>>()?.map(record::Item::Multi) -; - } - GeneratedField::Offline => { - if item__.is_some() { - return Err(serde::de::Error::duplicate_field("offline")); - } - item__ = map_.next_value::<::core::option::Option<_>>()?.map(record::Item::Offline) -; - } - } - } - Ok(Record { - name: name__.unwrap_or_default(), - pub_key: pub_key__, - item: item__, - }) - } - } - deserializer.deserialize_struct("cosmos.crypto.keyring.v1.Record", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for record::Ledger { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.crypto.keyring.v1.Record.Ledger", len)?; - if let Some(v) = self.path.as_ref() { - struct_ser.serialize_field("path", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for record::Ledger { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "path", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Path, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "path" => Ok(GeneratedField::Path), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = record::Ledger; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.crypto.keyring.v1.Record.Ledger") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut path__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Path => { - if path__.is_some() { - return Err(serde::de::Error::duplicate_field("path")); - } - path__ = map_.next_value()?; - } - } - } - Ok(record::Ledger { - path: path__, - }) - } - } - deserializer.deserialize_struct("cosmos.crypto.keyring.v1.Record.Ledger", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for record::Local { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.crypto.keyring.v1.Record.Local", len)?; - if let Some(v) = self.priv_key.as_ref() { - struct_ser.serialize_field("privKey", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for record::Local { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "priv_key", - "privKey", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PrivKey, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "privKey" | "priv_key" => Ok(GeneratedField::PrivKey), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = record::Local; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.crypto.keyring.v1.Record.Local") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut priv_key__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::PrivKey => { - if priv_key__.is_some() { - return Err(serde::de::Error::duplicate_field("privKey")); - } - priv_key__ = map_.next_value()?; - } - } - } - Ok(record::Local { - priv_key: priv_key__, - }) - } - } - deserializer.deserialize_struct("cosmos.crypto.keyring.v1.Record.Local", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for record::Multi { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.crypto.keyring.v1.Record.Multi", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for record::Multi { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = record::Multi; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.crypto.keyring.v1.Record.Multi") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(record::Multi { - }) - } - } - deserializer.deserialize_struct("cosmos.crypto.keyring.v1.Record.Multi", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for record::Offline { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.crypto.keyring.v1.Record.Offline", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for record::Offline { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = record::Offline; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.crypto.keyring.v1.Record.Offline") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(record::Offline { - }) - } - } - deserializer.deserialize_struct("cosmos.crypto.keyring.v1.Record.Offline", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.crypto.multisig.rs b/src/prost/cosmos.crypto.multisig.rs deleted file mode 100644 index 207e7260..00000000 --- a/src/prost/cosmos.crypto.multisig.rs +++ /dev/null @@ -1,22 +0,0 @@ -// This file is @generated by prost-build. -/// LegacyAminoPubKey specifies a public key type -/// which nests multiple public keys and a threshold, -/// it uses legacy amino address rules. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct LegacyAminoPubKey { - #[prost(uint32, tag = "1")] - pub threshold: u32, - #[prost(message, repeated, tag = "2")] - pub public_keys: ::prost::alloc::vec::Vec<::tendermint_proto::google::protobuf::Any>, -} -impl ::prost::Name for LegacyAminoPubKey { - const NAME: &'static str = "LegacyAminoPubKey"; - const PACKAGE: &'static str = "cosmos.crypto.multisig"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.crypto.multisig.LegacyAminoPubKey".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.crypto.multisig.LegacyAminoPubKey".into() - } -} diff --git a/src/prost/cosmos.crypto.multisig.serde.rs b/src/prost/cosmos.crypto.multisig.serde.rs deleted file mode 100644 index f535b553..00000000 --- a/src/prost/cosmos.crypto.multisig.serde.rs +++ /dev/null @@ -1,111 +0,0 @@ -impl serde::Serialize for LegacyAminoPubKey { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.crypto.multisig.LegacyAminoPubKey", len)?; - if true { - struct_ser.serialize_field("threshold", &self.threshold)?; - } - if true { - struct_ser.serialize_field("publicKeys", &self.public_keys)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for LegacyAminoPubKey { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "threshold", - "public_keys", - "publicKeys", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Threshold, - PublicKeys, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "threshold" => Ok(GeneratedField::Threshold), - "publicKeys" | "public_keys" => Ok(GeneratedField::PublicKeys), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = LegacyAminoPubKey; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.crypto.multisig.LegacyAminoPubKey") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut threshold__ = None; - let mut public_keys__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Threshold => { - if threshold__.is_some() { - return Err(serde::de::Error::duplicate_field("threshold")); - } - threshold__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::PublicKeys => { - if public_keys__.is_some() { - return Err(serde::de::Error::duplicate_field("publicKeys")); - } - public_keys__ = Some(map_.next_value()?); - } - } - } - Ok(LegacyAminoPubKey { - threshold: threshold__.unwrap_or_default(), - public_keys: public_keys__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.crypto.multisig.LegacyAminoPubKey", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.crypto.multisig.v1beta1.rs b/src/prost/cosmos.crypto.multisig.v1beta1.rs deleted file mode 100644 index ea870783..00000000 --- a/src/prost/cosmos.crypto.multisig.v1beta1.rs +++ /dev/null @@ -1,42 +0,0 @@ -// This file is @generated by prost-build. -/// MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. -/// See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers -/// signed and with which modes. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MultiSignature { - #[prost(bytes = "vec", repeated, tag = "1")] - pub signatures: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, -} -impl ::prost::Name for MultiSignature { - const NAME: &'static str = "MultiSignature"; - const PACKAGE: &'static str = "cosmos.crypto.multisig.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.crypto.multisig.v1beta1.MultiSignature".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.crypto.multisig.v1beta1.MultiSignature".into() - } -} -/// CompactBitArray is an implementation of a space efficient bit array. -/// This is used to ensure that the encoded data takes up a minimal amount of -/// space after proto encoding. -/// This is not thread safe, and is not intended for concurrent usage. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CompactBitArray { - #[prost(uint32, tag = "1")] - pub extra_bits_stored: u32, - #[prost(bytes = "vec", tag = "2")] - pub elems: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for CompactBitArray { - const NAME: &'static str = "CompactBitArray"; - const PACKAGE: &'static str = "cosmos.crypto.multisig.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.crypto.multisig.v1beta1.CompactBitArray".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.crypto.multisig.v1beta1.CompactBitArray".into() - } -} diff --git a/src/prost/cosmos.crypto.multisig.v1beta1.serde.rs b/src/prost/cosmos.crypto.multisig.v1beta1.serde.rs deleted file mode 100644 index 3a12dfe6..00000000 --- a/src/prost/cosmos.crypto.multisig.v1beta1.serde.rs +++ /dev/null @@ -1,208 +0,0 @@ -impl serde::Serialize for CompactBitArray { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.crypto.multisig.v1beta1.CompactBitArray", len)?; - if true { - struct_ser.serialize_field("extraBitsStored", &self.extra_bits_stored)?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("elems", pbjson::private::base64::encode(&self.elems).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CompactBitArray { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "extra_bits_stored", - "extraBitsStored", - "elems", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ExtraBitsStored, - Elems, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "extraBitsStored" | "extra_bits_stored" => Ok(GeneratedField::ExtraBitsStored), - "elems" => Ok(GeneratedField::Elems), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CompactBitArray; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.crypto.multisig.v1beta1.CompactBitArray") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut extra_bits_stored__ = None; - let mut elems__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ExtraBitsStored => { - if extra_bits_stored__.is_some() { - return Err(serde::de::Error::duplicate_field("extraBitsStored")); - } - extra_bits_stored__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Elems => { - if elems__.is_some() { - return Err(serde::de::Error::duplicate_field("elems")); - } - elems__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - } - } - Ok(CompactBitArray { - extra_bits_stored: extra_bits_stored__.unwrap_or_default(), - elems: elems__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.crypto.multisig.v1beta1.CompactBitArray", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MultiSignature { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.crypto.multisig.v1beta1.MultiSignature", len)?; - if true { - struct_ser.serialize_field("signatures", &self.signatures.iter().map(pbjson::private::base64::encode).collect::<::alloc::vec::Vec<_>>())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MultiSignature { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "signatures", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Signatures, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "signatures" => Ok(GeneratedField::Signatures), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MultiSignature; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.crypto.multisig.v1beta1.MultiSignature") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut signatures__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Signatures => { - if signatures__.is_some() { - return Err(serde::de::Error::duplicate_field("signatures")); - } - signatures__ = - Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::BytesDeserialize<_>>>()? - .into_iter().map(|x| x.0).collect()) - ; - } - } - } - Ok(MultiSignature { - signatures: signatures__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.crypto.multisig.v1beta1.MultiSignature", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.crypto.secp256k1.rs b/src/prost/cosmos.crypto.secp256k1.rs deleted file mode 100644 index fb4ba372..00000000 --- a/src/prost/cosmos.crypto.secp256k1.rs +++ /dev/null @@ -1,39 +0,0 @@ -// This file is @generated by prost-build. -/// PubKey defines a secp256k1 public key -/// Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte -/// if the y-coordinate is the lexicographically largest of the two associated with -/// the x-coordinate. Otherwise the first byte is a 0x03. -/// This prefix is followed with the x-coordinate. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PubKey { - #[prost(bytes = "vec", tag = "1")] - pub key: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for PubKey { - const NAME: &'static str = "PubKey"; - const PACKAGE: &'static str = "cosmos.crypto.secp256k1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.crypto.secp256k1.PubKey".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.crypto.secp256k1.PubKey".into() - } -} -/// PrivKey defines a secp256k1 private key. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PrivKey { - #[prost(bytes = "vec", tag = "1")] - pub key: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for PrivKey { - const NAME: &'static str = "PrivKey"; - const PACKAGE: &'static str = "cosmos.crypto.secp256k1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.crypto.secp256k1.PrivKey".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.crypto.secp256k1.PrivKey".into() - } -} diff --git a/src/prost/cosmos.crypto.secp256k1.serde.rs b/src/prost/cosmos.crypto.secp256k1.serde.rs deleted file mode 100644 index aaea5af5..00000000 --- a/src/prost/cosmos.crypto.secp256k1.serde.rs +++ /dev/null @@ -1,188 +0,0 @@ -impl serde::Serialize for PrivKey { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.crypto.secp256k1.PrivKey", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for PrivKey { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "key", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "key" => Ok(GeneratedField::Key), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = PrivKey; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.crypto.secp256k1.PrivKey") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut key__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Key => { - if key__.is_some() { - return Err(serde::de::Error::duplicate_field("key")); - } - key__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - } - } - Ok(PrivKey { - key: key__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.crypto.secp256k1.PrivKey", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for PubKey { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.crypto.secp256k1.PubKey", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for PubKey { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "key", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "key" => Ok(GeneratedField::Key), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = PubKey; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.crypto.secp256k1.PubKey") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut key__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Key => { - if key__.is_some() { - return Err(serde::de::Error::duplicate_field("key")); - } - key__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - } - } - Ok(PubKey { - key: key__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.crypto.secp256k1.PubKey", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.crypto.secp256r1.rs b/src/prost/cosmos.crypto.secp256r1.rs deleted file mode 100644 index 39ba3874..00000000 --- a/src/prost/cosmos.crypto.secp256r1.rs +++ /dev/null @@ -1,38 +0,0 @@ -// This file is @generated by prost-build. -/// PubKey defines a secp256r1 ECDSA public key. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PubKey { - /// Point on secp256r1 curve in a compressed representation as specified in section - /// 4.3.6 of ANSI X9.62: - #[prost(bytes = "vec", tag = "1")] - pub key: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for PubKey { - const NAME: &'static str = "PubKey"; - const PACKAGE: &'static str = "cosmos.crypto.secp256r1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.crypto.secp256r1.PubKey".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.crypto.secp256r1.PubKey".into() - } -} -/// PrivKey defines a secp256r1 ECDSA private key. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PrivKey { - /// secret number serialized using big-endian encoding - #[prost(bytes = "vec", tag = "1")] - pub secret: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for PrivKey { - const NAME: &'static str = "PrivKey"; - const PACKAGE: &'static str = "cosmos.crypto.secp256r1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.crypto.secp256r1.PrivKey".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.crypto.secp256r1.PrivKey".into() - } -} diff --git a/src/prost/cosmos.crypto.secp256r1.serde.rs b/src/prost/cosmos.crypto.secp256r1.serde.rs deleted file mode 100644 index f1cca10b..00000000 --- a/src/prost/cosmos.crypto.secp256r1.serde.rs +++ /dev/null @@ -1,188 +0,0 @@ -impl serde::Serialize for PrivKey { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.crypto.secp256r1.PrivKey", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("secret", pbjson::private::base64::encode(&self.secret).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for PrivKey { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "secret", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Secret, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "secret" => Ok(GeneratedField::Secret), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = PrivKey; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.crypto.secp256r1.PrivKey") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut secret__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Secret => { - if secret__.is_some() { - return Err(serde::de::Error::duplicate_field("secret")); - } - secret__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - } - } - Ok(PrivKey { - secret: secret__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.crypto.secp256r1.PrivKey", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for PubKey { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.crypto.secp256r1.PubKey", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for PubKey { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "key", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "key" => Ok(GeneratedField::Key), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = PubKey; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.crypto.secp256r1.PubKey") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut key__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Key => { - if key__.is_some() { - return Err(serde::de::Error::duplicate_field("key")); - } - key__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - } - } - Ok(PubKey { - key: key__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.crypto.secp256r1.PubKey", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.gov.module.v1.rs b/src/prost/cosmos.gov.module.v1.rs deleted file mode 100644 index e7d5510c..00000000 --- a/src/prost/cosmos.gov.module.v1.rs +++ /dev/null @@ -1,23 +0,0 @@ -// This file is @generated by prost-build. -/// Module is the config object of the gov module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Module { - /// max_metadata_len defines the maximum proposal metadata length. - /// Defaults to 255 if not explicitly set. - #[prost(uint64, tag = "1")] - 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, -} -impl ::prost::Name for Module { - const NAME: &'static str = "Module"; - const PACKAGE: &'static str = "cosmos.gov.module.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.module.v1.Module".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.module.v1.Module".into() - } -} diff --git a/src/prost/cosmos.gov.module.v1.serde.rs b/src/prost/cosmos.gov.module.v1.serde.rs deleted file mode 100644 index 88377721..00000000 --- a/src/prost/cosmos.gov.module.v1.serde.rs +++ /dev/null @@ -1,112 +0,0 @@ -impl serde::Serialize for Module { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.module.v1.Module", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("maxMetadataLen", ::alloc::string::ToString::to_string(&self.max_metadata_len).as_str())?; - } - if true { - struct_ser.serialize_field("authority", &self.authority)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Module { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "max_metadata_len", - "maxMetadataLen", - "authority", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - MaxMetadataLen, - Authority, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "maxMetadataLen" | "max_metadata_len" => Ok(GeneratedField::MaxMetadataLen), - "authority" => Ok(GeneratedField::Authority), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Module; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.module.v1.Module") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut max_metadata_len__ = None; - let mut authority__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::MaxMetadataLen => { - if max_metadata_len__.is_some() { - return Err(serde::de::Error::duplicate_field("maxMetadataLen")); - } - max_metadata_len__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Authority => { - if authority__.is_some() { - return Err(serde::de::Error::duplicate_field("authority")); - } - authority__ = Some(map_.next_value()?); - } - } - } - Ok(Module { - max_metadata_len: max_metadata_len__.unwrap_or_default(), - authority: authority__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.module.v1.Module", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.gov.v1.rs b/src/prost/cosmos.gov.v1.rs deleted file mode 100644 index 728fc705..00000000 --- a/src/prost/cosmos.gov.v1.rs +++ /dev/null @@ -1,2540 +0,0 @@ -// This file is @generated by prost-build. -/// WeightedVoteOption defines a unit of vote for vote split. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct WeightedVoteOption { - /// option defines the valid vote options, it must not contain duplicate vote options. - #[prost(enumeration = "VoteOption", tag = "1")] - pub option: i32, - /// weight is the vote weight associated with the vote option. - #[prost(string, tag = "2")] - pub weight: ::prost::alloc::string::String, -} -impl ::prost::Name for WeightedVoteOption { - const NAME: &'static str = "WeightedVoteOption"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.WeightedVoteOption".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.WeightedVoteOption".into() - } -} -/// Deposit defines an amount deposited by an account address to an active -/// proposal. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Deposit { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - 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, -} -impl ::prost::Name for Deposit { - const NAME: &'static str = "Deposit"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.Deposit".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.Deposit".into() - } -} -/// Proposal defines the core field members of a governance proposal. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Proposal { - /// id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - 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<::tendermint_proto::google::protobuf::Any>, - /// status defines the proposal status. - #[prost(enumeration = "ProposalStatus", tag = "3")] - pub status: i32, - /// final_tally_result is the final tally result of the proposal. When - /// querying a proposal via gRPC, this field is not populated until the - /// 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< - ::tendermint_proto::google::protobuf::Timestamp, - >, - /// deposit_end_time is the end time for deposition. - #[prost(message, optional, tag = "6")] - pub deposit_end_time: ::core::option::Option< - ::tendermint_proto::google::protobuf::Timestamp, - >, - /// 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< - ::tendermint_proto::google::protobuf::Timestamp, - >, - /// voting_end_time is the end time of voting on a proposal. - #[prost(message, optional, tag = "9")] - pub voting_end_time: ::core::option::Option< - ::tendermint_proto::google::protobuf::Timestamp, - >, - /// metadata is any arbitrary metadata attached to the proposal. - #[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, -} -impl ::prost::Name for Proposal { - const NAME: &'static str = "Proposal"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.Proposal".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.Proposal".into() - } -} -/// TallyResult defines a standard tally for a governance proposal. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -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, -} -impl ::prost::Name for TallyResult { - const NAME: &'static str = "TallyResult"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.TallyResult".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.TallyResult".into() - } -} -/// Vote defines a vote on a governance proposal. -/// A Vote consists of a proposal ID, the voter, and the vote option. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Vote { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - 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 to attached to the vote. - #[prost(string, tag = "5")] - pub metadata: ::prost::alloc::string::String, -} -impl ::prost::Name for Vote { - const NAME: &'static str = "Vote"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.Vote".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.Vote".into() - } -} -/// DepositParams defines the params for deposits on governance proposals. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DepositParams { - /// 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< - ::tendermint_proto::google::protobuf::Duration, - >, -} -impl ::prost::Name for DepositParams { - const NAME: &'static str = "DepositParams"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.DepositParams".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.DepositParams".into() - } -} -/// VotingParams defines the params for voting on governance proposals. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct VotingParams { - /// Duration of the voting period. - #[prost(message, optional, tag = "1")] - pub voting_period: ::core::option::Option< - ::tendermint_proto::google::protobuf::Duration, - >, -} -impl ::prost::Name for VotingParams { - const NAME: &'static str = "VotingParams"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.VotingParams".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.VotingParams".into() - } -} -/// TallyParams defines the params for tallying votes on governance proposals. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -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, -} -impl ::prost::Name for TallyParams { - const NAME: &'static str = "TallyParams"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.TallyParams".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.TallyParams".into() - } -} -/// Params defines the parameters for the x/gov module. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -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< - ::tendermint_proto::google::protobuf::Duration, - >, - /// Duration of the voting period. - #[prost(message, optional, tag = "3")] - pub voting_period: ::core::option::Option< - ::tendermint_proto::google::protobuf::Duration, - >, - /// Minimum percentage of total stake needed to vote for a result to be - /// considered valid. - #[prost(string, tag = "4")] - pub quorum: ::prost::alloc::string::String, - /// Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. - #[prost(string, tag = "5")] - 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")] - 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, - /// 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, -} -impl ::prost::Name for Params { - const NAME: &'static str = "Params"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.Params".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.Params".into() - } -} -/// VoteOption enumerates the valid vote options for a given governance proposal. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum VoteOption { - /// VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - Unspecified = 0, - /// VOTE_OPTION_YES defines a yes vote option. - Yes = 1, - /// VOTE_OPTION_ABSTAIN defines an abstain vote option. - Abstain = 2, - /// VOTE_OPTION_NO defines a no vote option. - No = 3, - /// VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - NoWithVeto = 4, -} -impl VoteOption { - /// 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 { - VoteOption::Unspecified => "VOTE_OPTION_UNSPECIFIED", - VoteOption::Yes => "VOTE_OPTION_YES", - VoteOption::Abstain => "VOTE_OPTION_ABSTAIN", - VoteOption::No => "VOTE_OPTION_NO", - VoteOption::NoWithVeto => "VOTE_OPTION_NO_WITH_VETO", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "VOTE_OPTION_UNSPECIFIED" => Some(Self::Unspecified), - "VOTE_OPTION_YES" => Some(Self::Yes), - "VOTE_OPTION_ABSTAIN" => Some(Self::Abstain), - "VOTE_OPTION_NO" => Some(Self::No), - "VOTE_OPTION_NO_WITH_VETO" => Some(Self::NoWithVeto), - _ => None, - } - } -} -/// ProposalStatus enumerates the valid statuses of a proposal. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum ProposalStatus { - /// PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - Unspecified = 0, - /// PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - /// period. - DepositPeriod = 1, - /// PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - /// period. - VotingPeriod = 2, - /// PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - /// passed. - Passed = 3, - /// PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - /// been rejected. - Rejected = 4, - /// PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - /// failed. - Failed = 5, -} -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::Unspecified => "PROPOSAL_STATUS_UNSPECIFIED", - ProposalStatus::DepositPeriod => "PROPOSAL_STATUS_DEPOSIT_PERIOD", - ProposalStatus::VotingPeriod => "PROPOSAL_STATUS_VOTING_PERIOD", - ProposalStatus::Passed => "PROPOSAL_STATUS_PASSED", - ProposalStatus::Rejected => "PROPOSAL_STATUS_REJECTED", - ProposalStatus::Failed => "PROPOSAL_STATUS_FAILED", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "PROPOSAL_STATUS_UNSPECIFIED" => Some(Self::Unspecified), - "PROPOSAL_STATUS_DEPOSIT_PERIOD" => Some(Self::DepositPeriod), - "PROPOSAL_STATUS_VOTING_PERIOD" => Some(Self::VotingPeriod), - "PROPOSAL_STATUS_PASSED" => Some(Self::Passed), - "PROPOSAL_STATUS_REJECTED" => Some(Self::Rejected), - "PROPOSAL_STATUS_FAILED" => Some(Self::Failed), - _ => None, - } - } -} -/// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary -/// proposal Content. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -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<::tendermint_proto::google::protobuf::Any>, - /// 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, -} -impl ::prost::Name for MsgSubmitProposal { - const NAME: &'static str = "MsgSubmitProposal"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.MsgSubmitProposal".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.MsgSubmitProposal".into() - } -} -/// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct MsgSubmitProposalResponse { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - pub proposal_id: u64, -} -impl ::prost::Name for MsgSubmitProposalResponse { - const NAME: &'static str = "MsgSubmitProposalResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.MsgSubmitProposalResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.MsgSubmitProposalResponse".into() - } -} -/// MsgExecLegacyContent is used to wrap the legacy content field into a message. -/// This ensures backwards compatibility with v1beta1.MsgSubmitProposal. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgExecLegacyContent { - /// content is the proposal's content. - #[prost(message, optional, tag = "1")] - pub content: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, - /// authority must be the gov module address. - #[prost(string, tag = "2")] - pub authority: ::prost::alloc::string::String, -} -impl ::prost::Name for MsgExecLegacyContent { - const NAME: &'static str = "MsgExecLegacyContent"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.MsgExecLegacyContent".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.MsgExecLegacyContent".into() - } -} -/// MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct MsgExecLegacyContentResponse {} -impl ::prost::Name for MsgExecLegacyContentResponse { - const NAME: &'static str = "MsgExecLegacyContentResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.MsgExecLegacyContentResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.MsgExecLegacyContentResponse".into() - } -} -/// MsgVote defines a message to cast a vote. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgVote { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - 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")] - pub option: i32, - /// metadata is any arbitrary metadata attached to the Vote. - #[prost(string, tag = "4")] - pub metadata: ::prost::alloc::string::String, -} -impl ::prost::Name for MsgVote { - const NAME: &'static str = "MsgVote"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.MsgVote".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.MsgVote".into() - } -} -/// MsgVoteResponse defines the Msg/Vote response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct MsgVoteResponse {} -impl ::prost::Name for MsgVoteResponse { - const NAME: &'static str = "MsgVoteResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.MsgVoteResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.MsgVoteResponse".into() - } -} -/// MsgVoteWeighted defines a message to cast a vote. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgVoteWeighted { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - 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, -} -impl ::prost::Name for MsgVoteWeighted { - const NAME: &'static str = "MsgVoteWeighted"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.MsgVoteWeighted".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.MsgVoteWeighted".into() - } -} -/// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct MsgVoteWeightedResponse {} -impl ::prost::Name for MsgVoteWeightedResponse { - const NAME: &'static str = "MsgVoteWeightedResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.MsgVoteWeightedResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.MsgVoteWeightedResponse".into() - } -} -/// MsgDeposit defines a message to submit a deposit to an existing proposal. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgDeposit { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - 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, -} -impl ::prost::Name for MsgDeposit { - const NAME: &'static str = "MsgDeposit"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.MsgDeposit".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.MsgDeposit".into() - } -} -/// MsgDepositResponse defines the Msg/Deposit response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct MsgDepositResponse {} -impl ::prost::Name for MsgDepositResponse { - const NAME: &'static str = "MsgDepositResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.MsgDepositResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.MsgDepositResponse".into() - } -} -/// MsgUpdateParams is the Msg/UpdateParams request type. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -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, -} -impl ::prost::Name for MsgUpdateParams { - const NAME: &'static str = "MsgUpdateParams"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.MsgUpdateParams".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.MsgUpdateParams".into() - } -} -/// MsgUpdateParamsResponse defines the response structure for executing a -/// MsgUpdateParams message. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct MsgUpdateParamsResponse {} -impl ::prost::Name for MsgUpdateParamsResponse { - const NAME: &'static str = "MsgUpdateParamsResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.MsgUpdateParamsResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.MsgUpdateParamsResponse".into() - } -} -/// Generated client implementations. -#[cfg(feature = "client")] -pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - /// Msg defines the gov Msg service. - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, - } - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: 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 - } - /// SubmitProposal defines a method to create new proposal given the messages. - pub async fn submit_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( - "/cosmos.gov.v1.Msg/SubmitProposal", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1.Msg", "SubmitProposal")); - self.inner.unary(req, path, codec).await - } - /// ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal - /// to execute a legacy content-based proposal. - pub async fn exec_legacy_content( - &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( - "/cosmos.gov.v1.Msg/ExecLegacyContent", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1.Msg", "ExecLegacyContent")); - self.inner.unary(req, path, codec).await - } - /// Vote defines a method to add a vote on a specific proposal. - pub async fn vote( - &mut self, - request: impl tonic::IntoRequest, - ) -> 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("/cosmos.gov.v1.Msg/Vote"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("cosmos.gov.v1.Msg", "Vote")); - self.inner.unary(req, path, codec).await - } - /// VoteWeighted defines a method to add a weighted vote on a specific proposal. - pub async fn vote_weighted( - &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( - "/cosmos.gov.v1.Msg/VoteWeighted", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1.Msg", "VoteWeighted")); - self.inner.unary(req, path, codec).await - } - /// Deposit defines a method to add deposit on a specific proposal. - pub async fn deposit( - &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( - "/cosmos.gov.v1.Msg/Deposit", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("cosmos.gov.v1.Msg", "Deposit")); - self.inner.unary(req, path, codec).await - } - /// UpdateParams defines a governance operation for updating the x/gov module - /// parameters. The authority is defined in the keeper. - /// - /// Since: cosmos-sdk 0.47 - pub async fn update_params( - &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( - "/cosmos.gov.v1.Msg/UpdateParams", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1.Msg", "UpdateParams")); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -#[cfg(feature = "server")] -pub mod msg_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. - #[async_trait] - pub trait Msg: Send + Sync + 'static { - /// SubmitProposal defines a method to create new proposal given the messages. - async fn submit_proposal( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal - /// to execute a legacy content-based proposal. - async fn exec_legacy_content( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Vote defines a method to add a vote on a specific proposal. - async fn vote( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - /// VoteWeighted defines a method to add a weighted vote on a specific proposal. - async fn vote_weighted( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Deposit defines a method to add deposit on a specific proposal. - async fn deposit( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// UpdateParams defines a governance operation for updating the x/gov module - /// parameters. The authority is defined in the keeper. - /// - /// Since: cosmos-sdk 0.47 - async fn update_params( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - /// Msg defines the gov Msg service. - #[derive(Debug)] - pub struct MsgServer { - inner: Arc, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - impl MsgServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - 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 { - match req.uri().path() { - "/cosmos.gov.v1.Msg/SubmitProposal" => { - #[allow(non_camel_case_types)] - struct SubmitProposalSvc(pub Arc); - impl tonic::server::UnaryService - for SubmitProposalSvc { - type Response = super::MsgSubmitProposalResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::submit_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 method = SubmitProposalSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.gov.v1.Msg/ExecLegacyContent" => { - #[allow(non_camel_case_types)] - struct ExecLegacyContentSvc(pub Arc); - impl tonic::server::UnaryService - for ExecLegacyContentSvc { - type Response = super::MsgExecLegacyContentResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::exec_legacy_content(&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 method = ExecLegacyContentSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.gov.v1.Msg/Vote" => { - #[allow(non_camel_case_types)] - struct VoteSvc(pub Arc); - impl tonic::server::UnaryService - for VoteSvc { - type Response = super::MsgVoteResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::vote(&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 method = VoteSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.gov.v1.Msg/VoteWeighted" => { - #[allow(non_camel_case_types)] - struct VoteWeightedSvc(pub Arc); - impl tonic::server::UnaryService - for VoteWeightedSvc { - type Response = super::MsgVoteWeightedResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::vote_weighted(&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 method = VoteWeightedSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.gov.v1.Msg/Deposit" => { - #[allow(non_camel_case_types)] - struct DepositSvc(pub Arc); - impl tonic::server::UnaryService - for DepositSvc { - type Response = super::MsgDepositResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::deposit(&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 method = DepositSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.gov.v1.Msg/UpdateParams" => { - #[allow(non_camel_case_types)] - struct UpdateParamsSvc(pub Arc); - impl tonic::server::UnaryService - for UpdateParamsSvc { - type Response = super::MsgUpdateParamsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::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 method = UpdateParamsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", tonic::Code::Unimplemented as i32) - .header( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ) - .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 tonic::server::NamedService for MsgServer { - const NAME: &'static str = "cosmos.gov.v1.Msg"; - } -} -/// QueryProposalRequest is the request type for the Query/Proposal RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct QueryProposalRequest { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - pub proposal_id: u64, -} -impl ::prost::Name for QueryProposalRequest { - const NAME: &'static str = "QueryProposalRequest"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.QueryProposalRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.QueryProposalRequest".into() - } -} -/// QueryProposalResponse is the response type for the Query/Proposal RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryProposalResponse { - /// proposal is the requested governance proposal. - #[prost(message, optional, tag = "1")] - pub proposal: ::core::option::Option, -} -impl ::prost::Name for QueryProposalResponse { - const NAME: &'static str = "QueryProposalResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.QueryProposalResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.QueryProposalResponse".into() - } -} -/// QueryProposalsRequest is the request type for the Query/Proposals RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryProposalsRequest { - /// proposal_status defines the status of the proposals. - #[prost(enumeration = "ProposalStatus", tag = "1")] - pub proposal_status: i32, - /// voter defines the voter address for the proposals. - #[prost(string, tag = "2")] - pub voter: ::prost::alloc::string::String, - /// depositor defines the deposit addresses from the proposals. - #[prost(string, tag = "3")] - pub depositor: ::prost::alloc::string::String, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "4")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryProposalsRequest { - const NAME: &'static str = "QueryProposalsRequest"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.QueryProposalsRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.QueryProposalsRequest".into() - } -} -/// QueryProposalsResponse is the response type for the Query/Proposals RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -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. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryProposalsResponse { - const NAME: &'static str = "QueryProposalsResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.QueryProposalsResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.QueryProposalsResponse".into() - } -} -/// QueryVoteRequest is the request type for the Query/Vote RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryVoteRequest { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - pub proposal_id: u64, - /// voter defines the voter address for the proposals. - #[prost(string, tag = "2")] - pub voter: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryVoteRequest { - const NAME: &'static str = "QueryVoteRequest"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.QueryVoteRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.QueryVoteRequest".into() - } -} -/// QueryVoteResponse is the response type for the Query/Vote RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryVoteResponse { - /// vote defines the queried vote. - #[prost(message, optional, tag = "1")] - pub vote: ::core::option::Option, -} -impl ::prost::Name for QueryVoteResponse { - const NAME: &'static str = "QueryVoteResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.QueryVoteResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.QueryVoteResponse".into() - } -} -/// QueryVotesRequest is the request type for the Query/Votes RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryVotesRequest { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - pub proposal_id: u64, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryVotesRequest { - const NAME: &'static str = "QueryVotesRequest"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.QueryVotesRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.QueryVotesRequest".into() - } -} -/// QueryVotesResponse is the response type for the Query/Votes RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryVotesResponse { - /// votes defines the queried votes. - #[prost(message, repeated, tag = "1")] - pub votes: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryVotesResponse { - const NAME: &'static str = "QueryVotesResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.QueryVotesResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.QueryVotesResponse".into() - } -} -/// QueryParamsRequest is the request type for the Query/Params RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryParamsRequest { - /// params_type defines which parameters to query for, can be one of "voting", - /// "tallying" or "deposit". - #[prost(string, tag = "1")] - pub params_type: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryParamsRequest { - const NAME: &'static str = "QueryParamsRequest"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.QueryParamsRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.QueryParamsRequest".into() - } -} -/// QueryParamsResponse is the response type for the Query/Params RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -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, -} -impl ::prost::Name for QueryParamsResponse { - const NAME: &'static str = "QueryParamsResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.QueryParamsResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.QueryParamsResponse".into() - } -} -/// QueryDepositRequest is the request type for the Query/Deposit RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDepositRequest { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - pub proposal_id: u64, - /// depositor defines the deposit addresses from the proposals. - #[prost(string, tag = "2")] - pub depositor: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryDepositRequest { - const NAME: &'static str = "QueryDepositRequest"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.QueryDepositRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.QueryDepositRequest".into() - } -} -/// QueryDepositResponse is the response type for the Query/Deposit RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDepositResponse { - /// deposit defines the requested deposit. - #[prost(message, optional, tag = "1")] - pub deposit: ::core::option::Option, -} -impl ::prost::Name for QueryDepositResponse { - const NAME: &'static str = "QueryDepositResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.QueryDepositResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.QueryDepositResponse".into() - } -} -/// QueryDepositsRequest is the request type for the Query/Deposits RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDepositsRequest { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - pub proposal_id: u64, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryDepositsRequest { - const NAME: &'static str = "QueryDepositsRequest"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.QueryDepositsRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.QueryDepositsRequest".into() - } -} -/// QueryDepositsResponse is the response type for the Query/Deposits RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -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. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryDepositsResponse { - const NAME: &'static str = "QueryDepositsResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.QueryDepositsResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.QueryDepositsResponse".into() - } -} -/// QueryTallyResultRequest is the request type for the Query/Tally RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct QueryTallyResultRequest { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - pub proposal_id: u64, -} -impl ::prost::Name for QueryTallyResultRequest { - const NAME: &'static str = "QueryTallyResultRequest"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.QueryTallyResultRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.QueryTallyResultRequest".into() - } -} -/// QueryTallyResultResponse is the response type for the Query/Tally RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryTallyResultResponse { - /// tally defines the requested tally. - #[prost(message, optional, tag = "1")] - pub tally: ::core::option::Option, -} -impl ::prost::Name for QueryTallyResultResponse { - const NAME: &'static str = "QueryTallyResultResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.QueryTallyResultResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.QueryTallyResultResponse".into() - } -} -/// Generated client implementations. -#[cfg(feature = "client")] -pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - /// Query defines the gRPC querier service for gov module - #[derive(Debug, Clone)] - pub struct QueryClient { - inner: tonic::client::Grpc, - } - impl QueryClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: 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 - } - /// Proposal queries proposal details based on ProposalID. - pub async fn 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( - "/cosmos.gov.v1.Query/Proposal", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1.Query", "Proposal")); - self.inner.unary(req, path, codec).await - } - /// Proposals queries all proposals based on given status. - pub async fn proposals( - &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( - "/cosmos.gov.v1.Query/Proposals", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1.Query", "Proposals")); - self.inner.unary(req, path, codec).await - } - /// Vote queries voted information based on proposalID, voterAddr. - pub async fn vote( - &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("/cosmos.gov.v1.Query/Vote"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("cosmos.gov.v1.Query", "Vote")); - self.inner.unary(req, path, codec).await - } - /// Votes queries votes of a given proposal. - pub async fn votes( - &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( - "/cosmos.gov.v1.Query/Votes", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("cosmos.gov.v1.Query", "Votes")); - self.inner.unary(req, path, codec).await - } - /// Params queries all parameters of the gov module. - pub async fn params( - &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( - "/cosmos.gov.v1.Query/Params", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1.Query", "Params")); - self.inner.unary(req, path, codec).await - } - /// Deposit queries single deposit information based proposalID, depositAddr. - pub async fn deposit( - &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( - "/cosmos.gov.v1.Query/Deposit", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1.Query", "Deposit")); - self.inner.unary(req, path, codec).await - } - /// Deposits queries all deposits of a single proposal. - pub async fn deposits( - &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( - "/cosmos.gov.v1.Query/Deposits", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1.Query", "Deposits")); - self.inner.unary(req, path, codec).await - } - /// TallyResult queries the tally of a proposal vote. - pub async fn tally_result( - &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( - "/cosmos.gov.v1.Query/TallyResult", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1.Query", "TallyResult")); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -#[cfg(feature = "server")] -pub mod query_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. - #[async_trait] - pub trait Query: Send + Sync + 'static { - /// Proposal queries proposal details based on ProposalID. - async fn proposal( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Proposals queries all proposals based on given status. - async fn proposals( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Vote queries voted information based on proposalID, voterAddr. - async fn vote( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Votes queries votes of a given proposal. - async fn votes( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Params queries all parameters of the gov module. - async fn params( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Deposit queries single deposit information based proposalID, depositAddr. - async fn deposit( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Deposits queries all deposits of a single proposal. - async fn deposits( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// TallyResult queries the tally of a proposal vote. - async fn tally_result( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - /// Query defines the gRPC querier service for gov module - #[derive(Debug)] - pub struct QueryServer { - inner: Arc, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - impl QueryServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - 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 { - match req.uri().path() { - "/cosmos.gov.v1.Query/Proposal" => { - #[allow(non_camel_case_types)] - struct ProposalSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for ProposalSvc { - type Response = super::QueryProposalResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::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 method = ProposalSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.gov.v1.Query/Proposals" => { - #[allow(non_camel_case_types)] - struct ProposalsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for ProposalsSvc { - type Response = super::QueryProposalsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::proposals(&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 method = ProposalsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.gov.v1.Query/Vote" => { - #[allow(non_camel_case_types)] - struct VoteSvc(pub Arc); - impl tonic::server::UnaryService - for VoteSvc { - type Response = super::QueryVoteResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::vote(&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 method = VoteSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.gov.v1.Query/Votes" => { - #[allow(non_camel_case_types)] - struct VotesSvc(pub Arc); - impl tonic::server::UnaryService - for VotesSvc { - type Response = super::QueryVotesResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::votes(&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 method = VotesSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.gov.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::Response, - 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 method = ParamsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.gov.v1.Query/Deposit" => { - #[allow(non_camel_case_types)] - struct DepositSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for DepositSvc { - type Response = super::QueryDepositResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::deposit(&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 method = DepositSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.gov.v1.Query/Deposits" => { - #[allow(non_camel_case_types)] - struct DepositsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for DepositsSvc { - type Response = super::QueryDepositsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::deposits(&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 method = DepositsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.gov.v1.Query/TallyResult" => { - #[allow(non_camel_case_types)] - struct TallyResultSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for TallyResultSvc { - type Response = super::QueryTallyResultResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::tally_result(&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 method = TallyResultSvc(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", tonic::Code::Unimplemented as i32) - .header( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ) - .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 tonic::server::NamedService for QueryServer { - const NAME: &'static str = "cosmos.gov.v1.Query"; - } -} -/// GenesisState defines the gov module's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GenesisState { - /// starting_proposal_id is the ID of the starting proposal. - #[prost(uint64, tag = "1")] - pub starting_proposal_id: u64, - /// deposits defines all the deposits present at genesis. - #[prost(message, repeated, tag = "2")] - pub deposits: ::prost::alloc::vec::Vec, - /// votes defines all the votes present at genesis. - #[prost(message, repeated, tag = "3")] - pub votes: ::prost::alloc::vec::Vec, - /// 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] - #[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] - #[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] - #[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, -} -impl ::prost::Name for GenesisState { - const NAME: &'static str = "GenesisState"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1.GenesisState".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1.GenesisState".into() - } -} diff --git a/src/prost/cosmos.gov.v1.serde.rs b/src/prost/cosmos.gov.v1.serde.rs deleted file mode 100644 index 82932543..00000000 --- a/src/prost/cosmos.gov.v1.serde.rs +++ /dev/null @@ -1,4771 +0,0 @@ -impl serde::Serialize for Deposit { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.Deposit", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; - } - if true { - struct_ser.serialize_field("depositor", &self.depositor)?; - } - if true { - struct_ser.serialize_field("amount", &self.amount)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Deposit { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposal_id", - "proposalId", - "depositor", - "amount", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ProposalId, - Depositor, - Amount, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), - "depositor" => Ok(GeneratedField::Depositor), - "amount" => Ok(GeneratedField::Amount), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Deposit; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.Deposit") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposal_id__ = None; - let mut depositor__ = None; - let mut amount__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ProposalId => { - if proposal_id__.is_some() { - return Err(serde::de::Error::duplicate_field("proposalId")); - } - proposal_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Depositor => { - if depositor__.is_some() { - return Err(serde::de::Error::duplicate_field("depositor")); - } - depositor__ = Some(map_.next_value()?); - } - GeneratedField::Amount => { - if amount__.is_some() { - return Err(serde::de::Error::duplicate_field("amount")); - } - amount__ = Some(map_.next_value()?); - } - } - } - Ok(Deposit { - proposal_id: proposal_id__.unwrap_or_default(), - depositor: depositor__.unwrap_or_default(), - amount: amount__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.Deposit", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for DepositParams { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.DepositParams", len)?; - if true { - struct_ser.serialize_field("minDeposit", &self.min_deposit)?; - } - if let Some(v) = self.max_deposit_period.as_ref() { - struct_ser.serialize_field("maxDepositPeriod", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for DepositParams { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "min_deposit", - "minDeposit", - "max_deposit_period", - "maxDepositPeriod", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - MinDeposit, - MaxDepositPeriod, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "minDeposit" | "min_deposit" => Ok(GeneratedField::MinDeposit), - "maxDepositPeriod" | "max_deposit_period" => Ok(GeneratedField::MaxDepositPeriod), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = DepositParams; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.DepositParams") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut min_deposit__ = None; - let mut max_deposit_period__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::MinDeposit => { - if min_deposit__.is_some() { - return Err(serde::de::Error::duplicate_field("minDeposit")); - } - min_deposit__ = Some(map_.next_value()?); - } - GeneratedField::MaxDepositPeriod => { - if max_deposit_period__.is_some() { - return Err(serde::de::Error::duplicate_field("maxDepositPeriod")); - } - max_deposit_period__ = map_.next_value()?; - } - } - } - Ok(DepositParams { - min_deposit: min_deposit__.unwrap_or_default(), - max_deposit_period: max_deposit_period__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.DepositParams", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for GenesisState { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.GenesisState", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("startingProposalId", ::alloc::string::ToString::to_string(&self.starting_proposal_id).as_str())?; - } - if true { - struct_ser.serialize_field("deposits", &self.deposits)?; - } - if true { - struct_ser.serialize_field("votes", &self.votes)?; - } - if true { - struct_ser.serialize_field("proposals", &self.proposals)?; - } - if let Some(v) = self.deposit_params.as_ref() { - struct_ser.serialize_field("depositParams", v)?; - } - if let Some(v) = self.voting_params.as_ref() { - struct_ser.serialize_field("votingParams", v)?; - } - if let Some(v) = self.tally_params.as_ref() { - struct_ser.serialize_field("tallyParams", v)?; - } - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GenesisState { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "starting_proposal_id", - "startingProposalId", - "deposits", - "votes", - "proposals", - "deposit_params", - "depositParams", - "voting_params", - "votingParams", - "tally_params", - "tallyParams", - "params", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - StartingProposalId, - Deposits, - Votes, - Proposals, - DepositParams, - VotingParams, - TallyParams, - Params, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "startingProposalId" | "starting_proposal_id" => Ok(GeneratedField::StartingProposalId), - "deposits" => Ok(GeneratedField::Deposits), - "votes" => Ok(GeneratedField::Votes), - "proposals" => Ok(GeneratedField::Proposals), - "depositParams" | "deposit_params" => Ok(GeneratedField::DepositParams), - "votingParams" | "voting_params" => Ok(GeneratedField::VotingParams), - "tallyParams" | "tally_params" => Ok(GeneratedField::TallyParams), - "params" => Ok(GeneratedField::Params), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GenesisState; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.GenesisState") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut starting_proposal_id__ = None; - let mut deposits__ = None; - let mut votes__ = None; - let mut proposals__ = None; - let mut deposit_params__ = None; - let mut voting_params__ = None; - let mut tally_params__ = None; - let mut params__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::StartingProposalId => { - if starting_proposal_id__.is_some() { - return Err(serde::de::Error::duplicate_field("startingProposalId")); - } - starting_proposal_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Deposits => { - if deposits__.is_some() { - return Err(serde::de::Error::duplicate_field("deposits")); - } - deposits__ = Some(map_.next_value()?); - } - GeneratedField::Votes => { - if votes__.is_some() { - return Err(serde::de::Error::duplicate_field("votes")); - } - votes__ = Some(map_.next_value()?); - } - GeneratedField::Proposals => { - if proposals__.is_some() { - return Err(serde::de::Error::duplicate_field("proposals")); - } - proposals__ = Some(map_.next_value()?); - } - GeneratedField::DepositParams => { - if deposit_params__.is_some() { - return Err(serde::de::Error::duplicate_field("depositParams")); - } - deposit_params__ = map_.next_value()?; - } - GeneratedField::VotingParams => { - if voting_params__.is_some() { - return Err(serde::de::Error::duplicate_field("votingParams")); - } - voting_params__ = map_.next_value()?; - } - GeneratedField::TallyParams => { - if tally_params__.is_some() { - return Err(serde::de::Error::duplicate_field("tallyParams")); - } - tally_params__ = map_.next_value()?; - } - GeneratedField::Params => { - if params__.is_some() { - return Err(serde::de::Error::duplicate_field("params")); - } - params__ = map_.next_value()?; - } - } - } - Ok(GenesisState { - starting_proposal_id: starting_proposal_id__.unwrap_or_default(), - deposits: deposits__.unwrap_or_default(), - votes: votes__.unwrap_or_default(), - proposals: proposals__.unwrap_or_default(), - deposit_params: deposit_params__, - voting_params: voting_params__, - tally_params: tally_params__, - params: params__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.GenesisState", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgDeposit { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgDeposit", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; - } - if true { - struct_ser.serialize_field("depositor", &self.depositor)?; - } - if true { - struct_ser.serialize_field("amount", &self.amount)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgDeposit { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposal_id", - "proposalId", - "depositor", - "amount", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ProposalId, - Depositor, - Amount, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), - "depositor" => Ok(GeneratedField::Depositor), - "amount" => Ok(GeneratedField::Amount), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgDeposit; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.MsgDeposit") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposal_id__ = None; - let mut depositor__ = None; - let mut amount__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ProposalId => { - if proposal_id__.is_some() { - return Err(serde::de::Error::duplicate_field("proposalId")); - } - proposal_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Depositor => { - if depositor__.is_some() { - return Err(serde::de::Error::duplicate_field("depositor")); - } - depositor__ = Some(map_.next_value()?); - } - GeneratedField::Amount => { - if amount__.is_some() { - return Err(serde::de::Error::duplicate_field("amount")); - } - amount__ = Some(map_.next_value()?); - } - } - } - Ok(MsgDeposit { - proposal_id: proposal_id__.unwrap_or_default(), - depositor: depositor__.unwrap_or_default(), - amount: amount__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.MsgDeposit", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgDepositResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgDepositResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgDepositResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgDepositResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.MsgDepositResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(MsgDepositResponse { - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.MsgDepositResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgExecLegacyContent { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgExecLegacyContent", len)?; - if let Some(v) = self.content.as_ref() { - struct_ser.serialize_field("content", v)?; - } - if true { - struct_ser.serialize_field("authority", &self.authority)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgExecLegacyContent { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "content", - "authority", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Content, - Authority, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "content" => Ok(GeneratedField::Content), - "authority" => Ok(GeneratedField::Authority), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgExecLegacyContent; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.MsgExecLegacyContent") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut content__ = None; - let mut authority__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Content => { - if content__.is_some() { - return Err(serde::de::Error::duplicate_field("content")); - } - content__ = map_.next_value()?; - } - GeneratedField::Authority => { - if authority__.is_some() { - return Err(serde::de::Error::duplicate_field("authority")); - } - authority__ = Some(map_.next_value()?); - } - } - } - Ok(MsgExecLegacyContent { - content: content__, - authority: authority__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.MsgExecLegacyContent", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgExecLegacyContentResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgExecLegacyContentResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgExecLegacyContentResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgExecLegacyContentResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.MsgExecLegacyContentResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(MsgExecLegacyContentResponse { - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.MsgExecLegacyContentResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgSubmitProposal { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgSubmitProposal", len)?; - if true { - struct_ser.serialize_field("messages", &self.messages)?; - } - if true { - struct_ser.serialize_field("initialDeposit", &self.initial_deposit)?; - } - if true { - struct_ser.serialize_field("proposer", &self.proposer)?; - } - if true { - struct_ser.serialize_field("metadata", &self.metadata)?; - } - if true { - struct_ser.serialize_field("title", &self.title)?; - } - if true { - struct_ser.serialize_field("summary", &self.summary)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgSubmitProposal { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "messages", - "initial_deposit", - "initialDeposit", - "proposer", - "metadata", - "title", - "summary", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Messages, - InitialDeposit, - Proposer, - Metadata, - Title, - Summary, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "messages" => Ok(GeneratedField::Messages), - "initialDeposit" | "initial_deposit" => Ok(GeneratedField::InitialDeposit), - "proposer" => Ok(GeneratedField::Proposer), - "metadata" => Ok(GeneratedField::Metadata), - "title" => Ok(GeneratedField::Title), - "summary" => Ok(GeneratedField::Summary), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgSubmitProposal; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.MsgSubmitProposal") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut messages__ = None; - let mut initial_deposit__ = None; - let mut proposer__ = None; - let mut metadata__ = None; - let mut title__ = None; - let mut summary__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Messages => { - if messages__.is_some() { - return Err(serde::de::Error::duplicate_field("messages")); - } - messages__ = Some(map_.next_value()?); - } - GeneratedField::InitialDeposit => { - if initial_deposit__.is_some() { - return Err(serde::de::Error::duplicate_field("initialDeposit")); - } - initial_deposit__ = Some(map_.next_value()?); - } - GeneratedField::Proposer => { - if proposer__.is_some() { - return Err(serde::de::Error::duplicate_field("proposer")); - } - proposer__ = Some(map_.next_value()?); - } - GeneratedField::Metadata => { - if metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("metadata")); - } - metadata__ = Some(map_.next_value()?); - } - GeneratedField::Title => { - if title__.is_some() { - return Err(serde::de::Error::duplicate_field("title")); - } - title__ = Some(map_.next_value()?); - } - GeneratedField::Summary => { - if summary__.is_some() { - return Err(serde::de::Error::duplicate_field("summary")); - } - summary__ = Some(map_.next_value()?); - } - } - } - Ok(MsgSubmitProposal { - messages: messages__.unwrap_or_default(), - initial_deposit: initial_deposit__.unwrap_or_default(), - proposer: proposer__.unwrap_or_default(), - metadata: metadata__.unwrap_or_default(), - title: title__.unwrap_or_default(), - summary: summary__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.MsgSubmitProposal", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgSubmitProposalResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgSubmitProposalResponse", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgSubmitProposalResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposal_id", - "proposalId", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ProposalId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgSubmitProposalResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.MsgSubmitProposalResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposal_id__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ProposalId => { - if proposal_id__.is_some() { - return Err(serde::de::Error::duplicate_field("proposalId")); - } - proposal_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(MsgSubmitProposalResponse { - proposal_id: proposal_id__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.MsgSubmitProposalResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgUpdateParams { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgUpdateParams", len)?; - if true { - struct_ser.serialize_field("authority", &self.authority)?; - } - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgUpdateParams { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "authority", - "params", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Authority, - Params, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "authority" => Ok(GeneratedField::Authority), - "params" => Ok(GeneratedField::Params), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgUpdateParams; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.MsgUpdateParams") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut authority__ = None; - let mut params__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Authority => { - if authority__.is_some() { - return Err(serde::de::Error::duplicate_field("authority")); - } - authority__ = Some(map_.next_value()?); - } - GeneratedField::Params => { - if params__.is_some() { - return Err(serde::de::Error::duplicate_field("params")); - } - params__ = map_.next_value()?; - } - } - } - Ok(MsgUpdateParams { - authority: authority__.unwrap_or_default(), - params: params__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.MsgUpdateParams", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgUpdateParamsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgUpdateParamsResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgUpdateParamsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgUpdateParamsResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.MsgUpdateParamsResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(MsgUpdateParamsResponse { - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.MsgUpdateParamsResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgVote { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgVote", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; - } - if true { - struct_ser.serialize_field("voter", &self.voter)?; - } - if true { - let v = VoteOption::try_from(self.option) - .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.option)))?; - struct_ser.serialize_field("option", &v)?; - } - if true { - struct_ser.serialize_field("metadata", &self.metadata)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgVote { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposal_id", - "proposalId", - "voter", - "option", - "metadata", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ProposalId, - Voter, - Option, - Metadata, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), - "voter" => Ok(GeneratedField::Voter), - "option" => Ok(GeneratedField::Option), - "metadata" => Ok(GeneratedField::Metadata), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgVote; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.MsgVote") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposal_id__ = None; - let mut voter__ = None; - let mut option__ = None; - let mut metadata__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ProposalId => { - if proposal_id__.is_some() { - return Err(serde::de::Error::duplicate_field("proposalId")); - } - proposal_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Voter => { - if voter__.is_some() { - return Err(serde::de::Error::duplicate_field("voter")); - } - voter__ = Some(map_.next_value()?); - } - GeneratedField::Option => { - if option__.is_some() { - return Err(serde::de::Error::duplicate_field("option")); - } - option__ = Some(map_.next_value::()? as i32); - } - GeneratedField::Metadata => { - if metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("metadata")); - } - metadata__ = Some(map_.next_value()?); - } - } - } - Ok(MsgVote { - proposal_id: proposal_id__.unwrap_or_default(), - voter: voter__.unwrap_or_default(), - option: option__.unwrap_or_default(), - metadata: metadata__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.MsgVote", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgVoteResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgVoteResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgVoteResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgVoteResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.MsgVoteResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(MsgVoteResponse { - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.MsgVoteResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgVoteWeighted { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgVoteWeighted", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; - } - if true { - struct_ser.serialize_field("voter", &self.voter)?; - } - if true { - struct_ser.serialize_field("options", &self.options)?; - } - if true { - struct_ser.serialize_field("metadata", &self.metadata)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgVoteWeighted { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposal_id", - "proposalId", - "voter", - "options", - "metadata", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ProposalId, - Voter, - Options, - Metadata, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), - "voter" => Ok(GeneratedField::Voter), - "options" => Ok(GeneratedField::Options), - "metadata" => Ok(GeneratedField::Metadata), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgVoteWeighted; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.MsgVoteWeighted") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposal_id__ = None; - let mut voter__ = None; - let mut options__ = None; - let mut metadata__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ProposalId => { - if proposal_id__.is_some() { - return Err(serde::de::Error::duplicate_field("proposalId")); - } - proposal_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Voter => { - if voter__.is_some() { - return Err(serde::de::Error::duplicate_field("voter")); - } - voter__ = Some(map_.next_value()?); - } - GeneratedField::Options => { - if options__.is_some() { - return Err(serde::de::Error::duplicate_field("options")); - } - options__ = Some(map_.next_value()?); - } - GeneratedField::Metadata => { - if metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("metadata")); - } - metadata__ = Some(map_.next_value()?); - } - } - } - Ok(MsgVoteWeighted { - proposal_id: proposal_id__.unwrap_or_default(), - voter: voter__.unwrap_or_default(), - options: options__.unwrap_or_default(), - metadata: metadata__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.MsgVoteWeighted", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgVoteWeightedResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgVoteWeightedResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgVoteWeightedResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgVoteWeightedResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.MsgVoteWeightedResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(MsgVoteWeightedResponse { - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.MsgVoteWeightedResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Params { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.Params", len)?; - if true { - struct_ser.serialize_field("minDeposit", &self.min_deposit)?; - } - if let Some(v) = self.max_deposit_period.as_ref() { - struct_ser.serialize_field("maxDepositPeriod", v)?; - } - if let Some(v) = self.voting_period.as_ref() { - struct_ser.serialize_field("votingPeriod", v)?; - } - if true { - struct_ser.serialize_field("quorum", &self.quorum)?; - } - if true { - struct_ser.serialize_field("threshold", &self.threshold)?; - } - if true { - struct_ser.serialize_field("vetoThreshold", &self.veto_threshold)?; - } - if true { - struct_ser.serialize_field("minInitialDepositRatio", &self.min_initial_deposit_ratio)?; - } - if true { - struct_ser.serialize_field("burnVoteQuorum", &self.burn_vote_quorum)?; - } - if true { - struct_ser.serialize_field("burnProposalDepositPrevote", &self.burn_proposal_deposit_prevote)?; - } - if true { - struct_ser.serialize_field("burnVoteVeto", &self.burn_vote_veto)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Params { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "min_deposit", - "minDeposit", - "max_deposit_period", - "maxDepositPeriod", - "voting_period", - "votingPeriod", - "quorum", - "threshold", - "veto_threshold", - "vetoThreshold", - "min_initial_deposit_ratio", - "minInitialDepositRatio", - "burn_vote_quorum", - "burnVoteQuorum", - "burn_proposal_deposit_prevote", - "burnProposalDepositPrevote", - "burn_vote_veto", - "burnVoteVeto", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - MinDeposit, - MaxDepositPeriod, - VotingPeriod, - Quorum, - Threshold, - VetoThreshold, - MinInitialDepositRatio, - BurnVoteQuorum, - BurnProposalDepositPrevote, - BurnVoteVeto, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "minDeposit" | "min_deposit" => Ok(GeneratedField::MinDeposit), - "maxDepositPeriod" | "max_deposit_period" => Ok(GeneratedField::MaxDepositPeriod), - "votingPeriod" | "voting_period" => Ok(GeneratedField::VotingPeriod), - "quorum" => Ok(GeneratedField::Quorum), - "threshold" => Ok(GeneratedField::Threshold), - "vetoThreshold" | "veto_threshold" => Ok(GeneratedField::VetoThreshold), - "minInitialDepositRatio" | "min_initial_deposit_ratio" => Ok(GeneratedField::MinInitialDepositRatio), - "burnVoteQuorum" | "burn_vote_quorum" => Ok(GeneratedField::BurnVoteQuorum), - "burnProposalDepositPrevote" | "burn_proposal_deposit_prevote" => Ok(GeneratedField::BurnProposalDepositPrevote), - "burnVoteVeto" | "burn_vote_veto" => Ok(GeneratedField::BurnVoteVeto), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Params; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.Params") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut min_deposit__ = None; - let mut max_deposit_period__ = None; - let mut voting_period__ = None; - let mut quorum__ = None; - let mut threshold__ = None; - let mut veto_threshold__ = None; - let mut min_initial_deposit_ratio__ = None; - let mut burn_vote_quorum__ = None; - let mut burn_proposal_deposit_prevote__ = None; - let mut burn_vote_veto__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::MinDeposit => { - if min_deposit__.is_some() { - return Err(serde::de::Error::duplicate_field("minDeposit")); - } - min_deposit__ = Some(map_.next_value()?); - } - GeneratedField::MaxDepositPeriod => { - if max_deposit_period__.is_some() { - return Err(serde::de::Error::duplicate_field("maxDepositPeriod")); - } - max_deposit_period__ = map_.next_value()?; - } - GeneratedField::VotingPeriod => { - if voting_period__.is_some() { - return Err(serde::de::Error::duplicate_field("votingPeriod")); - } - voting_period__ = map_.next_value()?; - } - GeneratedField::Quorum => { - if quorum__.is_some() { - return Err(serde::de::Error::duplicate_field("quorum")); - } - quorum__ = Some(map_.next_value()?); - } - GeneratedField::Threshold => { - if threshold__.is_some() { - return Err(serde::de::Error::duplicate_field("threshold")); - } - threshold__ = Some(map_.next_value()?); - } - GeneratedField::VetoThreshold => { - if veto_threshold__.is_some() { - return Err(serde::de::Error::duplicate_field("vetoThreshold")); - } - veto_threshold__ = Some(map_.next_value()?); - } - GeneratedField::MinInitialDepositRatio => { - if min_initial_deposit_ratio__.is_some() { - return Err(serde::de::Error::duplicate_field("minInitialDepositRatio")); - } - min_initial_deposit_ratio__ = Some(map_.next_value()?); - } - GeneratedField::BurnVoteQuorum => { - if burn_vote_quorum__.is_some() { - return Err(serde::de::Error::duplicate_field("burnVoteQuorum")); - } - burn_vote_quorum__ = Some(map_.next_value()?); - } - GeneratedField::BurnProposalDepositPrevote => { - if burn_proposal_deposit_prevote__.is_some() { - return Err(serde::de::Error::duplicate_field("burnProposalDepositPrevote")); - } - burn_proposal_deposit_prevote__ = Some(map_.next_value()?); - } - GeneratedField::BurnVoteVeto => { - if burn_vote_veto__.is_some() { - return Err(serde::de::Error::duplicate_field("burnVoteVeto")); - } - burn_vote_veto__ = Some(map_.next_value()?); - } - } - } - Ok(Params { - min_deposit: min_deposit__.unwrap_or_default(), - max_deposit_period: max_deposit_period__, - voting_period: voting_period__, - quorum: quorum__.unwrap_or_default(), - threshold: threshold__.unwrap_or_default(), - veto_threshold: veto_threshold__.unwrap_or_default(), - min_initial_deposit_ratio: min_initial_deposit_ratio__.unwrap_or_default(), - burn_vote_quorum: burn_vote_quorum__.unwrap_or_default(), - burn_proposal_deposit_prevote: burn_proposal_deposit_prevote__.unwrap_or_default(), - burn_vote_veto: burn_vote_veto__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.Params", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Proposal { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.Proposal", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("id", ::alloc::string::ToString::to_string(&self.id).as_str())?; - } - if true { - struct_ser.serialize_field("messages", &self.messages)?; - } - if true { - let v = ProposalStatus::try_from(self.status) - .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.status)))?; - struct_ser.serialize_field("status", &v)?; - } - if let Some(v) = self.final_tally_result.as_ref() { - struct_ser.serialize_field("finalTallyResult", v)?; - } - if let Some(v) = self.submit_time.as_ref() { - struct_ser.serialize_field("submitTime", v)?; - } - if let Some(v) = self.deposit_end_time.as_ref() { - struct_ser.serialize_field("depositEndTime", v)?; - } - if true { - struct_ser.serialize_field("totalDeposit", &self.total_deposit)?; - } - if let Some(v) = self.voting_start_time.as_ref() { - struct_ser.serialize_field("votingStartTime", v)?; - } - if let Some(v) = self.voting_end_time.as_ref() { - struct_ser.serialize_field("votingEndTime", v)?; - } - if true { - struct_ser.serialize_field("metadata", &self.metadata)?; - } - if true { - struct_ser.serialize_field("title", &self.title)?; - } - if true { - struct_ser.serialize_field("summary", &self.summary)?; - } - if true { - struct_ser.serialize_field("proposer", &self.proposer)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Proposal { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "id", - "messages", - "status", - "final_tally_result", - "finalTallyResult", - "submit_time", - "submitTime", - "deposit_end_time", - "depositEndTime", - "total_deposit", - "totalDeposit", - "voting_start_time", - "votingStartTime", - "voting_end_time", - "votingEndTime", - "metadata", - "title", - "summary", - "proposer", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Id, - Messages, - Status, - FinalTallyResult, - SubmitTime, - DepositEndTime, - TotalDeposit, - VotingStartTime, - VotingEndTime, - Metadata, - Title, - Summary, - Proposer, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "id" => Ok(GeneratedField::Id), - "messages" => Ok(GeneratedField::Messages), - "status" => Ok(GeneratedField::Status), - "finalTallyResult" | "final_tally_result" => Ok(GeneratedField::FinalTallyResult), - "submitTime" | "submit_time" => Ok(GeneratedField::SubmitTime), - "depositEndTime" | "deposit_end_time" => Ok(GeneratedField::DepositEndTime), - "totalDeposit" | "total_deposit" => Ok(GeneratedField::TotalDeposit), - "votingStartTime" | "voting_start_time" => Ok(GeneratedField::VotingStartTime), - "votingEndTime" | "voting_end_time" => Ok(GeneratedField::VotingEndTime), - "metadata" => Ok(GeneratedField::Metadata), - "title" => Ok(GeneratedField::Title), - "summary" => Ok(GeneratedField::Summary), - "proposer" => Ok(GeneratedField::Proposer), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Proposal; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.Proposal") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut id__ = None; - let mut messages__ = None; - let mut status__ = None; - let mut final_tally_result__ = None; - let mut submit_time__ = None; - let mut deposit_end_time__ = None; - let mut total_deposit__ = None; - let mut voting_start_time__ = None; - let mut voting_end_time__ = None; - let mut metadata__ = None; - let mut title__ = None; - let mut summary__ = None; - let mut proposer__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Id => { - if id__.is_some() { - return Err(serde::de::Error::duplicate_field("id")); - } - id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Messages => { - if messages__.is_some() { - return Err(serde::de::Error::duplicate_field("messages")); - } - messages__ = Some(map_.next_value()?); - } - GeneratedField::Status => { - if status__.is_some() { - return Err(serde::de::Error::duplicate_field("status")); - } - status__ = Some(map_.next_value::()? as i32); - } - GeneratedField::FinalTallyResult => { - if final_tally_result__.is_some() { - return Err(serde::de::Error::duplicate_field("finalTallyResult")); - } - final_tally_result__ = map_.next_value()?; - } - GeneratedField::SubmitTime => { - if submit_time__.is_some() { - return Err(serde::de::Error::duplicate_field("submitTime")); - } - submit_time__ = map_.next_value()?; - } - GeneratedField::DepositEndTime => { - if deposit_end_time__.is_some() { - return Err(serde::de::Error::duplicate_field("depositEndTime")); - } - deposit_end_time__ = map_.next_value()?; - } - GeneratedField::TotalDeposit => { - if total_deposit__.is_some() { - return Err(serde::de::Error::duplicate_field("totalDeposit")); - } - total_deposit__ = Some(map_.next_value()?); - } - GeneratedField::VotingStartTime => { - if voting_start_time__.is_some() { - return Err(serde::de::Error::duplicate_field("votingStartTime")); - } - voting_start_time__ = map_.next_value()?; - } - GeneratedField::VotingEndTime => { - if voting_end_time__.is_some() { - return Err(serde::de::Error::duplicate_field("votingEndTime")); - } - voting_end_time__ = map_.next_value()?; - } - GeneratedField::Metadata => { - if metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("metadata")); - } - metadata__ = Some(map_.next_value()?); - } - GeneratedField::Title => { - if title__.is_some() { - return Err(serde::de::Error::duplicate_field("title")); - } - title__ = Some(map_.next_value()?); - } - GeneratedField::Summary => { - if summary__.is_some() { - return Err(serde::de::Error::duplicate_field("summary")); - } - summary__ = Some(map_.next_value()?); - } - GeneratedField::Proposer => { - if proposer__.is_some() { - return Err(serde::de::Error::duplicate_field("proposer")); - } - proposer__ = Some(map_.next_value()?); - } - } - } - Ok(Proposal { - id: id__.unwrap_or_default(), - messages: messages__.unwrap_or_default(), - status: status__.unwrap_or_default(), - final_tally_result: final_tally_result__, - submit_time: submit_time__, - deposit_end_time: deposit_end_time__, - total_deposit: total_deposit__.unwrap_or_default(), - voting_start_time: voting_start_time__, - voting_end_time: voting_end_time__, - metadata: metadata__.unwrap_or_default(), - title: title__.unwrap_or_default(), - summary: summary__.unwrap_or_default(), - proposer: proposer__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.Proposal", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for ProposalStatus { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::Unspecified => "PROPOSAL_STATUS_UNSPECIFIED", - Self::DepositPeriod => "PROPOSAL_STATUS_DEPOSIT_PERIOD", - Self::VotingPeriod => "PROPOSAL_STATUS_VOTING_PERIOD", - Self::Passed => "PROPOSAL_STATUS_PASSED", - Self::Rejected => "PROPOSAL_STATUS_REJECTED", - Self::Failed => "PROPOSAL_STATUS_FAILED", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for ProposalStatus { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "PROPOSAL_STATUS_UNSPECIFIED", - "PROPOSAL_STATUS_DEPOSIT_PERIOD", - "PROPOSAL_STATUS_VOTING_PERIOD", - "PROPOSAL_STATUS_PASSED", - "PROPOSAL_STATUS_REJECTED", - "PROPOSAL_STATUS_FAILED", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ProposalStatus; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - fn visit_i64(self, v: i64) -> core::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> core::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "PROPOSAL_STATUS_UNSPECIFIED" => Ok(ProposalStatus::Unspecified), - "PROPOSAL_STATUS_DEPOSIT_PERIOD" => Ok(ProposalStatus::DepositPeriod), - "PROPOSAL_STATUS_VOTING_PERIOD" => Ok(ProposalStatus::VotingPeriod), - "PROPOSAL_STATUS_PASSED" => Ok(ProposalStatus::Passed), - "PROPOSAL_STATUS_REJECTED" => Ok(ProposalStatus::Rejected), - "PROPOSAL_STATUS_FAILED" => Ok(ProposalStatus::Failed), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for QueryDepositRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryDepositRequest", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; - } - if true { - struct_ser.serialize_field("depositor", &self.depositor)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDepositRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposal_id", - "proposalId", - "depositor", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ProposalId, - Depositor, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), - "depositor" => Ok(GeneratedField::Depositor), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryDepositRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.QueryDepositRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposal_id__ = None; - let mut depositor__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ProposalId => { - if proposal_id__.is_some() { - return Err(serde::de::Error::duplicate_field("proposalId")); - } - proposal_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Depositor => { - if depositor__.is_some() { - return Err(serde::de::Error::duplicate_field("depositor")); - } - depositor__ = Some(map_.next_value()?); - } - } - } - Ok(QueryDepositRequest { - proposal_id: proposal_id__.unwrap_or_default(), - depositor: depositor__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.QueryDepositRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryDepositResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryDepositResponse", len)?; - if let Some(v) = self.deposit.as_ref() { - struct_ser.serialize_field("deposit", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDepositResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "deposit", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Deposit, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "deposit" => Ok(GeneratedField::Deposit), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryDepositResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.QueryDepositResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut deposit__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Deposit => { - if deposit__.is_some() { - return Err(serde::de::Error::duplicate_field("deposit")); - } - deposit__ = map_.next_value()?; - } - } - } - Ok(QueryDepositResponse { - deposit: deposit__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.QueryDepositResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryDepositsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryDepositsRequest", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDepositsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposal_id", - "proposalId", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ProposalId, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryDepositsRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.QueryDepositsRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposal_id__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ProposalId => { - if proposal_id__.is_some() { - return Err(serde::de::Error::duplicate_field("proposalId")); - } - proposal_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryDepositsRequest { - proposal_id: proposal_id__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.QueryDepositsRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryDepositsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryDepositsResponse", len)?; - if true { - struct_ser.serialize_field("deposits", &self.deposits)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDepositsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "deposits", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Deposits, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "deposits" => Ok(GeneratedField::Deposits), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryDepositsResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.QueryDepositsResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut deposits__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Deposits => { - if deposits__.is_some() { - return Err(serde::de::Error::duplicate_field("deposits")); - } - deposits__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryDepositsResponse { - deposits: deposits__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.QueryDepositsResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryParamsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryParamsRequest", len)?; - if true { - struct_ser.serialize_field("paramsType", &self.params_type)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryParamsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "params_type", - "paramsType", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ParamsType, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "paramsType" | "params_type" => Ok(GeneratedField::ParamsType), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryParamsRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.QueryParamsRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut params_type__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ParamsType => { - if params_type__.is_some() { - return Err(serde::de::Error::duplicate_field("paramsType")); - } - params_type__ = Some(map_.next_value()?); - } - } - } - Ok(QueryParamsRequest { - params_type: params_type__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.QueryParamsRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryParamsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryParamsResponse", len)?; - if let Some(v) = self.voting_params.as_ref() { - struct_ser.serialize_field("votingParams", v)?; - } - if let Some(v) = self.deposit_params.as_ref() { - struct_ser.serialize_field("depositParams", v)?; - } - if let Some(v) = self.tally_params.as_ref() { - struct_ser.serialize_field("tallyParams", v)?; - } - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryParamsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "voting_params", - "votingParams", - "deposit_params", - "depositParams", - "tally_params", - "tallyParams", - "params", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - VotingParams, - DepositParams, - TallyParams, - Params, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "votingParams" | "voting_params" => Ok(GeneratedField::VotingParams), - "depositParams" | "deposit_params" => Ok(GeneratedField::DepositParams), - "tallyParams" | "tally_params" => Ok(GeneratedField::TallyParams), - "params" => Ok(GeneratedField::Params), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryParamsResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.QueryParamsResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut voting_params__ = None; - let mut deposit_params__ = None; - let mut tally_params__ = None; - let mut params__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::VotingParams => { - if voting_params__.is_some() { - return Err(serde::de::Error::duplicate_field("votingParams")); - } - voting_params__ = map_.next_value()?; - } - GeneratedField::DepositParams => { - if deposit_params__.is_some() { - return Err(serde::de::Error::duplicate_field("depositParams")); - } - deposit_params__ = map_.next_value()?; - } - GeneratedField::TallyParams => { - if tally_params__.is_some() { - return Err(serde::de::Error::duplicate_field("tallyParams")); - } - tally_params__ = map_.next_value()?; - } - GeneratedField::Params => { - if params__.is_some() { - return Err(serde::de::Error::duplicate_field("params")); - } - params__ = map_.next_value()?; - } - } - } - Ok(QueryParamsResponse { - voting_params: voting_params__, - deposit_params: deposit_params__, - tally_params: tally_params__, - params: params__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.QueryParamsResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryProposalRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryProposalRequest", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryProposalRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposal_id", - "proposalId", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ProposalId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryProposalRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.QueryProposalRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposal_id__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ProposalId => { - if proposal_id__.is_some() { - return Err(serde::de::Error::duplicate_field("proposalId")); - } - proposal_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(QueryProposalRequest { - proposal_id: proposal_id__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.QueryProposalRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryProposalResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryProposalResponse", len)?; - if let Some(v) = self.proposal.as_ref() { - struct_ser.serialize_field("proposal", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryProposalResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposal", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Proposal, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposal" => Ok(GeneratedField::Proposal), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryProposalResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.QueryProposalResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposal__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Proposal => { - if proposal__.is_some() { - return Err(serde::de::Error::duplicate_field("proposal")); - } - proposal__ = map_.next_value()?; - } - } - } - Ok(QueryProposalResponse { - proposal: proposal__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.QueryProposalResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryProposalsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryProposalsRequest", len)?; - if true { - let v = ProposalStatus::try_from(self.proposal_status) - .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.proposal_status)))?; - struct_ser.serialize_field("proposalStatus", &v)?; - } - if true { - struct_ser.serialize_field("voter", &self.voter)?; - } - if true { - struct_ser.serialize_field("depositor", &self.depositor)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryProposalsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposal_status", - "proposalStatus", - "voter", - "depositor", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ProposalStatus, - Voter, - Depositor, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposalStatus" | "proposal_status" => Ok(GeneratedField::ProposalStatus), - "voter" => Ok(GeneratedField::Voter), - "depositor" => Ok(GeneratedField::Depositor), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryProposalsRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.QueryProposalsRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposal_status__ = None; - let mut voter__ = None; - let mut depositor__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ProposalStatus => { - if proposal_status__.is_some() { - return Err(serde::de::Error::duplicate_field("proposalStatus")); - } - proposal_status__ = Some(map_.next_value::()? as i32); - } - GeneratedField::Voter => { - if voter__.is_some() { - return Err(serde::de::Error::duplicate_field("voter")); - } - voter__ = Some(map_.next_value()?); - } - GeneratedField::Depositor => { - if depositor__.is_some() { - return Err(serde::de::Error::duplicate_field("depositor")); - } - depositor__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryProposalsRequest { - proposal_status: proposal_status__.unwrap_or_default(), - voter: voter__.unwrap_or_default(), - depositor: depositor__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.QueryProposalsRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryProposalsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryProposalsResponse", len)?; - if true { - struct_ser.serialize_field("proposals", &self.proposals)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryProposalsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposals", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Proposals, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposals" => Ok(GeneratedField::Proposals), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryProposalsResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.QueryProposalsResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposals__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Proposals => { - if proposals__.is_some() { - return Err(serde::de::Error::duplicate_field("proposals")); - } - proposals__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryProposalsResponse { - proposals: proposals__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.QueryProposalsResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryTallyResultRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryTallyResultRequest", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryTallyResultRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposal_id", - "proposalId", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ProposalId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryTallyResultRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.QueryTallyResultRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposal_id__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ProposalId => { - if proposal_id__.is_some() { - return Err(serde::de::Error::duplicate_field("proposalId")); - } - proposal_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(QueryTallyResultRequest { - proposal_id: proposal_id__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.QueryTallyResultRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryTallyResultResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryTallyResultResponse", len)?; - if let Some(v) = self.tally.as_ref() { - struct_ser.serialize_field("tally", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryTallyResultResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "tally", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Tally, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "tally" => Ok(GeneratedField::Tally), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryTallyResultResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.QueryTallyResultResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut tally__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Tally => { - if tally__.is_some() { - return Err(serde::de::Error::duplicate_field("tally")); - } - tally__ = map_.next_value()?; - } - } - } - Ok(QueryTallyResultResponse { - tally: tally__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.QueryTallyResultResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryVoteRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryVoteRequest", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; - } - if true { - struct_ser.serialize_field("voter", &self.voter)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryVoteRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposal_id", - "proposalId", - "voter", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ProposalId, - Voter, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), - "voter" => Ok(GeneratedField::Voter), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryVoteRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.QueryVoteRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposal_id__ = None; - let mut voter__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ProposalId => { - if proposal_id__.is_some() { - return Err(serde::de::Error::duplicate_field("proposalId")); - } - proposal_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Voter => { - if voter__.is_some() { - return Err(serde::de::Error::duplicate_field("voter")); - } - voter__ = Some(map_.next_value()?); - } - } - } - Ok(QueryVoteRequest { - proposal_id: proposal_id__.unwrap_or_default(), - voter: voter__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.QueryVoteRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryVoteResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryVoteResponse", len)?; - if let Some(v) = self.vote.as_ref() { - struct_ser.serialize_field("vote", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryVoteResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "vote", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Vote, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "vote" => Ok(GeneratedField::Vote), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryVoteResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.QueryVoteResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut vote__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Vote => { - if vote__.is_some() { - return Err(serde::de::Error::duplicate_field("vote")); - } - vote__ = map_.next_value()?; - } - } - } - Ok(QueryVoteResponse { - vote: vote__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.QueryVoteResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryVotesRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryVotesRequest", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryVotesRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposal_id", - "proposalId", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ProposalId, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryVotesRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.QueryVotesRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposal_id__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ProposalId => { - if proposal_id__.is_some() { - return Err(serde::de::Error::duplicate_field("proposalId")); - } - proposal_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryVotesRequest { - proposal_id: proposal_id__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.QueryVotesRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryVotesResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryVotesResponse", len)?; - if true { - struct_ser.serialize_field("votes", &self.votes)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryVotesResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "votes", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Votes, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "votes" => Ok(GeneratedField::Votes), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryVotesResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.QueryVotesResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut votes__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Votes => { - if votes__.is_some() { - return Err(serde::de::Error::duplicate_field("votes")); - } - votes__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryVotesResponse { - votes: votes__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.QueryVotesResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for TallyParams { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.TallyParams", len)?; - if true { - struct_ser.serialize_field("quorum", &self.quorum)?; - } - if true { - struct_ser.serialize_field("threshold", &self.threshold)?; - } - if true { - struct_ser.serialize_field("vetoThreshold", &self.veto_threshold)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for TallyParams { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "quorum", - "threshold", - "veto_threshold", - "vetoThreshold", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Quorum, - Threshold, - VetoThreshold, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "quorum" => Ok(GeneratedField::Quorum), - "threshold" => Ok(GeneratedField::Threshold), - "vetoThreshold" | "veto_threshold" => Ok(GeneratedField::VetoThreshold), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TallyParams; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.TallyParams") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut quorum__ = None; - let mut threshold__ = None; - let mut veto_threshold__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Quorum => { - if quorum__.is_some() { - return Err(serde::de::Error::duplicate_field("quorum")); - } - quorum__ = Some(map_.next_value()?); - } - GeneratedField::Threshold => { - if threshold__.is_some() { - return Err(serde::de::Error::duplicate_field("threshold")); - } - threshold__ = Some(map_.next_value()?); - } - GeneratedField::VetoThreshold => { - if veto_threshold__.is_some() { - return Err(serde::de::Error::duplicate_field("vetoThreshold")); - } - veto_threshold__ = Some(map_.next_value()?); - } - } - } - Ok(TallyParams { - quorum: quorum__.unwrap_or_default(), - threshold: threshold__.unwrap_or_default(), - veto_threshold: veto_threshold__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.TallyParams", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for TallyResult { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.TallyResult", len)?; - if true { - struct_ser.serialize_field("yesCount", &self.yes_count)?; - } - if true { - struct_ser.serialize_field("abstainCount", &self.abstain_count)?; - } - if true { - struct_ser.serialize_field("noCount", &self.no_count)?; - } - if true { - struct_ser.serialize_field("noWithVetoCount", &self.no_with_veto_count)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for TallyResult { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "yes_count", - "yesCount", - "abstain_count", - "abstainCount", - "no_count", - "noCount", - "no_with_veto_count", - "noWithVetoCount", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - YesCount, - AbstainCount, - NoCount, - NoWithVetoCount, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "yesCount" | "yes_count" => Ok(GeneratedField::YesCount), - "abstainCount" | "abstain_count" => Ok(GeneratedField::AbstainCount), - "noCount" | "no_count" => Ok(GeneratedField::NoCount), - "noWithVetoCount" | "no_with_veto_count" => Ok(GeneratedField::NoWithVetoCount), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TallyResult; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.TallyResult") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut yes_count__ = None; - let mut abstain_count__ = None; - let mut no_count__ = None; - let mut no_with_veto_count__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::YesCount => { - if yes_count__.is_some() { - return Err(serde::de::Error::duplicate_field("yesCount")); - } - yes_count__ = Some(map_.next_value()?); - } - GeneratedField::AbstainCount => { - if abstain_count__.is_some() { - return Err(serde::de::Error::duplicate_field("abstainCount")); - } - abstain_count__ = Some(map_.next_value()?); - } - GeneratedField::NoCount => { - if no_count__.is_some() { - return Err(serde::de::Error::duplicate_field("noCount")); - } - no_count__ = Some(map_.next_value()?); - } - GeneratedField::NoWithVetoCount => { - if no_with_veto_count__.is_some() { - return Err(serde::de::Error::duplicate_field("noWithVetoCount")); - } - no_with_veto_count__ = Some(map_.next_value()?); - } - } - } - Ok(TallyResult { - yes_count: yes_count__.unwrap_or_default(), - abstain_count: abstain_count__.unwrap_or_default(), - no_count: no_count__.unwrap_or_default(), - no_with_veto_count: no_with_veto_count__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.TallyResult", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Vote { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.Vote", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; - } - if true { - struct_ser.serialize_field("voter", &self.voter)?; - } - if true { - struct_ser.serialize_field("options", &self.options)?; - } - if true { - struct_ser.serialize_field("metadata", &self.metadata)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Vote { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposal_id", - "proposalId", - "voter", - "options", - "metadata", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ProposalId, - Voter, - Options, - Metadata, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), - "voter" => Ok(GeneratedField::Voter), - "options" => Ok(GeneratedField::Options), - "metadata" => Ok(GeneratedField::Metadata), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Vote; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.Vote") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposal_id__ = None; - let mut voter__ = None; - let mut options__ = None; - let mut metadata__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ProposalId => { - if proposal_id__.is_some() { - return Err(serde::de::Error::duplicate_field("proposalId")); - } - proposal_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Voter => { - if voter__.is_some() { - return Err(serde::de::Error::duplicate_field("voter")); - } - voter__ = Some(map_.next_value()?); - } - GeneratedField::Options => { - if options__.is_some() { - return Err(serde::de::Error::duplicate_field("options")); - } - options__ = Some(map_.next_value()?); - } - GeneratedField::Metadata => { - if metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("metadata")); - } - metadata__ = Some(map_.next_value()?); - } - } - } - Ok(Vote { - proposal_id: proposal_id__.unwrap_or_default(), - voter: voter__.unwrap_or_default(), - options: options__.unwrap_or_default(), - metadata: metadata__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.Vote", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for VoteOption { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::Unspecified => "VOTE_OPTION_UNSPECIFIED", - Self::Yes => "VOTE_OPTION_YES", - Self::Abstain => "VOTE_OPTION_ABSTAIN", - Self::No => "VOTE_OPTION_NO", - Self::NoWithVeto => "VOTE_OPTION_NO_WITH_VETO", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for VoteOption { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "VOTE_OPTION_UNSPECIFIED", - "VOTE_OPTION_YES", - "VOTE_OPTION_ABSTAIN", - "VOTE_OPTION_NO", - "VOTE_OPTION_NO_WITH_VETO", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = VoteOption; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - fn visit_i64(self, v: i64) -> core::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> core::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "VOTE_OPTION_UNSPECIFIED" => Ok(VoteOption::Unspecified), - "VOTE_OPTION_YES" => Ok(VoteOption::Yes), - "VOTE_OPTION_ABSTAIN" => Ok(VoteOption::Abstain), - "VOTE_OPTION_NO" => Ok(VoteOption::No), - "VOTE_OPTION_NO_WITH_VETO" => Ok(VoteOption::NoWithVeto), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for VotingParams { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.VotingParams", len)?; - if let Some(v) = self.voting_period.as_ref() { - struct_ser.serialize_field("votingPeriod", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for VotingParams { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "voting_period", - "votingPeriod", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - VotingPeriod, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "votingPeriod" | "voting_period" => Ok(GeneratedField::VotingPeriod), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = VotingParams; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.VotingParams") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut voting_period__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::VotingPeriod => { - if voting_period__.is_some() { - return Err(serde::de::Error::duplicate_field("votingPeriod")); - } - voting_period__ = map_.next_value()?; - } - } - } - Ok(VotingParams { - voting_period: voting_period__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.VotingParams", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for WeightedVoteOption { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.WeightedVoteOption", len)?; - if true { - let v = VoteOption::try_from(self.option) - .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.option)))?; - struct_ser.serialize_field("option", &v)?; - } - if true { - struct_ser.serialize_field("weight", &self.weight)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for WeightedVoteOption { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "option", - "weight", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Option, - Weight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "option" => Ok(GeneratedField::Option), - "weight" => Ok(GeneratedField::Weight), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = WeightedVoteOption; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.WeightedVoteOption") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut option__ = None; - let mut weight__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Option => { - if option__.is_some() { - return Err(serde::de::Error::duplicate_field("option")); - } - option__ = Some(map_.next_value::()? as i32); - } - GeneratedField::Weight => { - if weight__.is_some() { - return Err(serde::de::Error::duplicate_field("weight")); - } - weight__ = Some(map_.next_value()?); - } - } - } - Ok(WeightedVoteOption { - option: option__.unwrap_or_default(), - weight: weight__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.WeightedVoteOption", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.gov.v1beta1.rs b/src/prost/cosmos.gov.v1beta1.rs deleted file mode 100644 index 4ebad1a4..00000000 --- a/src/prost/cosmos.gov.v1beta1.rs +++ /dev/null @@ -1,2231 +0,0 @@ -// This file is @generated by prost-build. -/// WeightedVoteOption defines a unit of vote for vote split. -/// -/// Since: cosmos-sdk 0.43 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct WeightedVoteOption { - /// option defines the valid vote options, it must not contain duplicate vote options. - #[prost(enumeration = "VoteOption", tag = "1")] - pub option: i32, - /// weight is the vote weight associated with the vote option. - #[prost(string, tag = "2")] - pub weight: ::prost::alloc::string::String, -} -impl ::prost::Name for WeightedVoteOption { - const NAME: &'static str = "WeightedVoteOption"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.WeightedVoteOption".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.WeightedVoteOption".into() - } -} -/// TextProposal defines a standard text proposal whose changes need to be -/// manually updated in case of approval. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -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, -} -impl ::prost::Name for TextProposal { - const NAME: &'static str = "TextProposal"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.TextProposal".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.TextProposal".into() - } -} -/// Deposit defines an amount deposited by an account address to an active -/// proposal. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Deposit { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - 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, -} -impl ::prost::Name for Deposit { - const NAME: &'static str = "Deposit"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.Deposit".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.Deposit".into() - } -} -/// Proposal defines the core field members of a governance proposal. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Proposal { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - pub proposal_id: u64, - /// content is the proposal's content. - #[prost(message, optional, tag = "2")] - pub content: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, - /// status defines the proposal status. - #[prost(enumeration = "ProposalStatus", tag = "3")] - pub status: i32, - /// final_tally_result is the final tally result of the proposal. When - /// querying a proposal via gRPC, this field is not populated until the - /// 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< - ::tendermint_proto::google::protobuf::Timestamp, - >, - /// deposit_end_time is the end time for deposition. - #[prost(message, optional, tag = "6")] - pub deposit_end_time: ::core::option::Option< - ::tendermint_proto::google::protobuf::Timestamp, - >, - /// 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< - ::tendermint_proto::google::protobuf::Timestamp, - >, - /// voting_end_time is the end time of voting on a proposal. - #[prost(message, optional, tag = "9")] - pub voting_end_time: ::core::option::Option< - ::tendermint_proto::google::protobuf::Timestamp, - >, -} -impl ::prost::Name for Proposal { - const NAME: &'static str = "Proposal"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.Proposal".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.Proposal".into() - } -} -/// TallyResult defines a standard tally for a governance proposal. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -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, -} -impl ::prost::Name for TallyResult { - const NAME: &'static str = "TallyResult"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.TallyResult".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.TallyResult".into() - } -} -/// Vote defines a vote on a governance proposal. -/// A Vote consists of a proposal ID, the voter, and the vote option. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Vote { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - 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 - /// if and only if `len(options) == 1` and that option has weight 1. In all - /// other cases, this field will default to VOTE_OPTION_UNSPECIFIED. - #[deprecated] - #[prost(enumeration = "VoteOption", tag = "3")] - 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, -} -impl ::prost::Name for Vote { - const NAME: &'static str = "Vote"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.Vote".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.Vote".into() - } -} -/// DepositParams defines the params for deposits on governance proposals. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DepositParams { - /// 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< - ::tendermint_proto::google::protobuf::Duration, - >, -} -impl ::prost::Name for DepositParams { - const NAME: &'static str = "DepositParams"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.DepositParams".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.DepositParams".into() - } -} -/// VotingParams defines the params for voting on governance proposals. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct VotingParams { - /// Duration of the voting period. - #[prost(message, optional, tag = "1")] - pub voting_period: ::core::option::Option< - ::tendermint_proto::google::protobuf::Duration, - >, -} -impl ::prost::Name for VotingParams { - const NAME: &'static str = "VotingParams"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.VotingParams".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.VotingParams".into() - } -} -/// TallyParams defines the params for tallying votes on governance proposals. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TallyParams { - /// Minimum percentage of total stake needed to vote for a result to be - /// considered valid. - #[prost(bytes = "vec", tag = "1")] - pub quorum: ::prost::alloc::vec::Vec, - /// Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. - #[prost(bytes = "vec", tag = "2")] - pub threshold: ::prost::alloc::vec::Vec, - /// Minimum value of Veto votes to Total votes ratio for proposal to be - /// vetoed. Default value: 1/3. - #[prost(bytes = "vec", tag = "3")] - pub veto_threshold: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for TallyParams { - const NAME: &'static str = "TallyParams"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.TallyParams".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.TallyParams".into() - } -} -/// VoteOption enumerates the valid vote options for a given governance proposal. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum VoteOption { - /// VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - Unspecified = 0, - /// VOTE_OPTION_YES defines a yes vote option. - Yes = 1, - /// VOTE_OPTION_ABSTAIN defines an abstain vote option. - Abstain = 2, - /// VOTE_OPTION_NO defines a no vote option. - No = 3, - /// VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - NoWithVeto = 4, -} -impl VoteOption { - /// 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 { - VoteOption::Unspecified => "VOTE_OPTION_UNSPECIFIED", - VoteOption::Yes => "VOTE_OPTION_YES", - VoteOption::Abstain => "VOTE_OPTION_ABSTAIN", - VoteOption::No => "VOTE_OPTION_NO", - VoteOption::NoWithVeto => "VOTE_OPTION_NO_WITH_VETO", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "VOTE_OPTION_UNSPECIFIED" => Some(Self::Unspecified), - "VOTE_OPTION_YES" => Some(Self::Yes), - "VOTE_OPTION_ABSTAIN" => Some(Self::Abstain), - "VOTE_OPTION_NO" => Some(Self::No), - "VOTE_OPTION_NO_WITH_VETO" => Some(Self::NoWithVeto), - _ => None, - } - } -} -/// ProposalStatus enumerates the valid statuses of a proposal. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum ProposalStatus { - /// PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - Unspecified = 0, - /// PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - /// period. - DepositPeriod = 1, - /// PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - /// period. - VotingPeriod = 2, - /// PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - /// passed. - Passed = 3, - /// PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - /// been rejected. - Rejected = 4, - /// PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - /// failed. - Failed = 5, -} -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::Unspecified => "PROPOSAL_STATUS_UNSPECIFIED", - ProposalStatus::DepositPeriod => "PROPOSAL_STATUS_DEPOSIT_PERIOD", - ProposalStatus::VotingPeriod => "PROPOSAL_STATUS_VOTING_PERIOD", - ProposalStatus::Passed => "PROPOSAL_STATUS_PASSED", - ProposalStatus::Rejected => "PROPOSAL_STATUS_REJECTED", - ProposalStatus::Failed => "PROPOSAL_STATUS_FAILED", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "PROPOSAL_STATUS_UNSPECIFIED" => Some(Self::Unspecified), - "PROPOSAL_STATUS_DEPOSIT_PERIOD" => Some(Self::DepositPeriod), - "PROPOSAL_STATUS_VOTING_PERIOD" => Some(Self::VotingPeriod), - "PROPOSAL_STATUS_PASSED" => Some(Self::Passed), - "PROPOSAL_STATUS_REJECTED" => Some(Self::Rejected), - "PROPOSAL_STATUS_FAILED" => Some(Self::Failed), - _ => None, - } - } -} -/// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary -/// proposal Content. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSubmitProposal { - /// content is the proposal's content. - #[prost(message, optional, tag = "1")] - pub content: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, - /// 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, -} -impl ::prost::Name for MsgSubmitProposal { - const NAME: &'static str = "MsgSubmitProposal"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.MsgSubmitProposal".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.MsgSubmitProposal".into() - } -} -/// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct MsgSubmitProposalResponse { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - pub proposal_id: u64, -} -impl ::prost::Name for MsgSubmitProposalResponse { - const NAME: &'static str = "MsgSubmitProposalResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.MsgSubmitProposalResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.MsgSubmitProposalResponse".into() - } -} -/// MsgVote defines a message to cast a vote. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgVote { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - 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")] - pub option: i32, -} -impl ::prost::Name for MsgVote { - const NAME: &'static str = "MsgVote"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.MsgVote".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.MsgVote".into() - } -} -/// MsgVoteResponse defines the Msg/Vote response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct MsgVoteResponse {} -impl ::prost::Name for MsgVoteResponse { - const NAME: &'static str = "MsgVoteResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.MsgVoteResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.MsgVoteResponse".into() - } -} -/// MsgVoteWeighted defines a message to cast a vote. -/// -/// Since: cosmos-sdk 0.43 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgVoteWeighted { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - 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, -} -impl ::prost::Name for MsgVoteWeighted { - const NAME: &'static str = "MsgVoteWeighted"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.MsgVoteWeighted".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.MsgVoteWeighted".into() - } -} -/// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. -/// -/// Since: cosmos-sdk 0.43 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct MsgVoteWeightedResponse {} -impl ::prost::Name for MsgVoteWeightedResponse { - const NAME: &'static str = "MsgVoteWeightedResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.MsgVoteWeightedResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.MsgVoteWeightedResponse".into() - } -} -/// MsgDeposit defines a message to submit a deposit to an existing proposal. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgDeposit { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - 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, -} -impl ::prost::Name for MsgDeposit { - const NAME: &'static str = "MsgDeposit"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.MsgDeposit".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.MsgDeposit".into() - } -} -/// MsgDepositResponse defines the Msg/Deposit response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct MsgDepositResponse {} -impl ::prost::Name for MsgDepositResponse { - const NAME: &'static str = "MsgDepositResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.MsgDepositResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.MsgDepositResponse".into() - } -} -/// Generated client implementations. -#[cfg(feature = "client")] -pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - /// Msg defines the bank Msg service. - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, - } - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: 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 - } - /// SubmitProposal defines a method to create new proposal given a content. - pub async fn submit_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( - "/cosmos.gov.v1beta1.Msg/SubmitProposal", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1beta1.Msg", "SubmitProposal")); - self.inner.unary(req, path, codec).await - } - /// Vote defines a method to add a vote on a specific proposal. - pub async fn vote( - &mut self, - request: impl tonic::IntoRequest, - ) -> 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( - "/cosmos.gov.v1beta1.Msg/Vote", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1beta1.Msg", "Vote")); - self.inner.unary(req, path, codec).await - } - /// VoteWeighted defines a method to add a weighted vote on a specific proposal. - /// - /// Since: cosmos-sdk 0.43 - pub async fn vote_weighted( - &mut self, - request: impl tonic::IntoRequest, - ) -> 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( - "/cosmos.gov.v1beta1.Msg/VoteWeighted", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1beta1.Msg", "VoteWeighted")); - self.inner.unary(req, path, codec).await - } - /// Deposit defines a method to add deposit on a specific proposal. - pub async fn deposit( - &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( - "/cosmos.gov.v1beta1.Msg/Deposit", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1beta1.Msg", "Deposit")); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -#[cfg(feature = "server")] -pub mod msg_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. - #[async_trait] - pub trait Msg: Send + Sync + 'static { - /// SubmitProposal defines a method to create new proposal given a content. - async fn submit_proposal( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Vote defines a method to add a vote on a specific proposal. - async fn vote( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - /// VoteWeighted defines a method to add a weighted vote on a specific proposal. - /// - /// Since: cosmos-sdk 0.43 - async fn vote_weighted( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Deposit defines a method to add deposit on a specific proposal. - async fn deposit( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - /// Msg defines the bank Msg service. - #[derive(Debug)] - pub struct MsgServer { - inner: Arc, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - impl MsgServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - 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 { - match req.uri().path() { - "/cosmos.gov.v1beta1.Msg/SubmitProposal" => { - #[allow(non_camel_case_types)] - struct SubmitProposalSvc(pub Arc); - impl tonic::server::UnaryService - for SubmitProposalSvc { - type Response = super::MsgSubmitProposalResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::submit_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 method = SubmitProposalSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.gov.v1beta1.Msg/Vote" => { - #[allow(non_camel_case_types)] - struct VoteSvc(pub Arc); - impl tonic::server::UnaryService - for VoteSvc { - type Response = super::MsgVoteResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::vote(&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 method = VoteSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.gov.v1beta1.Msg/VoteWeighted" => { - #[allow(non_camel_case_types)] - struct VoteWeightedSvc(pub Arc); - impl tonic::server::UnaryService - for VoteWeightedSvc { - type Response = super::MsgVoteWeightedResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::vote_weighted(&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 method = VoteWeightedSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.gov.v1beta1.Msg/Deposit" => { - #[allow(non_camel_case_types)] - struct DepositSvc(pub Arc); - impl tonic::server::UnaryService - for DepositSvc { - type Response = super::MsgDepositResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::deposit(&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 method = DepositSvc(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", tonic::Code::Unimplemented as i32) - .header( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ) - .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 tonic::server::NamedService for MsgServer { - const NAME: &'static str = "cosmos.gov.v1beta1.Msg"; - } -} -/// QueryProposalRequest is the request type for the Query/Proposal RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct QueryProposalRequest { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - pub proposal_id: u64, -} -impl ::prost::Name for QueryProposalRequest { - const NAME: &'static str = "QueryProposalRequest"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.QueryProposalRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.QueryProposalRequest".into() - } -} -/// QueryProposalResponse is the response type for the Query/Proposal RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryProposalResponse { - #[prost(message, optional, tag = "1")] - pub proposal: ::core::option::Option, -} -impl ::prost::Name for QueryProposalResponse { - const NAME: &'static str = "QueryProposalResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.QueryProposalResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.QueryProposalResponse".into() - } -} -/// QueryProposalsRequest is the request type for the Query/Proposals RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryProposalsRequest { - /// proposal_status defines the status of the proposals. - #[prost(enumeration = "ProposalStatus", tag = "1")] - pub proposal_status: i32, - /// voter defines the voter address for the proposals. - #[prost(string, tag = "2")] - pub voter: ::prost::alloc::string::String, - /// depositor defines the deposit addresses from the proposals. - #[prost(string, tag = "3")] - pub depositor: ::prost::alloc::string::String, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "4")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryProposalsRequest { - const NAME: &'static str = "QueryProposalsRequest"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.QueryProposalsRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.QueryProposalsRequest".into() - } -} -/// QueryProposalsResponse is the response type for the Query/Proposals RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -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. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryProposalsResponse { - const NAME: &'static str = "QueryProposalsResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.QueryProposalsResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.QueryProposalsResponse".into() - } -} -/// QueryVoteRequest is the request type for the Query/Vote RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryVoteRequest { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - pub proposal_id: u64, - /// voter defines the voter address for the proposals. - #[prost(string, tag = "2")] - pub voter: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryVoteRequest { - const NAME: &'static str = "QueryVoteRequest"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.QueryVoteRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.QueryVoteRequest".into() - } -} -/// QueryVoteResponse is the response type for the Query/Vote RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryVoteResponse { - /// vote defines the queried vote. - #[prost(message, optional, tag = "1")] - pub vote: ::core::option::Option, -} -impl ::prost::Name for QueryVoteResponse { - const NAME: &'static str = "QueryVoteResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.QueryVoteResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.QueryVoteResponse".into() - } -} -/// QueryVotesRequest is the request type for the Query/Votes RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryVotesRequest { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - pub proposal_id: u64, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryVotesRequest { - const NAME: &'static str = "QueryVotesRequest"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.QueryVotesRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.QueryVotesRequest".into() - } -} -/// QueryVotesResponse is the response type for the Query/Votes RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryVotesResponse { - /// votes defines the queried votes. - #[prost(message, repeated, tag = "1")] - pub votes: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryVotesResponse { - const NAME: &'static str = "QueryVotesResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.QueryVotesResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.QueryVotesResponse".into() - } -} -/// QueryParamsRequest is the request type for the Query/Params RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryParamsRequest { - /// params_type defines which parameters to query for, can be one of "voting", - /// "tallying" or "deposit". - #[prost(string, tag = "1")] - pub params_type: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryParamsRequest { - const NAME: &'static str = "QueryParamsRequest"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.QueryParamsRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.QueryParamsRequest".into() - } -} -/// QueryParamsResponse is the response type for the Query/Params RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryParamsResponse { - /// voting_params defines the parameters related to voting. - #[prost(message, optional, tag = "1")] - pub voting_params: ::core::option::Option, - /// deposit_params defines the parameters related to deposit. - #[prost(message, optional, tag = "2")] - pub deposit_params: ::core::option::Option, - /// tally_params defines the parameters related to tally. - #[prost(message, optional, tag = "3")] - pub tally_params: ::core::option::Option, -} -impl ::prost::Name for QueryParamsResponse { - const NAME: &'static str = "QueryParamsResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.QueryParamsResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.QueryParamsResponse".into() - } -} -/// QueryDepositRequest is the request type for the Query/Deposit RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDepositRequest { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - pub proposal_id: u64, - /// depositor defines the deposit addresses from the proposals. - #[prost(string, tag = "2")] - pub depositor: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryDepositRequest { - const NAME: &'static str = "QueryDepositRequest"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.QueryDepositRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.QueryDepositRequest".into() - } -} -/// QueryDepositResponse is the response type for the Query/Deposit RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDepositResponse { - /// deposit defines the requested deposit. - #[prost(message, optional, tag = "1")] - pub deposit: ::core::option::Option, -} -impl ::prost::Name for QueryDepositResponse { - const NAME: &'static str = "QueryDepositResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.QueryDepositResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.QueryDepositResponse".into() - } -} -/// QueryDepositsRequest is the request type for the Query/Deposits RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDepositsRequest { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - pub proposal_id: u64, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryDepositsRequest { - const NAME: &'static str = "QueryDepositsRequest"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.QueryDepositsRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.QueryDepositsRequest".into() - } -} -/// QueryDepositsResponse is the response type for the Query/Deposits RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -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. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryDepositsResponse { - const NAME: &'static str = "QueryDepositsResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.QueryDepositsResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.QueryDepositsResponse".into() - } -} -/// QueryTallyResultRequest is the request type for the Query/Tally RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct QueryTallyResultRequest { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - pub proposal_id: u64, -} -impl ::prost::Name for QueryTallyResultRequest { - const NAME: &'static str = "QueryTallyResultRequest"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.QueryTallyResultRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.QueryTallyResultRequest".into() - } -} -/// QueryTallyResultResponse is the response type for the Query/Tally RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryTallyResultResponse { - /// tally defines the requested tally. - #[prost(message, optional, tag = "1")] - pub tally: ::core::option::Option, -} -impl ::prost::Name for QueryTallyResultResponse { - const NAME: &'static str = "QueryTallyResultResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.QueryTallyResultResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.QueryTallyResultResponse".into() - } -} -/// Generated client implementations. -#[cfg(feature = "client")] -pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - /// Query defines the gRPC querier service for gov module - #[derive(Debug, Clone)] - pub struct QueryClient { - inner: tonic::client::Grpc, - } - impl QueryClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: 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 - } - /// Proposal queries proposal details based on ProposalID. - pub async fn 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( - "/cosmos.gov.v1beta1.Query/Proposal", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1beta1.Query", "Proposal")); - self.inner.unary(req, path, codec).await - } - /// Proposals queries all proposals based on given status. - pub async fn proposals( - &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( - "/cosmos.gov.v1beta1.Query/Proposals", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1beta1.Query", "Proposals")); - self.inner.unary(req, path, codec).await - } - /// Vote queries voted information based on proposalID, voterAddr. - pub async fn vote( - &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( - "/cosmos.gov.v1beta1.Query/Vote", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1beta1.Query", "Vote")); - self.inner.unary(req, path, codec).await - } - /// Votes queries votes of a given proposal. - pub async fn votes( - &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( - "/cosmos.gov.v1beta1.Query/Votes", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1beta1.Query", "Votes")); - self.inner.unary(req, path, codec).await - } - /// Params queries all parameters of the gov module. - pub async fn params( - &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( - "/cosmos.gov.v1beta1.Query/Params", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1beta1.Query", "Params")); - self.inner.unary(req, path, codec).await - } - /// Deposit queries single deposit information based proposalID, depositAddr. - pub async fn deposit( - &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( - "/cosmos.gov.v1beta1.Query/Deposit", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1beta1.Query", "Deposit")); - self.inner.unary(req, path, codec).await - } - /// Deposits queries all deposits of a single proposal. - pub async fn deposits( - &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( - "/cosmos.gov.v1beta1.Query/Deposits", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1beta1.Query", "Deposits")); - self.inner.unary(req, path, codec).await - } - /// TallyResult queries the tally of a proposal vote. - pub async fn tally_result( - &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( - "/cosmos.gov.v1beta1.Query/TallyResult", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1beta1.Query", "TallyResult")); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -#[cfg(feature = "server")] -pub mod query_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. - #[async_trait] - pub trait Query: Send + Sync + 'static { - /// Proposal queries proposal details based on ProposalID. - async fn proposal( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Proposals queries all proposals based on given status. - async fn proposals( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Vote queries voted information based on proposalID, voterAddr. - async fn vote( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Votes queries votes of a given proposal. - async fn votes( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Params queries all parameters of the gov module. - async fn params( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Deposit queries single deposit information based proposalID, depositAddr. - async fn deposit( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Deposits queries all deposits of a single proposal. - async fn deposits( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// TallyResult queries the tally of a proposal vote. - async fn tally_result( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - /// Query defines the gRPC querier service for gov module - #[derive(Debug)] - pub struct QueryServer { - inner: Arc, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - impl QueryServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - 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 { - match req.uri().path() { - "/cosmos.gov.v1beta1.Query/Proposal" => { - #[allow(non_camel_case_types)] - struct ProposalSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for ProposalSvc { - type Response = super::QueryProposalResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::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 method = ProposalSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.gov.v1beta1.Query/Proposals" => { - #[allow(non_camel_case_types)] - struct ProposalsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for ProposalsSvc { - type Response = super::QueryProposalsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::proposals(&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 method = ProposalsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.gov.v1beta1.Query/Vote" => { - #[allow(non_camel_case_types)] - struct VoteSvc(pub Arc); - impl tonic::server::UnaryService - for VoteSvc { - type Response = super::QueryVoteResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::vote(&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 method = VoteSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.gov.v1beta1.Query/Votes" => { - #[allow(non_camel_case_types)] - struct VotesSvc(pub Arc); - impl tonic::server::UnaryService - for VotesSvc { - type Response = super::QueryVotesResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::votes(&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 method = VotesSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.gov.v1beta1.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::Response, - 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 method = ParamsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.gov.v1beta1.Query/Deposit" => { - #[allow(non_camel_case_types)] - struct DepositSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for DepositSvc { - type Response = super::QueryDepositResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::deposit(&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 method = DepositSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.gov.v1beta1.Query/Deposits" => { - #[allow(non_camel_case_types)] - struct DepositsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for DepositsSvc { - type Response = super::QueryDepositsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::deposits(&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 method = DepositsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.gov.v1beta1.Query/TallyResult" => { - #[allow(non_camel_case_types)] - struct TallyResultSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for TallyResultSvc { - type Response = super::QueryTallyResultResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::tally_result(&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 method = TallyResultSvc(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", tonic::Code::Unimplemented as i32) - .header( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ) - .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 tonic::server::NamedService for QueryServer { - const NAME: &'static str = "cosmos.gov.v1beta1.Query"; - } -} -/// GenesisState defines the gov module's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GenesisState { - /// starting_proposal_id is the ID of the starting proposal. - #[prost(uint64, tag = "1")] - pub starting_proposal_id: u64, - /// deposits defines all the deposits present at genesis. - #[prost(message, repeated, tag = "2")] - pub deposits: ::prost::alloc::vec::Vec, - /// votes defines all the votes present at genesis. - #[prost(message, repeated, tag = "3")] - pub votes: ::prost::alloc::vec::Vec, - /// proposals defines all the proposals present at genesis. - #[prost(message, repeated, tag = "4")] - pub proposals: ::prost::alloc::vec::Vec, - /// params defines all the parameters of related to deposit. - #[prost(message, optional, tag = "5")] - pub deposit_params: ::core::option::Option, - /// params defines all the parameters of related to voting. - #[prost(message, optional, tag = "6")] - pub voting_params: ::core::option::Option, - /// params defines all the parameters of related to tally. - #[prost(message, optional, tag = "7")] - pub tally_params: ::core::option::Option, -} -impl ::prost::Name for GenesisState { - const NAME: &'static str = "GenesisState"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.gov.v1beta1.GenesisState".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.gov.v1beta1.GenesisState".into() - } -} diff --git a/src/prost/cosmos.gov.v1beta1.serde.rs b/src/prost/cosmos.gov.v1beta1.serde.rs deleted file mode 100644 index 1e738333..00000000 --- a/src/prost/cosmos.gov.v1beta1.serde.rs +++ /dev/null @@ -1,4091 +0,0 @@ -impl serde::Serialize for Deposit { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.Deposit", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; - } - if true { - struct_ser.serialize_field("depositor", &self.depositor)?; - } - if true { - struct_ser.serialize_field("amount", &self.amount)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Deposit { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposal_id", - "proposalId", - "depositor", - "amount", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ProposalId, - Depositor, - Amount, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), - "depositor" => Ok(GeneratedField::Depositor), - "amount" => Ok(GeneratedField::Amount), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Deposit; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.Deposit") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposal_id__ = None; - let mut depositor__ = None; - let mut amount__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ProposalId => { - if proposal_id__.is_some() { - return Err(serde::de::Error::duplicate_field("proposalId")); - } - proposal_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Depositor => { - if depositor__.is_some() { - return Err(serde::de::Error::duplicate_field("depositor")); - } - depositor__ = Some(map_.next_value()?); - } - GeneratedField::Amount => { - if amount__.is_some() { - return Err(serde::de::Error::duplicate_field("amount")); - } - amount__ = Some(map_.next_value()?); - } - } - } - Ok(Deposit { - proposal_id: proposal_id__.unwrap_or_default(), - depositor: depositor__.unwrap_or_default(), - amount: amount__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.Deposit", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for DepositParams { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.DepositParams", len)?; - if true { - struct_ser.serialize_field("minDeposit", &self.min_deposit)?; - } - if let Some(v) = self.max_deposit_period.as_ref() { - struct_ser.serialize_field("maxDepositPeriod", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for DepositParams { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "min_deposit", - "minDeposit", - "max_deposit_period", - "maxDepositPeriod", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - MinDeposit, - MaxDepositPeriod, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "minDeposit" | "min_deposit" => Ok(GeneratedField::MinDeposit), - "maxDepositPeriod" | "max_deposit_period" => Ok(GeneratedField::MaxDepositPeriod), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = DepositParams; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.DepositParams") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut min_deposit__ = None; - let mut max_deposit_period__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::MinDeposit => { - if min_deposit__.is_some() { - return Err(serde::de::Error::duplicate_field("minDeposit")); - } - min_deposit__ = Some(map_.next_value()?); - } - GeneratedField::MaxDepositPeriod => { - if max_deposit_period__.is_some() { - return Err(serde::de::Error::duplicate_field("maxDepositPeriod")); - } - max_deposit_period__ = map_.next_value()?; - } - } - } - Ok(DepositParams { - min_deposit: min_deposit__.unwrap_or_default(), - max_deposit_period: max_deposit_period__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.DepositParams", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for GenesisState { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.GenesisState", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("startingProposalId", ::alloc::string::ToString::to_string(&self.starting_proposal_id).as_str())?; - } - if true { - struct_ser.serialize_field("deposits", &self.deposits)?; - } - if true { - struct_ser.serialize_field("votes", &self.votes)?; - } - if true { - struct_ser.serialize_field("proposals", &self.proposals)?; - } - if let Some(v) = self.deposit_params.as_ref() { - struct_ser.serialize_field("depositParams", v)?; - } - if let Some(v) = self.voting_params.as_ref() { - struct_ser.serialize_field("votingParams", v)?; - } - if let Some(v) = self.tally_params.as_ref() { - struct_ser.serialize_field("tallyParams", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GenesisState { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "starting_proposal_id", - "startingProposalId", - "deposits", - "votes", - "proposals", - "deposit_params", - "depositParams", - "voting_params", - "votingParams", - "tally_params", - "tallyParams", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - StartingProposalId, - Deposits, - Votes, - Proposals, - DepositParams, - VotingParams, - TallyParams, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "startingProposalId" | "starting_proposal_id" => Ok(GeneratedField::StartingProposalId), - "deposits" => Ok(GeneratedField::Deposits), - "votes" => Ok(GeneratedField::Votes), - "proposals" => Ok(GeneratedField::Proposals), - "depositParams" | "deposit_params" => Ok(GeneratedField::DepositParams), - "votingParams" | "voting_params" => Ok(GeneratedField::VotingParams), - "tallyParams" | "tally_params" => Ok(GeneratedField::TallyParams), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GenesisState; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.GenesisState") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut starting_proposal_id__ = None; - let mut deposits__ = None; - let mut votes__ = None; - let mut proposals__ = None; - let mut deposit_params__ = None; - let mut voting_params__ = None; - let mut tally_params__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::StartingProposalId => { - if starting_proposal_id__.is_some() { - return Err(serde::de::Error::duplicate_field("startingProposalId")); - } - starting_proposal_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Deposits => { - if deposits__.is_some() { - return Err(serde::de::Error::duplicate_field("deposits")); - } - deposits__ = Some(map_.next_value()?); - } - GeneratedField::Votes => { - if votes__.is_some() { - return Err(serde::de::Error::duplicate_field("votes")); - } - votes__ = Some(map_.next_value()?); - } - GeneratedField::Proposals => { - if proposals__.is_some() { - return Err(serde::de::Error::duplicate_field("proposals")); - } - proposals__ = Some(map_.next_value()?); - } - GeneratedField::DepositParams => { - if deposit_params__.is_some() { - return Err(serde::de::Error::duplicate_field("depositParams")); - } - deposit_params__ = map_.next_value()?; - } - GeneratedField::VotingParams => { - if voting_params__.is_some() { - return Err(serde::de::Error::duplicate_field("votingParams")); - } - voting_params__ = map_.next_value()?; - } - GeneratedField::TallyParams => { - if tally_params__.is_some() { - return Err(serde::de::Error::duplicate_field("tallyParams")); - } - tally_params__ = map_.next_value()?; - } - } - } - Ok(GenesisState { - starting_proposal_id: starting_proposal_id__.unwrap_or_default(), - deposits: deposits__.unwrap_or_default(), - votes: votes__.unwrap_or_default(), - proposals: proposals__.unwrap_or_default(), - deposit_params: deposit_params__, - voting_params: voting_params__, - tally_params: tally_params__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.GenesisState", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgDeposit { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.MsgDeposit", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; - } - if true { - struct_ser.serialize_field("depositor", &self.depositor)?; - } - if true { - struct_ser.serialize_field("amount", &self.amount)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgDeposit { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposal_id", - "proposalId", - "depositor", - "amount", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ProposalId, - Depositor, - Amount, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), - "depositor" => Ok(GeneratedField::Depositor), - "amount" => Ok(GeneratedField::Amount), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgDeposit; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.MsgDeposit") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposal_id__ = None; - let mut depositor__ = None; - let mut amount__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ProposalId => { - if proposal_id__.is_some() { - return Err(serde::de::Error::duplicate_field("proposalId")); - } - proposal_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Depositor => { - if depositor__.is_some() { - return Err(serde::de::Error::duplicate_field("depositor")); - } - depositor__ = Some(map_.next_value()?); - } - GeneratedField::Amount => { - if amount__.is_some() { - return Err(serde::de::Error::duplicate_field("amount")); - } - amount__ = Some(map_.next_value()?); - } - } - } - Ok(MsgDeposit { - proposal_id: proposal_id__.unwrap_or_default(), - depositor: depositor__.unwrap_or_default(), - amount: amount__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.MsgDeposit", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgDepositResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.MsgDepositResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgDepositResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgDepositResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.MsgDepositResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(MsgDepositResponse { - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.MsgDepositResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgSubmitProposal { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.MsgSubmitProposal", len)?; - if let Some(v) = self.content.as_ref() { - struct_ser.serialize_field("content", v)?; - } - if true { - struct_ser.serialize_field("initialDeposit", &self.initial_deposit)?; - } - if true { - struct_ser.serialize_field("proposer", &self.proposer)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgSubmitProposal { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "content", - "initial_deposit", - "initialDeposit", - "proposer", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Content, - InitialDeposit, - Proposer, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "content" => Ok(GeneratedField::Content), - "initialDeposit" | "initial_deposit" => Ok(GeneratedField::InitialDeposit), - "proposer" => Ok(GeneratedField::Proposer), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgSubmitProposal; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.MsgSubmitProposal") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut content__ = None; - let mut initial_deposit__ = None; - let mut proposer__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Content => { - if content__.is_some() { - return Err(serde::de::Error::duplicate_field("content")); - } - content__ = map_.next_value()?; - } - GeneratedField::InitialDeposit => { - if initial_deposit__.is_some() { - return Err(serde::de::Error::duplicate_field("initialDeposit")); - } - initial_deposit__ = Some(map_.next_value()?); - } - GeneratedField::Proposer => { - if proposer__.is_some() { - return Err(serde::de::Error::duplicate_field("proposer")); - } - proposer__ = Some(map_.next_value()?); - } - } - } - Ok(MsgSubmitProposal { - content: content__, - initial_deposit: initial_deposit__.unwrap_or_default(), - proposer: proposer__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.MsgSubmitProposal", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgSubmitProposalResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.MsgSubmitProposalResponse", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgSubmitProposalResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposal_id", - "proposalId", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ProposalId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgSubmitProposalResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.MsgSubmitProposalResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposal_id__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ProposalId => { - if proposal_id__.is_some() { - return Err(serde::de::Error::duplicate_field("proposalId")); - } - proposal_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(MsgSubmitProposalResponse { - proposal_id: proposal_id__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.MsgSubmitProposalResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgVote { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.MsgVote", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; - } - if true { - struct_ser.serialize_field("voter", &self.voter)?; - } - if true { - let v = VoteOption::try_from(self.option) - .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.option)))?; - struct_ser.serialize_field("option", &v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgVote { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposal_id", - "proposalId", - "voter", - "option", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ProposalId, - Voter, - Option, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), - "voter" => Ok(GeneratedField::Voter), - "option" => Ok(GeneratedField::Option), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgVote; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.MsgVote") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposal_id__ = None; - let mut voter__ = None; - let mut option__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ProposalId => { - if proposal_id__.is_some() { - return Err(serde::de::Error::duplicate_field("proposalId")); - } - proposal_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Voter => { - if voter__.is_some() { - return Err(serde::de::Error::duplicate_field("voter")); - } - voter__ = Some(map_.next_value()?); - } - GeneratedField::Option => { - if option__.is_some() { - return Err(serde::de::Error::duplicate_field("option")); - } - option__ = Some(map_.next_value::()? as i32); - } - } - } - Ok(MsgVote { - proposal_id: proposal_id__.unwrap_or_default(), - voter: voter__.unwrap_or_default(), - option: option__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.MsgVote", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgVoteResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.MsgVoteResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgVoteResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgVoteResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.MsgVoteResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(MsgVoteResponse { - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.MsgVoteResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgVoteWeighted { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.MsgVoteWeighted", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; - } - if true { - struct_ser.serialize_field("voter", &self.voter)?; - } - if true { - struct_ser.serialize_field("options", &self.options)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgVoteWeighted { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposal_id", - "proposalId", - "voter", - "options", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ProposalId, - Voter, - Options, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), - "voter" => Ok(GeneratedField::Voter), - "options" => Ok(GeneratedField::Options), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgVoteWeighted; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.MsgVoteWeighted") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposal_id__ = None; - let mut voter__ = None; - let mut options__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ProposalId => { - if proposal_id__.is_some() { - return Err(serde::de::Error::duplicate_field("proposalId")); - } - proposal_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Voter => { - if voter__.is_some() { - return Err(serde::de::Error::duplicate_field("voter")); - } - voter__ = Some(map_.next_value()?); - } - GeneratedField::Options => { - if options__.is_some() { - return Err(serde::de::Error::duplicate_field("options")); - } - options__ = Some(map_.next_value()?); - } - } - } - Ok(MsgVoteWeighted { - proposal_id: proposal_id__.unwrap_or_default(), - voter: voter__.unwrap_or_default(), - options: options__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.MsgVoteWeighted", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgVoteWeightedResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.MsgVoteWeightedResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgVoteWeightedResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgVoteWeightedResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.MsgVoteWeightedResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(MsgVoteWeightedResponse { - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.MsgVoteWeightedResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Proposal { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.Proposal", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; - } - if let Some(v) = self.content.as_ref() { - struct_ser.serialize_field("content", v)?; - } - if true { - let v = ProposalStatus::try_from(self.status) - .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.status)))?; - struct_ser.serialize_field("status", &v)?; - } - if let Some(v) = self.final_tally_result.as_ref() { - struct_ser.serialize_field("finalTallyResult", v)?; - } - if let Some(v) = self.submit_time.as_ref() { - struct_ser.serialize_field("submitTime", v)?; - } - if let Some(v) = self.deposit_end_time.as_ref() { - struct_ser.serialize_field("depositEndTime", v)?; - } - if true { - struct_ser.serialize_field("totalDeposit", &self.total_deposit)?; - } - if let Some(v) = self.voting_start_time.as_ref() { - struct_ser.serialize_field("votingStartTime", v)?; - } - if let Some(v) = self.voting_end_time.as_ref() { - struct_ser.serialize_field("votingEndTime", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Proposal { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposal_id", - "proposalId", - "content", - "status", - "final_tally_result", - "finalTallyResult", - "submit_time", - "submitTime", - "deposit_end_time", - "depositEndTime", - "total_deposit", - "totalDeposit", - "voting_start_time", - "votingStartTime", - "voting_end_time", - "votingEndTime", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ProposalId, - Content, - Status, - FinalTallyResult, - SubmitTime, - DepositEndTime, - TotalDeposit, - VotingStartTime, - VotingEndTime, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), - "content" => Ok(GeneratedField::Content), - "status" => Ok(GeneratedField::Status), - "finalTallyResult" | "final_tally_result" => Ok(GeneratedField::FinalTallyResult), - "submitTime" | "submit_time" => Ok(GeneratedField::SubmitTime), - "depositEndTime" | "deposit_end_time" => Ok(GeneratedField::DepositEndTime), - "totalDeposit" | "total_deposit" => Ok(GeneratedField::TotalDeposit), - "votingStartTime" | "voting_start_time" => Ok(GeneratedField::VotingStartTime), - "votingEndTime" | "voting_end_time" => Ok(GeneratedField::VotingEndTime), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Proposal; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.Proposal") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposal_id__ = None; - let mut content__ = None; - let mut status__ = None; - let mut final_tally_result__ = None; - let mut submit_time__ = None; - let mut deposit_end_time__ = None; - let mut total_deposit__ = None; - let mut voting_start_time__ = None; - let mut voting_end_time__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ProposalId => { - if proposal_id__.is_some() { - return Err(serde::de::Error::duplicate_field("proposalId")); - } - proposal_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Content => { - if content__.is_some() { - return Err(serde::de::Error::duplicate_field("content")); - } - content__ = map_.next_value()?; - } - GeneratedField::Status => { - if status__.is_some() { - return Err(serde::de::Error::duplicate_field("status")); - } - status__ = Some(map_.next_value::()? as i32); - } - GeneratedField::FinalTallyResult => { - if final_tally_result__.is_some() { - return Err(serde::de::Error::duplicate_field("finalTallyResult")); - } - final_tally_result__ = map_.next_value()?; - } - GeneratedField::SubmitTime => { - if submit_time__.is_some() { - return Err(serde::de::Error::duplicate_field("submitTime")); - } - submit_time__ = map_.next_value()?; - } - GeneratedField::DepositEndTime => { - if deposit_end_time__.is_some() { - return Err(serde::de::Error::duplicate_field("depositEndTime")); - } - deposit_end_time__ = map_.next_value()?; - } - GeneratedField::TotalDeposit => { - if total_deposit__.is_some() { - return Err(serde::de::Error::duplicate_field("totalDeposit")); - } - total_deposit__ = Some(map_.next_value()?); - } - GeneratedField::VotingStartTime => { - if voting_start_time__.is_some() { - return Err(serde::de::Error::duplicate_field("votingStartTime")); - } - voting_start_time__ = map_.next_value()?; - } - GeneratedField::VotingEndTime => { - if voting_end_time__.is_some() { - return Err(serde::de::Error::duplicate_field("votingEndTime")); - } - voting_end_time__ = map_.next_value()?; - } - } - } - Ok(Proposal { - proposal_id: proposal_id__.unwrap_or_default(), - content: content__, - status: status__.unwrap_or_default(), - final_tally_result: final_tally_result__, - submit_time: submit_time__, - deposit_end_time: deposit_end_time__, - total_deposit: total_deposit__.unwrap_or_default(), - voting_start_time: voting_start_time__, - voting_end_time: voting_end_time__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.Proposal", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for ProposalStatus { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::Unspecified => "PROPOSAL_STATUS_UNSPECIFIED", - Self::DepositPeriod => "PROPOSAL_STATUS_DEPOSIT_PERIOD", - Self::VotingPeriod => "PROPOSAL_STATUS_VOTING_PERIOD", - Self::Passed => "PROPOSAL_STATUS_PASSED", - Self::Rejected => "PROPOSAL_STATUS_REJECTED", - Self::Failed => "PROPOSAL_STATUS_FAILED", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for ProposalStatus { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "PROPOSAL_STATUS_UNSPECIFIED", - "PROPOSAL_STATUS_DEPOSIT_PERIOD", - "PROPOSAL_STATUS_VOTING_PERIOD", - "PROPOSAL_STATUS_PASSED", - "PROPOSAL_STATUS_REJECTED", - "PROPOSAL_STATUS_FAILED", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ProposalStatus; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - fn visit_i64(self, v: i64) -> core::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> core::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "PROPOSAL_STATUS_UNSPECIFIED" => Ok(ProposalStatus::Unspecified), - "PROPOSAL_STATUS_DEPOSIT_PERIOD" => Ok(ProposalStatus::DepositPeriod), - "PROPOSAL_STATUS_VOTING_PERIOD" => Ok(ProposalStatus::VotingPeriod), - "PROPOSAL_STATUS_PASSED" => Ok(ProposalStatus::Passed), - "PROPOSAL_STATUS_REJECTED" => Ok(ProposalStatus::Rejected), - "PROPOSAL_STATUS_FAILED" => Ok(ProposalStatus::Failed), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for QueryDepositRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryDepositRequest", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; - } - if true { - struct_ser.serialize_field("depositor", &self.depositor)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDepositRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposal_id", - "proposalId", - "depositor", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ProposalId, - Depositor, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), - "depositor" => Ok(GeneratedField::Depositor), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryDepositRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.QueryDepositRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposal_id__ = None; - let mut depositor__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ProposalId => { - if proposal_id__.is_some() { - return Err(serde::de::Error::duplicate_field("proposalId")); - } - proposal_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Depositor => { - if depositor__.is_some() { - return Err(serde::de::Error::duplicate_field("depositor")); - } - depositor__ = Some(map_.next_value()?); - } - } - } - Ok(QueryDepositRequest { - proposal_id: proposal_id__.unwrap_or_default(), - depositor: depositor__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryDepositRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryDepositResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryDepositResponse", len)?; - if let Some(v) = self.deposit.as_ref() { - struct_ser.serialize_field("deposit", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDepositResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "deposit", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Deposit, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "deposit" => Ok(GeneratedField::Deposit), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryDepositResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.QueryDepositResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut deposit__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Deposit => { - if deposit__.is_some() { - return Err(serde::de::Error::duplicate_field("deposit")); - } - deposit__ = map_.next_value()?; - } - } - } - Ok(QueryDepositResponse { - deposit: deposit__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryDepositResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryDepositsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryDepositsRequest", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDepositsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposal_id", - "proposalId", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ProposalId, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryDepositsRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.QueryDepositsRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposal_id__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ProposalId => { - if proposal_id__.is_some() { - return Err(serde::de::Error::duplicate_field("proposalId")); - } - proposal_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryDepositsRequest { - proposal_id: proposal_id__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryDepositsRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryDepositsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryDepositsResponse", len)?; - if true { - struct_ser.serialize_field("deposits", &self.deposits)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDepositsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "deposits", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Deposits, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "deposits" => Ok(GeneratedField::Deposits), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryDepositsResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.QueryDepositsResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut deposits__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Deposits => { - if deposits__.is_some() { - return Err(serde::de::Error::duplicate_field("deposits")); - } - deposits__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryDepositsResponse { - deposits: deposits__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryDepositsResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryParamsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryParamsRequest", len)?; - if true { - struct_ser.serialize_field("paramsType", &self.params_type)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryParamsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "params_type", - "paramsType", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ParamsType, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "paramsType" | "params_type" => Ok(GeneratedField::ParamsType), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryParamsRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.QueryParamsRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut params_type__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ParamsType => { - if params_type__.is_some() { - return Err(serde::de::Error::duplicate_field("paramsType")); - } - params_type__ = Some(map_.next_value()?); - } - } - } - Ok(QueryParamsRequest { - params_type: params_type__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryParamsRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryParamsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryParamsResponse", len)?; - if let Some(v) = self.voting_params.as_ref() { - struct_ser.serialize_field("votingParams", v)?; - } - if let Some(v) = self.deposit_params.as_ref() { - struct_ser.serialize_field("depositParams", v)?; - } - if let Some(v) = self.tally_params.as_ref() { - struct_ser.serialize_field("tallyParams", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryParamsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "voting_params", - "votingParams", - "deposit_params", - "depositParams", - "tally_params", - "tallyParams", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - VotingParams, - DepositParams, - TallyParams, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "votingParams" | "voting_params" => Ok(GeneratedField::VotingParams), - "depositParams" | "deposit_params" => Ok(GeneratedField::DepositParams), - "tallyParams" | "tally_params" => Ok(GeneratedField::TallyParams), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryParamsResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.QueryParamsResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut voting_params__ = None; - let mut deposit_params__ = None; - let mut tally_params__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::VotingParams => { - if voting_params__.is_some() { - return Err(serde::de::Error::duplicate_field("votingParams")); - } - voting_params__ = map_.next_value()?; - } - GeneratedField::DepositParams => { - if deposit_params__.is_some() { - return Err(serde::de::Error::duplicate_field("depositParams")); - } - deposit_params__ = map_.next_value()?; - } - GeneratedField::TallyParams => { - if tally_params__.is_some() { - return Err(serde::de::Error::duplicate_field("tallyParams")); - } - tally_params__ = map_.next_value()?; - } - } - } - Ok(QueryParamsResponse { - voting_params: voting_params__, - deposit_params: deposit_params__, - tally_params: tally_params__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryParamsResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryProposalRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryProposalRequest", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryProposalRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposal_id", - "proposalId", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ProposalId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryProposalRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.QueryProposalRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposal_id__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ProposalId => { - if proposal_id__.is_some() { - return Err(serde::de::Error::duplicate_field("proposalId")); - } - proposal_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(QueryProposalRequest { - proposal_id: proposal_id__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryProposalRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryProposalResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryProposalResponse", len)?; - if let Some(v) = self.proposal.as_ref() { - struct_ser.serialize_field("proposal", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryProposalResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposal", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Proposal, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposal" => Ok(GeneratedField::Proposal), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryProposalResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.QueryProposalResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposal__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Proposal => { - if proposal__.is_some() { - return Err(serde::de::Error::duplicate_field("proposal")); - } - proposal__ = map_.next_value()?; - } - } - } - Ok(QueryProposalResponse { - proposal: proposal__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryProposalResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryProposalsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryProposalsRequest", len)?; - if true { - let v = ProposalStatus::try_from(self.proposal_status) - .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.proposal_status)))?; - struct_ser.serialize_field("proposalStatus", &v)?; - } - if true { - struct_ser.serialize_field("voter", &self.voter)?; - } - if true { - struct_ser.serialize_field("depositor", &self.depositor)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryProposalsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposal_status", - "proposalStatus", - "voter", - "depositor", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ProposalStatus, - Voter, - Depositor, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposalStatus" | "proposal_status" => Ok(GeneratedField::ProposalStatus), - "voter" => Ok(GeneratedField::Voter), - "depositor" => Ok(GeneratedField::Depositor), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryProposalsRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.QueryProposalsRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposal_status__ = None; - let mut voter__ = None; - let mut depositor__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ProposalStatus => { - if proposal_status__.is_some() { - return Err(serde::de::Error::duplicate_field("proposalStatus")); - } - proposal_status__ = Some(map_.next_value::()? as i32); - } - GeneratedField::Voter => { - if voter__.is_some() { - return Err(serde::de::Error::duplicate_field("voter")); - } - voter__ = Some(map_.next_value()?); - } - GeneratedField::Depositor => { - if depositor__.is_some() { - return Err(serde::de::Error::duplicate_field("depositor")); - } - depositor__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryProposalsRequest { - proposal_status: proposal_status__.unwrap_or_default(), - voter: voter__.unwrap_or_default(), - depositor: depositor__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryProposalsRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryProposalsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryProposalsResponse", len)?; - if true { - struct_ser.serialize_field("proposals", &self.proposals)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryProposalsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposals", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Proposals, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposals" => Ok(GeneratedField::Proposals), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryProposalsResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.QueryProposalsResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposals__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Proposals => { - if proposals__.is_some() { - return Err(serde::de::Error::duplicate_field("proposals")); - } - proposals__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryProposalsResponse { - proposals: proposals__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryProposalsResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryTallyResultRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryTallyResultRequest", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryTallyResultRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposal_id", - "proposalId", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ProposalId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryTallyResultRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.QueryTallyResultRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposal_id__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ProposalId => { - if proposal_id__.is_some() { - return Err(serde::de::Error::duplicate_field("proposalId")); - } - proposal_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(QueryTallyResultRequest { - proposal_id: proposal_id__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryTallyResultRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryTallyResultResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryTallyResultResponse", len)?; - if let Some(v) = self.tally.as_ref() { - struct_ser.serialize_field("tally", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryTallyResultResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "tally", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Tally, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "tally" => Ok(GeneratedField::Tally), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryTallyResultResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.QueryTallyResultResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut tally__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Tally => { - if tally__.is_some() { - return Err(serde::de::Error::duplicate_field("tally")); - } - tally__ = map_.next_value()?; - } - } - } - Ok(QueryTallyResultResponse { - tally: tally__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryTallyResultResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryVoteRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryVoteRequest", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; - } - if true { - struct_ser.serialize_field("voter", &self.voter)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryVoteRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposal_id", - "proposalId", - "voter", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ProposalId, - Voter, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), - "voter" => Ok(GeneratedField::Voter), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryVoteRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.QueryVoteRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposal_id__ = None; - let mut voter__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ProposalId => { - if proposal_id__.is_some() { - return Err(serde::de::Error::duplicate_field("proposalId")); - } - proposal_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Voter => { - if voter__.is_some() { - return Err(serde::de::Error::duplicate_field("voter")); - } - voter__ = Some(map_.next_value()?); - } - } - } - Ok(QueryVoteRequest { - proposal_id: proposal_id__.unwrap_or_default(), - voter: voter__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryVoteRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryVoteResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryVoteResponse", len)?; - if let Some(v) = self.vote.as_ref() { - struct_ser.serialize_field("vote", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryVoteResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "vote", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Vote, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "vote" => Ok(GeneratedField::Vote), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryVoteResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.QueryVoteResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut vote__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Vote => { - if vote__.is_some() { - return Err(serde::de::Error::duplicate_field("vote")); - } - vote__ = map_.next_value()?; - } - } - } - Ok(QueryVoteResponse { - vote: vote__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryVoteResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryVotesRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryVotesRequest", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryVotesRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposal_id", - "proposalId", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ProposalId, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryVotesRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.QueryVotesRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposal_id__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ProposalId => { - if proposal_id__.is_some() { - return Err(serde::de::Error::duplicate_field("proposalId")); - } - proposal_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryVotesRequest { - proposal_id: proposal_id__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryVotesRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryVotesResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryVotesResponse", len)?; - if true { - struct_ser.serialize_field("votes", &self.votes)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryVotesResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "votes", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Votes, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "votes" => Ok(GeneratedField::Votes), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryVotesResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.QueryVotesResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut votes__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Votes => { - if votes__.is_some() { - return Err(serde::de::Error::duplicate_field("votes")); - } - votes__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryVotesResponse { - votes: votes__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryVotesResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for TallyParams { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.TallyParams", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("quorum", pbjson::private::base64::encode(&self.quorum).as_str())?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("threshold", pbjson::private::base64::encode(&self.threshold).as_str())?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("vetoThreshold", pbjson::private::base64::encode(&self.veto_threshold).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for TallyParams { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "quorum", - "threshold", - "veto_threshold", - "vetoThreshold", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Quorum, - Threshold, - VetoThreshold, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "quorum" => Ok(GeneratedField::Quorum), - "threshold" => Ok(GeneratedField::Threshold), - "vetoThreshold" | "veto_threshold" => Ok(GeneratedField::VetoThreshold), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TallyParams; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.TallyParams") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut quorum__ = None; - let mut threshold__ = None; - let mut veto_threshold__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Quorum => { - if quorum__.is_some() { - return Err(serde::de::Error::duplicate_field("quorum")); - } - quorum__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Threshold => { - if threshold__.is_some() { - return Err(serde::de::Error::duplicate_field("threshold")); - } - threshold__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::VetoThreshold => { - if veto_threshold__.is_some() { - return Err(serde::de::Error::duplicate_field("vetoThreshold")); - } - veto_threshold__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - } - } - Ok(TallyParams { - quorum: quorum__.unwrap_or_default(), - threshold: threshold__.unwrap_or_default(), - veto_threshold: veto_threshold__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.TallyParams", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for TallyResult { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.TallyResult", len)?; - if true { - struct_ser.serialize_field("yes", &self.yes)?; - } - if true { - struct_ser.serialize_field("abstain", &self.abstain)?; - } - if true { - struct_ser.serialize_field("no", &self.no)?; - } - if true { - struct_ser.serialize_field("noWithVeto", &self.no_with_veto)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for TallyResult { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "yes", - "abstain", - "no", - "no_with_veto", - "noWithVeto", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Yes, - Abstain, - No, - NoWithVeto, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "yes" => Ok(GeneratedField::Yes), - "abstain" => Ok(GeneratedField::Abstain), - "no" => Ok(GeneratedField::No), - "noWithVeto" | "no_with_veto" => Ok(GeneratedField::NoWithVeto), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TallyResult; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.TallyResult") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut yes__ = None; - let mut abstain__ = None; - let mut no__ = None; - let mut no_with_veto__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Yes => { - if yes__.is_some() { - return Err(serde::de::Error::duplicate_field("yes")); - } - yes__ = Some(map_.next_value()?); - } - GeneratedField::Abstain => { - if abstain__.is_some() { - return Err(serde::de::Error::duplicate_field("abstain")); - } - abstain__ = Some(map_.next_value()?); - } - GeneratedField::No => { - if no__.is_some() { - return Err(serde::de::Error::duplicate_field("no")); - } - no__ = Some(map_.next_value()?); - } - GeneratedField::NoWithVeto => { - if no_with_veto__.is_some() { - return Err(serde::de::Error::duplicate_field("noWithVeto")); - } - no_with_veto__ = Some(map_.next_value()?); - } - } - } - Ok(TallyResult { - yes: yes__.unwrap_or_default(), - abstain: abstain__.unwrap_or_default(), - no: no__.unwrap_or_default(), - no_with_veto: no_with_veto__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.TallyResult", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for TextProposal { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.TextProposal", len)?; - if true { - struct_ser.serialize_field("title", &self.title)?; - } - if true { - struct_ser.serialize_field("description", &self.description)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for TextProposal { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "title", - "description", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Title, - Description, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "title" => Ok(GeneratedField::Title), - "description" => Ok(GeneratedField::Description), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TextProposal; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.TextProposal") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut title__ = None; - let mut description__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Title => { - if title__.is_some() { - return Err(serde::de::Error::duplicate_field("title")); - } - title__ = Some(map_.next_value()?); - } - GeneratedField::Description => { - if description__.is_some() { - return Err(serde::de::Error::duplicate_field("description")); - } - description__ = Some(map_.next_value()?); - } - } - } - Ok(TextProposal { - title: title__.unwrap_or_default(), - description: description__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.TextProposal", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Vote { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.Vote", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; - } - if true { - struct_ser.serialize_field("voter", &self.voter)?; - } - if true { - let v = VoteOption::try_from(self.option) - .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.option)))?; - struct_ser.serialize_field("option", &v)?; - } - if true { - struct_ser.serialize_field("options", &self.options)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Vote { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "proposal_id", - "proposalId", - "voter", - "option", - "options", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ProposalId, - Voter, - Option, - Options, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), - "voter" => Ok(GeneratedField::Voter), - "option" => Ok(GeneratedField::Option), - "options" => Ok(GeneratedField::Options), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Vote; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.Vote") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proposal_id__ = None; - let mut voter__ = None; - let mut option__ = None; - let mut options__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ProposalId => { - if proposal_id__.is_some() { - return Err(serde::de::Error::duplicate_field("proposalId")); - } - proposal_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Voter => { - if voter__.is_some() { - return Err(serde::de::Error::duplicate_field("voter")); - } - voter__ = Some(map_.next_value()?); - } - GeneratedField::Option => { - if option__.is_some() { - return Err(serde::de::Error::duplicate_field("option")); - } - option__ = Some(map_.next_value::()? as i32); - } - GeneratedField::Options => { - if options__.is_some() { - return Err(serde::de::Error::duplicate_field("options")); - } - options__ = Some(map_.next_value()?); - } - } - } - Ok(Vote { - proposal_id: proposal_id__.unwrap_or_default(), - voter: voter__.unwrap_or_default(), - option: option__.unwrap_or_default(), - options: options__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.Vote", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for VoteOption { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::Unspecified => "VOTE_OPTION_UNSPECIFIED", - Self::Yes => "VOTE_OPTION_YES", - Self::Abstain => "VOTE_OPTION_ABSTAIN", - Self::No => "VOTE_OPTION_NO", - Self::NoWithVeto => "VOTE_OPTION_NO_WITH_VETO", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for VoteOption { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "VOTE_OPTION_UNSPECIFIED", - "VOTE_OPTION_YES", - "VOTE_OPTION_ABSTAIN", - "VOTE_OPTION_NO", - "VOTE_OPTION_NO_WITH_VETO", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = VoteOption; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - fn visit_i64(self, v: i64) -> core::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> core::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "VOTE_OPTION_UNSPECIFIED" => Ok(VoteOption::Unspecified), - "VOTE_OPTION_YES" => Ok(VoteOption::Yes), - "VOTE_OPTION_ABSTAIN" => Ok(VoteOption::Abstain), - "VOTE_OPTION_NO" => Ok(VoteOption::No), - "VOTE_OPTION_NO_WITH_VETO" => Ok(VoteOption::NoWithVeto), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for VotingParams { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.VotingParams", len)?; - if let Some(v) = self.voting_period.as_ref() { - struct_ser.serialize_field("votingPeriod", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for VotingParams { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "voting_period", - "votingPeriod", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - VotingPeriod, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "votingPeriod" | "voting_period" => Ok(GeneratedField::VotingPeriod), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = VotingParams; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.VotingParams") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut voting_period__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::VotingPeriod => { - if voting_period__.is_some() { - return Err(serde::de::Error::duplicate_field("votingPeriod")); - } - voting_period__ = map_.next_value()?; - } - } - } - Ok(VotingParams { - voting_period: voting_period__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.VotingParams", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for WeightedVoteOption { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.WeightedVoteOption", len)?; - if true { - let v = VoteOption::try_from(self.option) - .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.option)))?; - struct_ser.serialize_field("option", &v)?; - } - if true { - struct_ser.serialize_field("weight", &self.weight)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for WeightedVoteOption { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "option", - "weight", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Option, - Weight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "option" => Ok(GeneratedField::Option), - "weight" => Ok(GeneratedField::Weight), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = WeightedVoteOption; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.gov.v1beta1.WeightedVoteOption") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut option__ = None; - let mut weight__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Option => { - if option__.is_some() { - return Err(serde::de::Error::duplicate_field("option")); - } - option__ = Some(map_.next_value::()? as i32); - } - GeneratedField::Weight => { - if weight__.is_some() { - return Err(serde::de::Error::duplicate_field("weight")); - } - weight__ = Some(map_.next_value()?); - } - } - } - Ok(WeightedVoteOption { - option: option__.unwrap_or_default(), - weight: weight__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1beta1.WeightedVoteOption", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.ics23.v1.serde.rs b/src/prost/cosmos.ics23.v1.serde.rs deleted file mode 100644 index 776025f5..00000000 --- a/src/prost/cosmos.ics23.v1.serde.rs +++ /dev/null @@ -1,1936 +0,0 @@ -impl serde::Serialize for BatchEntry { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.proof.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.ics23.v1.BatchEntry", len)?; - if let Some(v) = self.proof.as_ref() { - match v { - batch_entry::Proof::Exist(v) => { - struct_ser.serialize_field("exist", v)?; - } - batch_entry::Proof::Nonexist(v) => { - struct_ser.serialize_field("nonexist", v)?; - } - } - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for BatchEntry { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "exist", - "nonexist", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Exist, - Nonexist, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "exist" => Ok(GeneratedField::Exist), - "nonexist" => Ok(GeneratedField::Nonexist), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = BatchEntry; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.ics23.v1.BatchEntry") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proof__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Exist => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("exist")); - } - proof__ = map_.next_value::<::core::option::Option<_>>()?.map(batch_entry::Proof::Exist) -; - } - GeneratedField::Nonexist => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("nonexist")); - } - proof__ = map_.next_value::<::core::option::Option<_>>()?.map(batch_entry::Proof::Nonexist) -; - } - } - } - Ok(BatchEntry { - proof: proof__, - }) - } - } - deserializer.deserialize_struct("cosmos.ics23.v1.BatchEntry", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for BatchProof { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.ics23.v1.BatchProof", len)?; - if true { - struct_ser.serialize_field("entries", &self.entries)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for BatchProof { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "entries", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Entries, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "entries" => Ok(GeneratedField::Entries), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = BatchProof; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.ics23.v1.BatchProof") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut entries__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Entries => { - if entries__.is_some() { - return Err(serde::de::Error::duplicate_field("entries")); - } - entries__ = Some(map_.next_value()?); - } - } - } - Ok(BatchProof { - entries: entries__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.ics23.v1.BatchProof", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for CommitmentProof { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.proof.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.ics23.v1.CommitmentProof", len)?; - if let Some(v) = self.proof.as_ref() { - match v { - commitment_proof::Proof::Exist(v) => { - struct_ser.serialize_field("exist", v)?; - } - commitment_proof::Proof::Nonexist(v) => { - struct_ser.serialize_field("nonexist", v)?; - } - commitment_proof::Proof::Batch(v) => { - struct_ser.serialize_field("batch", v)?; - } - commitment_proof::Proof::Compressed(v) => { - struct_ser.serialize_field("compressed", v)?; - } - } - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CommitmentProof { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "exist", - "nonexist", - "batch", - "compressed", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Exist, - Nonexist, - Batch, - Compressed, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "exist" => Ok(GeneratedField::Exist), - "nonexist" => Ok(GeneratedField::Nonexist), - "batch" => Ok(GeneratedField::Batch), - "compressed" => Ok(GeneratedField::Compressed), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CommitmentProof; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.ics23.v1.CommitmentProof") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proof__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Exist => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("exist")); - } - proof__ = map_.next_value::<::core::option::Option<_>>()?.map(commitment_proof::Proof::Exist) -; - } - GeneratedField::Nonexist => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("nonexist")); - } - proof__ = map_.next_value::<::core::option::Option<_>>()?.map(commitment_proof::Proof::Nonexist) -; - } - GeneratedField::Batch => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("batch")); - } - proof__ = map_.next_value::<::core::option::Option<_>>()?.map(commitment_proof::Proof::Batch) -; - } - GeneratedField::Compressed => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("compressed")); - } - proof__ = map_.next_value::<::core::option::Option<_>>()?.map(commitment_proof::Proof::Compressed) -; - } - } - } - Ok(CommitmentProof { - proof: proof__, - }) - } - } - deserializer.deserialize_struct("cosmos.ics23.v1.CommitmentProof", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for CompressedBatchEntry { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.proof.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.ics23.v1.CompressedBatchEntry", len)?; - if let Some(v) = self.proof.as_ref() { - match v { - compressed_batch_entry::Proof::Exist(v) => { - struct_ser.serialize_field("exist", v)?; - } - compressed_batch_entry::Proof::Nonexist(v) => { - struct_ser.serialize_field("nonexist", v)?; - } - } - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CompressedBatchEntry { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "exist", - "nonexist", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Exist, - Nonexist, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "exist" => Ok(GeneratedField::Exist), - "nonexist" => Ok(GeneratedField::Nonexist), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CompressedBatchEntry; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.ics23.v1.CompressedBatchEntry") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proof__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Exist => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("exist")); - } - proof__ = map_.next_value::<::core::option::Option<_>>()?.map(compressed_batch_entry::Proof::Exist) -; - } - GeneratedField::Nonexist => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("nonexist")); - } - proof__ = map_.next_value::<::core::option::Option<_>>()?.map(compressed_batch_entry::Proof::Nonexist) -; - } - } - } - Ok(CompressedBatchEntry { - proof: proof__, - }) - } - } - deserializer.deserialize_struct("cosmos.ics23.v1.CompressedBatchEntry", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for CompressedBatchProof { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.ics23.v1.CompressedBatchProof", len)?; - if true { - struct_ser.serialize_field("entries", &self.entries)?; - } - if true { - struct_ser.serialize_field("lookupInners", &self.lookup_inners)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CompressedBatchProof { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "entries", - "lookup_inners", - "lookupInners", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Entries, - LookupInners, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "entries" => Ok(GeneratedField::Entries), - "lookupInners" | "lookup_inners" => Ok(GeneratedField::LookupInners), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CompressedBatchProof; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.ics23.v1.CompressedBatchProof") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut entries__ = None; - let mut lookup_inners__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Entries => { - if entries__.is_some() { - return Err(serde::de::Error::duplicate_field("entries")); - } - entries__ = Some(map_.next_value()?); - } - GeneratedField::LookupInners => { - if lookup_inners__.is_some() { - return Err(serde::de::Error::duplicate_field("lookupInners")); - } - lookup_inners__ = Some(map_.next_value()?); - } - } - } - Ok(CompressedBatchProof { - entries: entries__.unwrap_or_default(), - lookup_inners: lookup_inners__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.ics23.v1.CompressedBatchProof", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for CompressedExistenceProof { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.ics23.v1.CompressedExistenceProof", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("value", pbjson::private::base64::encode(&self.value).as_str())?; - } - if let Some(v) = self.leaf.as_ref() { - struct_ser.serialize_field("leaf", v)?; - } - if true { - struct_ser.serialize_field("path", &self.path)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CompressedExistenceProof { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "key", - "value", - "leaf", - "path", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - Value, - Leaf, - Path, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "key" => Ok(GeneratedField::Key), - "value" => Ok(GeneratedField::Value), - "leaf" => Ok(GeneratedField::Leaf), - "path" => Ok(GeneratedField::Path), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CompressedExistenceProof; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.ics23.v1.CompressedExistenceProof") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut key__ = None; - let mut value__ = None; - let mut leaf__ = None; - let mut path__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Key => { - if key__.is_some() { - return Err(serde::de::Error::duplicate_field("key")); - } - key__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Value => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("value")); - } - value__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Leaf => { - if leaf__.is_some() { - return Err(serde::de::Error::duplicate_field("leaf")); - } - leaf__ = map_.next_value()?; - } - GeneratedField::Path => { - if path__.is_some() { - return Err(serde::de::Error::duplicate_field("path")); - } - path__ = - Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::NumberDeserialize<_>>>()? - .into_iter().map(|x| x.0).collect()) - ; - } - } - } - Ok(CompressedExistenceProof { - key: key__.unwrap_or_default(), - value: value__.unwrap_or_default(), - leaf: leaf__, - path: path__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.ics23.v1.CompressedExistenceProof", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for CompressedNonExistenceProof { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.ics23.v1.CompressedNonExistenceProof", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - if let Some(v) = self.left.as_ref() { - struct_ser.serialize_field("left", v)?; - } - if let Some(v) = self.right.as_ref() { - struct_ser.serialize_field("right", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CompressedNonExistenceProof { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "key", - "left", - "right", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - Left, - Right, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "key" => Ok(GeneratedField::Key), - "left" => Ok(GeneratedField::Left), - "right" => Ok(GeneratedField::Right), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CompressedNonExistenceProof; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.ics23.v1.CompressedNonExistenceProof") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut key__ = None; - let mut left__ = None; - let mut right__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Key => { - if key__.is_some() { - return Err(serde::de::Error::duplicate_field("key")); - } - key__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Left => { - if left__.is_some() { - return Err(serde::de::Error::duplicate_field("left")); - } - left__ = map_.next_value()?; - } - GeneratedField::Right => { - if right__.is_some() { - return Err(serde::de::Error::duplicate_field("right")); - } - right__ = map_.next_value()?; - } - } - } - Ok(CompressedNonExistenceProof { - key: key__.unwrap_or_default(), - left: left__, - right: right__, - }) - } - } - deserializer.deserialize_struct("cosmos.ics23.v1.CompressedNonExistenceProof", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for ExistenceProof { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.ics23.v1.ExistenceProof", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("value", pbjson::private::base64::encode(&self.value).as_str())?; - } - if let Some(v) = self.leaf.as_ref() { - struct_ser.serialize_field("leaf", v)?; - } - if true { - struct_ser.serialize_field("path", &self.path)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ExistenceProof { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "key", - "value", - "leaf", - "path", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - Value, - Leaf, - Path, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "key" => Ok(GeneratedField::Key), - "value" => Ok(GeneratedField::Value), - "leaf" => Ok(GeneratedField::Leaf), - "path" => Ok(GeneratedField::Path), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ExistenceProof; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.ics23.v1.ExistenceProof") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut key__ = None; - let mut value__ = None; - let mut leaf__ = None; - let mut path__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Key => { - if key__.is_some() { - return Err(serde::de::Error::duplicate_field("key")); - } - key__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Value => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("value")); - } - value__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Leaf => { - if leaf__.is_some() { - return Err(serde::de::Error::duplicate_field("leaf")); - } - leaf__ = map_.next_value()?; - } - GeneratedField::Path => { - if path__.is_some() { - return Err(serde::de::Error::duplicate_field("path")); - } - path__ = Some(map_.next_value()?); - } - } - } - Ok(ExistenceProof { - key: key__.unwrap_or_default(), - value: value__.unwrap_or_default(), - leaf: leaf__, - path: path__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.ics23.v1.ExistenceProof", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for HashOp { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::NoHash => "NO_HASH", - Self::Sha256 => "SHA256", - Self::Sha512 => "SHA512", - Self::Keccak => "KECCAK", - Self::Ripemd160 => "RIPEMD160", - Self::Bitcoin => "BITCOIN", - Self::Sha512256 => "SHA512_256", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for HashOp { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "NO_HASH", - "SHA256", - "SHA512", - "KECCAK", - "RIPEMD160", - "BITCOIN", - "SHA512_256", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = HashOp; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - fn visit_i64(self, v: i64) -> core::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> core::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "NO_HASH" => Ok(HashOp::NoHash), - "SHA256" => Ok(HashOp::Sha256), - "SHA512" => Ok(HashOp::Sha512), - "KECCAK" => Ok(HashOp::Keccak), - "RIPEMD160" => Ok(HashOp::Ripemd160), - "BITCOIN" => Ok(HashOp::Bitcoin), - "SHA512_256" => Ok(HashOp::Sha512256), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for InnerOp { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.ics23.v1.InnerOp", len)?; - if true { - let v = HashOp::try_from(self.hash) - .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.hash)))?; - struct_ser.serialize_field("hash", &v)?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("prefix", pbjson::private::base64::encode(&self.prefix).as_str())?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("suffix", pbjson::private::base64::encode(&self.suffix).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for InnerOp { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "hash", - "prefix", - "suffix", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Hash, - Prefix, - Suffix, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "hash" => Ok(GeneratedField::Hash), - "prefix" => Ok(GeneratedField::Prefix), - "suffix" => Ok(GeneratedField::Suffix), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = InnerOp; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.ics23.v1.InnerOp") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut hash__ = None; - let mut prefix__ = None; - let mut suffix__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Hash => { - if hash__.is_some() { - return Err(serde::de::Error::duplicate_field("hash")); - } - hash__ = Some(map_.next_value::()? as i32); - } - GeneratedField::Prefix => { - if prefix__.is_some() { - return Err(serde::de::Error::duplicate_field("prefix")); - } - prefix__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Suffix => { - if suffix__.is_some() { - return Err(serde::de::Error::duplicate_field("suffix")); - } - suffix__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - } - } - Ok(InnerOp { - hash: hash__.unwrap_or_default(), - prefix: prefix__.unwrap_or_default(), - suffix: suffix__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.ics23.v1.InnerOp", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for InnerSpec { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.ics23.v1.InnerSpec", len)?; - if true { - struct_ser.serialize_field("childOrder", &self.child_order)?; - } - if true { - struct_ser.serialize_field("childSize", &self.child_size)?; - } - if true { - struct_ser.serialize_field("minPrefixLength", &self.min_prefix_length)?; - } - if true { - struct_ser.serialize_field("maxPrefixLength", &self.max_prefix_length)?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("emptyChild", pbjson::private::base64::encode(&self.empty_child).as_str())?; - } - if true { - let v = HashOp::try_from(self.hash) - .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.hash)))?; - struct_ser.serialize_field("hash", &v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for InnerSpec { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "child_order", - "childOrder", - "child_size", - "childSize", - "min_prefix_length", - "minPrefixLength", - "max_prefix_length", - "maxPrefixLength", - "empty_child", - "emptyChild", - "hash", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ChildOrder, - ChildSize, - MinPrefixLength, - MaxPrefixLength, - EmptyChild, - Hash, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "childOrder" | "child_order" => Ok(GeneratedField::ChildOrder), - "childSize" | "child_size" => Ok(GeneratedField::ChildSize), - "minPrefixLength" | "min_prefix_length" => Ok(GeneratedField::MinPrefixLength), - "maxPrefixLength" | "max_prefix_length" => Ok(GeneratedField::MaxPrefixLength), - "emptyChild" | "empty_child" => Ok(GeneratedField::EmptyChild), - "hash" => Ok(GeneratedField::Hash), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = InnerSpec; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.ics23.v1.InnerSpec") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut child_order__ = None; - let mut child_size__ = None; - let mut min_prefix_length__ = None; - let mut max_prefix_length__ = None; - let mut empty_child__ = None; - let mut hash__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ChildOrder => { - if child_order__.is_some() { - return Err(serde::de::Error::duplicate_field("childOrder")); - } - child_order__ = - Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::NumberDeserialize<_>>>()? - .into_iter().map(|x| x.0).collect()) - ; - } - GeneratedField::ChildSize => { - if child_size__.is_some() { - return Err(serde::de::Error::duplicate_field("childSize")); - } - child_size__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::MinPrefixLength => { - if min_prefix_length__.is_some() { - return Err(serde::de::Error::duplicate_field("minPrefixLength")); - } - min_prefix_length__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::MaxPrefixLength => { - if max_prefix_length__.is_some() { - return Err(serde::de::Error::duplicate_field("maxPrefixLength")); - } - max_prefix_length__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::EmptyChild => { - if empty_child__.is_some() { - return Err(serde::de::Error::duplicate_field("emptyChild")); - } - empty_child__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Hash => { - if hash__.is_some() { - return Err(serde::de::Error::duplicate_field("hash")); - } - hash__ = Some(map_.next_value::()? as i32); - } - } - } - Ok(InnerSpec { - child_order: child_order__.unwrap_or_default(), - child_size: child_size__.unwrap_or_default(), - min_prefix_length: min_prefix_length__.unwrap_or_default(), - max_prefix_length: max_prefix_length__.unwrap_or_default(), - empty_child: empty_child__.unwrap_or_default(), - hash: hash__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.ics23.v1.InnerSpec", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for LeafOp { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.ics23.v1.LeafOp", len)?; - if true { - let v = HashOp::try_from(self.hash) - .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.hash)))?; - struct_ser.serialize_field("hash", &v)?; - } - if true { - let v = HashOp::try_from(self.prehash_key) - .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.prehash_key)))?; - struct_ser.serialize_field("prehashKey", &v)?; - } - if true { - let v = HashOp::try_from(self.prehash_value) - .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.prehash_value)))?; - struct_ser.serialize_field("prehashValue", &v)?; - } - if true { - let v = LengthOp::try_from(self.length) - .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.length)))?; - struct_ser.serialize_field("length", &v)?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("prefix", pbjson::private::base64::encode(&self.prefix).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for LeafOp { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "hash", - "prehash_key", - "prehashKey", - "prehash_value", - "prehashValue", - "length", - "prefix", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Hash, - PrehashKey, - PrehashValue, - Length, - Prefix, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "hash" => Ok(GeneratedField::Hash), - "prehashKey" | "prehash_key" => Ok(GeneratedField::PrehashKey), - "prehashValue" | "prehash_value" => Ok(GeneratedField::PrehashValue), - "length" => Ok(GeneratedField::Length), - "prefix" => Ok(GeneratedField::Prefix), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = LeafOp; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.ics23.v1.LeafOp") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut hash__ = None; - let mut prehash_key__ = None; - let mut prehash_value__ = None; - let mut length__ = None; - let mut prefix__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Hash => { - if hash__.is_some() { - return Err(serde::de::Error::duplicate_field("hash")); - } - hash__ = Some(map_.next_value::()? as i32); - } - GeneratedField::PrehashKey => { - if prehash_key__.is_some() { - return Err(serde::de::Error::duplicate_field("prehashKey")); - } - prehash_key__ = Some(map_.next_value::()? as i32); - } - GeneratedField::PrehashValue => { - if prehash_value__.is_some() { - return Err(serde::de::Error::duplicate_field("prehashValue")); - } - prehash_value__ = Some(map_.next_value::()? as i32); - } - GeneratedField::Length => { - if length__.is_some() { - return Err(serde::de::Error::duplicate_field("length")); - } - length__ = Some(map_.next_value::()? as i32); - } - GeneratedField::Prefix => { - if prefix__.is_some() { - return Err(serde::de::Error::duplicate_field("prefix")); - } - prefix__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - } - } - Ok(LeafOp { - hash: hash__.unwrap_or_default(), - prehash_key: prehash_key__.unwrap_or_default(), - prehash_value: prehash_value__.unwrap_or_default(), - length: length__.unwrap_or_default(), - prefix: prefix__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.ics23.v1.LeafOp", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for LengthOp { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::NoPrefix => "NO_PREFIX", - Self::VarProto => "VAR_PROTO", - Self::VarRlp => "VAR_RLP", - Self::Fixed32Big => "FIXED32_BIG", - Self::Fixed32Little => "FIXED32_LITTLE", - Self::Fixed64Big => "FIXED64_BIG", - Self::Fixed64Little => "FIXED64_LITTLE", - Self::Require32Bytes => "REQUIRE_32_BYTES", - Self::Require64Bytes => "REQUIRE_64_BYTES", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for LengthOp { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "NO_PREFIX", - "VAR_PROTO", - "VAR_RLP", - "FIXED32_BIG", - "FIXED32_LITTLE", - "FIXED64_BIG", - "FIXED64_LITTLE", - "REQUIRE_32_BYTES", - "REQUIRE_64_BYTES", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = LengthOp; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - fn visit_i64(self, v: i64) -> core::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> core::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "NO_PREFIX" => Ok(LengthOp::NoPrefix), - "VAR_PROTO" => Ok(LengthOp::VarProto), - "VAR_RLP" => Ok(LengthOp::VarRlp), - "FIXED32_BIG" => Ok(LengthOp::Fixed32Big), - "FIXED32_LITTLE" => Ok(LengthOp::Fixed32Little), - "FIXED64_BIG" => Ok(LengthOp::Fixed64Big), - "FIXED64_LITTLE" => Ok(LengthOp::Fixed64Little), - "REQUIRE_32_BYTES" => Ok(LengthOp::Require32Bytes), - "REQUIRE_64_BYTES" => Ok(LengthOp::Require64Bytes), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for NonExistenceProof { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.ics23.v1.NonExistenceProof", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - if let Some(v) = self.left.as_ref() { - struct_ser.serialize_field("left", v)?; - } - if let Some(v) = self.right.as_ref() { - struct_ser.serialize_field("right", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for NonExistenceProof { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "key", - "left", - "right", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - Left, - Right, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "key" => Ok(GeneratedField::Key), - "left" => Ok(GeneratedField::Left), - "right" => Ok(GeneratedField::Right), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = NonExistenceProof; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.ics23.v1.NonExistenceProof") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut key__ = None; - let mut left__ = None; - let mut right__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Key => { - if key__.is_some() { - return Err(serde::de::Error::duplicate_field("key")); - } - key__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Left => { - if left__.is_some() { - return Err(serde::de::Error::duplicate_field("left")); - } - left__ = map_.next_value()?; - } - GeneratedField::Right => { - if right__.is_some() { - return Err(serde::de::Error::duplicate_field("right")); - } - right__ = map_.next_value()?; - } - } - } - Ok(NonExistenceProof { - key: key__.unwrap_or_default(), - left: left__, - right: right__, - }) - } - } - deserializer.deserialize_struct("cosmos.ics23.v1.NonExistenceProof", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for ProofSpec { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.ics23.v1.ProofSpec", len)?; - if let Some(v) = self.leaf_spec.as_ref() { - struct_ser.serialize_field("leafSpec", v)?; - } - if let Some(v) = self.inner_spec.as_ref() { - struct_ser.serialize_field("innerSpec", v)?; - } - if true { - struct_ser.serialize_field("maxDepth", &self.max_depth)?; - } - if true { - struct_ser.serialize_field("minDepth", &self.min_depth)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ProofSpec { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "leaf_spec", - "leafSpec", - "inner_spec", - "innerSpec", - "max_depth", - "maxDepth", - "min_depth", - "minDepth", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - LeafSpec, - InnerSpec, - MaxDepth, - MinDepth, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "leafSpec" | "leaf_spec" => Ok(GeneratedField::LeafSpec), - "innerSpec" | "inner_spec" => Ok(GeneratedField::InnerSpec), - "maxDepth" | "max_depth" => Ok(GeneratedField::MaxDepth), - "minDepth" | "min_depth" => Ok(GeneratedField::MinDepth), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ProofSpec; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.ics23.v1.ProofSpec") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut leaf_spec__ = None; - let mut inner_spec__ = None; - let mut max_depth__ = None; - let mut min_depth__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::LeafSpec => { - if leaf_spec__.is_some() { - return Err(serde::de::Error::duplicate_field("leafSpec")); - } - leaf_spec__ = map_.next_value()?; - } - GeneratedField::InnerSpec => { - if inner_spec__.is_some() { - return Err(serde::de::Error::duplicate_field("innerSpec")); - } - inner_spec__ = map_.next_value()?; - } - GeneratedField::MaxDepth => { - if max_depth__.is_some() { - return Err(serde::de::Error::duplicate_field("maxDepth")); - } - max_depth__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::MinDepth => { - if min_depth__.is_some() { - return Err(serde::de::Error::duplicate_field("minDepth")); - } - min_depth__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(ProofSpec { - leaf_spec: leaf_spec__, - inner_spec: inner_spec__, - max_depth: max_depth__.unwrap_or_default(), - min_depth: min_depth__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.ics23.v1.ProofSpec", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.staking.module.v1.rs b/src/prost/cosmos.staking.module.v1.rs deleted file mode 100644 index 803365bf..00000000 --- a/src/prost/cosmos.staking.module.v1.rs +++ /dev/null @@ -1,24 +0,0 @@ -// This file is @generated by prost-build. -/// Module is the config object of the staking module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -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, -} -impl ::prost::Name for Module { - const NAME: &'static str = "Module"; - const PACKAGE: &'static str = "cosmos.staking.module.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.module.v1.Module".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.module.v1.Module".into() - } -} diff --git a/src/prost/cosmos.staking.module.v1.serde.rs b/src/prost/cosmos.staking.module.v1.serde.rs deleted file mode 100644 index f9224074..00000000 --- a/src/prost/cosmos.staking.module.v1.serde.rs +++ /dev/null @@ -1,109 +0,0 @@ -impl serde::Serialize for Module { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.module.v1.Module", len)?; - if true { - struct_ser.serialize_field("hooksOrder", &self.hooks_order)?; - } - if true { - struct_ser.serialize_field("authority", &self.authority)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Module { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "hooks_order", - "hooksOrder", - "authority", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - HooksOrder, - Authority, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "hooksOrder" | "hooks_order" => Ok(GeneratedField::HooksOrder), - "authority" => Ok(GeneratedField::Authority), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Module; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.module.v1.Module") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut hooks_order__ = None; - let mut authority__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::HooksOrder => { - if hooks_order__.is_some() { - return Err(serde::de::Error::duplicate_field("hooksOrder")); - } - hooks_order__ = Some(map_.next_value()?); - } - GeneratedField::Authority => { - if authority__.is_some() { - return Err(serde::de::Error::duplicate_field("authority")); - } - authority__ = Some(map_.next_value()?); - } - } - } - Ok(Module { - hooks_order: hooks_order__.unwrap_or_default(), - authority: authority__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.staking.module.v1.Module", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.staking.v1beta1.rs b/src/prost/cosmos.staking.v1beta1.rs deleted file mode 100644 index 12664b88..00000000 --- a/src/prost/cosmos.staking.v1beta1.rs +++ /dev/null @@ -1,3901 +0,0 @@ -// This file is @generated by prost-build. -/// HistoricalInfo contains header and validator information for a given block. -/// It is stored as part of staking module's state, which persists the `n` most -/// recent HistoricalInfo -/// (`n` is set by the staking module's `historical_entries` parameter). -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct HistoricalInfo { - #[prost(message, optional, tag = "1")] - pub header: ::core::option::Option<::tendermint_proto::types::Header>, - #[prost(message, repeated, tag = "2")] - pub valset: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for HistoricalInfo { - const NAME: &'static str = "HistoricalInfo"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.HistoricalInfo".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.HistoricalInfo".into() - } -} -/// CommissionRates defines the initial commission rates to be used for creating -/// a validator. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CommissionRates { - /// rate is the commission rate charged to delegators, as a fraction. - #[prost(string, tag = "1")] - pub rate: ::prost::alloc::string::String, - /// max_rate defines the maximum commission rate which validator can ever charge, as a fraction. - #[prost(string, tag = "2")] - pub max_rate: ::prost::alloc::string::String, - /// max_change_rate defines the maximum daily increase of the validator commission, as a fraction. - #[prost(string, tag = "3")] - pub max_change_rate: ::prost::alloc::string::String, -} -impl ::prost::Name for CommissionRates { - const NAME: &'static str = "CommissionRates"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.CommissionRates".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.CommissionRates".into() - } -} -/// Commission defines commission parameters for a given validator. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Commission { - /// commission_rates defines the initial commission rates to be used for creating a validator. - #[prost(message, optional, tag = "1")] - pub commission_rates: ::core::option::Option, - /// update_time is the last time the commission rate was changed. - #[prost(message, optional, tag = "2")] - pub update_time: ::core::option::Option< - ::tendermint_proto::google::protobuf::Timestamp, - >, -} -impl ::prost::Name for Commission { - const NAME: &'static str = "Commission"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.Commission".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.Commission".into() - } -} -/// Description defines a validator description. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Description { - /// moniker defines a human-readable name for the validator. - #[prost(string, tag = "1")] - pub moniker: ::prost::alloc::string::String, - /// identity defines an optional identity signature (ex. UPort or Keybase). - #[prost(string, tag = "2")] - pub identity: ::prost::alloc::string::String, - /// website defines an optional website link. - #[prost(string, tag = "3")] - pub website: ::prost::alloc::string::String, - /// security_contact defines an optional email for security contact. - #[prost(string, tag = "4")] - pub security_contact: ::prost::alloc::string::String, - /// details define other optional details. - #[prost(string, tag = "5")] - pub details: ::prost::alloc::string::String, -} -impl ::prost::Name for Description { - const NAME: &'static str = "Description"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.Description".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.Description".into() - } -} -/// Validator defines a validator, together with the total amount of the -/// Validator's bond shares and their exchange rate to coins. Slashing results in -/// a decrease in the exchange rate, allowing correct calculation of future -/// undelegations without iterating over delegators. When coins are delegated to -/// this validator, the validator is credited with a delegation whose number of -/// bond shares is based on the amount of coins delegated divided by the current -/// exchange rate. Voting power can be calculated as total bonded shares -/// multiplied by exchange rate. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Validator { - /// operator_address defines the address of the validator's operator; bech encoded in JSON. - #[prost(string, tag = "1")] - pub operator_address: ::prost::alloc::string::String, - /// consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. - #[prost(message, optional, tag = "2")] - pub consensus_pubkey: ::core::option::Option< - ::tendermint_proto::google::protobuf::Any, - >, - /// jailed defined whether the validator has been jailed from bonded status or not. - #[prost(bool, tag = "3")] - pub jailed: bool, - /// status is the validator status (bonded/unbonding/unbonded). - #[prost(enumeration = "BondStatus", tag = "4")] - pub status: i32, - /// tokens define the delegated tokens (incl. self-delegation). - #[prost(string, tag = "5")] - pub tokens: ::prost::alloc::string::String, - /// delegator_shares defines total shares issued to a validator's delegators. - #[prost(string, tag = "6")] - pub delegator_shares: ::prost::alloc::string::String, - /// description defines the description terms for the validator. - #[prost(message, optional, tag = "7")] - pub description: ::core::option::Option, - /// unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. - #[prost(int64, tag = "8")] - pub unbonding_height: i64, - /// unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. - #[prost(message, optional, tag = "9")] - pub unbonding_time: ::core::option::Option< - ::tendermint_proto::google::protobuf::Timestamp, - >, - /// commission defines the commission parameters. - #[prost(message, optional, tag = "10")] - pub commission: ::core::option::Option, - /// min_self_delegation is the validator's self declared minimum self delegation. - /// - /// 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")] - pub unbonding_on_hold_ref_count: i64, - /// list of unbonding ids, each uniquely identifing an unbonding of this validator - #[prost(uint64, repeated, tag = "13")] - pub unbonding_ids: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for Validator { - const NAME: &'static str = "Validator"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.Validator".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.Validator".into() - } -} -/// ValAddresses defines a repeated set of validator addresses. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ValAddresses { - #[prost(string, repeated, tag = "1")] - pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -impl ::prost::Name for ValAddresses { - const NAME: &'static str = "ValAddresses"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.ValAddresses".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.ValAddresses".into() - } -} -/// DVPair is struct that just has a delegator-validator pair with no other data. -/// It is intended to be used as a marshalable pointer. For example, a DVPair can -/// be used to construct the key to getting an UnbondingDelegation from state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DvPair { - #[prost(string, tag = "1")] - pub delegator_address: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub validator_address: ::prost::alloc::string::String, -} -impl ::prost::Name for DvPair { - const NAME: &'static str = "DVPair"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.DVPair".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.DVPair".into() - } -} -/// DVPairs defines an array of DVPair objects. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DvPairs { - #[prost(message, repeated, tag = "1")] - pub pairs: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for DvPairs { - const NAME: &'static str = "DVPairs"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.DVPairs".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.DVPairs".into() - } -} -/// DVVTriplet is struct that just has a delegator-validator-validator triplet -/// with no other data. It is intended to be used as a marshalable pointer. For -/// example, a DVVTriplet can be used to construct the key to getting a -/// Redelegation from state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DvvTriplet { - #[prost(string, tag = "1")] - pub delegator_address: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub validator_src_address: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub validator_dst_address: ::prost::alloc::string::String, -} -impl ::prost::Name for DvvTriplet { - const NAME: &'static str = "DVVTriplet"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.DVVTriplet".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.DVVTriplet".into() - } -} -/// DVVTriplets defines an array of DVVTriplet objects. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DvvTriplets { - #[prost(message, repeated, tag = "1")] - pub triplets: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for DvvTriplets { - const NAME: &'static str = "DVVTriplets"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.DVVTriplets".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.DVVTriplets".into() - } -} -/// Delegation represents the bond with tokens held by an account. It is -/// owned by one delegator, and is associated with the voting power of one -/// validator. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Delegation { - /// 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 bech32-encoded address of the validator. - #[prost(string, tag = "2")] - pub validator_address: ::prost::alloc::string::String, - /// shares define the delegation shares received. - #[prost(string, tag = "3")] - pub shares: ::prost::alloc::string::String, -} -impl ::prost::Name for Delegation { - const NAME: &'static str = "Delegation"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.Delegation".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.Delegation".into() - } -} -/// UnbondingDelegation stores all of a single delegator's unbonding bonds -/// for a single validator in an time-ordered list. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UnbondingDelegation { - /// 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 bech32-encoded address of the validator. - #[prost(string, tag = "2")] - pub validator_address: ::prost::alloc::string::String, - /// entries are the unbonding delegation entries. - /// - /// unbonding delegation entries - #[prost(message, repeated, tag = "3")] - pub entries: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for UnbondingDelegation { - const NAME: &'static str = "UnbondingDelegation"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.UnbondingDelegation".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.UnbondingDelegation".into() - } -} -/// UnbondingDelegationEntry defines an unbonding object with relevant metadata. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UnbondingDelegationEntry { - /// creation_height is the height which the unbonding took place. - #[prost(int64, tag = "1")] - pub creation_height: i64, - /// completion_time is the unix time for unbonding completion. - #[prost(message, optional, tag = "2")] - pub completion_time: ::core::option::Option< - ::tendermint_proto::google::protobuf::Timestamp, - >, - /// initial_balance defines the tokens initially scheduled to receive at completion. - #[prost(string, tag = "3")] - pub initial_balance: ::prost::alloc::string::String, - /// 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")] - pub unbonding_id: u64, - /// Strictly positive if this entry's unbonding has been stopped by external modules - #[prost(int64, tag = "6")] - pub unbonding_on_hold_ref_count: i64, -} -impl ::prost::Name for UnbondingDelegationEntry { - const NAME: &'static str = "UnbondingDelegationEntry"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.UnbondingDelegationEntry".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.UnbondingDelegationEntry".into() - } -} -/// RedelegationEntry defines a redelegation object with relevant metadata. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RedelegationEntry { - /// creation_height defines the height which the redelegation took place. - #[prost(int64, tag = "1")] - pub creation_height: i64, - /// completion_time defines the unix time for redelegation completion. - #[prost(message, optional, tag = "2")] - pub completion_time: ::core::option::Option< - ::tendermint_proto::google::protobuf::Timestamp, - >, - /// initial_balance defines the initial balance when redelegation started. - #[prost(string, tag = "3")] - pub initial_balance: ::prost::alloc::string::String, - /// shares_dst is the amount of destination-validator shares created by redelegation. - #[prost(string, tag = "4")] - pub shares_dst: ::prost::alloc::string::String, - /// Incrementing id that uniquely identifies this entry - #[prost(uint64, tag = "5")] - pub unbonding_id: u64, - /// Strictly positive if this entry's unbonding has been stopped by external modules - #[prost(int64, tag = "6")] - pub unbonding_on_hold_ref_count: i64, -} -impl ::prost::Name for RedelegationEntry { - const NAME: &'static str = "RedelegationEntry"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.RedelegationEntry".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.RedelegationEntry".into() - } -} -/// Redelegation contains the list of a particular delegator's redelegating bonds -/// from a particular source validator to a particular destination validator. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Redelegation { - /// delegator_address is the bech32-encoded address of the delegator. - #[prost(string, tag = "1")] - pub delegator_address: ::prost::alloc::string::String, - /// validator_src_address is the validator redelegation source operator address. - #[prost(string, tag = "2")] - pub validator_src_address: ::prost::alloc::string::String, - /// validator_dst_address is the validator redelegation destination operator address. - #[prost(string, tag = "3")] - pub validator_dst_address: ::prost::alloc::string::String, - /// entries are the redelegation entries. - /// - /// redelegation entries - #[prost(message, repeated, tag = "4")] - pub entries: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for Redelegation { - const NAME: &'static str = "Redelegation"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.Redelegation".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.Redelegation".into() - } -} -/// Params defines the parameters for the x/staking module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Params { - /// unbonding_time is the time duration of unbonding. - #[prost(message, optional, tag = "1")] - pub unbonding_time: ::core::option::Option< - ::tendermint_proto::google::protobuf::Duration, - >, - /// max_validators is the maximum number of validators. - #[prost(uint32, tag = "2")] - pub max_validators: u32, - /// max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). - #[prost(uint32, tag = "3")] - pub max_entries: u32, - /// historical_entries is the number of historical entries to persist. - #[prost(uint32, tag = "4")] - pub historical_entries: u32, - /// bond_denom defines the bondable coin denomination. - #[prost(string, tag = "5")] - pub bond_denom: ::prost::alloc::string::String, - /// min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators - #[prost(string, tag = "6")] - pub min_commission_rate: ::prost::alloc::string::String, -} -impl ::prost::Name for Params { - const NAME: &'static str = "Params"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.Params".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.Params".into() - } -} -/// DelegationResponse is equivalent to Delegation except that it contains a -/// balance in addition to shares which is more suitable for client responses. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DelegationResponse { - #[prost(message, optional, tag = "1")] - pub delegation: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub balance: ::core::option::Option, -} -impl ::prost::Name for DelegationResponse { - const NAME: &'static str = "DelegationResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.DelegationResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.DelegationResponse".into() - } -} -/// RedelegationEntryResponse is equivalent to a RedelegationEntry except that it -/// contains a balance in addition to shares which is more suitable for client -/// responses. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RedelegationEntryResponse { - #[prost(message, optional, tag = "1")] - pub redelegation_entry: ::core::option::Option, - #[prost(string, tag = "4")] - pub balance: ::prost::alloc::string::String, -} -impl ::prost::Name for RedelegationEntryResponse { - const NAME: &'static str = "RedelegationEntryResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.RedelegationEntryResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.RedelegationEntryResponse".into() - } -} -/// RedelegationResponse is equivalent to a Redelegation except that its entries -/// contain a balance in addition to shares which is more suitable for client -/// responses. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RedelegationResponse { - #[prost(message, optional, tag = "1")] - pub redelegation: ::core::option::Option, - #[prost(message, repeated, tag = "2")] - pub entries: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for RedelegationResponse { - const NAME: &'static str = "RedelegationResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.RedelegationResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.RedelegationResponse".into() - } -} -/// Pool is used for tracking bonded and not-bonded token supply of the bond -/// denomination. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Pool { - #[prost(string, tag = "1")] - pub not_bonded_tokens: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub bonded_tokens: ::prost::alloc::string::String, -} -impl ::prost::Name for Pool { - const NAME: &'static str = "Pool"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.Pool".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.Pool".into() - } -} -/// 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, ::prost::Message)] -pub struct ValidatorUpdates { - #[prost(message, repeated, tag = "1")] - pub updates: ::prost::alloc::vec::Vec<::tendermint_proto::abci::ValidatorUpdate>, -} -impl ::prost::Name for ValidatorUpdates { - const NAME: &'static str = "ValidatorUpdates"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.ValidatorUpdates".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.ValidatorUpdates".into() - } -} -/// BondStatus is the status of a validator. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum BondStatus { - /// UNSPECIFIED defines an invalid validator status. - Unspecified = 0, - /// UNBONDED defines a validator that is not bonded. - Unbonded = 1, - /// UNBONDING defines a validator that is unbonding. - Unbonding = 2, - /// BONDED defines a validator that is bonded. - Bonded = 3, -} -impl BondStatus { - /// 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 { - BondStatus::Unspecified => "BOND_STATUS_UNSPECIFIED", - BondStatus::Unbonded => "BOND_STATUS_UNBONDED", - BondStatus::Unbonding => "BOND_STATUS_UNBONDING", - BondStatus::Bonded => "BOND_STATUS_BONDED", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "BOND_STATUS_UNSPECIFIED" => Some(Self::Unspecified), - "BOND_STATUS_UNBONDED" => Some(Self::Unbonded), - "BOND_STATUS_UNBONDING" => Some(Self::Unbonding), - "BOND_STATUS_BONDED" => Some(Self::Bonded), - _ => None, - } - } -} -/// Infraction indicates the infraction a validator commited. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -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, - } - } -} -/// InfractionType indicates the infraction type a validator commited. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum InfractionType { - /// UNSPECIFIED defines an empty infraction type. - 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 InfractionType { - /// 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 { - InfractionType::Unspecified => "INFRACTION_TYPE_UNSPECIFIED", - InfractionType::DoubleSign => "INFRACTION_TYPE_DOUBLE_SIGN", - InfractionType::Downtime => "INFRACTION_TYPE_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_TYPE_UNSPECIFIED" => Some(Self::Unspecified), - "INFRACTION_TYPE_DOUBLE_SIGN" => Some(Self::DoubleSign), - "INFRACTION_TYPE_DOWNTIME" => Some(Self::Downtime), - _ => None, - } - } -} -/// MsgCreateValidator defines a SDK message for creating a new validator. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgCreateValidator { - #[prost(message, optional, tag = "1")] - pub description: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub commission: ::core::option::Option, - #[prost(string, tag = "3")] - pub min_self_delegation: ::prost::alloc::string::String, - #[prost(string, tag = "4")] - pub delegator_address: ::prost::alloc::string::String, - #[prost(string, tag = "5")] - pub validator_address: ::prost::alloc::string::String, - #[prost(message, optional, tag = "6")] - pub pubkey: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, - #[prost(message, optional, tag = "7")] - pub value: ::core::option::Option, -} -impl ::prost::Name for MsgCreateValidator { - const NAME: &'static str = "MsgCreateValidator"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.MsgCreateValidator".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.MsgCreateValidator".into() - } -} -/// MsgCreateValidatorResponse defines the Msg/CreateValidator response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct MsgCreateValidatorResponse {} -impl ::prost::Name for MsgCreateValidatorResponse { - const NAME: &'static str = "MsgCreateValidatorResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.MsgCreateValidatorResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.MsgCreateValidatorResponse".into() - } -} -/// MsgEditValidator defines a SDK message for editing an existing validator. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgEditValidator { - #[prost(message, optional, tag = "1")] - pub description: ::core::option::Option, - #[prost(string, tag = "2")] - pub validator_address: ::prost::alloc::string::String, - /// We pass a reference to the new commission rate and min self delegation as - /// it's not mandatory to update. If not updated, the deserialized rate will be - /// zero with no way to distinguish if an update was intended. - /// REF: #2373 - #[prost(string, tag = "3")] - pub commission_rate: ::prost::alloc::string::String, - #[prost(string, tag = "4")] - pub min_self_delegation: ::prost::alloc::string::String, -} -impl ::prost::Name for MsgEditValidator { - const NAME: &'static str = "MsgEditValidator"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.MsgEditValidator".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.MsgEditValidator".into() - } -} -/// MsgEditValidatorResponse defines the Msg/EditValidator response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct MsgEditValidatorResponse {} -impl ::prost::Name for MsgEditValidatorResponse { - const NAME: &'static str = "MsgEditValidatorResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.MsgEditValidatorResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.MsgEditValidatorResponse".into() - } -} -/// MsgDelegate defines a SDK message for performing a delegation of coins -/// from a delegator to a validator. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgDelegate { - #[prost(string, tag = "1")] - pub delegator_address: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub validator_address: ::prost::alloc::string::String, - #[prost(message, optional, tag = "3")] - pub amount: ::core::option::Option, -} -impl ::prost::Name for MsgDelegate { - const NAME: &'static str = "MsgDelegate"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.MsgDelegate".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.MsgDelegate".into() - } -} -/// MsgDelegateResponse defines the Msg/Delegate response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct MsgDelegateResponse {} -impl ::prost::Name for MsgDelegateResponse { - const NAME: &'static str = "MsgDelegateResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.MsgDelegateResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.MsgDelegateResponse".into() - } -} -/// MsgBeginRedelegate defines a SDK message for performing a redelegation -/// of coins from a delegator and source validator to a destination validator. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgBeginRedelegate { - #[prost(string, tag = "1")] - pub delegator_address: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub validator_src_address: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub validator_dst_address: ::prost::alloc::string::String, - #[prost(message, optional, tag = "4")] - pub amount: ::core::option::Option, -} -impl ::prost::Name for MsgBeginRedelegate { - const NAME: &'static str = "MsgBeginRedelegate"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.MsgBeginRedelegate".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.MsgBeginRedelegate".into() - } -} -/// MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct MsgBeginRedelegateResponse { - #[prost(message, optional, tag = "1")] - pub completion_time: ::core::option::Option< - ::tendermint_proto::google::protobuf::Timestamp, - >, -} -impl ::prost::Name for MsgBeginRedelegateResponse { - const NAME: &'static str = "MsgBeginRedelegateResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.MsgBeginRedelegateResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.MsgBeginRedelegateResponse".into() - } -} -/// MsgUndelegate defines a SDK message for performing an undelegation from a -/// delegate and a validator. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUndelegate { - #[prost(string, tag = "1")] - pub delegator_address: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub validator_address: ::prost::alloc::string::String, - #[prost(message, optional, tag = "3")] - pub amount: ::core::option::Option, -} -impl ::prost::Name for MsgUndelegate { - const NAME: &'static str = "MsgUndelegate"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.MsgUndelegate".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.MsgUndelegate".into() - } -} -/// MsgUndelegateResponse defines the Msg/Undelegate response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct MsgUndelegateResponse { - #[prost(message, optional, tag = "1")] - pub completion_time: ::core::option::Option< - ::tendermint_proto::google::protobuf::Timestamp, - >, -} -impl ::prost::Name for MsgUndelegateResponse { - const NAME: &'static str = "MsgUndelegateResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.MsgUndelegateResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.MsgUndelegateResponse".into() - } -} -/// MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgCancelUnbondingDelegation { - #[prost(string, tag = "1")] - pub delegator_address: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub validator_address: ::prost::alloc::string::String, - /// amount is always less than or equal to unbonding delegation entry balance - #[prost(message, optional, tag = "3")] - pub amount: ::core::option::Option, - /// creation_height is the height which the unbonding took place. - #[prost(int64, tag = "4")] - pub creation_height: i64, -} -impl ::prost::Name for MsgCancelUnbondingDelegation { - const NAME: &'static str = "MsgCancelUnbondingDelegation"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.MsgCancelUnbondingDelegation".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation".into() - } -} -/// MsgCancelUnbondingDelegationResponse -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct MsgCancelUnbondingDelegationResponse {} -impl ::prost::Name for MsgCancelUnbondingDelegationResponse { - const NAME: &'static str = "MsgCancelUnbondingDelegationResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse".into() - } -} -/// MsgUpdateParams is the Msg/UpdateParams request type. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -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, -} -impl ::prost::Name for MsgUpdateParams { - const NAME: &'static str = "MsgUpdateParams"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.MsgUpdateParams".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.MsgUpdateParams".into() - } -} -/// MsgUpdateParamsResponse defines the response structure for executing a -/// MsgUpdateParams message. -/// -/// Since: cosmos-sdk 0.47 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct MsgUpdateParamsResponse {} -impl ::prost::Name for MsgUpdateParamsResponse { - const NAME: &'static str = "MsgUpdateParamsResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.MsgUpdateParamsResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.MsgUpdateParamsResponse".into() - } -} -/// Generated client implementations. -#[cfg(feature = "client")] -pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - /// Msg defines the staking Msg service. - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, - } - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: 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 - } - /// CreateValidator defines a method for creating a new validator. - pub async fn create_validator( - &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( - "/cosmos.staking.v1beta1.Msg/CreateValidator", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("cosmos.staking.v1beta1.Msg", "CreateValidator"), - ); - self.inner.unary(req, path, codec).await - } - /// EditValidator defines a method for editing an existing validator. - pub async fn edit_validator( - &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( - "/cosmos.staking.v1beta1.Msg/EditValidator", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.staking.v1beta1.Msg", "EditValidator")); - self.inner.unary(req, path, codec).await - } - /// Delegate defines a method for performing a delegation of coins - /// from a delegator to a validator. - pub async fn delegate( - &mut self, - request: impl tonic::IntoRequest, - ) -> 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( - "/cosmos.staking.v1beta1.Msg/Delegate", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.staking.v1beta1.Msg", "Delegate")); - self.inner.unary(req, path, codec).await - } - /// BeginRedelegate defines a method for performing a redelegation - /// of coins from a delegator and source validator to a destination validator. - pub async fn begin_redelegate( - &mut self, - request: impl tonic::IntoRequest, - ) -> 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( - "/cosmos.staking.v1beta1.Msg/BeginRedelegate", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("cosmos.staking.v1beta1.Msg", "BeginRedelegate"), - ); - self.inner.unary(req, path, codec).await - } - /// Undelegate defines a method for performing an undelegation from a - /// delegate and a validator. - pub async fn undelegate( - &mut self, - request: impl tonic::IntoRequest, - ) -> 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( - "/cosmos.staking.v1beta1.Msg/Undelegate", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.staking.v1beta1.Msg", "Undelegate")); - self.inner.unary(req, path, codec).await - } - /// CancelUnbondingDelegation defines a method for performing canceling the unbonding delegation - /// and delegate back to previous validator. - /// - /// Since: cosmos-sdk 0.46 - pub async fn cancel_unbonding_delegation( - &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( - "/cosmos.staking.v1beta1.Msg/CancelUnbondingDelegation", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.staking.v1beta1.Msg", - "CancelUnbondingDelegation", - ), - ); - self.inner.unary(req, path, codec).await - } - /// UpdateParams defines an operation for updating the x/staking module - /// parameters. - /// Since: cosmos-sdk 0.47 - pub async fn update_params( - &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( - "/cosmos.staking.v1beta1.Msg/UpdateParams", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.staking.v1beta1.Msg", "UpdateParams")); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -#[cfg(feature = "server")] -pub mod msg_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. - #[async_trait] - pub trait Msg: Send + Sync + 'static { - /// CreateValidator defines a method for creating a new validator. - async fn create_validator( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// EditValidator defines a method for editing an existing validator. - async fn edit_validator( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Delegate defines a method for performing a delegation of coins - /// from a delegator to a validator. - async fn delegate( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// BeginRedelegate defines a method for performing a redelegation - /// of coins from a delegator and source validator to a destination validator. - async fn begin_redelegate( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Undelegate defines a method for performing an undelegation from a - /// delegate and a validator. - async fn undelegate( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// CancelUnbondingDelegation defines a method for performing canceling the unbonding delegation - /// and delegate back to previous validator. - /// - /// Since: cosmos-sdk 0.46 - async fn cancel_unbonding_delegation( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// UpdateParams defines an operation for updating the x/staking module - /// parameters. - /// Since: cosmos-sdk 0.47 - async fn update_params( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - /// Msg defines the staking Msg service. - #[derive(Debug)] - pub struct MsgServer { - inner: Arc, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - impl MsgServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - 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 { - match req.uri().path() { - "/cosmos.staking.v1beta1.Msg/CreateValidator" => { - #[allow(non_camel_case_types)] - struct CreateValidatorSvc(pub Arc); - impl tonic::server::UnaryService - for CreateValidatorSvc { - type Response = super::MsgCreateValidatorResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::create_validator(&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 method = CreateValidatorSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.staking.v1beta1.Msg/EditValidator" => { - #[allow(non_camel_case_types)] - struct EditValidatorSvc(pub Arc); - impl tonic::server::UnaryService - for EditValidatorSvc { - type Response = super::MsgEditValidatorResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::edit_validator(&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 method = EditValidatorSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.staking.v1beta1.Msg/Delegate" => { - #[allow(non_camel_case_types)] - struct DelegateSvc(pub Arc); - impl tonic::server::UnaryService - for DelegateSvc { - type Response = super::MsgDelegateResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::delegate(&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 method = DelegateSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.staking.v1beta1.Msg/BeginRedelegate" => { - #[allow(non_camel_case_types)] - struct BeginRedelegateSvc(pub Arc); - impl tonic::server::UnaryService - for BeginRedelegateSvc { - type Response = super::MsgBeginRedelegateResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::begin_redelegate(&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 method = BeginRedelegateSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.staking.v1beta1.Msg/Undelegate" => { - #[allow(non_camel_case_types)] - struct UndelegateSvc(pub Arc); - impl tonic::server::UnaryService - for UndelegateSvc { - type Response = super::MsgUndelegateResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::undelegate(&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 method = UndelegateSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.staking.v1beta1.Msg/CancelUnbondingDelegation" => { - #[allow(non_camel_case_types)] - struct CancelUnbondingDelegationSvc(pub Arc); - impl< - T: Msg, - > tonic::server::UnaryService - for CancelUnbondingDelegationSvc { - type Response = super::MsgCancelUnbondingDelegationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::cancel_unbonding_delegation(&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 method = CancelUnbondingDelegationSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.staking.v1beta1.Msg/UpdateParams" => { - #[allow(non_camel_case_types)] - struct UpdateParamsSvc(pub Arc); - impl tonic::server::UnaryService - for UpdateParamsSvc { - type Response = super::MsgUpdateParamsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::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 method = UpdateParamsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", tonic::Code::Unimplemented as i32) - .header( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ) - .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 tonic::server::NamedService for MsgServer { - const NAME: &'static str = "cosmos.staking.v1beta1.Msg"; - } -} -/// QueryValidatorsRequest is request type for Query/Validators RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryValidatorsRequest { - /// status enables to query for validators matching a given status. - #[prost(string, tag = "1")] - pub status: ::prost::alloc::string::String, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryValidatorsRequest { - const NAME: &'static str = "QueryValidatorsRequest"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.QueryValidatorsRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.QueryValidatorsRequest".into() - } -} -/// QueryValidatorsResponse is response type for the Query/Validators RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryValidatorsResponse { - /// validators contains all the queried validators. - #[prost(message, repeated, tag = "1")] - pub validators: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryValidatorsResponse { - const NAME: &'static str = "QueryValidatorsResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.QueryValidatorsResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.QueryValidatorsResponse".into() - } -} -/// QueryValidatorRequest is response type for the Query/Validator RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryValidatorRequest { - /// validator_addr defines the validator address to query for. - #[prost(string, tag = "1")] - pub validator_addr: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryValidatorRequest { - const NAME: &'static str = "QueryValidatorRequest"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.QueryValidatorRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.QueryValidatorRequest".into() - } -} -/// QueryValidatorResponse is response type for the Query/Validator RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryValidatorResponse { - /// validator defines the validator info. - #[prost(message, optional, tag = "1")] - pub validator: ::core::option::Option, -} -impl ::prost::Name for QueryValidatorResponse { - const NAME: &'static str = "QueryValidatorResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.QueryValidatorResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.QueryValidatorResponse".into() - } -} -/// QueryValidatorDelegationsRequest is request type for the -/// Query/ValidatorDelegations RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryValidatorDelegationsRequest { - /// validator_addr defines the validator address to query for. - #[prost(string, tag = "1")] - pub validator_addr: ::prost::alloc::string::String, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryValidatorDelegationsRequest { - const NAME: &'static str = "QueryValidatorDelegationsRequest"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.QueryValidatorDelegationsRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.QueryValidatorDelegationsRequest".into() - } -} -/// QueryValidatorDelegationsResponse is response type for the -/// Query/ValidatorDelegations RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryValidatorDelegationsResponse { - #[prost(message, repeated, tag = "1")] - pub delegation_responses: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryValidatorDelegationsResponse { - const NAME: &'static str = "QueryValidatorDelegationsResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.QueryValidatorDelegationsResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.QueryValidatorDelegationsResponse".into() - } -} -/// QueryValidatorUnbondingDelegationsRequest is required type for the -/// Query/ValidatorUnbondingDelegations RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryValidatorUnbondingDelegationsRequest { - /// validator_addr defines the validator address to query for. - #[prost(string, tag = "1")] - pub validator_addr: ::prost::alloc::string::String, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryValidatorUnbondingDelegationsRequest { - const NAME: &'static str = "QueryValidatorUnbondingDelegationsRequest"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest".into() - } -} -/// QueryValidatorUnbondingDelegationsResponse is response type for the -/// Query/ValidatorUnbondingDelegations RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryValidatorUnbondingDelegationsResponse { - #[prost(message, repeated, tag = "1")] - pub unbonding_responses: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryValidatorUnbondingDelegationsResponse { - const NAME: &'static str = "QueryValidatorUnbondingDelegationsResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse".into() - } -} -/// QueryDelegationRequest is request type for the Query/Delegation RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDelegationRequest { - /// delegator_addr defines the delegator address to query for. - #[prost(string, tag = "1")] - pub delegator_addr: ::prost::alloc::string::String, - /// validator_addr defines the validator address to query for. - #[prost(string, tag = "2")] - pub validator_addr: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryDelegationRequest { - const NAME: &'static str = "QueryDelegationRequest"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.QueryDelegationRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.QueryDelegationRequest".into() - } -} -/// QueryDelegationResponse is response type for the Query/Delegation RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDelegationResponse { - /// delegation_responses defines the delegation info of a delegation. - #[prost(message, optional, tag = "1")] - pub delegation_response: ::core::option::Option, -} -impl ::prost::Name for QueryDelegationResponse { - const NAME: &'static str = "QueryDelegationResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.QueryDelegationResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.QueryDelegationResponse".into() - } -} -/// QueryUnbondingDelegationRequest is request type for the -/// Query/UnbondingDelegation RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUnbondingDelegationRequest { - /// delegator_addr defines the delegator address to query for. - #[prost(string, tag = "1")] - pub delegator_addr: ::prost::alloc::string::String, - /// validator_addr defines the validator address to query for. - #[prost(string, tag = "2")] - pub validator_addr: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryUnbondingDelegationRequest { - const NAME: &'static str = "QueryUnbondingDelegationRequest"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.QueryUnbondingDelegationRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.QueryUnbondingDelegationRequest".into() - } -} -/// QueryDelegationResponse is response type for the Query/UnbondingDelegation -/// RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUnbondingDelegationResponse { - /// unbond defines the unbonding information of a delegation. - #[prost(message, optional, tag = "1")] - pub unbond: ::core::option::Option, -} -impl ::prost::Name for QueryUnbondingDelegationResponse { - const NAME: &'static str = "QueryUnbondingDelegationResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.QueryUnbondingDelegationResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.QueryUnbondingDelegationResponse".into() - } -} -/// QueryDelegatorDelegationsRequest is request type for the -/// Query/DelegatorDelegations RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDelegatorDelegationsRequest { - /// delegator_addr defines the delegator address to query for. - #[prost(string, tag = "1")] - pub delegator_addr: ::prost::alloc::string::String, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryDelegatorDelegationsRequest { - const NAME: &'static str = "QueryDelegatorDelegationsRequest"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest".into() - } -} -/// QueryDelegatorDelegationsResponse is response type for the -/// Query/DelegatorDelegations RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDelegatorDelegationsResponse { - /// delegation_responses defines all the delegations' info of a delegator. - #[prost(message, repeated, tag = "1")] - pub delegation_responses: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryDelegatorDelegationsResponse { - const NAME: &'static str = "QueryDelegatorDelegationsResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse".into() - } -} -/// QueryDelegatorUnbondingDelegationsRequest is request type for the -/// Query/DelegatorUnbondingDelegations RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDelegatorUnbondingDelegationsRequest { - /// delegator_addr defines the delegator address to query for. - #[prost(string, tag = "1")] - pub delegator_addr: ::prost::alloc::string::String, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryDelegatorUnbondingDelegationsRequest { - const NAME: &'static str = "QueryDelegatorUnbondingDelegationsRequest"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest".into() - } -} -/// QueryUnbondingDelegatorDelegationsResponse is response type for the -/// Query/UnbondingDelegatorDelegations RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDelegatorUnbondingDelegationsResponse { - #[prost(message, repeated, tag = "1")] - pub unbonding_responses: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryDelegatorUnbondingDelegationsResponse { - const NAME: &'static str = "QueryDelegatorUnbondingDelegationsResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse".into() - } -} -/// QueryRedelegationsRequest is request type for the Query/Redelegations RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryRedelegationsRequest { - /// delegator_addr defines the delegator address to query for. - #[prost(string, tag = "1")] - pub delegator_addr: ::prost::alloc::string::String, - /// src_validator_addr defines the validator address to redelegate from. - #[prost(string, tag = "2")] - pub src_validator_addr: ::prost::alloc::string::String, - /// dst_validator_addr defines the validator address to redelegate to. - #[prost(string, tag = "3")] - pub dst_validator_addr: ::prost::alloc::string::String, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "4")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryRedelegationsRequest { - const NAME: &'static str = "QueryRedelegationsRequest"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.QueryRedelegationsRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.QueryRedelegationsRequest".into() - } -} -/// QueryRedelegationsResponse is response type for the Query/Redelegations RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryRedelegationsResponse { - #[prost(message, repeated, tag = "1")] - pub redelegation_responses: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryRedelegationsResponse { - const NAME: &'static str = "QueryRedelegationsResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.QueryRedelegationsResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.QueryRedelegationsResponse".into() - } -} -/// QueryDelegatorValidatorsRequest is request type for the -/// Query/DelegatorValidators RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDelegatorValidatorsRequest { - /// delegator_addr defines the delegator address to query for. - #[prost(string, tag = "1")] - pub delegator_addr: ::prost::alloc::string::String, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryDelegatorValidatorsRequest { - const NAME: &'static str = "QueryDelegatorValidatorsRequest"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest".into() - } -} -/// QueryDelegatorValidatorsResponse is response type for the -/// Query/DelegatorValidators RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDelegatorValidatorsResponse { - /// validators defines the validators' info of a delegator. - #[prost(message, repeated, tag = "1")] - pub validators: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryDelegatorValidatorsResponse { - const NAME: &'static str = "QueryDelegatorValidatorsResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse".into() - } -} -/// QueryDelegatorValidatorRequest is request type for the -/// Query/DelegatorValidator RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDelegatorValidatorRequest { - /// delegator_addr defines the delegator address to query for. - #[prost(string, tag = "1")] - pub delegator_addr: ::prost::alloc::string::String, - /// validator_addr defines the validator address to query for. - #[prost(string, tag = "2")] - pub validator_addr: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryDelegatorValidatorRequest { - const NAME: &'static str = "QueryDelegatorValidatorRequest"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.QueryDelegatorValidatorRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.QueryDelegatorValidatorRequest".into() - } -} -/// QueryDelegatorValidatorResponse response type for the -/// Query/DelegatorValidator RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDelegatorValidatorResponse { - /// validator defines the validator info. - #[prost(message, optional, tag = "1")] - pub validator: ::core::option::Option, -} -impl ::prost::Name for QueryDelegatorValidatorResponse { - const NAME: &'static str = "QueryDelegatorValidatorResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.QueryDelegatorValidatorResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.QueryDelegatorValidatorResponse".into() - } -} -/// QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct QueryHistoricalInfoRequest { - /// height defines at which height to query the historical info. - #[prost(int64, tag = "1")] - pub height: i64, -} -impl ::prost::Name for QueryHistoricalInfoRequest { - const NAME: &'static str = "QueryHistoricalInfoRequest"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.QueryHistoricalInfoRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.QueryHistoricalInfoRequest".into() - } -} -/// QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryHistoricalInfoResponse { - /// hist defines the historical info at the given height. - #[prost(message, optional, tag = "1")] - pub hist: ::core::option::Option, -} -impl ::prost::Name for QueryHistoricalInfoResponse { - const NAME: &'static str = "QueryHistoricalInfoResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.QueryHistoricalInfoResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.QueryHistoricalInfoResponse".into() - } -} -/// QueryPoolRequest is request type for the Query/Pool RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct QueryPoolRequest {} -impl ::prost::Name for QueryPoolRequest { - const NAME: &'static str = "QueryPoolRequest"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.QueryPoolRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.QueryPoolRequest".into() - } -} -/// QueryPoolResponse is response type for the Query/Pool RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPoolResponse { - /// pool defines the pool info. - #[prost(message, optional, tag = "1")] - pub pool: ::core::option::Option, -} -impl ::prost::Name for QueryPoolResponse { - const NAME: &'static str = "QueryPoolResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.QueryPoolResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.QueryPoolResponse".into() - } -} -/// QueryParamsRequest is request type for the Query/Params RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct QueryParamsRequest {} -impl ::prost::Name for QueryParamsRequest { - const NAME: &'static str = "QueryParamsRequest"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.QueryParamsRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.QueryParamsRequest".into() - } -} -/// QueryParamsResponse is response type for the Query/Params RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryParamsResponse { - /// params holds all the parameters of this module. - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, -} -impl ::prost::Name for QueryParamsResponse { - const NAME: &'static str = "QueryParamsResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.QueryParamsResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.QueryParamsResponse".into() - } -} -/// Generated client implementations. -#[cfg(feature = "client")] -pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - /// Query defines the gRPC querier service. - #[derive(Debug, Clone)] - pub struct QueryClient { - inner: tonic::client::Grpc, - } - impl QueryClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: 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 - } - /// Validators queries all validators that match the given status. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - pub async fn validators( - &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( - "/cosmos.staking.v1beta1.Query/Validators", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.staking.v1beta1.Query", "Validators")); - self.inner.unary(req, path, codec).await - } - /// Validator queries validator info for given validator address. - pub async fn validator( - &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( - "/cosmos.staking.v1beta1.Query/Validator", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.staking.v1beta1.Query", "Validator")); - self.inner.unary(req, path, codec).await - } - /// ValidatorDelegations queries delegate info for given validator. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - pub async fn validator_delegations( - &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( - "/cosmos.staking.v1beta1.Query/ValidatorDelegations", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.staking.v1beta1.Query", - "ValidatorDelegations", - ), - ); - self.inner.unary(req, path, codec).await - } - /// ValidatorUnbondingDelegations queries unbonding delegations of a validator. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - pub async fn validator_unbonding_delegations( - &mut self, - request: impl tonic::IntoRequest< - super::QueryValidatorUnbondingDelegationsRequest, - >, - ) -> 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( - "/cosmos.staking.v1beta1.Query/ValidatorUnbondingDelegations", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.staking.v1beta1.Query", - "ValidatorUnbondingDelegations", - ), - ); - self.inner.unary(req, path, codec).await - } - /// Delegation queries delegate info for given validator delegator pair. - pub async fn delegation( - &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( - "/cosmos.staking.v1beta1.Query/Delegation", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.staking.v1beta1.Query", "Delegation")); - self.inner.unary(req, path, codec).await - } - /// UnbondingDelegation queries unbonding info for given validator delegator - /// pair. - pub async fn unbonding_delegation( - &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( - "/cosmos.staking.v1beta1.Query/UnbondingDelegation", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.staking.v1beta1.Query", - "UnbondingDelegation", - ), - ); - self.inner.unary(req, path, codec).await - } - /// DelegatorDelegations queries all delegations of a given delegator address. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - pub async fn delegator_delegations( - &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( - "/cosmos.staking.v1beta1.Query/DelegatorDelegations", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.staking.v1beta1.Query", - "DelegatorDelegations", - ), - ); - self.inner.unary(req, path, codec).await - } - /// DelegatorUnbondingDelegations queries all unbonding delegations of a given - /// delegator address. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - pub async fn delegator_unbonding_delegations( - &mut self, - request: impl tonic::IntoRequest< - super::QueryDelegatorUnbondingDelegationsRequest, - >, - ) -> 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( - "/cosmos.staking.v1beta1.Query/DelegatorUnbondingDelegations", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.staking.v1beta1.Query", - "DelegatorUnbondingDelegations", - ), - ); - self.inner.unary(req, path, codec).await - } - /// Redelegations queries redelegations of given address. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - pub async fn redelegations( - &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( - "/cosmos.staking.v1beta1.Query/Redelegations", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("cosmos.staking.v1beta1.Query", "Redelegations"), - ); - self.inner.unary(req, path, codec).await - } - /// DelegatorValidators queries all validators info for given delegator - /// address. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - pub async fn delegator_validators( - &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( - "/cosmos.staking.v1beta1.Query/DelegatorValidators", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.staking.v1beta1.Query", - "DelegatorValidators", - ), - ); - self.inner.unary(req, path, codec).await - } - /// DelegatorValidator queries validator info for given delegator validator - /// pair. - pub async fn delegator_validator( - &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( - "/cosmos.staking.v1beta1.Query/DelegatorValidator", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("cosmos.staking.v1beta1.Query", "DelegatorValidator"), - ); - self.inner.unary(req, path, codec).await - } - /// HistoricalInfo queries the historical info for given height. - pub async fn historical_info( - &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( - "/cosmos.staking.v1beta1.Query/HistoricalInfo", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("cosmos.staking.v1beta1.Query", "HistoricalInfo"), - ); - self.inner.unary(req, path, codec).await - } - /// Pool queries the pool info. - pub async fn pool( - &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( - "/cosmos.staking.v1beta1.Query/Pool", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.staking.v1beta1.Query", "Pool")); - self.inner.unary(req, path, codec).await - } - /// Parameters queries the staking parameters. - pub async fn params( - &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( - "/cosmos.staking.v1beta1.Query/Params", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.staking.v1beta1.Query", "Params")); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -#[cfg(feature = "server")] -pub mod query_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. - #[async_trait] - pub trait Query: Send + Sync + 'static { - /// Validators queries all validators that match the given status. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - async fn validators( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Validator queries validator info for given validator address. - async fn validator( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// ValidatorDelegations queries delegate info for given validator. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - async fn validator_delegations( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// ValidatorUnbondingDelegations queries unbonding delegations of a validator. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - async fn validator_unbonding_delegations( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Delegation queries delegate info for given validator delegator pair. - async fn delegation( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// UnbondingDelegation queries unbonding info for given validator delegator - /// pair. - async fn unbonding_delegation( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DelegatorDelegations queries all delegations of a given delegator address. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - async fn delegator_delegations( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DelegatorUnbondingDelegations queries all unbonding delegations of a given - /// delegator address. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - async fn delegator_unbonding_delegations( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Redelegations queries redelegations of given address. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - async fn redelegations( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DelegatorValidators queries all validators info for given delegator - /// address. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - async fn delegator_validators( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DelegatorValidator queries validator info for given delegator validator - /// pair. - async fn delegator_validator( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// HistoricalInfo queries the historical info for given height. - async fn historical_info( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Pool queries the pool info. - async fn pool( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Parameters queries the staking parameters. - async fn params( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - /// Query defines the gRPC querier service. - #[derive(Debug)] - pub struct QueryServer { - inner: Arc, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - impl QueryServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - 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 { - match req.uri().path() { - "/cosmos.staking.v1beta1.Query/Validators" => { - #[allow(non_camel_case_types)] - struct ValidatorsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for ValidatorsSvc { - type Response = super::QueryValidatorsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::validators(&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 method = ValidatorsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.staking.v1beta1.Query/Validator" => { - #[allow(non_camel_case_types)] - struct ValidatorSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for ValidatorSvc { - type Response = super::QueryValidatorResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::validator(&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 method = ValidatorSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.staking.v1beta1.Query/ValidatorDelegations" => { - #[allow(non_camel_case_types)] - struct ValidatorDelegationsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService< - super::QueryValidatorDelegationsRequest, - > for ValidatorDelegationsSvc { - type Response = super::QueryValidatorDelegationsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::QueryValidatorDelegationsRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::validator_delegations(&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 method = ValidatorDelegationsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.staking.v1beta1.Query/ValidatorUnbondingDelegations" => { - #[allow(non_camel_case_types)] - struct ValidatorUnbondingDelegationsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService< - super::QueryValidatorUnbondingDelegationsRequest, - > for ValidatorUnbondingDelegationsSvc { - type Response = super::QueryValidatorUnbondingDelegationsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::QueryValidatorUnbondingDelegationsRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::validator_unbonding_delegations( - &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 method = ValidatorUnbondingDelegationsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.staking.v1beta1.Query/Delegation" => { - #[allow(non_camel_case_types)] - struct DelegationSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for DelegationSvc { - type Response = super::QueryDelegationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::delegation(&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 method = DelegationSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.staking.v1beta1.Query/UnbondingDelegation" => { - #[allow(non_camel_case_types)] - struct UnbondingDelegationSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for UnbondingDelegationSvc { - type Response = super::QueryUnbondingDelegationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::QueryUnbondingDelegationRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::unbonding_delegation(&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 method = UnbondingDelegationSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.staking.v1beta1.Query/DelegatorDelegations" => { - #[allow(non_camel_case_types)] - struct DelegatorDelegationsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService< - super::QueryDelegatorDelegationsRequest, - > for DelegatorDelegationsSvc { - type Response = super::QueryDelegatorDelegationsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::QueryDelegatorDelegationsRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::delegator_delegations(&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 method = DelegatorDelegationsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.staking.v1beta1.Query/DelegatorUnbondingDelegations" => { - #[allow(non_camel_case_types)] - struct DelegatorUnbondingDelegationsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService< - super::QueryDelegatorUnbondingDelegationsRequest, - > for DelegatorUnbondingDelegationsSvc { - type Response = super::QueryDelegatorUnbondingDelegationsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::QueryDelegatorUnbondingDelegationsRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::delegator_unbonding_delegations( - &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 method = DelegatorUnbondingDelegationsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.staking.v1beta1.Query/Redelegations" => { - #[allow(non_camel_case_types)] - struct RedelegationsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for RedelegationsSvc { - type Response = super::QueryRedelegationsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::redelegations(&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 method = RedelegationsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.staking.v1beta1.Query/DelegatorValidators" => { - #[allow(non_camel_case_types)] - struct DelegatorValidatorsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for DelegatorValidatorsSvc { - type Response = super::QueryDelegatorValidatorsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::QueryDelegatorValidatorsRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::delegator_validators(&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 method = DelegatorValidatorsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.staking.v1beta1.Query/DelegatorValidator" => { - #[allow(non_camel_case_types)] - struct DelegatorValidatorSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for DelegatorValidatorSvc { - type Response = super::QueryDelegatorValidatorResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::QueryDelegatorValidatorRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::delegator_validator(&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 method = DelegatorValidatorSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.staking.v1beta1.Query/HistoricalInfo" => { - #[allow(non_camel_case_types)] - struct HistoricalInfoSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for HistoricalInfoSvc { - type Response = super::QueryHistoricalInfoResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::historical_info(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = HistoricalInfoSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.staking.v1beta1.Query/Pool" => { - #[allow(non_camel_case_types)] - struct PoolSvc(pub Arc); - impl tonic::server::UnaryService - for PoolSvc { - type Response = super::QueryPoolResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::pool(&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 method = PoolSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.staking.v1beta1.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::Response, - 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 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", tonic::Code::Unimplemented as i32) - .header( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ) - .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 tonic::server::NamedService for QueryServer { - const NAME: &'static str = "cosmos.staking.v1beta1.Query"; - } -} -/// StakeAuthorization defines authorization for delegate/undelegate/redelegate. -/// -/// Since: cosmos-sdk 0.43 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct StakeAuthorization { - /// max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is - /// empty, there is no spend limit and any amount of coins can be delegated. - #[prost(message, optional, tag = "1")] - pub max_tokens: ::core::option::Option, - /// authorization_type defines one of AuthorizationType. - #[prost(enumeration = "AuthorizationType", tag = "4")] - pub authorization_type: i32, - /// validators is the oneof that represents either allow_list or deny_list - #[prost(oneof = "stake_authorization::Validators", tags = "2, 3")] - pub validators: ::core::option::Option, -} -/// Nested message and enum types in `StakeAuthorization`. -pub mod stake_authorization { - /// Validators defines list of validator addresses. - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct ValidatorsVec { - #[prost(string, repeated, tag = "1")] - pub address: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - } - impl ::prost::Name for ValidatorsVec { - const NAME: &'static str = "Validators"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.StakeAuthorization.Validators".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.StakeAuthorization.Validators".into() - } - } - /// validators is the oneof that represents either allow_list or deny_list - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Validators { - /// allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's - /// account. - #[prost(message, tag = "2")] - AllowList(ValidatorsVec), - /// deny_list specifies list of validator addresses to whom grantee can not delegate tokens. - #[prost(message, tag = "3")] - DenyList(ValidatorsVec), - } -} -impl ::prost::Name for StakeAuthorization { - const NAME: &'static str = "StakeAuthorization"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.StakeAuthorization".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.StakeAuthorization".into() - } -} -/// AuthorizationType defines the type of staking module authorization type -/// -/// Since: cosmos-sdk 0.43 -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum AuthorizationType { - /// AUTHORIZATION_TYPE_UNSPECIFIED specifies an unknown authorization type - Unspecified = 0, - /// AUTHORIZATION_TYPE_DELEGATE defines an authorization type for Msg/Delegate - Delegate = 1, - /// AUTHORIZATION_TYPE_UNDELEGATE defines an authorization type for Msg/Undelegate - Undelegate = 2, - /// AUTHORIZATION_TYPE_REDELEGATE defines an authorization type for Msg/BeginRedelegate - Redelegate = 3, -} -impl AuthorizationType { - /// 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 { - AuthorizationType::Unspecified => "AUTHORIZATION_TYPE_UNSPECIFIED", - AuthorizationType::Delegate => "AUTHORIZATION_TYPE_DELEGATE", - AuthorizationType::Undelegate => "AUTHORIZATION_TYPE_UNDELEGATE", - AuthorizationType::Redelegate => "AUTHORIZATION_TYPE_REDELEGATE", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "AUTHORIZATION_TYPE_UNSPECIFIED" => Some(Self::Unspecified), - "AUTHORIZATION_TYPE_DELEGATE" => Some(Self::Delegate), - "AUTHORIZATION_TYPE_UNDELEGATE" => Some(Self::Undelegate), - "AUTHORIZATION_TYPE_REDELEGATE" => Some(Self::Redelegate), - _ => None, - } - } -} -/// GenesisState defines the staking module's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GenesisState { - /// params defines all the parameters 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 - /// the previous end block. - #[prost(bytes = "vec", tag = "2")] - pub last_total_power: ::prost::alloc::vec::Vec, - /// last_validator_powers is a special index that provides a historical list - /// of the last-block's bonded validators. - #[prost(message, repeated, tag = "3")] - pub last_validator_powers: ::prost::alloc::vec::Vec, - /// 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. - #[prost(message, repeated, tag = "5")] - pub delegations: ::prost::alloc::vec::Vec, - /// unbonding_delegations defines the unbonding delegations active at genesis. - #[prost(message, repeated, tag = "6")] - pub unbonding_delegations: ::prost::alloc::vec::Vec, - /// redelegations defines the redelegations active at genesis. - #[prost(message, repeated, tag = "7")] - pub redelegations: ::prost::alloc::vec::Vec, - #[prost(bool, tag = "8")] - pub exported: bool, -} -impl ::prost::Name for GenesisState { - const NAME: &'static str = "GenesisState"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.GenesisState".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.GenesisState".into() - } -} -/// LastValidatorPower required for validator set update logic. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct LastValidatorPower { - /// address is the address of the validator. - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - /// power defines the power of the validator. - #[prost(int64, tag = "2")] - pub power: i64, -} -impl ::prost::Name for LastValidatorPower { - const NAME: &'static str = "LastValidatorPower"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.staking.v1beta1.LastValidatorPower".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.staking.v1beta1.LastValidatorPower".into() - } -} diff --git a/src/prost/cosmos.staking.v1beta1.serde.rs b/src/prost/cosmos.staking.v1beta1.serde.rs deleted file mode 100644 index 38ca4a23..00000000 --- a/src/prost/cosmos.staking.v1beta1.serde.rs +++ /dev/null @@ -1,7752 +0,0 @@ -impl serde::Serialize for AuthorizationType { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::Unspecified => "AUTHORIZATION_TYPE_UNSPECIFIED", - Self::Delegate => "AUTHORIZATION_TYPE_DELEGATE", - Self::Undelegate => "AUTHORIZATION_TYPE_UNDELEGATE", - Self::Redelegate => "AUTHORIZATION_TYPE_REDELEGATE", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for AuthorizationType { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "AUTHORIZATION_TYPE_UNSPECIFIED", - "AUTHORIZATION_TYPE_DELEGATE", - "AUTHORIZATION_TYPE_UNDELEGATE", - "AUTHORIZATION_TYPE_REDELEGATE", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = AuthorizationType; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - fn visit_i64(self, v: i64) -> core::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> core::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "AUTHORIZATION_TYPE_UNSPECIFIED" => Ok(AuthorizationType::Unspecified), - "AUTHORIZATION_TYPE_DELEGATE" => Ok(AuthorizationType::Delegate), - "AUTHORIZATION_TYPE_UNDELEGATE" => Ok(AuthorizationType::Undelegate), - "AUTHORIZATION_TYPE_REDELEGATE" => Ok(AuthorizationType::Redelegate), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for BondStatus { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::Unspecified => "BOND_STATUS_UNSPECIFIED", - Self::Unbonded => "BOND_STATUS_UNBONDED", - Self::Unbonding => "BOND_STATUS_UNBONDING", - Self::Bonded => "BOND_STATUS_BONDED", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for BondStatus { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "BOND_STATUS_UNSPECIFIED", - "BOND_STATUS_UNBONDED", - "BOND_STATUS_UNBONDING", - "BOND_STATUS_BONDED", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = BondStatus; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - fn visit_i64(self, v: i64) -> core::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> core::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "BOND_STATUS_UNSPECIFIED" => Ok(BondStatus::Unspecified), - "BOND_STATUS_UNBONDED" => Ok(BondStatus::Unbonded), - "BOND_STATUS_UNBONDING" => Ok(BondStatus::Unbonding), - "BOND_STATUS_BONDED" => Ok(BondStatus::Bonded), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for Commission { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.Commission", len)?; - if let Some(v) = self.commission_rates.as_ref() { - struct_ser.serialize_field("commissionRates", v)?; - } - if let Some(v) = self.update_time.as_ref() { - struct_ser.serialize_field("updateTime", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Commission { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "commission_rates", - "commissionRates", - "update_time", - "updateTime", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - CommissionRates, - UpdateTime, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "commissionRates" | "commission_rates" => Ok(GeneratedField::CommissionRates), - "updateTime" | "update_time" => Ok(GeneratedField::UpdateTime), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Commission; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.Commission") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut commission_rates__ = None; - let mut update_time__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::CommissionRates => { - if commission_rates__.is_some() { - return Err(serde::de::Error::duplicate_field("commissionRates")); - } - commission_rates__ = map_.next_value()?; - } - GeneratedField::UpdateTime => { - if update_time__.is_some() { - return Err(serde::de::Error::duplicate_field("updateTime")); - } - update_time__ = map_.next_value()?; - } - } - } - Ok(Commission { - commission_rates: commission_rates__, - update_time: update_time__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.Commission", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for CommissionRates { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.CommissionRates", len)?; - if true { - struct_ser.serialize_field("rate", &self.rate)?; - } - if true { - struct_ser.serialize_field("maxRate", &self.max_rate)?; - } - if true { - struct_ser.serialize_field("maxChangeRate", &self.max_change_rate)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CommissionRates { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "rate", - "max_rate", - "maxRate", - "max_change_rate", - "maxChangeRate", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Rate, - MaxRate, - MaxChangeRate, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "rate" => Ok(GeneratedField::Rate), - "maxRate" | "max_rate" => Ok(GeneratedField::MaxRate), - "maxChangeRate" | "max_change_rate" => Ok(GeneratedField::MaxChangeRate), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CommissionRates; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.CommissionRates") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut rate__ = None; - let mut max_rate__ = None; - let mut max_change_rate__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Rate => { - if rate__.is_some() { - return Err(serde::de::Error::duplicate_field("rate")); - } - rate__ = Some(map_.next_value()?); - } - GeneratedField::MaxRate => { - if max_rate__.is_some() { - return Err(serde::de::Error::duplicate_field("maxRate")); - } - max_rate__ = Some(map_.next_value()?); - } - GeneratedField::MaxChangeRate => { - if max_change_rate__.is_some() { - return Err(serde::de::Error::duplicate_field("maxChangeRate")); - } - max_change_rate__ = Some(map_.next_value()?); - } - } - } - Ok(CommissionRates { - rate: rate__.unwrap_or_default(), - max_rate: max_rate__.unwrap_or_default(), - max_change_rate: max_change_rate__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.CommissionRates", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for DvPair { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.DVPair", len)?; - if true { - struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; - } - if true { - struct_ser.serialize_field("validatorAddress", &self.validator_address)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for DvPair { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "delegator_address", - "delegatorAddress", - "validator_address", - "validatorAddress", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - DelegatorAddress, - ValidatorAddress, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "delegatorAddress" | "delegator_address" => Ok(GeneratedField::DelegatorAddress), - "validatorAddress" | "validator_address" => Ok(GeneratedField::ValidatorAddress), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = DvPair; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.DVPair") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut delegator_address__ = None; - let mut validator_address__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::DelegatorAddress => { - if delegator_address__.is_some() { - return Err(serde::de::Error::duplicate_field("delegatorAddress")); - } - delegator_address__ = Some(map_.next_value()?); - } - GeneratedField::ValidatorAddress => { - if validator_address__.is_some() { - return Err(serde::de::Error::duplicate_field("validatorAddress")); - } - validator_address__ = Some(map_.next_value()?); - } - } - } - Ok(DvPair { - delegator_address: delegator_address__.unwrap_or_default(), - validator_address: validator_address__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.DVPair", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for DvPairs { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.DVPairs", len)?; - if true { - struct_ser.serialize_field("pairs", &self.pairs)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for DvPairs { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "pairs", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Pairs, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "pairs" => Ok(GeneratedField::Pairs), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = DvPairs; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.DVPairs") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut pairs__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Pairs => { - if pairs__.is_some() { - return Err(serde::de::Error::duplicate_field("pairs")); - } - pairs__ = Some(map_.next_value()?); - } - } - } - Ok(DvPairs { - pairs: pairs__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.DVPairs", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for DvvTriplet { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.DVVTriplet", len)?; - if true { - struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; - } - if true { - struct_ser.serialize_field("validatorSrcAddress", &self.validator_src_address)?; - } - if true { - struct_ser.serialize_field("validatorDstAddress", &self.validator_dst_address)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for DvvTriplet { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "delegator_address", - "delegatorAddress", - "validator_src_address", - "validatorSrcAddress", - "validator_dst_address", - "validatorDstAddress", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - DelegatorAddress, - ValidatorSrcAddress, - ValidatorDstAddress, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "delegatorAddress" | "delegator_address" => Ok(GeneratedField::DelegatorAddress), - "validatorSrcAddress" | "validator_src_address" => Ok(GeneratedField::ValidatorSrcAddress), - "validatorDstAddress" | "validator_dst_address" => Ok(GeneratedField::ValidatorDstAddress), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = DvvTriplet; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.DVVTriplet") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut delegator_address__ = None; - let mut validator_src_address__ = None; - let mut validator_dst_address__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::DelegatorAddress => { - if delegator_address__.is_some() { - return Err(serde::de::Error::duplicate_field("delegatorAddress")); - } - delegator_address__ = Some(map_.next_value()?); - } - GeneratedField::ValidatorSrcAddress => { - if validator_src_address__.is_some() { - return Err(serde::de::Error::duplicate_field("validatorSrcAddress")); - } - validator_src_address__ = Some(map_.next_value()?); - } - GeneratedField::ValidatorDstAddress => { - if validator_dst_address__.is_some() { - return Err(serde::de::Error::duplicate_field("validatorDstAddress")); - } - validator_dst_address__ = Some(map_.next_value()?); - } - } - } - Ok(DvvTriplet { - delegator_address: delegator_address__.unwrap_or_default(), - validator_src_address: validator_src_address__.unwrap_or_default(), - validator_dst_address: validator_dst_address__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.DVVTriplet", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for DvvTriplets { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.DVVTriplets", len)?; - if true { - struct_ser.serialize_field("triplets", &self.triplets)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for DvvTriplets { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "triplets", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Triplets, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "triplets" => Ok(GeneratedField::Triplets), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = DvvTriplets; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.DVVTriplets") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut triplets__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Triplets => { - if triplets__.is_some() { - return Err(serde::de::Error::duplicate_field("triplets")); - } - triplets__ = Some(map_.next_value()?); - } - } - } - Ok(DvvTriplets { - triplets: triplets__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.DVVTriplets", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Delegation { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.Delegation", len)?; - if true { - struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; - } - if true { - struct_ser.serialize_field("validatorAddress", &self.validator_address)?; - } - if true { - struct_ser.serialize_field("shares", &self.shares)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Delegation { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "delegator_address", - "delegatorAddress", - "validator_address", - "validatorAddress", - "shares", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - DelegatorAddress, - ValidatorAddress, - Shares, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "delegatorAddress" | "delegator_address" => Ok(GeneratedField::DelegatorAddress), - "validatorAddress" | "validator_address" => Ok(GeneratedField::ValidatorAddress), - "shares" => Ok(GeneratedField::Shares), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Delegation; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.Delegation") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut delegator_address__ = None; - let mut validator_address__ = None; - let mut shares__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::DelegatorAddress => { - if delegator_address__.is_some() { - return Err(serde::de::Error::duplicate_field("delegatorAddress")); - } - delegator_address__ = Some(map_.next_value()?); - } - GeneratedField::ValidatorAddress => { - if validator_address__.is_some() { - return Err(serde::de::Error::duplicate_field("validatorAddress")); - } - validator_address__ = Some(map_.next_value()?); - } - GeneratedField::Shares => { - if shares__.is_some() { - return Err(serde::de::Error::duplicate_field("shares")); - } - shares__ = Some(map_.next_value()?); - } - } - } - Ok(Delegation { - delegator_address: delegator_address__.unwrap_or_default(), - validator_address: validator_address__.unwrap_or_default(), - shares: shares__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.Delegation", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for DelegationResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.DelegationResponse", len)?; - if let Some(v) = self.delegation.as_ref() { - struct_ser.serialize_field("delegation", v)?; - } - if let Some(v) = self.balance.as_ref() { - struct_ser.serialize_field("balance", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for DelegationResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "delegation", - "balance", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Delegation, - Balance, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "delegation" => Ok(GeneratedField::Delegation), - "balance" => Ok(GeneratedField::Balance), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = DelegationResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.DelegationResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut delegation__ = None; - let mut balance__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Delegation => { - if delegation__.is_some() { - return Err(serde::de::Error::duplicate_field("delegation")); - } - delegation__ = map_.next_value()?; - } - GeneratedField::Balance => { - if balance__.is_some() { - return Err(serde::de::Error::duplicate_field("balance")); - } - balance__ = map_.next_value()?; - } - } - } - Ok(DelegationResponse { - delegation: delegation__, - balance: balance__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.DelegationResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Description { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.Description", len)?; - if true { - struct_ser.serialize_field("moniker", &self.moniker)?; - } - if true { - struct_ser.serialize_field("identity", &self.identity)?; - } - if true { - struct_ser.serialize_field("website", &self.website)?; - } - if true { - struct_ser.serialize_field("securityContact", &self.security_contact)?; - } - if true { - struct_ser.serialize_field("details", &self.details)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Description { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "moniker", - "identity", - "website", - "security_contact", - "securityContact", - "details", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Moniker, - Identity, - Website, - SecurityContact, - Details, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "moniker" => Ok(GeneratedField::Moniker), - "identity" => Ok(GeneratedField::Identity), - "website" => Ok(GeneratedField::Website), - "securityContact" | "security_contact" => Ok(GeneratedField::SecurityContact), - "details" => Ok(GeneratedField::Details), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Description; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.Description") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut moniker__ = None; - let mut identity__ = None; - let mut website__ = None; - let mut security_contact__ = None; - let mut details__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Moniker => { - if moniker__.is_some() { - return Err(serde::de::Error::duplicate_field("moniker")); - } - moniker__ = Some(map_.next_value()?); - } - GeneratedField::Identity => { - if identity__.is_some() { - return Err(serde::de::Error::duplicate_field("identity")); - } - identity__ = Some(map_.next_value()?); - } - GeneratedField::Website => { - if website__.is_some() { - return Err(serde::de::Error::duplicate_field("website")); - } - website__ = Some(map_.next_value()?); - } - GeneratedField::SecurityContact => { - if security_contact__.is_some() { - return Err(serde::de::Error::duplicate_field("securityContact")); - } - security_contact__ = Some(map_.next_value()?); - } - GeneratedField::Details => { - if details__.is_some() { - return Err(serde::de::Error::duplicate_field("details")); - } - details__ = Some(map_.next_value()?); - } - } - } - Ok(Description { - moniker: moniker__.unwrap_or_default(), - identity: identity__.unwrap_or_default(), - website: website__.unwrap_or_default(), - security_contact: security_contact__.unwrap_or_default(), - details: details__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.Description", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for GenesisState { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.GenesisState", len)?; - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("lastTotalPower", pbjson::private::base64::encode(&self.last_total_power).as_str())?; - } - if true { - struct_ser.serialize_field("lastValidatorPowers", &self.last_validator_powers)?; - } - if true { - struct_ser.serialize_field("validators", &self.validators)?; - } - if true { - struct_ser.serialize_field("delegations", &self.delegations)?; - } - if true { - struct_ser.serialize_field("unbondingDelegations", &self.unbonding_delegations)?; - } - if true { - struct_ser.serialize_field("redelegations", &self.redelegations)?; - } - if true { - struct_ser.serialize_field("exported", &self.exported)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GenesisState { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "params", - "last_total_power", - "lastTotalPower", - "last_validator_powers", - "lastValidatorPowers", - "validators", - "delegations", - "unbonding_delegations", - "unbondingDelegations", - "redelegations", - "exported", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Params, - LastTotalPower, - LastValidatorPowers, - Validators, - Delegations, - UnbondingDelegations, - Redelegations, - Exported, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "params" => Ok(GeneratedField::Params), - "lastTotalPower" | "last_total_power" => Ok(GeneratedField::LastTotalPower), - "lastValidatorPowers" | "last_validator_powers" => Ok(GeneratedField::LastValidatorPowers), - "validators" => Ok(GeneratedField::Validators), - "delegations" => Ok(GeneratedField::Delegations), - "unbondingDelegations" | "unbonding_delegations" => Ok(GeneratedField::UnbondingDelegations), - "redelegations" => Ok(GeneratedField::Redelegations), - "exported" => Ok(GeneratedField::Exported), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GenesisState; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.GenesisState") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut params__ = None; - let mut last_total_power__ = None; - let mut last_validator_powers__ = None; - let mut validators__ = None; - let mut delegations__ = None; - let mut unbonding_delegations__ = None; - let mut redelegations__ = None; - let mut exported__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Params => { - if params__.is_some() { - return Err(serde::de::Error::duplicate_field("params")); - } - params__ = map_.next_value()?; - } - GeneratedField::LastTotalPower => { - if last_total_power__.is_some() { - return Err(serde::de::Error::duplicate_field("lastTotalPower")); - } - last_total_power__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::LastValidatorPowers => { - if last_validator_powers__.is_some() { - return Err(serde::de::Error::duplicate_field("lastValidatorPowers")); - } - last_validator_powers__ = Some(map_.next_value()?); - } - GeneratedField::Validators => { - if validators__.is_some() { - return Err(serde::de::Error::duplicate_field("validators")); - } - validators__ = Some(map_.next_value()?); - } - GeneratedField::Delegations => { - if delegations__.is_some() { - return Err(serde::de::Error::duplicate_field("delegations")); - } - delegations__ = Some(map_.next_value()?); - } - GeneratedField::UnbondingDelegations => { - if unbonding_delegations__.is_some() { - return Err(serde::de::Error::duplicate_field("unbondingDelegations")); - } - unbonding_delegations__ = Some(map_.next_value()?); - } - GeneratedField::Redelegations => { - if redelegations__.is_some() { - return Err(serde::de::Error::duplicate_field("redelegations")); - } - redelegations__ = Some(map_.next_value()?); - } - GeneratedField::Exported => { - if exported__.is_some() { - return Err(serde::de::Error::duplicate_field("exported")); - } - exported__ = Some(map_.next_value()?); - } - } - } - Ok(GenesisState { - params: params__, - last_total_power: last_total_power__.unwrap_or_default(), - last_validator_powers: last_validator_powers__.unwrap_or_default(), - validators: validators__.unwrap_or_default(), - delegations: delegations__.unwrap_or_default(), - unbonding_delegations: unbonding_delegations__.unwrap_or_default(), - redelegations: redelegations__.unwrap_or_default(), - exported: exported__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.GenesisState", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for HistoricalInfo { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.HistoricalInfo", len)?; - if let Some(v) = self.header.as_ref() { - struct_ser.serialize_field("header", v)?; - } - if true { - struct_ser.serialize_field("valset", &self.valset)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for HistoricalInfo { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "header", - "valset", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Header, - Valset, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "header" => Ok(GeneratedField::Header), - "valset" => Ok(GeneratedField::Valset), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = HistoricalInfo; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.HistoricalInfo") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut header__ = None; - let mut valset__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Header => { - if header__.is_some() { - return Err(serde::de::Error::duplicate_field("header")); - } - header__ = map_.next_value()?; - } - GeneratedField::Valset => { - if valset__.is_some() { - return Err(serde::de::Error::duplicate_field("valset")); - } - valset__ = Some(map_.next_value()?); - } - } - } - Ok(HistoricalInfo { - header: header__, - valset: valset__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.HistoricalInfo", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Infraction { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::Unspecified => "INFRACTION_UNSPECIFIED", - Self::DoubleSign => "INFRACTION_DOUBLE_SIGN", - Self::Downtime => "INFRACTION_DOWNTIME", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for Infraction { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "INFRACTION_UNSPECIFIED", - "INFRACTION_DOUBLE_SIGN", - "INFRACTION_DOWNTIME", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Infraction; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - fn visit_i64(self, v: i64) -> core::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> core::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "INFRACTION_UNSPECIFIED" => Ok(Infraction::Unspecified), - "INFRACTION_DOUBLE_SIGN" => Ok(Infraction::DoubleSign), - "INFRACTION_DOWNTIME" => Ok(Infraction::Downtime), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for InfractionType { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::Unspecified => "INFRACTION_TYPE_UNSPECIFIED", - Self::DoubleSign => "INFRACTION_TYPE_DOUBLE_SIGN", - Self::Downtime => "INFRACTION_TYPE_DOWNTIME", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for InfractionType { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "INFRACTION_TYPE_UNSPECIFIED", - "INFRACTION_TYPE_DOUBLE_SIGN", - "INFRACTION_TYPE_DOWNTIME", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = InfractionType; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - fn visit_i64(self, v: i64) -> core::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> core::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "INFRACTION_TYPE_UNSPECIFIED" => Ok(InfractionType::Unspecified), - "INFRACTION_TYPE_DOUBLE_SIGN" => Ok(InfractionType::DoubleSign), - "INFRACTION_TYPE_DOWNTIME" => Ok(InfractionType::Downtime), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for LastValidatorPower { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.LastValidatorPower", len)?; - if true { - struct_ser.serialize_field("address", &self.address)?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("power", ::alloc::string::ToString::to_string(&self.power).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for LastValidatorPower { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "address", - "power", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Address, - Power, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "address" => Ok(GeneratedField::Address), - "power" => Ok(GeneratedField::Power), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = LastValidatorPower; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.LastValidatorPower") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut address__ = None; - let mut power__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Address => { - if address__.is_some() { - return Err(serde::de::Error::duplicate_field("address")); - } - address__ = Some(map_.next_value()?); - } - GeneratedField::Power => { - if power__.is_some() { - return Err(serde::de::Error::duplicate_field("power")); - } - power__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(LastValidatorPower { - address: address__.unwrap_or_default(), - power: power__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.LastValidatorPower", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgBeginRedelegate { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgBeginRedelegate", len)?; - if true { - struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; - } - if true { - struct_ser.serialize_field("validatorSrcAddress", &self.validator_src_address)?; - } - if true { - struct_ser.serialize_field("validatorDstAddress", &self.validator_dst_address)?; - } - if let Some(v) = self.amount.as_ref() { - struct_ser.serialize_field("amount", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgBeginRedelegate { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "delegator_address", - "delegatorAddress", - "validator_src_address", - "validatorSrcAddress", - "validator_dst_address", - "validatorDstAddress", - "amount", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - DelegatorAddress, - ValidatorSrcAddress, - ValidatorDstAddress, - Amount, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "delegatorAddress" | "delegator_address" => Ok(GeneratedField::DelegatorAddress), - "validatorSrcAddress" | "validator_src_address" => Ok(GeneratedField::ValidatorSrcAddress), - "validatorDstAddress" | "validator_dst_address" => Ok(GeneratedField::ValidatorDstAddress), - "amount" => Ok(GeneratedField::Amount), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgBeginRedelegate; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.MsgBeginRedelegate") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut delegator_address__ = None; - let mut validator_src_address__ = None; - let mut validator_dst_address__ = None; - let mut amount__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::DelegatorAddress => { - if delegator_address__.is_some() { - return Err(serde::de::Error::duplicate_field("delegatorAddress")); - } - delegator_address__ = Some(map_.next_value()?); - } - GeneratedField::ValidatorSrcAddress => { - if validator_src_address__.is_some() { - return Err(serde::de::Error::duplicate_field("validatorSrcAddress")); - } - validator_src_address__ = Some(map_.next_value()?); - } - GeneratedField::ValidatorDstAddress => { - if validator_dst_address__.is_some() { - return Err(serde::de::Error::duplicate_field("validatorDstAddress")); - } - validator_dst_address__ = Some(map_.next_value()?); - } - GeneratedField::Amount => { - if amount__.is_some() { - return Err(serde::de::Error::duplicate_field("amount")); - } - amount__ = map_.next_value()?; - } - } - } - Ok(MsgBeginRedelegate { - delegator_address: delegator_address__.unwrap_or_default(), - validator_src_address: validator_src_address__.unwrap_or_default(), - validator_dst_address: validator_dst_address__.unwrap_or_default(), - amount: amount__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.MsgBeginRedelegate", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgBeginRedelegateResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgBeginRedelegateResponse", len)?; - if let Some(v) = self.completion_time.as_ref() { - struct_ser.serialize_field("completionTime", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgBeginRedelegateResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "completion_time", - "completionTime", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - CompletionTime, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "completionTime" | "completion_time" => Ok(GeneratedField::CompletionTime), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgBeginRedelegateResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.MsgBeginRedelegateResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut completion_time__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::CompletionTime => { - if completion_time__.is_some() { - return Err(serde::de::Error::duplicate_field("completionTime")); - } - completion_time__ = map_.next_value()?; - } - } - } - Ok(MsgBeginRedelegateResponse { - completion_time: completion_time__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.MsgBeginRedelegateResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgCancelUnbondingDelegation { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", len)?; - if true { - struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; - } - if true { - struct_ser.serialize_field("validatorAddress", &self.validator_address)?; - } - if let Some(v) = self.amount.as_ref() { - struct_ser.serialize_field("amount", v)?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("creationHeight", ::alloc::string::ToString::to_string(&self.creation_height).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgCancelUnbondingDelegation { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "delegator_address", - "delegatorAddress", - "validator_address", - "validatorAddress", - "amount", - "creation_height", - "creationHeight", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - DelegatorAddress, - ValidatorAddress, - Amount, - CreationHeight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "delegatorAddress" | "delegator_address" => Ok(GeneratedField::DelegatorAddress), - "validatorAddress" | "validator_address" => Ok(GeneratedField::ValidatorAddress), - "amount" => Ok(GeneratedField::Amount), - "creationHeight" | "creation_height" => Ok(GeneratedField::CreationHeight), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgCancelUnbondingDelegation; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.MsgCancelUnbondingDelegation") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut delegator_address__ = None; - let mut validator_address__ = None; - let mut amount__ = None; - let mut creation_height__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::DelegatorAddress => { - if delegator_address__.is_some() { - return Err(serde::de::Error::duplicate_field("delegatorAddress")); - } - delegator_address__ = Some(map_.next_value()?); - } - GeneratedField::ValidatorAddress => { - if validator_address__.is_some() { - return Err(serde::de::Error::duplicate_field("validatorAddress")); - } - validator_address__ = Some(map_.next_value()?); - } - GeneratedField::Amount => { - if amount__.is_some() { - return Err(serde::de::Error::duplicate_field("amount")); - } - amount__ = map_.next_value()?; - } - GeneratedField::CreationHeight => { - if creation_height__.is_some() { - return Err(serde::de::Error::duplicate_field("creationHeight")); - } - creation_height__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(MsgCancelUnbondingDelegation { - delegator_address: delegator_address__.unwrap_or_default(), - validator_address: validator_address__.unwrap_or_default(), - amount: amount__, - creation_height: creation_height__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgCancelUnbondingDelegationResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgCancelUnbondingDelegationResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgCancelUnbondingDelegationResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(MsgCancelUnbondingDelegationResponse { - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgCreateValidator { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgCreateValidator", len)?; - if let Some(v) = self.description.as_ref() { - struct_ser.serialize_field("description", v)?; - } - if let Some(v) = self.commission.as_ref() { - struct_ser.serialize_field("commission", v)?; - } - if true { - struct_ser.serialize_field("minSelfDelegation", &self.min_self_delegation)?; - } - if true { - struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; - } - if true { - struct_ser.serialize_field("validatorAddress", &self.validator_address)?; - } - if let Some(v) = self.pubkey.as_ref() { - struct_ser.serialize_field("pubkey", v)?; - } - if let Some(v) = self.value.as_ref() { - struct_ser.serialize_field("value", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgCreateValidator { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "description", - "commission", - "min_self_delegation", - "minSelfDelegation", - "delegator_address", - "delegatorAddress", - "validator_address", - "validatorAddress", - "pubkey", - "value", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Description, - Commission, - MinSelfDelegation, - DelegatorAddress, - ValidatorAddress, - Pubkey, - Value, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "description" => Ok(GeneratedField::Description), - "commission" => Ok(GeneratedField::Commission), - "minSelfDelegation" | "min_self_delegation" => Ok(GeneratedField::MinSelfDelegation), - "delegatorAddress" | "delegator_address" => Ok(GeneratedField::DelegatorAddress), - "validatorAddress" | "validator_address" => Ok(GeneratedField::ValidatorAddress), - "pubkey" => Ok(GeneratedField::Pubkey), - "value" => Ok(GeneratedField::Value), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgCreateValidator; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.MsgCreateValidator") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut description__ = None; - let mut commission__ = None; - let mut min_self_delegation__ = None; - let mut delegator_address__ = None; - let mut validator_address__ = None; - let mut pubkey__ = None; - let mut value__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Description => { - if description__.is_some() { - return Err(serde::de::Error::duplicate_field("description")); - } - description__ = map_.next_value()?; - } - GeneratedField::Commission => { - if commission__.is_some() { - return Err(serde::de::Error::duplicate_field("commission")); - } - commission__ = map_.next_value()?; - } - GeneratedField::MinSelfDelegation => { - if min_self_delegation__.is_some() { - return Err(serde::de::Error::duplicate_field("minSelfDelegation")); - } - min_self_delegation__ = Some(map_.next_value()?); - } - GeneratedField::DelegatorAddress => { - if delegator_address__.is_some() { - return Err(serde::de::Error::duplicate_field("delegatorAddress")); - } - delegator_address__ = Some(map_.next_value()?); - } - GeneratedField::ValidatorAddress => { - if validator_address__.is_some() { - return Err(serde::de::Error::duplicate_field("validatorAddress")); - } - validator_address__ = Some(map_.next_value()?); - } - GeneratedField::Pubkey => { - if pubkey__.is_some() { - return Err(serde::de::Error::duplicate_field("pubkey")); - } - pubkey__ = map_.next_value()?; - } - GeneratedField::Value => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("value")); - } - value__ = map_.next_value()?; - } - } - } - Ok(MsgCreateValidator { - description: description__, - commission: commission__, - min_self_delegation: min_self_delegation__.unwrap_or_default(), - delegator_address: delegator_address__.unwrap_or_default(), - validator_address: validator_address__.unwrap_or_default(), - pubkey: pubkey__, - value: value__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.MsgCreateValidator", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgCreateValidatorResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgCreateValidatorResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgCreateValidatorResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgCreateValidatorResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.MsgCreateValidatorResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(MsgCreateValidatorResponse { - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.MsgCreateValidatorResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgDelegate { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgDelegate", len)?; - if true { - struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; - } - if true { - struct_ser.serialize_field("validatorAddress", &self.validator_address)?; - } - if let Some(v) = self.amount.as_ref() { - struct_ser.serialize_field("amount", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgDelegate { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "delegator_address", - "delegatorAddress", - "validator_address", - "validatorAddress", - "amount", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - DelegatorAddress, - ValidatorAddress, - Amount, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "delegatorAddress" | "delegator_address" => Ok(GeneratedField::DelegatorAddress), - "validatorAddress" | "validator_address" => Ok(GeneratedField::ValidatorAddress), - "amount" => Ok(GeneratedField::Amount), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgDelegate; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.MsgDelegate") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut delegator_address__ = None; - let mut validator_address__ = None; - let mut amount__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::DelegatorAddress => { - if delegator_address__.is_some() { - return Err(serde::de::Error::duplicate_field("delegatorAddress")); - } - delegator_address__ = Some(map_.next_value()?); - } - GeneratedField::ValidatorAddress => { - if validator_address__.is_some() { - return Err(serde::de::Error::duplicate_field("validatorAddress")); - } - validator_address__ = Some(map_.next_value()?); - } - GeneratedField::Amount => { - if amount__.is_some() { - return Err(serde::de::Error::duplicate_field("amount")); - } - amount__ = map_.next_value()?; - } - } - } - Ok(MsgDelegate { - delegator_address: delegator_address__.unwrap_or_default(), - validator_address: validator_address__.unwrap_or_default(), - amount: amount__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.MsgDelegate", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgDelegateResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgDelegateResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgDelegateResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgDelegateResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.MsgDelegateResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(MsgDelegateResponse { - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.MsgDelegateResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgEditValidator { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgEditValidator", len)?; - if let Some(v) = self.description.as_ref() { - struct_ser.serialize_field("description", v)?; - } - if true { - struct_ser.serialize_field("validatorAddress", &self.validator_address)?; - } - if true { - struct_ser.serialize_field("commissionRate", &self.commission_rate)?; - } - if true { - struct_ser.serialize_field("minSelfDelegation", &self.min_self_delegation)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgEditValidator { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "description", - "validator_address", - "validatorAddress", - "commission_rate", - "commissionRate", - "min_self_delegation", - "minSelfDelegation", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Description, - ValidatorAddress, - CommissionRate, - MinSelfDelegation, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "description" => Ok(GeneratedField::Description), - "validatorAddress" | "validator_address" => Ok(GeneratedField::ValidatorAddress), - "commissionRate" | "commission_rate" => Ok(GeneratedField::CommissionRate), - "minSelfDelegation" | "min_self_delegation" => Ok(GeneratedField::MinSelfDelegation), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgEditValidator; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.MsgEditValidator") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut description__ = None; - let mut validator_address__ = None; - let mut commission_rate__ = None; - let mut min_self_delegation__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Description => { - if description__.is_some() { - return Err(serde::de::Error::duplicate_field("description")); - } - description__ = map_.next_value()?; - } - GeneratedField::ValidatorAddress => { - if validator_address__.is_some() { - return Err(serde::de::Error::duplicate_field("validatorAddress")); - } - validator_address__ = Some(map_.next_value()?); - } - GeneratedField::CommissionRate => { - if commission_rate__.is_some() { - return Err(serde::de::Error::duplicate_field("commissionRate")); - } - commission_rate__ = Some(map_.next_value()?); - } - GeneratedField::MinSelfDelegation => { - if min_self_delegation__.is_some() { - return Err(serde::de::Error::duplicate_field("minSelfDelegation")); - } - min_self_delegation__ = Some(map_.next_value()?); - } - } - } - Ok(MsgEditValidator { - description: description__, - validator_address: validator_address__.unwrap_or_default(), - commission_rate: commission_rate__.unwrap_or_default(), - min_self_delegation: min_self_delegation__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.MsgEditValidator", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgEditValidatorResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgEditValidatorResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgEditValidatorResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgEditValidatorResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.MsgEditValidatorResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(MsgEditValidatorResponse { - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.MsgEditValidatorResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgUndelegate { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgUndelegate", len)?; - if true { - struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; - } - if true { - struct_ser.serialize_field("validatorAddress", &self.validator_address)?; - } - if let Some(v) = self.amount.as_ref() { - struct_ser.serialize_field("amount", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgUndelegate { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "delegator_address", - "delegatorAddress", - "validator_address", - "validatorAddress", - "amount", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - DelegatorAddress, - ValidatorAddress, - Amount, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "delegatorAddress" | "delegator_address" => Ok(GeneratedField::DelegatorAddress), - "validatorAddress" | "validator_address" => Ok(GeneratedField::ValidatorAddress), - "amount" => Ok(GeneratedField::Amount), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgUndelegate; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.MsgUndelegate") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut delegator_address__ = None; - let mut validator_address__ = None; - let mut amount__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::DelegatorAddress => { - if delegator_address__.is_some() { - return Err(serde::de::Error::duplicate_field("delegatorAddress")); - } - delegator_address__ = Some(map_.next_value()?); - } - GeneratedField::ValidatorAddress => { - if validator_address__.is_some() { - return Err(serde::de::Error::duplicate_field("validatorAddress")); - } - validator_address__ = Some(map_.next_value()?); - } - GeneratedField::Amount => { - if amount__.is_some() { - return Err(serde::de::Error::duplicate_field("amount")); - } - amount__ = map_.next_value()?; - } - } - } - Ok(MsgUndelegate { - delegator_address: delegator_address__.unwrap_or_default(), - validator_address: validator_address__.unwrap_or_default(), - amount: amount__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.MsgUndelegate", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgUndelegateResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgUndelegateResponse", len)?; - if let Some(v) = self.completion_time.as_ref() { - struct_ser.serialize_field("completionTime", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgUndelegateResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "completion_time", - "completionTime", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - CompletionTime, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "completionTime" | "completion_time" => Ok(GeneratedField::CompletionTime), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgUndelegateResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.MsgUndelegateResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut completion_time__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::CompletionTime => { - if completion_time__.is_some() { - return Err(serde::de::Error::duplicate_field("completionTime")); - } - completion_time__ = map_.next_value()?; - } - } - } - Ok(MsgUndelegateResponse { - completion_time: completion_time__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.MsgUndelegateResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgUpdateParams { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgUpdateParams", len)?; - if true { - struct_ser.serialize_field("authority", &self.authority)?; - } - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgUpdateParams { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "authority", - "params", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Authority, - Params, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "authority" => Ok(GeneratedField::Authority), - "params" => Ok(GeneratedField::Params), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgUpdateParams; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.MsgUpdateParams") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut authority__ = None; - let mut params__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Authority => { - if authority__.is_some() { - return Err(serde::de::Error::duplicate_field("authority")); - } - authority__ = Some(map_.next_value()?); - } - GeneratedField::Params => { - if params__.is_some() { - return Err(serde::de::Error::duplicate_field("params")); - } - params__ = map_.next_value()?; - } - } - } - Ok(MsgUpdateParams { - authority: authority__.unwrap_or_default(), - params: params__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.MsgUpdateParams", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgUpdateParamsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgUpdateParamsResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgUpdateParamsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgUpdateParamsResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.MsgUpdateParamsResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(MsgUpdateParamsResponse { - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.MsgUpdateParamsResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Params { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.Params", len)?; - if let Some(v) = self.unbonding_time.as_ref() { - struct_ser.serialize_field("unbondingTime", v)?; - } - if true { - struct_ser.serialize_field("maxValidators", &self.max_validators)?; - } - if true { - struct_ser.serialize_field("maxEntries", &self.max_entries)?; - } - if true { - struct_ser.serialize_field("historicalEntries", &self.historical_entries)?; - } - if true { - struct_ser.serialize_field("bondDenom", &self.bond_denom)?; - } - if true { - struct_ser.serialize_field("minCommissionRate", &self.min_commission_rate)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Params { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "unbonding_time", - "unbondingTime", - "max_validators", - "maxValidators", - "max_entries", - "maxEntries", - "historical_entries", - "historicalEntries", - "bond_denom", - "bondDenom", - "min_commission_rate", - "minCommissionRate", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - UnbondingTime, - MaxValidators, - MaxEntries, - HistoricalEntries, - BondDenom, - MinCommissionRate, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "unbondingTime" | "unbonding_time" => Ok(GeneratedField::UnbondingTime), - "maxValidators" | "max_validators" => Ok(GeneratedField::MaxValidators), - "maxEntries" | "max_entries" => Ok(GeneratedField::MaxEntries), - "historicalEntries" | "historical_entries" => Ok(GeneratedField::HistoricalEntries), - "bondDenom" | "bond_denom" => Ok(GeneratedField::BondDenom), - "minCommissionRate" | "min_commission_rate" => Ok(GeneratedField::MinCommissionRate), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Params; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.Params") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut unbonding_time__ = None; - let mut max_validators__ = None; - let mut max_entries__ = None; - let mut historical_entries__ = None; - let mut bond_denom__ = None; - let mut min_commission_rate__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::UnbondingTime => { - if unbonding_time__.is_some() { - return Err(serde::de::Error::duplicate_field("unbondingTime")); - } - unbonding_time__ = map_.next_value()?; - } - GeneratedField::MaxValidators => { - if max_validators__.is_some() { - return Err(serde::de::Error::duplicate_field("maxValidators")); - } - max_validators__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::MaxEntries => { - if max_entries__.is_some() { - return Err(serde::de::Error::duplicate_field("maxEntries")); - } - max_entries__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::HistoricalEntries => { - if historical_entries__.is_some() { - return Err(serde::de::Error::duplicate_field("historicalEntries")); - } - historical_entries__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::BondDenom => { - if bond_denom__.is_some() { - return Err(serde::de::Error::duplicate_field("bondDenom")); - } - bond_denom__ = Some(map_.next_value()?); - } - GeneratedField::MinCommissionRate => { - if min_commission_rate__.is_some() { - return Err(serde::de::Error::duplicate_field("minCommissionRate")); - } - min_commission_rate__ = Some(map_.next_value()?); - } - } - } - Ok(Params { - unbonding_time: unbonding_time__, - max_validators: max_validators__.unwrap_or_default(), - max_entries: max_entries__.unwrap_or_default(), - historical_entries: historical_entries__.unwrap_or_default(), - bond_denom: bond_denom__.unwrap_or_default(), - min_commission_rate: min_commission_rate__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.Params", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Pool { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.Pool", len)?; - if true { - struct_ser.serialize_field("notBondedTokens", &self.not_bonded_tokens)?; - } - if true { - struct_ser.serialize_field("bondedTokens", &self.bonded_tokens)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Pool { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "not_bonded_tokens", - "notBondedTokens", - "bonded_tokens", - "bondedTokens", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - NotBondedTokens, - BondedTokens, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "notBondedTokens" | "not_bonded_tokens" => Ok(GeneratedField::NotBondedTokens), - "bondedTokens" | "bonded_tokens" => Ok(GeneratedField::BondedTokens), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Pool; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.Pool") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut not_bonded_tokens__ = None; - let mut bonded_tokens__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::NotBondedTokens => { - if not_bonded_tokens__.is_some() { - return Err(serde::de::Error::duplicate_field("notBondedTokens")); - } - not_bonded_tokens__ = Some(map_.next_value()?); - } - GeneratedField::BondedTokens => { - if bonded_tokens__.is_some() { - return Err(serde::de::Error::duplicate_field("bondedTokens")); - } - bonded_tokens__ = Some(map_.next_value()?); - } - } - } - Ok(Pool { - not_bonded_tokens: not_bonded_tokens__.unwrap_or_default(), - bonded_tokens: bonded_tokens__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.Pool", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryDelegationRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryDelegationRequest", len)?; - if true { - struct_ser.serialize_field("delegatorAddr", &self.delegator_addr)?; - } - if true { - struct_ser.serialize_field("validatorAddr", &self.validator_addr)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDelegationRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "delegator_addr", - "delegatorAddr", - "validator_addr", - "validatorAddr", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - DelegatorAddr, - ValidatorAddr, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "delegatorAddr" | "delegator_addr" => Ok(GeneratedField::DelegatorAddr), - "validatorAddr" | "validator_addr" => Ok(GeneratedField::ValidatorAddr), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryDelegationRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.QueryDelegationRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut delegator_addr__ = None; - let mut validator_addr__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::DelegatorAddr => { - if delegator_addr__.is_some() { - return Err(serde::de::Error::duplicate_field("delegatorAddr")); - } - delegator_addr__ = Some(map_.next_value()?); - } - GeneratedField::ValidatorAddr => { - if validator_addr__.is_some() { - return Err(serde::de::Error::duplicate_field("validatorAddr")); - } - validator_addr__ = Some(map_.next_value()?); - } - } - } - Ok(QueryDelegationRequest { - delegator_addr: delegator_addr__.unwrap_or_default(), - validator_addr: validator_addr__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryDelegationRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryDelegationResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryDelegationResponse", len)?; - if let Some(v) = self.delegation_response.as_ref() { - struct_ser.serialize_field("delegationResponse", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDelegationResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "delegation_response", - "delegationResponse", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - DelegationResponse, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "delegationResponse" | "delegation_response" => Ok(GeneratedField::DelegationResponse), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryDelegationResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.QueryDelegationResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut delegation_response__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::DelegationResponse => { - if delegation_response__.is_some() { - return Err(serde::de::Error::duplicate_field("delegationResponse")); - } - delegation_response__ = map_.next_value()?; - } - } - } - Ok(QueryDelegationResponse { - delegation_response: delegation_response__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryDelegationResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryDelegatorDelegationsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest", len)?; - if true { - struct_ser.serialize_field("delegatorAddr", &self.delegator_addr)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDelegatorDelegationsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "delegator_addr", - "delegatorAddr", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - DelegatorAddr, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "delegatorAddr" | "delegator_addr" => Ok(GeneratedField::DelegatorAddr), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryDelegatorDelegationsRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut delegator_addr__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::DelegatorAddr => { - if delegator_addr__.is_some() { - return Err(serde::de::Error::duplicate_field("delegatorAddr")); - } - delegator_addr__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryDelegatorDelegationsRequest { - delegator_addr: delegator_addr__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryDelegatorDelegationsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse", len)?; - if true { - struct_ser.serialize_field("delegationResponses", &self.delegation_responses)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDelegatorDelegationsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "delegation_responses", - "delegationResponses", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - DelegationResponses, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "delegationResponses" | "delegation_responses" => Ok(GeneratedField::DelegationResponses), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryDelegatorDelegationsResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut delegation_responses__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::DelegationResponses => { - if delegation_responses__.is_some() { - return Err(serde::de::Error::duplicate_field("delegationResponses")); - } - delegation_responses__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryDelegatorDelegationsResponse { - delegation_responses: delegation_responses__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryDelegatorUnbondingDelegationsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest", len)?; - if true { - struct_ser.serialize_field("delegatorAddr", &self.delegator_addr)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDelegatorUnbondingDelegationsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "delegator_addr", - "delegatorAddr", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - DelegatorAddr, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "delegatorAddr" | "delegator_addr" => Ok(GeneratedField::DelegatorAddr), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryDelegatorUnbondingDelegationsRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut delegator_addr__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::DelegatorAddr => { - if delegator_addr__.is_some() { - return Err(serde::de::Error::duplicate_field("delegatorAddr")); - } - delegator_addr__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryDelegatorUnbondingDelegationsRequest { - delegator_addr: delegator_addr__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryDelegatorUnbondingDelegationsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse", len)?; - if true { - struct_ser.serialize_field("unbondingResponses", &self.unbonding_responses)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDelegatorUnbondingDelegationsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "unbonding_responses", - "unbondingResponses", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - UnbondingResponses, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "unbondingResponses" | "unbonding_responses" => Ok(GeneratedField::UnbondingResponses), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryDelegatorUnbondingDelegationsResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut unbonding_responses__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::UnbondingResponses => { - if unbonding_responses__.is_some() { - return Err(serde::de::Error::duplicate_field("unbondingResponses")); - } - unbonding_responses__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryDelegatorUnbondingDelegationsResponse { - unbonding_responses: unbonding_responses__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryDelegatorValidatorRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryDelegatorValidatorRequest", len)?; - if true { - struct_ser.serialize_field("delegatorAddr", &self.delegator_addr)?; - } - if true { - struct_ser.serialize_field("validatorAddr", &self.validator_addr)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDelegatorValidatorRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "delegator_addr", - "delegatorAddr", - "validator_addr", - "validatorAddr", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - DelegatorAddr, - ValidatorAddr, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "delegatorAddr" | "delegator_addr" => Ok(GeneratedField::DelegatorAddr), - "validatorAddr" | "validator_addr" => Ok(GeneratedField::ValidatorAddr), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryDelegatorValidatorRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.QueryDelegatorValidatorRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut delegator_addr__ = None; - let mut validator_addr__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::DelegatorAddr => { - if delegator_addr__.is_some() { - return Err(serde::de::Error::duplicate_field("delegatorAddr")); - } - delegator_addr__ = Some(map_.next_value()?); - } - GeneratedField::ValidatorAddr => { - if validator_addr__.is_some() { - return Err(serde::de::Error::duplicate_field("validatorAddr")); - } - validator_addr__ = Some(map_.next_value()?); - } - } - } - Ok(QueryDelegatorValidatorRequest { - delegator_addr: delegator_addr__.unwrap_or_default(), - validator_addr: validator_addr__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryDelegatorValidatorRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryDelegatorValidatorResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryDelegatorValidatorResponse", len)?; - if let Some(v) = self.validator.as_ref() { - struct_ser.serialize_field("validator", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDelegatorValidatorResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "validator", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Validator, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "validator" => Ok(GeneratedField::Validator), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryDelegatorValidatorResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.QueryDelegatorValidatorResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut validator__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Validator => { - if validator__.is_some() { - return Err(serde::de::Error::duplicate_field("validator")); - } - validator__ = map_.next_value()?; - } - } - } - Ok(QueryDelegatorValidatorResponse { - validator: validator__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryDelegatorValidatorResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryDelegatorValidatorsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest", len)?; - if true { - struct_ser.serialize_field("delegatorAddr", &self.delegator_addr)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDelegatorValidatorsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "delegator_addr", - "delegatorAddr", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - DelegatorAddr, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "delegatorAddr" | "delegator_addr" => Ok(GeneratedField::DelegatorAddr), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryDelegatorValidatorsRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut delegator_addr__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::DelegatorAddr => { - if delegator_addr__.is_some() { - return Err(serde::de::Error::duplicate_field("delegatorAddr")); - } - delegator_addr__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryDelegatorValidatorsRequest { - delegator_addr: delegator_addr__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryDelegatorValidatorsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse", len)?; - if true { - struct_ser.serialize_field("validators", &self.validators)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDelegatorValidatorsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "validators", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Validators, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "validators" => Ok(GeneratedField::Validators), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryDelegatorValidatorsResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut validators__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Validators => { - if validators__.is_some() { - return Err(serde::de::Error::duplicate_field("validators")); - } - validators__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryDelegatorValidatorsResponse { - validators: validators__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryHistoricalInfoRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryHistoricalInfoRequest", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("height", ::alloc::string::ToString::to_string(&self.height).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryHistoricalInfoRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "height", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Height, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "height" => Ok(GeneratedField::Height), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryHistoricalInfoRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.QueryHistoricalInfoRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut height__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Height => { - if height__.is_some() { - return Err(serde::de::Error::duplicate_field("height")); - } - height__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(QueryHistoricalInfoRequest { - height: height__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryHistoricalInfoRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryHistoricalInfoResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryHistoricalInfoResponse", len)?; - if let Some(v) = self.hist.as_ref() { - struct_ser.serialize_field("hist", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryHistoricalInfoResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "hist", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Hist, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "hist" => Ok(GeneratedField::Hist), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryHistoricalInfoResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.QueryHistoricalInfoResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut hist__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Hist => { - if hist__.is_some() { - return Err(serde::de::Error::duplicate_field("hist")); - } - hist__ = map_.next_value()?; - } - } - } - Ok(QueryHistoricalInfoResponse { - hist: hist__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryHistoricalInfoResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryParamsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryParamsRequest", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryParamsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryParamsRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.QueryParamsRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(QueryParamsRequest { - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryParamsRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryParamsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryParamsResponse", len)?; - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryParamsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "params", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Params, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "params" => Ok(GeneratedField::Params), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryParamsResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.QueryParamsResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut params__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Params => { - if params__.is_some() { - return Err(serde::de::Error::duplicate_field("params")); - } - params__ = map_.next_value()?; - } - } - } - Ok(QueryParamsResponse { - params: params__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryParamsResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryPoolRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryPoolRequest", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryPoolRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryPoolRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.QueryPoolRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(QueryPoolRequest { - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryPoolRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryPoolResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryPoolResponse", len)?; - if let Some(v) = self.pool.as_ref() { - struct_ser.serialize_field("pool", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryPoolResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "pool", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Pool, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "pool" => Ok(GeneratedField::Pool), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryPoolResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.QueryPoolResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut pool__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Pool => { - if pool__.is_some() { - return Err(serde::de::Error::duplicate_field("pool")); - } - pool__ = map_.next_value()?; - } - } - } - Ok(QueryPoolResponse { - pool: pool__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryPoolResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryRedelegationsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryRedelegationsRequest", len)?; - if true { - struct_ser.serialize_field("delegatorAddr", &self.delegator_addr)?; - } - if true { - struct_ser.serialize_field("srcValidatorAddr", &self.src_validator_addr)?; - } - if true { - struct_ser.serialize_field("dstValidatorAddr", &self.dst_validator_addr)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryRedelegationsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "delegator_addr", - "delegatorAddr", - "src_validator_addr", - "srcValidatorAddr", - "dst_validator_addr", - "dstValidatorAddr", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - DelegatorAddr, - SrcValidatorAddr, - DstValidatorAddr, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "delegatorAddr" | "delegator_addr" => Ok(GeneratedField::DelegatorAddr), - "srcValidatorAddr" | "src_validator_addr" => Ok(GeneratedField::SrcValidatorAddr), - "dstValidatorAddr" | "dst_validator_addr" => Ok(GeneratedField::DstValidatorAddr), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryRedelegationsRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.QueryRedelegationsRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut delegator_addr__ = None; - let mut src_validator_addr__ = None; - let mut dst_validator_addr__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::DelegatorAddr => { - if delegator_addr__.is_some() { - return Err(serde::de::Error::duplicate_field("delegatorAddr")); - } - delegator_addr__ = Some(map_.next_value()?); - } - GeneratedField::SrcValidatorAddr => { - if src_validator_addr__.is_some() { - return Err(serde::de::Error::duplicate_field("srcValidatorAddr")); - } - src_validator_addr__ = Some(map_.next_value()?); - } - GeneratedField::DstValidatorAddr => { - if dst_validator_addr__.is_some() { - return Err(serde::de::Error::duplicate_field("dstValidatorAddr")); - } - dst_validator_addr__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryRedelegationsRequest { - delegator_addr: delegator_addr__.unwrap_or_default(), - src_validator_addr: src_validator_addr__.unwrap_or_default(), - dst_validator_addr: dst_validator_addr__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryRedelegationsRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryRedelegationsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryRedelegationsResponse", len)?; - if true { - struct_ser.serialize_field("redelegationResponses", &self.redelegation_responses)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryRedelegationsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "redelegation_responses", - "redelegationResponses", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - RedelegationResponses, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "redelegationResponses" | "redelegation_responses" => Ok(GeneratedField::RedelegationResponses), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryRedelegationsResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.QueryRedelegationsResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut redelegation_responses__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::RedelegationResponses => { - if redelegation_responses__.is_some() { - return Err(serde::de::Error::duplicate_field("redelegationResponses")); - } - redelegation_responses__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryRedelegationsResponse { - redelegation_responses: redelegation_responses__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryRedelegationsResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryUnbondingDelegationRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryUnbondingDelegationRequest", len)?; - if true { - struct_ser.serialize_field("delegatorAddr", &self.delegator_addr)?; - } - if true { - struct_ser.serialize_field("validatorAddr", &self.validator_addr)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryUnbondingDelegationRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "delegator_addr", - "delegatorAddr", - "validator_addr", - "validatorAddr", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - DelegatorAddr, - ValidatorAddr, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "delegatorAddr" | "delegator_addr" => Ok(GeneratedField::DelegatorAddr), - "validatorAddr" | "validator_addr" => Ok(GeneratedField::ValidatorAddr), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryUnbondingDelegationRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.QueryUnbondingDelegationRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut delegator_addr__ = None; - let mut validator_addr__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::DelegatorAddr => { - if delegator_addr__.is_some() { - return Err(serde::de::Error::duplicate_field("delegatorAddr")); - } - delegator_addr__ = Some(map_.next_value()?); - } - GeneratedField::ValidatorAddr => { - if validator_addr__.is_some() { - return Err(serde::de::Error::duplicate_field("validatorAddr")); - } - validator_addr__ = Some(map_.next_value()?); - } - } - } - Ok(QueryUnbondingDelegationRequest { - delegator_addr: delegator_addr__.unwrap_or_default(), - validator_addr: validator_addr__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryUnbondingDelegationRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryUnbondingDelegationResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryUnbondingDelegationResponse", len)?; - if let Some(v) = self.unbond.as_ref() { - struct_ser.serialize_field("unbond", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryUnbondingDelegationResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "unbond", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Unbond, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "unbond" => Ok(GeneratedField::Unbond), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryUnbondingDelegationResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.QueryUnbondingDelegationResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut unbond__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Unbond => { - if unbond__.is_some() { - return Err(serde::de::Error::duplicate_field("unbond")); - } - unbond__ = map_.next_value()?; - } - } - } - Ok(QueryUnbondingDelegationResponse { - unbond: unbond__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryUnbondingDelegationResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryValidatorDelegationsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryValidatorDelegationsRequest", len)?; - if true { - struct_ser.serialize_field("validatorAddr", &self.validator_addr)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryValidatorDelegationsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "validator_addr", - "validatorAddr", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ValidatorAddr, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "validatorAddr" | "validator_addr" => Ok(GeneratedField::ValidatorAddr), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryValidatorDelegationsRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.QueryValidatorDelegationsRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut validator_addr__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ValidatorAddr => { - if validator_addr__.is_some() { - return Err(serde::de::Error::duplicate_field("validatorAddr")); - } - validator_addr__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryValidatorDelegationsRequest { - validator_addr: validator_addr__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryValidatorDelegationsRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryValidatorDelegationsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryValidatorDelegationsResponse", len)?; - if true { - struct_ser.serialize_field("delegationResponses", &self.delegation_responses)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryValidatorDelegationsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "delegation_responses", - "delegationResponses", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - DelegationResponses, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "delegationResponses" | "delegation_responses" => Ok(GeneratedField::DelegationResponses), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryValidatorDelegationsResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.QueryValidatorDelegationsResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut delegation_responses__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::DelegationResponses => { - if delegation_responses__.is_some() { - return Err(serde::de::Error::duplicate_field("delegationResponses")); - } - delegation_responses__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryValidatorDelegationsResponse { - delegation_responses: delegation_responses__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryValidatorDelegationsResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryValidatorRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryValidatorRequest", len)?; - if true { - struct_ser.serialize_field("validatorAddr", &self.validator_addr)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryValidatorRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "validator_addr", - "validatorAddr", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ValidatorAddr, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "validatorAddr" | "validator_addr" => Ok(GeneratedField::ValidatorAddr), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryValidatorRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.QueryValidatorRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut validator_addr__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ValidatorAddr => { - if validator_addr__.is_some() { - return Err(serde::de::Error::duplicate_field("validatorAddr")); - } - validator_addr__ = Some(map_.next_value()?); - } - } - } - Ok(QueryValidatorRequest { - validator_addr: validator_addr__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryValidatorRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryValidatorResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryValidatorResponse", len)?; - if let Some(v) = self.validator.as_ref() { - struct_ser.serialize_field("validator", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryValidatorResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "validator", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Validator, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "validator" => Ok(GeneratedField::Validator), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryValidatorResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.QueryValidatorResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut validator__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Validator => { - if validator__.is_some() { - return Err(serde::de::Error::duplicate_field("validator")); - } - validator__ = map_.next_value()?; - } - } - } - Ok(QueryValidatorResponse { - validator: validator__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryValidatorResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryValidatorUnbondingDelegationsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest", len)?; - if true { - struct_ser.serialize_field("validatorAddr", &self.validator_addr)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryValidatorUnbondingDelegationsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "validator_addr", - "validatorAddr", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ValidatorAddr, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "validatorAddr" | "validator_addr" => Ok(GeneratedField::ValidatorAddr), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryValidatorUnbondingDelegationsRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut validator_addr__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ValidatorAddr => { - if validator_addr__.is_some() { - return Err(serde::de::Error::duplicate_field("validatorAddr")); - } - validator_addr__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryValidatorUnbondingDelegationsRequest { - validator_addr: validator_addr__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryValidatorUnbondingDelegationsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse", len)?; - if true { - struct_ser.serialize_field("unbondingResponses", &self.unbonding_responses)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryValidatorUnbondingDelegationsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "unbonding_responses", - "unbondingResponses", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - UnbondingResponses, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "unbondingResponses" | "unbonding_responses" => Ok(GeneratedField::UnbondingResponses), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryValidatorUnbondingDelegationsResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut unbonding_responses__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::UnbondingResponses => { - if unbonding_responses__.is_some() { - return Err(serde::de::Error::duplicate_field("unbondingResponses")); - } - unbonding_responses__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryValidatorUnbondingDelegationsResponse { - unbonding_responses: unbonding_responses__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryValidatorsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryValidatorsRequest", len)?; - if true { - struct_ser.serialize_field("status", &self.status)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryValidatorsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "status", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Status, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "status" => Ok(GeneratedField::Status), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryValidatorsRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.QueryValidatorsRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut status__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Status => { - if status__.is_some() { - return Err(serde::de::Error::duplicate_field("status")); - } - status__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryValidatorsRequest { - status: status__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryValidatorsRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryValidatorsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryValidatorsResponse", len)?; - if true { - struct_ser.serialize_field("validators", &self.validators)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryValidatorsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "validators", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Validators, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "validators" => Ok(GeneratedField::Validators), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryValidatorsResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.QueryValidatorsResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut validators__ = None; - let mut pagination__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Validators => { - if validators__.is_some() { - return Err(serde::de::Error::duplicate_field("validators")); - } - validators__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - } - } - Ok(QueryValidatorsResponse { - validators: validators__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryValidatorsResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Redelegation { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.Redelegation", len)?; - if true { - struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; - } - if true { - struct_ser.serialize_field("validatorSrcAddress", &self.validator_src_address)?; - } - if true { - struct_ser.serialize_field("validatorDstAddress", &self.validator_dst_address)?; - } - if true { - struct_ser.serialize_field("entries", &self.entries)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Redelegation { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "delegator_address", - "delegatorAddress", - "validator_src_address", - "validatorSrcAddress", - "validator_dst_address", - "validatorDstAddress", - "entries", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - DelegatorAddress, - ValidatorSrcAddress, - ValidatorDstAddress, - Entries, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "delegatorAddress" | "delegator_address" => Ok(GeneratedField::DelegatorAddress), - "validatorSrcAddress" | "validator_src_address" => Ok(GeneratedField::ValidatorSrcAddress), - "validatorDstAddress" | "validator_dst_address" => Ok(GeneratedField::ValidatorDstAddress), - "entries" => Ok(GeneratedField::Entries), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Redelegation; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.Redelegation") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut delegator_address__ = None; - let mut validator_src_address__ = None; - let mut validator_dst_address__ = None; - let mut entries__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::DelegatorAddress => { - if delegator_address__.is_some() { - return Err(serde::de::Error::duplicate_field("delegatorAddress")); - } - delegator_address__ = Some(map_.next_value()?); - } - GeneratedField::ValidatorSrcAddress => { - if validator_src_address__.is_some() { - return Err(serde::de::Error::duplicate_field("validatorSrcAddress")); - } - validator_src_address__ = Some(map_.next_value()?); - } - GeneratedField::ValidatorDstAddress => { - if validator_dst_address__.is_some() { - return Err(serde::de::Error::duplicate_field("validatorDstAddress")); - } - validator_dst_address__ = Some(map_.next_value()?); - } - GeneratedField::Entries => { - if entries__.is_some() { - return Err(serde::de::Error::duplicate_field("entries")); - } - entries__ = Some(map_.next_value()?); - } - } - } - Ok(Redelegation { - delegator_address: delegator_address__.unwrap_or_default(), - validator_src_address: validator_src_address__.unwrap_or_default(), - validator_dst_address: validator_dst_address__.unwrap_or_default(), - entries: entries__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.Redelegation", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for RedelegationEntry { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.RedelegationEntry", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("creationHeight", ::alloc::string::ToString::to_string(&self.creation_height).as_str())?; - } - if let Some(v) = self.completion_time.as_ref() { - struct_ser.serialize_field("completionTime", v)?; - } - if true { - struct_ser.serialize_field("initialBalance", &self.initial_balance)?; - } - if true { - struct_ser.serialize_field("sharesDst", &self.shares_dst)?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("unbondingId", ::alloc::string::ToString::to_string(&self.unbonding_id).as_str())?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("unbondingOnHoldRefCount", ::alloc::string::ToString::to_string(&self.unbonding_on_hold_ref_count).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for RedelegationEntry { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "creation_height", - "creationHeight", - "completion_time", - "completionTime", - "initial_balance", - "initialBalance", - "shares_dst", - "sharesDst", - "unbonding_id", - "unbondingId", - "unbonding_on_hold_ref_count", - "unbondingOnHoldRefCount", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - CreationHeight, - CompletionTime, - InitialBalance, - SharesDst, - UnbondingId, - UnbondingOnHoldRefCount, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "creationHeight" | "creation_height" => Ok(GeneratedField::CreationHeight), - "completionTime" | "completion_time" => Ok(GeneratedField::CompletionTime), - "initialBalance" | "initial_balance" => Ok(GeneratedField::InitialBalance), - "sharesDst" | "shares_dst" => Ok(GeneratedField::SharesDst), - "unbondingId" | "unbonding_id" => Ok(GeneratedField::UnbondingId), - "unbondingOnHoldRefCount" | "unbonding_on_hold_ref_count" => Ok(GeneratedField::UnbondingOnHoldRefCount), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RedelegationEntry; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.RedelegationEntry") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut creation_height__ = None; - let mut completion_time__ = None; - let mut initial_balance__ = None; - let mut shares_dst__ = None; - let mut unbonding_id__ = None; - let mut unbonding_on_hold_ref_count__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::CreationHeight => { - if creation_height__.is_some() { - return Err(serde::de::Error::duplicate_field("creationHeight")); - } - creation_height__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::CompletionTime => { - if completion_time__.is_some() { - return Err(serde::de::Error::duplicate_field("completionTime")); - } - completion_time__ = map_.next_value()?; - } - GeneratedField::InitialBalance => { - if initial_balance__.is_some() { - return Err(serde::de::Error::duplicate_field("initialBalance")); - } - initial_balance__ = Some(map_.next_value()?); - } - GeneratedField::SharesDst => { - if shares_dst__.is_some() { - return Err(serde::de::Error::duplicate_field("sharesDst")); - } - shares_dst__ = Some(map_.next_value()?); - } - GeneratedField::UnbondingId => { - if unbonding_id__.is_some() { - return Err(serde::de::Error::duplicate_field("unbondingId")); - } - unbonding_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::UnbondingOnHoldRefCount => { - if unbonding_on_hold_ref_count__.is_some() { - return Err(serde::de::Error::duplicate_field("unbondingOnHoldRefCount")); - } - unbonding_on_hold_ref_count__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(RedelegationEntry { - creation_height: creation_height__.unwrap_or_default(), - completion_time: completion_time__, - initial_balance: initial_balance__.unwrap_or_default(), - shares_dst: shares_dst__.unwrap_or_default(), - unbonding_id: unbonding_id__.unwrap_or_default(), - unbonding_on_hold_ref_count: unbonding_on_hold_ref_count__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.RedelegationEntry", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for RedelegationEntryResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.RedelegationEntryResponse", len)?; - if let Some(v) = self.redelegation_entry.as_ref() { - struct_ser.serialize_field("redelegationEntry", v)?; - } - if true { - struct_ser.serialize_field("balance", &self.balance)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for RedelegationEntryResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "redelegation_entry", - "redelegationEntry", - "balance", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - RedelegationEntry, - Balance, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "redelegationEntry" | "redelegation_entry" => Ok(GeneratedField::RedelegationEntry), - "balance" => Ok(GeneratedField::Balance), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RedelegationEntryResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.RedelegationEntryResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut redelegation_entry__ = None; - let mut balance__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::RedelegationEntry => { - if redelegation_entry__.is_some() { - return Err(serde::de::Error::duplicate_field("redelegationEntry")); - } - redelegation_entry__ = map_.next_value()?; - } - GeneratedField::Balance => { - if balance__.is_some() { - return Err(serde::de::Error::duplicate_field("balance")); - } - balance__ = Some(map_.next_value()?); - } - } - } - Ok(RedelegationEntryResponse { - redelegation_entry: redelegation_entry__, - balance: balance__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.RedelegationEntryResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for RedelegationResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.RedelegationResponse", len)?; - if let Some(v) = self.redelegation.as_ref() { - struct_ser.serialize_field("redelegation", v)?; - } - if true { - struct_ser.serialize_field("entries", &self.entries)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for RedelegationResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "redelegation", - "entries", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Redelegation, - Entries, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "redelegation" => Ok(GeneratedField::Redelegation), - "entries" => Ok(GeneratedField::Entries), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RedelegationResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.RedelegationResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut redelegation__ = None; - let mut entries__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Redelegation => { - if redelegation__.is_some() { - return Err(serde::de::Error::duplicate_field("redelegation")); - } - redelegation__ = map_.next_value()?; - } - GeneratedField::Entries => { - if entries__.is_some() { - return Err(serde::de::Error::duplicate_field("entries")); - } - entries__ = Some(map_.next_value()?); - } - } - } - Ok(RedelegationResponse { - redelegation: redelegation__, - entries: entries__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.RedelegationResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for UnbondingDelegation { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.UnbondingDelegation", len)?; - if true { - struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; - } - if true { - struct_ser.serialize_field("validatorAddress", &self.validator_address)?; - } - if true { - struct_ser.serialize_field("entries", &self.entries)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for UnbondingDelegation { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "delegator_address", - "delegatorAddress", - "validator_address", - "validatorAddress", - "entries", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - DelegatorAddress, - ValidatorAddress, - Entries, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "delegatorAddress" | "delegator_address" => Ok(GeneratedField::DelegatorAddress), - "validatorAddress" | "validator_address" => Ok(GeneratedField::ValidatorAddress), - "entries" => Ok(GeneratedField::Entries), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = UnbondingDelegation; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.UnbondingDelegation") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut delegator_address__ = None; - let mut validator_address__ = None; - let mut entries__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::DelegatorAddress => { - if delegator_address__.is_some() { - return Err(serde::de::Error::duplicate_field("delegatorAddress")); - } - delegator_address__ = Some(map_.next_value()?); - } - GeneratedField::ValidatorAddress => { - if validator_address__.is_some() { - return Err(serde::de::Error::duplicate_field("validatorAddress")); - } - validator_address__ = Some(map_.next_value()?); - } - GeneratedField::Entries => { - if entries__.is_some() { - return Err(serde::de::Error::duplicate_field("entries")); - } - entries__ = Some(map_.next_value()?); - } - } - } - Ok(UnbondingDelegation { - delegator_address: delegator_address__.unwrap_or_default(), - validator_address: validator_address__.unwrap_or_default(), - entries: entries__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.UnbondingDelegation", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for UnbondingDelegationEntry { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.UnbondingDelegationEntry", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("creationHeight", ::alloc::string::ToString::to_string(&self.creation_height).as_str())?; - } - if let Some(v) = self.completion_time.as_ref() { - struct_ser.serialize_field("completionTime", v)?; - } - if true { - struct_ser.serialize_field("initialBalance", &self.initial_balance)?; - } - if true { - struct_ser.serialize_field("balance", &self.balance)?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("unbondingId", ::alloc::string::ToString::to_string(&self.unbonding_id).as_str())?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("unbondingOnHoldRefCount", ::alloc::string::ToString::to_string(&self.unbonding_on_hold_ref_count).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for UnbondingDelegationEntry { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "creation_height", - "creationHeight", - "completion_time", - "completionTime", - "initial_balance", - "initialBalance", - "balance", - "unbonding_id", - "unbondingId", - "unbonding_on_hold_ref_count", - "unbondingOnHoldRefCount", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - CreationHeight, - CompletionTime, - InitialBalance, - Balance, - UnbondingId, - UnbondingOnHoldRefCount, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "creationHeight" | "creation_height" => Ok(GeneratedField::CreationHeight), - "completionTime" | "completion_time" => Ok(GeneratedField::CompletionTime), - "initialBalance" | "initial_balance" => Ok(GeneratedField::InitialBalance), - "balance" => Ok(GeneratedField::Balance), - "unbondingId" | "unbonding_id" => Ok(GeneratedField::UnbondingId), - "unbondingOnHoldRefCount" | "unbonding_on_hold_ref_count" => Ok(GeneratedField::UnbondingOnHoldRefCount), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = UnbondingDelegationEntry; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.UnbondingDelegationEntry") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut creation_height__ = None; - let mut completion_time__ = None; - let mut initial_balance__ = None; - let mut balance__ = None; - let mut unbonding_id__ = None; - let mut unbonding_on_hold_ref_count__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::CreationHeight => { - if creation_height__.is_some() { - return Err(serde::de::Error::duplicate_field("creationHeight")); - } - creation_height__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::CompletionTime => { - if completion_time__.is_some() { - return Err(serde::de::Error::duplicate_field("completionTime")); - } - completion_time__ = map_.next_value()?; - } - GeneratedField::InitialBalance => { - if initial_balance__.is_some() { - return Err(serde::de::Error::duplicate_field("initialBalance")); - } - initial_balance__ = Some(map_.next_value()?); - } - GeneratedField::Balance => { - if balance__.is_some() { - return Err(serde::de::Error::duplicate_field("balance")); - } - balance__ = Some(map_.next_value()?); - } - GeneratedField::UnbondingId => { - if unbonding_id__.is_some() { - return Err(serde::de::Error::duplicate_field("unbondingId")); - } - unbonding_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::UnbondingOnHoldRefCount => { - if unbonding_on_hold_ref_count__.is_some() { - return Err(serde::de::Error::duplicate_field("unbondingOnHoldRefCount")); - } - unbonding_on_hold_ref_count__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(UnbondingDelegationEntry { - creation_height: creation_height__.unwrap_or_default(), - completion_time: completion_time__, - initial_balance: initial_balance__.unwrap_or_default(), - balance: balance__.unwrap_or_default(), - unbonding_id: unbonding_id__.unwrap_or_default(), - unbonding_on_hold_ref_count: unbonding_on_hold_ref_count__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.UnbondingDelegationEntry", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for ValAddresses { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.ValAddresses", len)?; - if true { - struct_ser.serialize_field("addresses", &self.addresses)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ValAddresses { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "addresses", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Addresses, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "addresses" => Ok(GeneratedField::Addresses), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ValAddresses; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.ValAddresses") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut addresses__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Addresses => { - if addresses__.is_some() { - return Err(serde::de::Error::duplicate_field("addresses")); - } - addresses__ = Some(map_.next_value()?); - } - } - } - Ok(ValAddresses { - addresses: addresses__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.ValAddresses", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Validator { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.Validator", len)?; - if true { - struct_ser.serialize_field("operatorAddress", &self.operator_address)?; - } - if let Some(v) = self.consensus_pubkey.as_ref() { - struct_ser.serialize_field("consensusPubkey", v)?; - } - if true { - struct_ser.serialize_field("jailed", &self.jailed)?; - } - if true { - let v = BondStatus::try_from(self.status) - .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.status)))?; - struct_ser.serialize_field("status", &v)?; - } - if true { - struct_ser.serialize_field("tokens", &self.tokens)?; - } - if true { - struct_ser.serialize_field("delegatorShares", &self.delegator_shares)?; - } - if let Some(v) = self.description.as_ref() { - struct_ser.serialize_field("description", v)?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("unbondingHeight", ::alloc::string::ToString::to_string(&self.unbonding_height).as_str())?; - } - if let Some(v) = self.unbonding_time.as_ref() { - struct_ser.serialize_field("unbondingTime", v)?; - } - if let Some(v) = self.commission.as_ref() { - struct_ser.serialize_field("commission", v)?; - } - if true { - struct_ser.serialize_field("minSelfDelegation", &self.min_self_delegation)?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("unbondingOnHoldRefCount", ::alloc::string::ToString::to_string(&self.unbonding_on_hold_ref_count).as_str())?; - } - if true { - struct_ser.serialize_field("unbondingIds", &self.unbonding_ids.iter().map(::alloc::string::ToString::to_string).collect::<::alloc::vec::Vec<_>>())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Validator { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "operator_address", - "operatorAddress", - "consensus_pubkey", - "consensusPubkey", - "jailed", - "status", - "tokens", - "delegator_shares", - "delegatorShares", - "description", - "unbonding_height", - "unbondingHeight", - "unbonding_time", - "unbondingTime", - "commission", - "min_self_delegation", - "minSelfDelegation", - "unbonding_on_hold_ref_count", - "unbondingOnHoldRefCount", - "unbonding_ids", - "unbondingIds", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - OperatorAddress, - ConsensusPubkey, - Jailed, - Status, - Tokens, - DelegatorShares, - Description, - UnbondingHeight, - UnbondingTime, - Commission, - MinSelfDelegation, - UnbondingOnHoldRefCount, - UnbondingIds, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "operatorAddress" | "operator_address" => Ok(GeneratedField::OperatorAddress), - "consensusPubkey" | "consensus_pubkey" => Ok(GeneratedField::ConsensusPubkey), - "jailed" => Ok(GeneratedField::Jailed), - "status" => Ok(GeneratedField::Status), - "tokens" => Ok(GeneratedField::Tokens), - "delegatorShares" | "delegator_shares" => Ok(GeneratedField::DelegatorShares), - "description" => Ok(GeneratedField::Description), - "unbondingHeight" | "unbonding_height" => Ok(GeneratedField::UnbondingHeight), - "unbondingTime" | "unbonding_time" => Ok(GeneratedField::UnbondingTime), - "commission" => Ok(GeneratedField::Commission), - "minSelfDelegation" | "min_self_delegation" => Ok(GeneratedField::MinSelfDelegation), - "unbondingOnHoldRefCount" | "unbonding_on_hold_ref_count" => Ok(GeneratedField::UnbondingOnHoldRefCount), - "unbondingIds" | "unbonding_ids" => Ok(GeneratedField::UnbondingIds), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Validator; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.Validator") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut operator_address__ = None; - let mut consensus_pubkey__ = None; - let mut jailed__ = None; - let mut status__ = None; - let mut tokens__ = None; - let mut delegator_shares__ = None; - let mut description__ = None; - let mut unbonding_height__ = None; - let mut unbonding_time__ = None; - let mut commission__ = None; - let mut min_self_delegation__ = None; - let mut unbonding_on_hold_ref_count__ = None; - let mut unbonding_ids__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::OperatorAddress => { - if operator_address__.is_some() { - return Err(serde::de::Error::duplicate_field("operatorAddress")); - } - operator_address__ = Some(map_.next_value()?); - } - GeneratedField::ConsensusPubkey => { - if consensus_pubkey__.is_some() { - return Err(serde::de::Error::duplicate_field("consensusPubkey")); - } - consensus_pubkey__ = map_.next_value()?; - } - GeneratedField::Jailed => { - if jailed__.is_some() { - return Err(serde::de::Error::duplicate_field("jailed")); - } - jailed__ = Some(map_.next_value()?); - } - GeneratedField::Status => { - if status__.is_some() { - return Err(serde::de::Error::duplicate_field("status")); - } - status__ = Some(map_.next_value::()? as i32); - } - GeneratedField::Tokens => { - if tokens__.is_some() { - return Err(serde::de::Error::duplicate_field("tokens")); - } - tokens__ = Some(map_.next_value()?); - } - GeneratedField::DelegatorShares => { - if delegator_shares__.is_some() { - return Err(serde::de::Error::duplicate_field("delegatorShares")); - } - delegator_shares__ = Some(map_.next_value()?); - } - GeneratedField::Description => { - if description__.is_some() { - return Err(serde::de::Error::duplicate_field("description")); - } - description__ = map_.next_value()?; - } - GeneratedField::UnbondingHeight => { - if unbonding_height__.is_some() { - return Err(serde::de::Error::duplicate_field("unbondingHeight")); - } - unbonding_height__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::UnbondingTime => { - if unbonding_time__.is_some() { - return Err(serde::de::Error::duplicate_field("unbondingTime")); - } - unbonding_time__ = map_.next_value()?; - } - GeneratedField::Commission => { - if commission__.is_some() { - return Err(serde::de::Error::duplicate_field("commission")); - } - commission__ = map_.next_value()?; - } - GeneratedField::MinSelfDelegation => { - if min_self_delegation__.is_some() { - return Err(serde::de::Error::duplicate_field("minSelfDelegation")); - } - min_self_delegation__ = Some(map_.next_value()?); - } - GeneratedField::UnbondingOnHoldRefCount => { - if unbonding_on_hold_ref_count__.is_some() { - return Err(serde::de::Error::duplicate_field("unbondingOnHoldRefCount")); - } - unbonding_on_hold_ref_count__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::UnbondingIds => { - if unbonding_ids__.is_some() { - return Err(serde::de::Error::duplicate_field("unbondingIds")); - } - unbonding_ids__ = - Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::NumberDeserialize<_>>>()? - .into_iter().map(|x| x.0).collect()) - ; - } - } - } - Ok(Validator { - operator_address: operator_address__.unwrap_or_default(), - consensus_pubkey: consensus_pubkey__, - jailed: jailed__.unwrap_or_default(), - status: status__.unwrap_or_default(), - tokens: tokens__.unwrap_or_default(), - delegator_shares: delegator_shares__.unwrap_or_default(), - description: description__, - unbonding_height: unbonding_height__.unwrap_or_default(), - unbonding_time: unbonding_time__, - commission: commission__, - min_self_delegation: min_self_delegation__.unwrap_or_default(), - unbonding_on_hold_ref_count: unbonding_on_hold_ref_count__.unwrap_or_default(), - unbonding_ids: unbonding_ids__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.staking.v1beta1.Validator", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.tx.config.v1.rs b/src/prost/cosmos.tx.config.v1.rs deleted file mode 100644 index 2020b0b5..00000000 --- a/src/prost/cosmos.tx.config.v1.rs +++ /dev/null @@ -1,24 +0,0 @@ -// This file is @generated by prost-build. -/// Config is the config object of the x/auth/tx package. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -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, -} -impl ::prost::Name for Config { - const NAME: &'static str = "Config"; - const PACKAGE: &'static str = "cosmos.tx.config.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.config.v1.Config".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.config.v1.Config".into() - } -} diff --git a/src/prost/cosmos.tx.config.v1.serde.rs b/src/prost/cosmos.tx.config.v1.serde.rs deleted file mode 100644 index d4283484..00000000 --- a/src/prost/cosmos.tx.config.v1.serde.rs +++ /dev/null @@ -1,110 +0,0 @@ -impl serde::Serialize for Config { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.tx.config.v1.Config", len)?; - if true { - struct_ser.serialize_field("skipAnteHandler", &self.skip_ante_handler)?; - } - if true { - struct_ser.serialize_field("skipPostHandler", &self.skip_post_handler)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Config { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "skip_ante_handler", - "skipAnteHandler", - "skip_post_handler", - "skipPostHandler", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - SkipAnteHandler, - SkipPostHandler, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "skipAnteHandler" | "skip_ante_handler" => Ok(GeneratedField::SkipAnteHandler), - "skipPostHandler" | "skip_post_handler" => Ok(GeneratedField::SkipPostHandler), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Config; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.tx.config.v1.Config") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut skip_ante_handler__ = None; - let mut skip_post_handler__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::SkipAnteHandler => { - if skip_ante_handler__.is_some() { - return Err(serde::de::Error::duplicate_field("skipAnteHandler")); - } - skip_ante_handler__ = Some(map_.next_value()?); - } - GeneratedField::SkipPostHandler => { - if skip_post_handler__.is_some() { - return Err(serde::de::Error::duplicate_field("skipPostHandler")); - } - skip_post_handler__ = Some(map_.next_value()?); - } - } - } - Ok(Config { - skip_ante_handler: skip_ante_handler__.unwrap_or_default(), - skip_post_handler: skip_post_handler__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.tx.config.v1.Config", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.tx.signing.v1beta1.rs b/src/prost/cosmos.tx.signing.v1beta1.rs deleted file mode 100644 index d956303e..00000000 --- a/src/prost/cosmos.tx.signing.v1beta1.rs +++ /dev/null @@ -1,197 +0,0 @@ -// This file is @generated by prost-build. -/// SignatureDescriptors wraps multiple SignatureDescriptor's. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SignatureDescriptors { - /// signatures are the signature descriptors - #[prost(message, repeated, tag = "1")] - pub signatures: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for SignatureDescriptors { - const NAME: &'static str = "SignatureDescriptors"; - const PACKAGE: &'static str = "cosmos.tx.signing.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.signing.v1beta1.SignatureDescriptors".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.signing.v1beta1.SignatureDescriptors".into() - } -} -/// SignatureDescriptor is a convenience type which represents the full data for -/// a signature including the public key of the signer, signing modes and the -/// signature itself. It is primarily used for coordinating signatures between -/// clients. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SignatureDescriptor { - /// public_key is the public key of the signer - #[prost(message, optional, tag = "1")] - pub public_key: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, - #[prost(message, optional, tag = "2")] - pub data: ::core::option::Option, - /// sequence is the sequence of the account, which describes the - /// number of committed transactions signed by a given address. It is used to prevent - /// replay attacks. - #[prost(uint64, tag = "3")] - pub sequence: u64, -} -/// Nested message and enum types in `SignatureDescriptor`. -pub mod signature_descriptor { - /// Data represents signature data - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct Data { - /// sum is the oneof that specifies whether this represents single or multi-signature data - #[prost(oneof = "data::Sum", tags = "1, 2")] - pub sum: ::core::option::Option, - } - /// Nested message and enum types in `Data`. - pub mod data { - /// Single is the signature data for a single signer - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct Single { - /// mode is the signing mode of the single signer - #[prost(enumeration = "super::super::SignMode", tag = "1")] - pub mode: i32, - /// signature is the raw signature bytes - #[prost(bytes = "vec", tag = "2")] - pub signature: ::prost::alloc::vec::Vec, - } - impl ::prost::Name for Single { - const NAME: &'static str = "Single"; - const PACKAGE: &'static str = "cosmos.tx.signing.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single".into() - } - } - /// Multi is the signature data for a multisig public key - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct Multi { - /// bitarray specifies which keys within the multisig are signing - #[prost(message, optional, tag = "1")] - pub bitarray: ::core::option::Option< - super::super::super::super::super::crypto::multisig::v1beta1::CompactBitArray, - >, - /// signatures is the signatures of the multi-signature - #[prost(message, repeated, tag = "2")] - pub signatures: ::prost::alloc::vec::Vec, - } - impl ::prost::Name for Multi { - const NAME: &'static str = "Multi"; - const PACKAGE: &'static str = "cosmos.tx.signing.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi".into() - } - } - /// sum is the oneof that specifies whether this represents single or multi-signature data - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Sum { - /// single represents a single signer - #[prost(message, tag = "1")] - Single(Single), - /// multi represents a multisig signer - #[prost(message, tag = "2")] - Multi(Multi), - } - } - impl ::prost::Name for Data { - const NAME: &'static str = "Data"; - const PACKAGE: &'static str = "cosmos.tx.signing.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.signing.v1beta1.SignatureDescriptor.Data".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.signing.v1beta1.SignatureDescriptor.Data".into() - } - } -} -impl ::prost::Name for SignatureDescriptor { - const NAME: &'static str = "SignatureDescriptor"; - const PACKAGE: &'static str = "cosmos.tx.signing.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.signing.v1beta1.SignatureDescriptor".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.signing.v1beta1.SignatureDescriptor".into() - } -} -/// SignMode represents a signing mode with its own security guarantees. -/// -/// This enum should be considered a registry of all known sign modes -/// in the Cosmos ecosystem. Apps are not expected to support all known -/// sign modes. Apps that would like to support custom sign modes are -/// encouraged to open a small PR against this file to add a new case -/// to this SignMode enum describing their sign mode so that different -/// apps have a consistent version of this enum. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum SignMode { - /// SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be - /// rejected. - Unspecified = 0, - /// SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is - /// verified with raw bytes from Tx. - 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. 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`. It also allows - /// for adding Tips in transactions. - /// - /// Since: cosmos-sdk 0.46 - DirectAux = 3, - /// SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses - /// Amino JSON and will be removed in the future. - LegacyAminoJson = 127, - /// SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos - /// SDK. Ref: - /// - /// Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant, - /// but is not implemented on the SDK by default. To enable EIP-191, you need - /// to pass a custom `TxConfig` that has an implementation of - /// `SignModeHandler` for EIP-191. The SDK may decide to fully support - /// EIP-191 in the future. - /// - /// Since: cosmos-sdk 0.45.2 - Eip191 = 191, -} -impl SignMode { - /// 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 { - SignMode::Unspecified => "SIGN_MODE_UNSPECIFIED", - SignMode::Direct => "SIGN_MODE_DIRECT", - SignMode::Textual => "SIGN_MODE_TEXTUAL", - SignMode::DirectAux => "SIGN_MODE_DIRECT_AUX", - SignMode::LegacyAminoJson => "SIGN_MODE_LEGACY_AMINO_JSON", - SignMode::Eip191 => "SIGN_MODE_EIP_191", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "SIGN_MODE_UNSPECIFIED" => Some(Self::Unspecified), - "SIGN_MODE_DIRECT" => Some(Self::Direct), - "SIGN_MODE_TEXTUAL" => Some(Self::Textual), - "SIGN_MODE_DIRECT_AUX" => Some(Self::DirectAux), - "SIGN_MODE_LEGACY_AMINO_JSON" => Some(Self::LegacyAminoJson), - "SIGN_MODE_EIP_191" => Some(Self::Eip191), - _ => None, - } - } -} diff --git a/src/prost/cosmos.tx.signing.v1beta1.serde.rs b/src/prost/cosmos.tx.signing.v1beta1.serde.rs deleted file mode 100644 index 0a8c385c..00000000 --- a/src/prost/cosmos.tx.signing.v1beta1.serde.rs +++ /dev/null @@ -1,633 +0,0 @@ -impl serde::Serialize for SignMode { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::Unspecified => "SIGN_MODE_UNSPECIFIED", - Self::Direct => "SIGN_MODE_DIRECT", - Self::Textual => "SIGN_MODE_TEXTUAL", - Self::DirectAux => "SIGN_MODE_DIRECT_AUX", - Self::LegacyAminoJson => "SIGN_MODE_LEGACY_AMINO_JSON", - Self::Eip191 => "SIGN_MODE_EIP_191", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for SignMode { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "SIGN_MODE_UNSPECIFIED", - "SIGN_MODE_DIRECT", - "SIGN_MODE_TEXTUAL", - "SIGN_MODE_DIRECT_AUX", - "SIGN_MODE_LEGACY_AMINO_JSON", - "SIGN_MODE_EIP_191", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SignMode; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - fn visit_i64(self, v: i64) -> core::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> core::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "SIGN_MODE_UNSPECIFIED" => Ok(SignMode::Unspecified), - "SIGN_MODE_DIRECT" => Ok(SignMode::Direct), - "SIGN_MODE_TEXTUAL" => Ok(SignMode::Textual), - "SIGN_MODE_DIRECT_AUX" => Ok(SignMode::DirectAux), - "SIGN_MODE_LEGACY_AMINO_JSON" => Ok(SignMode::LegacyAminoJson), - "SIGN_MODE_EIP_191" => Ok(SignMode::Eip191), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for SignatureDescriptor { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.tx.signing.v1beta1.SignatureDescriptor", len)?; - if let Some(v) = self.public_key.as_ref() { - struct_ser.serialize_field("publicKey", v)?; - } - if let Some(v) = self.data.as_ref() { - struct_ser.serialize_field("data", v)?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("sequence", ::alloc::string::ToString::to_string(&self.sequence).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SignatureDescriptor { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "public_key", - "publicKey", - "data", - "sequence", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PublicKey, - Data, - Sequence, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "publicKey" | "public_key" => Ok(GeneratedField::PublicKey), - "data" => Ok(GeneratedField::Data), - "sequence" => Ok(GeneratedField::Sequence), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SignatureDescriptor; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.tx.signing.v1beta1.SignatureDescriptor") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut public_key__ = None; - let mut data__ = None; - let mut sequence__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::PublicKey => { - if public_key__.is_some() { - return Err(serde::de::Error::duplicate_field("publicKey")); - } - public_key__ = map_.next_value()?; - } - GeneratedField::Data => { - if data__.is_some() { - return Err(serde::de::Error::duplicate_field("data")); - } - data__ = map_.next_value()?; - } - GeneratedField::Sequence => { - if sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("sequence")); - } - sequence__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(SignatureDescriptor { - public_key: public_key__, - data: data__, - sequence: sequence__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.tx.signing.v1beta1.SignatureDescriptor", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for signature_descriptor::Data { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.sum.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.tx.signing.v1beta1.SignatureDescriptor.Data", len)?; - if let Some(v) = self.sum.as_ref() { - match v { - signature_descriptor::data::Sum::Single(v) => { - struct_ser.serialize_field("single", v)?; - } - signature_descriptor::data::Sum::Multi(v) => { - struct_ser.serialize_field("multi", v)?; - } - } - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for signature_descriptor::Data { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "single", - "multi", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Single, - Multi, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "single" => Ok(GeneratedField::Single), - "multi" => Ok(GeneratedField::Multi), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = signature_descriptor::Data; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.tx.signing.v1beta1.SignatureDescriptor.Data") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut sum__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Single => { - if sum__.is_some() { - return Err(serde::de::Error::duplicate_field("single")); - } - sum__ = map_.next_value::<::core::option::Option<_>>()?.map(signature_descriptor::data::Sum::Single) -; - } - GeneratedField::Multi => { - if sum__.is_some() { - return Err(serde::de::Error::duplicate_field("multi")); - } - sum__ = map_.next_value::<::core::option::Option<_>>()?.map(signature_descriptor::data::Sum::Multi) -; - } - } - } - Ok(signature_descriptor::Data { - sum: sum__, - }) - } - } - deserializer.deserialize_struct("cosmos.tx.signing.v1beta1.SignatureDescriptor.Data", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for signature_descriptor::data::Multi { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi", len)?; - if let Some(v) = self.bitarray.as_ref() { - struct_ser.serialize_field("bitarray", v)?; - } - if true { - struct_ser.serialize_field("signatures", &self.signatures)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for signature_descriptor::data::Multi { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "bitarray", - "signatures", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Bitarray, - Signatures, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "bitarray" => Ok(GeneratedField::Bitarray), - "signatures" => Ok(GeneratedField::Signatures), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = signature_descriptor::data::Multi; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut bitarray__ = None; - let mut signatures__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Bitarray => { - if bitarray__.is_some() { - return Err(serde::de::Error::duplicate_field("bitarray")); - } - bitarray__ = map_.next_value()?; - } - GeneratedField::Signatures => { - if signatures__.is_some() { - return Err(serde::de::Error::duplicate_field("signatures")); - } - signatures__ = Some(map_.next_value()?); - } - } - } - Ok(signature_descriptor::data::Multi { - bitarray: bitarray__, - signatures: signatures__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for signature_descriptor::data::Single { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single", len)?; - if true { - let v = SignMode::try_from(self.mode) - .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.mode)))?; - struct_ser.serialize_field("mode", &v)?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("signature", pbjson::private::base64::encode(&self.signature).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for signature_descriptor::data::Single { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "mode", - "signature", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Mode, - Signature, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "mode" => Ok(GeneratedField::Mode), - "signature" => Ok(GeneratedField::Signature), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = signature_descriptor::data::Single; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut mode__ = None; - let mut signature__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Mode => { - if mode__.is_some() { - return Err(serde::de::Error::duplicate_field("mode")); - } - mode__ = Some(map_.next_value::()? as i32); - } - GeneratedField::Signature => { - if signature__.is_some() { - return Err(serde::de::Error::duplicate_field("signature")); - } - signature__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - } - } - Ok(signature_descriptor::data::Single { - mode: mode__.unwrap_or_default(), - signature: signature__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for SignatureDescriptors { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.tx.signing.v1beta1.SignatureDescriptors", len)?; - if true { - struct_ser.serialize_field("signatures", &self.signatures)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SignatureDescriptors { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "signatures", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Signatures, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "signatures" => Ok(GeneratedField::Signatures), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SignatureDescriptors; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.tx.signing.v1beta1.SignatureDescriptors") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut signatures__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Signatures => { - if signatures__.is_some() { - return Err(serde::de::Error::duplicate_field("signatures")); - } - signatures__ = Some(map_.next_value()?); - } - } - } - Ok(SignatureDescriptors { - signatures: signatures__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.tx.signing.v1beta1.SignatureDescriptors", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.tx.v1beta1.rs b/src/prost/cosmos.tx.v1beta1.rs deleted file mode 100644 index f70a32d3..00000000 --- a/src/prost/cosmos.tx.v1beta1.rs +++ /dev/null @@ -1,1838 +0,0 @@ -// This file is @generated by prost-build. -/// Tx is the standard type used for broadcasting transactions. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Tx { - /// body is the processable content of the transaction - #[prost(message, optional, tag = "1")] - pub body: ::core::option::Option, - /// auth_info is the authorization related content of the transaction, - /// specifically signers, signer modes and fee - #[prost(message, optional, tag = "2")] - pub auth_info: ::core::option::Option, - /// signatures is a list of signatures that matches the length and order of - /// AuthInfo's signer_infos to allow connecting signature meta information like - /// public key and signing mode by position. - #[prost(bytes = "vec", repeated, tag = "3")] - pub signatures: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, -} -impl ::prost::Name for Tx { - const NAME: &'static str = "Tx"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.Tx".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.Tx".into() - } -} -/// TxRaw is a variant of Tx that pins the signer's exact binary representation -/// of body and auth_info. This is used for signing, broadcasting and -/// verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and -/// the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used -/// as the transaction ID. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TxRaw { - /// body_bytes is a protobuf serialization of a TxBody that matches the - /// representation in SignDoc. - #[prost(bytes = "vec", tag = "1")] - pub body_bytes: ::prost::alloc::vec::Vec, - /// auth_info_bytes is a protobuf serialization of an AuthInfo that matches the - /// representation in SignDoc. - #[prost(bytes = "vec", tag = "2")] - pub auth_info_bytes: ::prost::alloc::vec::Vec, - /// signatures is a list of signatures that matches the length and order of - /// AuthInfo's signer_infos to allow connecting signature meta information like - /// public key and signing mode by position. - #[prost(bytes = "vec", repeated, tag = "3")] - pub signatures: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, -} -impl ::prost::Name for TxRaw { - const NAME: &'static str = "TxRaw"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.TxRaw".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.TxRaw".into() - } -} -/// SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SignDoc { - /// body_bytes is protobuf serialization of a TxBody that matches the - /// representation in TxRaw. - #[prost(bytes = "vec", tag = "1")] - pub body_bytes: ::prost::alloc::vec::Vec, - /// auth_info_bytes is a protobuf serialization of an AuthInfo that matches the - /// representation in TxRaw. - #[prost(bytes = "vec", tag = "2")] - pub auth_info_bytes: ::prost::alloc::vec::Vec, - /// chain_id is the unique identifier of the chain this transaction targets. - /// It prevents signed transactions from being used on another chain by an - /// attacker - #[prost(string, tag = "3")] - pub chain_id: ::prost::alloc::string::String, - /// account_number is the account number of the account in state - #[prost(uint64, tag = "4")] - pub account_number: u64, -} -impl ::prost::Name for SignDoc { - const NAME: &'static str = "SignDoc"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.SignDoc".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.SignDoc".into() - } -} -/// SignDocDirectAux is the type used for generating sign bytes for -/// SIGN_MODE_DIRECT_AUX. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SignDocDirectAux { - /// body_bytes is protobuf serialization of a TxBody that matches the - /// representation in TxRaw. - #[prost(bytes = "vec", tag = "1")] - pub body_bytes: ::prost::alloc::vec::Vec, - /// public_key is the public key of the signing account. - #[prost(message, optional, tag = "2")] - pub public_key: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, - /// chain_id is the identifier of the chain this transaction targets. - /// It prevents signed transactions from being used on another chain by an - /// attacker. - #[prost(string, tag = "3")] - pub chain_id: ::prost::alloc::string::String, - /// account_number is the account number of the account in state. - #[prost(uint64, tag = "4")] - pub account_number: u64, - /// sequence is the sequence number of the signing account. - #[prost(uint64, tag = "5")] - pub sequence: u64, - /// 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, -} -impl ::prost::Name for SignDocDirectAux { - const NAME: &'static str = "SignDocDirectAux"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.SignDocDirectAux".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.SignDocDirectAux".into() - } -} -/// TxBody is the body of a transaction that all signers sign over. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TxBody { - /// messages is a list of messages to be executed. The required signers of - /// those messages define the number and order of elements in AuthInfo's - /// signer_infos and Tx's signatures. Each required signer address is added to - /// the list only the first time it occurs. - /// By convention, the first required signer (usually from the first message) - /// is referred to as the primary signer and pays the fee for the whole - /// transaction. - #[prost(message, repeated, tag = "1")] - pub messages: ::prost::alloc::vec::Vec<::tendermint_proto::google::protobuf::Any>, - /// memo is any arbitrary note/comment to be added to the transaction. - /// WARNING: in clients, any publicly exposed text should not be called memo, - /// but should be called `note` instead (see ). - #[prost(string, tag = "2")] - pub memo: ::prost::alloc::string::String, - /// timeout is the block height after which this transaction will not - /// be processed by the chain - #[prost(uint64, tag = "3")] - pub timeout_height: u64, - /// extension_options are arbitrary options that can be added by chains - /// when the default options are not sufficient. If any of these are present - /// and can't be handled, the transaction will be rejected - #[prost(message, repeated, tag = "1023")] - pub extension_options: ::prost::alloc::vec::Vec< - ::tendermint_proto::google::protobuf::Any, - >, - /// extension_options are arbitrary options that can be added by chains - /// when the default options are not sufficient. If any of these are present - /// and can't be handled, they will be ignored - #[prost(message, repeated, tag = "2047")] - pub non_critical_extension_options: ::prost::alloc::vec::Vec< - ::tendermint_proto::google::protobuf::Any, - >, -} -impl ::prost::Name for TxBody { - const NAME: &'static str = "TxBody"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.TxBody".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.TxBody".into() - } -} -/// AuthInfo describes the fee and signer modes that are used to sign a -/// transaction. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AuthInfo { - /// signer_infos defines the signing modes for the required signers. The number - /// and order of elements must match the required signers from TxBody's - /// messages. The first element is the primary signer and the one which pays - /// the fee. - #[prost(message, repeated, tag = "1")] - pub signer_infos: ::prost::alloc::vec::Vec, - /// Fee is the fee and gas limit for the transaction. The first signer is the - /// primary signer and the one which pays the fee. The fee can be calculated - /// based on the cost of evaluating the body and doing signature verification - /// of the signers. This can be estimated via simulation. - #[prost(message, optional, tag = "2")] - pub fee: ::core::option::Option, - /// Tip is the optional tip used for transactions fees paid in another denom. - /// - /// This field is ignored if the chain didn't enable tips, i.e. didn't add the - /// `TipDecorator` in its posthandler. - /// - /// Since: cosmos-sdk 0.46 - #[prost(message, optional, tag = "3")] - pub tip: ::core::option::Option, -} -impl ::prost::Name for AuthInfo { - const NAME: &'static str = "AuthInfo"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.AuthInfo".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.AuthInfo".into() - } -} -/// SignerInfo describes the public key and signing mode of a single top-level -/// signer. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SignerInfo { - /// public_key is the public key of the signer. It is optional for accounts - /// that already exist in state. If unset, the verifier can use the required \ - /// signer address for this position and lookup the public key. - #[prost(message, optional, tag = "1")] - pub public_key: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, - /// mode_info describes the signing mode of the signer and is a nested - /// structure to support nested multisig pubkey's - #[prost(message, optional, tag = "2")] - pub mode_info: ::core::option::Option, - /// sequence is the sequence of the account, which describes the - /// number of committed transactions signed by a given address. It is used to - /// prevent replay attacks. - #[prost(uint64, tag = "3")] - pub sequence: u64, -} -impl ::prost::Name for SignerInfo { - const NAME: &'static str = "SignerInfo"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.SignerInfo".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.SignerInfo".into() - } -} -/// ModeInfo describes the signing mode of a single or nested multisig signer. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ModeInfo { - /// sum is the oneof that specifies whether this represents a single or nested - /// multisig signer - #[prost(oneof = "mode_info::Sum", tags = "1, 2")] - pub sum: ::core::option::Option, -} -/// Nested message and enum types in `ModeInfo`. -pub mod mode_info { - /// Single is the mode info for a single signer. It is structured as a message - /// to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the - /// future - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, Copy, PartialEq, ::prost::Message)] - pub struct Single { - /// mode is the signing mode of the single signer - #[prost(enumeration = "super::super::signing::v1beta1::SignMode", tag = "1")] - pub mode: i32, - } - impl ::prost::Name for Single { - const NAME: &'static str = "Single"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.ModeInfo.Single".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.ModeInfo.Single".into() - } - } - /// Multi is the mode info for a multisig public key - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct Multi { - /// bitarray specifies which keys within the multisig are signing - #[prost(message, optional, tag = "1")] - pub bitarray: ::core::option::Option< - super::super::super::crypto::multisig::v1beta1::CompactBitArray, - >, - /// mode_infos is the corresponding modes of the signers of the multisig - /// which could include nested multisig public keys - #[prost(message, repeated, tag = "2")] - pub mode_infos: ::prost::alloc::vec::Vec, - } - impl ::prost::Name for Multi { - const NAME: &'static str = "Multi"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.ModeInfo.Multi".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.ModeInfo.Multi".into() - } - } - /// sum is the oneof that specifies whether this represents a single or nested - /// multisig signer - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Sum { - /// single represents a single signer - #[prost(message, tag = "1")] - Single(Single), - /// multi represents a nested multisig signer - #[prost(message, tag = "2")] - Multi(Multi), - } -} -impl ::prost::Name for ModeInfo { - const NAME: &'static str = "ModeInfo"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.ModeInfo".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.ModeInfo".into() - } -} -/// Fee includes the amount of coins paid in fees and the maximum -/// gas to be used by the transaction. The ratio yields an effective "gasprice", -/// which must be above some miminum to be accepted into the mempool. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Fee { - /// amount is the amount of coins to be paid as a fee - #[prost(message, repeated, tag = "1")] - pub amount: ::prost::alloc::vec::Vec, - /// gas_limit is the maximum gas that can be used in transaction processing - /// before an out of gas error occurs - #[prost(uint64, tag = "2")] - pub gas_limit: u64, - /// if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. - /// the payer must be a tx signer (and thus have signed this field in AuthInfo). - /// setting this field does *not* change the ordering of required signers for the transaction. - #[prost(string, tag = "3")] - pub payer: ::prost::alloc::string::String, - /// if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used - /// to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does - /// not support fee grants, this will fail - #[prost(string, tag = "4")] - pub granter: ::prost::alloc::string::String, -} -impl ::prost::Name for Fee { - const NAME: &'static str = "Fee"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.Fee".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.Fee".into() - } -} -/// Tip is the tip used for meta-transactions. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Tip { - /// amount is the amount of the tip - #[prost(message, repeated, tag = "1")] - pub amount: ::prost::alloc::vec::Vec, - /// tipper is the address of the account paying for the tip - #[prost(string, tag = "2")] - pub tipper: ::prost::alloc::string::String, -} -impl ::prost::Name for Tip { - const NAME: &'static str = "Tip"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.Tip".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.Tip".into() - } -} -/// AuxSignerData is the intermediary format that an auxiliary signer (e.g. a -/// tipper) builds and sends to the fee payer (who will build and broadcast the -/// actual tx). AuxSignerData is not a valid tx in itself, and will be rejected -/// by the node if sent directly as-is. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AuxSignerData { - /// address is the bech32-encoded address of the auxiliary signer. If using - /// AuxSignerData across different chains, the bech32 prefix of the target - /// chain (where the final transaction is broadcasted) should be used. - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - /// sign_doc is the SIGN_MODE_DIRECT_AUX sign doc that the auxiliary signer - /// signs. Note: we use the same sign doc even if we're signing with - /// LEGACY_AMINO_JSON. - #[prost(message, optional, tag = "2")] - pub sign_doc: ::core::option::Option, - /// mode is the signing mode of the single signer. - #[prost(enumeration = "super::signing::v1beta1::SignMode", tag = "3")] - pub mode: i32, - /// sig is the signature of the sign doc. - #[prost(bytes = "vec", tag = "4")] - pub sig: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for AuxSignerData { - const NAME: &'static str = "AuxSignerData"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.AuxSignerData".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.AuxSignerData".into() - } -} -/// GetTxsEventRequest is the request type for the Service.TxsByEvents -/// RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetTxsEventRequest { - /// events is the list of transaction event type. - #[prost(string, repeated, tag = "1")] - pub events: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// pagination defines a pagination for the request. - /// Deprecated post v0.46.x: use page and limit instead. - #[deprecated] - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, - #[prost(enumeration = "OrderBy", tag = "3")] - pub order_by: i32, - /// page is the page number to query, starts at 1. If not provided, will default to first page. - #[prost(uint64, tag = "4")] - pub page: u64, - /// limit is the total number of results to be returned in the result page. - /// If left empty it will default to a value to be set by each app. - #[prost(uint64, tag = "5")] - pub limit: u64, -} -impl ::prost::Name for GetTxsEventRequest { - const NAME: &'static str = "GetTxsEventRequest"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.GetTxsEventRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.GetTxsEventRequest".into() - } -} -/// GetTxsEventResponse is the response type for the Service.TxsByEvents -/// RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetTxsEventResponse { - /// txs is the list of queried transactions. - #[prost(message, repeated, tag = "1")] - pub txs: ::prost::alloc::vec::Vec, - /// tx_responses is the list of queried TxResponses. - #[prost(message, repeated, tag = "2")] - pub tx_responses: ::prost::alloc::vec::Vec< - super::super::base::abci::v1beta1::TxResponse, - >, - /// pagination defines a pagination for the response. - /// Deprecated post v0.46.x: use total instead. - #[deprecated] - #[prost(message, optional, tag = "3")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, - /// total is total number of results available - #[prost(uint64, tag = "4")] - pub total: u64, -} -impl ::prost::Name for GetTxsEventResponse { - const NAME: &'static str = "GetTxsEventResponse"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.GetTxsEventResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.GetTxsEventResponse".into() - } -} -/// BroadcastTxRequest is the request type for the Service.BroadcastTxRequest -/// RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BroadcastTxRequest { - /// tx_bytes is the raw transaction. - #[prost(bytes = "vec", tag = "1")] - pub tx_bytes: ::prost::alloc::vec::Vec, - #[prost(enumeration = "BroadcastMode", tag = "2")] - pub mode: i32, -} -impl ::prost::Name for BroadcastTxRequest { - const NAME: &'static str = "BroadcastTxRequest"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.BroadcastTxRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.BroadcastTxRequest".into() - } -} -/// BroadcastTxResponse is the response type for the -/// Service.BroadcastTx method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BroadcastTxResponse { - /// tx_response is the queried TxResponses. - #[prost(message, optional, tag = "1")] - pub tx_response: ::core::option::Option< - super::super::base::abci::v1beta1::TxResponse, - >, -} -impl ::prost::Name for BroadcastTxResponse { - const NAME: &'static str = "BroadcastTxResponse"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.BroadcastTxResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.BroadcastTxResponse".into() - } -} -/// SimulateRequest is the request type for the Service.Simulate -/// RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SimulateRequest { - /// tx is the transaction to simulate. - /// Deprecated. Send raw tx bytes instead. - #[deprecated] - #[prost(message, optional, tag = "1")] - pub tx: ::core::option::Option, - /// tx_bytes is the raw transaction. - /// - /// Since: cosmos-sdk 0.43 - #[prost(bytes = "vec", tag = "2")] - pub tx_bytes: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for SimulateRequest { - const NAME: &'static str = "SimulateRequest"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.SimulateRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.SimulateRequest".into() - } -} -/// SimulateResponse is the response type for the -/// Service.SimulateRPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SimulateResponse { - /// gas_info is the information about gas used in the simulation. - #[prost(message, optional, tag = "1")] - pub gas_info: ::core::option::Option, - /// result is the result of the simulation. - #[prost(message, optional, tag = "2")] - pub result: ::core::option::Option, -} -impl ::prost::Name for SimulateResponse { - const NAME: &'static str = "SimulateResponse"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.SimulateResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.SimulateResponse".into() - } -} -/// GetTxRequest is the request type for the Service.GetTx -/// RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetTxRequest { - /// hash is the tx hash to query, encoded as a hex string. - #[prost(string, tag = "1")] - pub hash: ::prost::alloc::string::String, -} -impl ::prost::Name for GetTxRequest { - const NAME: &'static str = "GetTxRequest"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.GetTxRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.GetTxRequest".into() - } -} -/// GetTxResponse is the response type for the Service.GetTx method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetTxResponse { - /// tx is the queried transaction. - #[prost(message, optional, tag = "1")] - pub tx: ::core::option::Option, - /// tx_response is the queried TxResponses. - #[prost(message, optional, tag = "2")] - pub tx_response: ::core::option::Option< - super::super::base::abci::v1beta1::TxResponse, - >, -} -impl ::prost::Name for GetTxResponse { - const NAME: &'static str = "GetTxResponse"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.GetTxResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.GetTxResponse".into() - } -} -/// GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs -/// RPC method. -/// -/// Since: cosmos-sdk 0.45.2 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetBlockWithTxsRequest { - /// height is the height of the block to query. - #[prost(int64, tag = "1")] - pub height: i64, - /// pagination defines a pagination for the request. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for GetBlockWithTxsRequest { - const NAME: &'static str = "GetBlockWithTxsRequest"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.GetBlockWithTxsRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.GetBlockWithTxsRequest".into() - } -} -/// GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. -/// -/// Since: cosmos-sdk 0.45.2 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetBlockWithTxsResponse { - /// txs are the transactions in the block. - #[prost(message, repeated, tag = "1")] - pub txs: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "2")] - pub block_id: ::core::option::Option<::tendermint_proto::types::BlockId>, - #[prost(message, optional, tag = "3")] - pub block: ::core::option::Option<::tendermint_proto::types::Block>, - /// pagination defines a pagination for the response. - #[prost(message, optional, tag = "4")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for GetBlockWithTxsResponse { - const NAME: &'static str = "GetBlockWithTxsResponse"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.GetBlockWithTxsResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.GetBlockWithTxsResponse".into() - } -} -/// 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, ::prost::Message)] -pub struct TxDecodeRequest { - /// tx_bytes is the raw transaction. - #[prost(bytes = "vec", tag = "1")] - pub tx_bytes: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for TxDecodeRequest { - const NAME: &'static str = "TxDecodeRequest"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.TxDecodeRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.TxDecodeRequest".into() - } -} -/// 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, ::prost::Message)] -pub struct TxDecodeResponse { - /// tx is the decoded transaction. - #[prost(message, optional, tag = "1")] - pub tx: ::core::option::Option, -} -impl ::prost::Name for TxDecodeResponse { - const NAME: &'static str = "TxDecodeResponse"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.TxDecodeResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.TxDecodeResponse".into() - } -} -/// 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, ::prost::Message)] -pub struct TxEncodeRequest { - /// tx is the transaction to encode. - #[prost(message, optional, tag = "1")] - pub tx: ::core::option::Option, -} -impl ::prost::Name for TxEncodeRequest { - const NAME: &'static str = "TxEncodeRequest"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.TxEncodeRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.TxEncodeRequest".into() - } -} -/// 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, ::prost::Message)] -pub struct TxEncodeResponse { - /// tx_bytes is the encoded transaction bytes. - #[prost(bytes = "vec", tag = "1")] - pub tx_bytes: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for TxEncodeResponse { - const NAME: &'static str = "TxEncodeResponse"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.TxEncodeResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.TxEncodeResponse".into() - } -} -/// 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, ::prost::Message)] -pub struct TxEncodeAminoRequest { - #[prost(string, tag = "1")] - pub amino_json: ::prost::alloc::string::String, -} -impl ::prost::Name for TxEncodeAminoRequest { - const NAME: &'static str = "TxEncodeAminoRequest"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.TxEncodeAminoRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.TxEncodeAminoRequest".into() - } -} -/// 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, ::prost::Message)] -pub struct TxEncodeAminoResponse { - #[prost(bytes = "vec", tag = "1")] - pub amino_binary: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for TxEncodeAminoResponse { - const NAME: &'static str = "TxEncodeAminoResponse"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.TxEncodeAminoResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.TxEncodeAminoResponse".into() - } -} -/// 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, ::prost::Message)] -pub struct TxDecodeAminoRequest { - #[prost(bytes = "vec", tag = "1")] - pub amino_binary: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for TxDecodeAminoRequest { - const NAME: &'static str = "TxDecodeAminoRequest"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.TxDecodeAminoRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.TxDecodeAminoRequest".into() - } -} -/// 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, ::prost::Message)] -pub struct TxDecodeAminoResponse { - #[prost(string, tag = "1")] - pub amino_json: ::prost::alloc::string::String, -} -impl ::prost::Name for TxDecodeAminoResponse { - const NAME: &'static str = "TxDecodeAminoResponse"; - const PACKAGE: &'static str = "cosmos.tx.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.tx.v1beta1.TxDecodeAminoResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.tx.v1beta1.TxDecodeAminoResponse".into() - } -} -/// OrderBy defines the sorting order -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum OrderBy { - /// 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, - /// ORDER_BY_DESC defines descending order - Desc = 2, -} -impl OrderBy { - /// 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 { - OrderBy::Unspecified => "ORDER_BY_UNSPECIFIED", - OrderBy::Asc => "ORDER_BY_ASC", - OrderBy::Desc => "ORDER_BY_DESC", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "ORDER_BY_UNSPECIFIED" => Some(Self::Unspecified), - "ORDER_BY_ASC" => Some(Self::Asc), - "ORDER_BY_DESC" => Some(Self::Desc), - _ => None, - } - } -} -/// BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -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. - Block = 1, - /// 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. - Async = 3, -} -impl BroadcastMode { - /// 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 { - BroadcastMode::Unspecified => "BROADCAST_MODE_UNSPECIFIED", - BroadcastMode::Block => "BROADCAST_MODE_BLOCK", - BroadcastMode::Sync => "BROADCAST_MODE_SYNC", - BroadcastMode::Async => "BROADCAST_MODE_ASYNC", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "BROADCAST_MODE_UNSPECIFIED" => Some(Self::Unspecified), - "BROADCAST_MODE_BLOCK" => Some(Self::Block), - "BROADCAST_MODE_SYNC" => Some(Self::Sync), - "BROADCAST_MODE_ASYNC" => Some(Self::Async), - _ => None, - } - } -} -/// Generated client implementations. -#[cfg(feature = "client")] -pub mod service_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - /// Service defines a gRPC service for interacting with transactions. - #[derive(Debug, Clone)] - pub struct ServiceClient { - inner: tonic::client::Grpc, - } - impl ServiceClient { - /// 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 ServiceClient - 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, - ) -> ServiceClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + Send + Sync, - { - ServiceClient::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 - } - /// Simulate simulates executing a transaction for estimating gas usage. - pub async fn simulate( - &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( - "/cosmos.tx.v1beta1.Service/Simulate", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.tx.v1beta1.Service", "Simulate")); - self.inner.unary(req, path, codec).await - } - /// GetTx fetches a tx by hash. - pub async fn get_tx( - &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( - "/cosmos.tx.v1beta1.Service/GetTx", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.tx.v1beta1.Service", "GetTx")); - self.inner.unary(req, path, codec).await - } - /// BroadcastTx broadcast transaction. - pub async fn broadcast_tx( - &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( - "/cosmos.tx.v1beta1.Service/BroadcastTx", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.tx.v1beta1.Service", "BroadcastTx")); - self.inner.unary(req, path, codec).await - } - /// GetTxsEvent fetches txs by event. - pub async fn get_txs_event( - &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( - "/cosmos.tx.v1beta1.Service/GetTxsEvent", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.tx.v1beta1.Service", "GetTxsEvent")); - self.inner.unary(req, path, codec).await - } - /// GetBlockWithTxs fetches a block with decoded txs. - /// - /// Since: cosmos-sdk 0.45.2 - pub async fn get_block_with_txs( - &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( - "/cosmos.tx.v1beta1.Service/GetBlockWithTxs", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.tx.v1beta1.Service", "GetBlockWithTxs")); - self.inner.unary(req, path, codec).await - } - /// TxDecode decodes the transaction. - /// - /// Since: cosmos-sdk 0.47 - pub async fn tx_decode( - &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( - "/cosmos.tx.v1beta1.Service/TxDecode", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.tx.v1beta1.Service", "TxDecode")); - self.inner.unary(req, path, codec).await - } - /// TxEncode encodes the transaction. - /// - /// Since: cosmos-sdk 0.47 - pub async fn tx_encode( - &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( - "/cosmos.tx.v1beta1.Service/TxEncode", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.tx.v1beta1.Service", "TxEncode")); - self.inner.unary(req, path, codec).await - } - /// TxEncodeAmino encodes an Amino transaction from JSON to encoded bytes. - /// - /// Since: cosmos-sdk 0.47 - pub async fn tx_encode_amino( - &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( - "/cosmos.tx.v1beta1.Service/TxEncodeAmino", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.tx.v1beta1.Service", "TxEncodeAmino")); - self.inner.unary(req, path, codec).await - } - /// TxDecodeAmino decodes an Amino transaction from encoded bytes to JSON. - /// - /// Since: cosmos-sdk 0.47 - pub async fn tx_decode_amino( - &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( - "/cosmos.tx.v1beta1.Service/TxDecodeAmino", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.tx.v1beta1.Service", "TxDecodeAmino")); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -#[cfg(feature = "server")] -pub mod service_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with ServiceServer. - #[async_trait] - pub trait Service: Send + Sync + 'static { - /// Simulate simulates executing a transaction for estimating gas usage. - async fn simulate( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetTx fetches a tx by hash. - async fn get_tx( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - /// BroadcastTx broadcast transaction. - async fn broadcast_tx( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetTxsEvent fetches txs by event. - async fn get_txs_event( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetBlockWithTxs fetches a block with decoded txs. - /// - /// Since: cosmos-sdk 0.45.2 - async fn get_block_with_txs( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// TxDecode decodes the transaction. - /// - /// Since: cosmos-sdk 0.47 - async fn tx_decode( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// TxEncode encodes the transaction. - /// - /// Since: cosmos-sdk 0.47 - async fn tx_encode( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// TxEncodeAmino encodes an Amino transaction from JSON to encoded bytes. - /// - /// Since: cosmos-sdk 0.47 - async fn tx_encode_amino( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// TxDecodeAmino decodes an Amino transaction from encoded bytes to JSON. - /// - /// Since: cosmos-sdk 0.47 - async fn tx_decode_amino( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - /// Service defines a gRPC service for interacting with transactions. - #[derive(Debug)] - pub struct ServiceServer { - inner: Arc, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - impl ServiceServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - 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 ServiceServer - where - T: Service, - 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 { - match req.uri().path() { - "/cosmos.tx.v1beta1.Service/Simulate" => { - #[allow(non_camel_case_types)] - struct SimulateSvc(pub Arc); - impl tonic::server::UnaryService - for SimulateSvc { - type Response = super::SimulateResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::simulate(&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 method = SimulateSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.tx.v1beta1.Service/GetTx" => { - #[allow(non_camel_case_types)] - struct GetTxSvc(pub Arc); - impl tonic::server::UnaryService - for GetTxSvc { - type Response = super::GetTxResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_tx(&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 method = GetTxSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.tx.v1beta1.Service/BroadcastTx" => { - #[allow(non_camel_case_types)] - struct BroadcastTxSvc(pub Arc); - impl< - T: Service, - > tonic::server::UnaryService - for BroadcastTxSvc { - type Response = super::BroadcastTxResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::broadcast_tx(&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 method = BroadcastTxSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.tx.v1beta1.Service/GetTxsEvent" => { - #[allow(non_camel_case_types)] - struct GetTxsEventSvc(pub Arc); - impl< - T: Service, - > tonic::server::UnaryService - for GetTxsEventSvc { - type Response = super::GetTxsEventResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_txs_event(&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 method = GetTxsEventSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.tx.v1beta1.Service/GetBlockWithTxs" => { - #[allow(non_camel_case_types)] - struct GetBlockWithTxsSvc(pub Arc); - impl< - T: Service, - > tonic::server::UnaryService - for GetBlockWithTxsSvc { - type Response = super::GetBlockWithTxsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_block_with_txs(&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 method = GetBlockWithTxsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.tx.v1beta1.Service/TxDecode" => { - #[allow(non_camel_case_types)] - struct TxDecodeSvc(pub Arc); - impl tonic::server::UnaryService - for TxDecodeSvc { - type Response = super::TxDecodeResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::tx_decode(&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 method = TxDecodeSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.tx.v1beta1.Service/TxEncode" => { - #[allow(non_camel_case_types)] - struct TxEncodeSvc(pub Arc); - impl tonic::server::UnaryService - for TxEncodeSvc { - type Response = super::TxEncodeResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::tx_encode(&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 method = TxEncodeSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.tx.v1beta1.Service/TxEncodeAmino" => { - #[allow(non_camel_case_types)] - struct TxEncodeAminoSvc(pub Arc); - impl< - T: Service, - > tonic::server::UnaryService - for TxEncodeAminoSvc { - type Response = super::TxEncodeAminoResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::tx_encode_amino(&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 method = TxEncodeAminoSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.tx.v1beta1.Service/TxDecodeAmino" => { - #[allow(non_camel_case_types)] - struct TxDecodeAminoSvc(pub Arc); - impl< - T: Service, - > tonic::server::UnaryService - for TxDecodeAminoSvc { - type Response = super::TxDecodeAminoResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::tx_decode_amino(&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 method = TxDecodeAminoSvc(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", tonic::Code::Unimplemented as i32) - .header( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ) - .body(empty_body()) - .unwrap(), - ) - }) - } - } - } - } - impl Clone for ServiceServer { - 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 tonic::server::NamedService for ServiceServer { - const NAME: &'static str = "cosmos.tx.v1beta1.Service"; - } -} diff --git a/src/prost/cosmos.upgrade.module.v1.rs b/src/prost/cosmos.upgrade.module.v1.rs deleted file mode 100644 index f2db33dd..00000000 --- a/src/prost/cosmos.upgrade.module.v1.rs +++ /dev/null @@ -1,19 +0,0 @@ -// This file is @generated by prost-build. -/// Module is the config object of the upgrade module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -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, -} -impl ::prost::Name for Module { - const NAME: &'static str = "Module"; - const PACKAGE: &'static str = "cosmos.upgrade.module.v1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.upgrade.module.v1.Module".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.upgrade.module.v1.Module".into() - } -} diff --git a/src/prost/cosmos.upgrade.module.v1.serde.rs b/src/prost/cosmos.upgrade.module.v1.serde.rs deleted file mode 100644 index 7aee8176..00000000 --- a/src/prost/cosmos.upgrade.module.v1.serde.rs +++ /dev/null @@ -1,91 +0,0 @@ -impl serde::Serialize for Module { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.module.v1.Module", len)?; - if true { - struct_ser.serialize_field("authority", &self.authority)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Module { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "authority", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Authority, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "authority" => Ok(GeneratedField::Authority), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Module; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.upgrade.module.v1.Module") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut authority__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Authority => { - if authority__.is_some() { - return Err(serde::de::Error::duplicate_field("authority")); - } - authority__ = Some(map_.next_value()?); - } - } - } - Ok(Module { - authority: authority__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.upgrade.module.v1.Module", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.upgrade.v1beta1.rs b/src/prost/cosmos.upgrade.v1beta1.rs deleted file mode 100644 index f0a4c981..00000000 --- a/src/prost/cosmos.upgrade.v1beta1.rs +++ /dev/null @@ -1,1393 +0,0 @@ -// This file is @generated by prost-build. -/// Plan specifies information about a planned upgrade and when it should occur. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Plan { - /// Sets the name for the upgrade. This name will be used by the upgraded - /// version of the software to apply any special "on-upgrade" commands during - /// the first BeginBlock method after the upgrade is applied. It is also used - /// to detect whether a software version can handle a given upgrade. If no - /// upgrade handler with this name has been set in the software, it will be - /// assumed that the software is out-of-date when the upgrade Time or Height is - /// reached and the software will exit. - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - /// Deprecated: Time based upgrades have been deprecated. Time based upgrade logic - /// has been removed from the SDK. - /// If this field is not empty, an error will be thrown. - #[deprecated] - #[prost(message, optional, tag = "2")] - pub time: ::core::option::Option<::tendermint_proto::google::protobuf::Timestamp>, - /// The height at which the upgrade must be performed. - #[prost(int64, tag = "3")] - pub height: i64, - /// Any application specific upgrade info to be included on-chain - /// such as a git commit that validators could automatically upgrade to - #[prost(string, tag = "4")] - pub info: ::prost::alloc::string::String, - /// Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been - /// moved to the IBC module in the sub module 02-client. - /// If this field is not empty, an error will be thrown. - #[deprecated] - #[prost(message, optional, tag = "5")] - pub upgraded_client_state: ::core::option::Option< - ::tendermint_proto::google::protobuf::Any, - >, -} -impl ::prost::Name for Plan { - const NAME: &'static str = "Plan"; - const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.upgrade.v1beta1.Plan".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.upgrade.v1beta1.Plan".into() - } -} -/// SoftwareUpgradeProposal is a gov Content type for initiating a software -/// upgrade. -/// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov -/// proposals, see MsgSoftwareUpgrade. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -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, -} -impl ::prost::Name for SoftwareUpgradeProposal { - const NAME: &'static str = "SoftwareUpgradeProposal"; - const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.upgrade.v1beta1.SoftwareUpgradeProposal".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal".into() - } -} -/// CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software -/// upgrade. -/// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov -/// proposals, see MsgCancelUpgrade. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -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, -} -impl ::prost::Name for CancelSoftwareUpgradeProposal { - const NAME: &'static str = "CancelSoftwareUpgradeProposal"; - const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal".into() - } -} -/// ModuleVersion specifies a module and its consensus version. -/// -/// Since: cosmos-sdk 0.43 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ModuleVersion { - /// name of the app module - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - /// consensus version of the app module - #[prost(uint64, tag = "2")] - pub version: u64, -} -impl ::prost::Name for ModuleVersion { - const NAME: &'static str = "ModuleVersion"; - const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.upgrade.v1beta1.ModuleVersion".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.upgrade.v1beta1.ModuleVersion".into() - } -} -/// MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSoftwareUpgrade { - /// authority is the address that controls the module (defaults to x/gov unless overwritten). - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// plan is the upgrade plan. - #[prost(message, optional, tag = "2")] - pub plan: ::core::option::Option, -} -impl ::prost::Name for MsgSoftwareUpgrade { - const NAME: &'static str = "MsgSoftwareUpgrade"; - const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.upgrade.v1beta1.MsgSoftwareUpgrade".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade".into() - } -} -/// MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct MsgSoftwareUpgradeResponse {} -impl ::prost::Name for MsgSoftwareUpgradeResponse { - const NAME: &'static str = "MsgSoftwareUpgradeResponse"; - const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse".into() - } -} -/// MsgCancelUpgrade is the Msg/CancelUpgrade request type. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgCancelUpgrade { - /// authority is the address that controls the module (defaults to x/gov unless overwritten). - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, -} -impl ::prost::Name for MsgCancelUpgrade { - const NAME: &'static str = "MsgCancelUpgrade"; - const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.upgrade.v1beta1.MsgCancelUpgrade".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.upgrade.v1beta1.MsgCancelUpgrade".into() - } -} -/// MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct MsgCancelUpgradeResponse {} -impl ::prost::Name for MsgCancelUpgradeResponse { - const NAME: &'static str = "MsgCancelUpgradeResponse"; - const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse".into() - } -} -/// Generated client implementations. -#[cfg(feature = "client")] -pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - /// Msg defines the upgrade Msg service. - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, - } - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: 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 - } - /// SoftwareUpgrade is a governance operation for initiating a software upgrade. - /// - /// Since: cosmos-sdk 0.46 - pub async fn software_upgrade( - &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( - "/cosmos.upgrade.v1beta1.Msg/SoftwareUpgrade", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("cosmos.upgrade.v1beta1.Msg", "SoftwareUpgrade"), - ); - self.inner.unary(req, path, codec).await - } - /// CancelUpgrade is a governance operation for cancelling a previously - /// approved software upgrade. - /// - /// Since: cosmos-sdk 0.46 - pub async fn cancel_upgrade( - &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( - "/cosmos.upgrade.v1beta1.Msg/CancelUpgrade", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.upgrade.v1beta1.Msg", "CancelUpgrade")); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -#[cfg(feature = "server")] -pub mod msg_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. - #[async_trait] - pub trait Msg: Send + Sync + 'static { - /// SoftwareUpgrade is a governance operation for initiating a software upgrade. - /// - /// Since: cosmos-sdk 0.46 - async fn software_upgrade( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// CancelUpgrade is a governance operation for cancelling a previously - /// approved software upgrade. - /// - /// Since: cosmos-sdk 0.46 - async fn cancel_upgrade( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - /// Msg defines the upgrade Msg service. - #[derive(Debug)] - pub struct MsgServer { - inner: Arc, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - impl MsgServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - 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 { - match req.uri().path() { - "/cosmos.upgrade.v1beta1.Msg/SoftwareUpgrade" => { - #[allow(non_camel_case_types)] - struct SoftwareUpgradeSvc(pub Arc); - impl tonic::server::UnaryService - for SoftwareUpgradeSvc { - type Response = super::MsgSoftwareUpgradeResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::software_upgrade(&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 method = SoftwareUpgradeSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.upgrade.v1beta1.Msg/CancelUpgrade" => { - #[allow(non_camel_case_types)] - struct CancelUpgradeSvc(pub Arc); - impl tonic::server::UnaryService - for CancelUpgradeSvc { - type Response = super::MsgCancelUpgradeResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::cancel_upgrade(&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 method = CancelUpgradeSvc(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", tonic::Code::Unimplemented as i32) - .header( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ) - .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 tonic::server::NamedService for MsgServer { - const NAME: &'static str = "cosmos.upgrade.v1beta1.Msg"; - } -} -/// QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct QueryCurrentPlanRequest {} -impl ::prost::Name for QueryCurrentPlanRequest { - const NAME: &'static str = "QueryCurrentPlanRequest"; - const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.upgrade.v1beta1.QueryCurrentPlanRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.upgrade.v1beta1.QueryCurrentPlanRequest".into() - } -} -/// QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryCurrentPlanResponse { - /// plan is the current upgrade plan. - #[prost(message, optional, tag = "1")] - pub plan: ::core::option::Option, -} -impl ::prost::Name for QueryCurrentPlanResponse { - const NAME: &'static str = "QueryCurrentPlanResponse"; - const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.upgrade.v1beta1.QueryCurrentPlanResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.upgrade.v1beta1.QueryCurrentPlanResponse".into() - } -} -/// QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryAppliedPlanRequest { - /// name is the name of the applied plan to query for. - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryAppliedPlanRequest { - const NAME: &'static str = "QueryAppliedPlanRequest"; - const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.upgrade.v1beta1.QueryAppliedPlanRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.upgrade.v1beta1.QueryAppliedPlanRequest".into() - } -} -/// QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct QueryAppliedPlanResponse { - /// height is the block height at which the plan was applied. - #[prost(int64, tag = "1")] - pub height: i64, -} -impl ::prost::Name for QueryAppliedPlanResponse { - const NAME: &'static str = "QueryAppliedPlanResponse"; - const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.upgrade.v1beta1.QueryAppliedPlanResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.upgrade.v1beta1.QueryAppliedPlanResponse".into() - } -} -/// QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState -/// RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct QueryUpgradedConsensusStateRequest { - /// last height of the current chain must be sent in request - /// as this is the height under which next consensus state is stored - #[prost(int64, tag = "1")] - pub last_height: i64, -} -impl ::prost::Name for QueryUpgradedConsensusStateRequest { - const NAME: &'static str = "QueryUpgradedConsensusStateRequest"; - const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest".into() - } -} -/// QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState -/// RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUpgradedConsensusStateResponse { - /// Since: cosmos-sdk 0.43 - #[prost(bytes = "vec", tag = "2")] - pub upgraded_consensus_state: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for QueryUpgradedConsensusStateResponse { - const NAME: &'static str = "QueryUpgradedConsensusStateResponse"; - const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse".into() - } -} -/// QueryModuleVersionsRequest is the request type for the Query/ModuleVersions -/// RPC method. -/// -/// Since: cosmos-sdk 0.43 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryModuleVersionsRequest { - /// module_name is a field to query a specific module - /// consensus version from state. Leaving this empty will - /// fetch the full list of module versions from state - #[prost(string, tag = "1")] - pub module_name: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryModuleVersionsRequest { - const NAME: &'static str = "QueryModuleVersionsRequest"; - const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.upgrade.v1beta1.QueryModuleVersionsRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.upgrade.v1beta1.QueryModuleVersionsRequest".into() - } -} -/// QueryModuleVersionsResponse is the response type for the Query/ModuleVersions -/// RPC method. -/// -/// Since: cosmos-sdk 0.43 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryModuleVersionsResponse { - /// module_versions is a list of module names with their consensus versions. - #[prost(message, repeated, tag = "1")] - pub module_versions: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for QueryModuleVersionsResponse { - const NAME: &'static str = "QueryModuleVersionsResponse"; - const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.upgrade.v1beta1.QueryModuleVersionsResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.upgrade.v1beta1.QueryModuleVersionsResponse".into() - } -} -/// QueryAuthorityRequest is the request type for Query/Authority -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct QueryAuthorityRequest {} -impl ::prost::Name for QueryAuthorityRequest { - const NAME: &'static str = "QueryAuthorityRequest"; - const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.upgrade.v1beta1.QueryAuthorityRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.upgrade.v1beta1.QueryAuthorityRequest".into() - } -} -/// QueryAuthorityResponse is the response type for Query/Authority -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryAuthorityResponse { - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryAuthorityResponse { - const NAME: &'static str = "QueryAuthorityResponse"; - const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos.upgrade.v1beta1.QueryAuthorityResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos.upgrade.v1beta1.QueryAuthorityResponse".into() - } -} -/// Generated client implementations. -#[cfg(feature = "client")] -pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - /// Query defines the gRPC upgrade querier service. - #[derive(Debug, Clone)] - pub struct QueryClient { - inner: tonic::client::Grpc, - } - impl QueryClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: 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 - } - /// CurrentPlan queries the current upgrade plan. - pub async fn current_plan( - &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( - "/cosmos.upgrade.v1beta1.Query/CurrentPlan", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.upgrade.v1beta1.Query", "CurrentPlan")); - self.inner.unary(req, path, codec).await - } - /// AppliedPlan queries a previously applied upgrade plan by its name. - pub async fn applied_plan( - &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( - "/cosmos.upgrade.v1beta1.Query/AppliedPlan", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.upgrade.v1beta1.Query", "AppliedPlan")); - self.inner.unary(req, path, codec).await - } - /// UpgradedConsensusState queries the consensus state that will serve - /// as a trusted kernel for the next version of this chain. It will only be - /// stored at the last height of this chain. - /// UpgradedConsensusState RPC not supported with legacy querier - /// This rpc is deprecated now that IBC has its own replacement - /// (https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) - pub async fn upgraded_consensus_state( - &mut self, - request: impl tonic::IntoRequest, - ) -> 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( - "/cosmos.upgrade.v1beta1.Query/UpgradedConsensusState", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.upgrade.v1beta1.Query", - "UpgradedConsensusState", - ), - ); - self.inner.unary(req, path, codec).await - } - /// ModuleVersions queries the list of module versions from state. - /// - /// Since: cosmos-sdk 0.43 - pub async fn module_versions( - &mut self, - request: impl tonic::IntoRequest, - ) -> 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( - "/cosmos.upgrade.v1beta1.Query/ModuleVersions", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("cosmos.upgrade.v1beta1.Query", "ModuleVersions"), - ); - self.inner.unary(req, path, codec).await - } - /// Returns the account with authority to conduct upgrades - /// - /// Since: cosmos-sdk 0.46 - pub async fn authority( - &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( - "/cosmos.upgrade.v1beta1.Query/Authority", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.upgrade.v1beta1.Query", "Authority")); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -#[cfg(feature = "server")] -pub mod query_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. - #[async_trait] - pub trait Query: Send + Sync + 'static { - /// CurrentPlan queries the current upgrade plan. - async fn current_plan( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// AppliedPlan queries a previously applied upgrade plan by its name. - async fn applied_plan( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// UpgradedConsensusState queries the consensus state that will serve - /// as a trusted kernel for the next version of this chain. It will only be - /// stored at the last height of this chain. - /// UpgradedConsensusState RPC not supported with legacy querier - /// This rpc is deprecated now that IBC has its own replacement - /// (https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) - async fn upgraded_consensus_state( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// ModuleVersions queries the list of module versions from state. - /// - /// Since: cosmos-sdk 0.43 - async fn module_versions( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Returns the account with authority to conduct upgrades - /// - /// Since: cosmos-sdk 0.46 - async fn authority( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - /// Query defines the gRPC upgrade querier service. - #[derive(Debug)] - pub struct QueryServer { - inner: Arc, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - impl QueryServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - 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 { - match req.uri().path() { - "/cosmos.upgrade.v1beta1.Query/CurrentPlan" => { - #[allow(non_camel_case_types)] - struct CurrentPlanSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for CurrentPlanSvc { - type Response = super::QueryCurrentPlanResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::current_plan(&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 method = CurrentPlanSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.upgrade.v1beta1.Query/AppliedPlan" => { - #[allow(non_camel_case_types)] - struct AppliedPlanSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for AppliedPlanSvc { - type Response = super::QueryAppliedPlanResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::applied_plan(&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 method = AppliedPlanSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.upgrade.v1beta1.Query/UpgradedConsensusState" => { - #[allow(non_camel_case_types)] - struct UpgradedConsensusStateSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService< - super::QueryUpgradedConsensusStateRequest, - > for UpgradedConsensusStateSvc { - type Response = super::QueryUpgradedConsensusStateResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::QueryUpgradedConsensusStateRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::upgraded_consensus_state(&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 method = UpgradedConsensusStateSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.upgrade.v1beta1.Query/ModuleVersions" => { - #[allow(non_camel_case_types)] - struct ModuleVersionsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for ModuleVersionsSvc { - type Response = super::QueryModuleVersionsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::module_versions(&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 method = ModuleVersionsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/cosmos.upgrade.v1beta1.Query/Authority" => { - #[allow(non_camel_case_types)] - struct AuthoritySvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for AuthoritySvc { - type Response = super::QueryAuthorityResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::authority(&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 method = AuthoritySvc(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", tonic::Code::Unimplemented as i32) - .header( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ) - .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 tonic::server::NamedService for QueryServer { - const NAME: &'static str = "cosmos.upgrade.v1beta1.Query"; - } -} diff --git a/src/prost/cosmos.upgrade.v1beta1.serde.rs b/src/prost/cosmos.upgrade.v1beta1.serde.rs deleted file mode 100644 index de744724..00000000 --- a/src/prost/cosmos.upgrade.v1beta1.serde.rs +++ /dev/null @@ -1,1731 +0,0 @@ -impl serde::Serialize for CancelSoftwareUpgradeProposal { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal", len)?; - if true { - struct_ser.serialize_field("title", &self.title)?; - } - if true { - struct_ser.serialize_field("description", &self.description)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CancelSoftwareUpgradeProposal { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "title", - "description", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Title, - Description, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "title" => Ok(GeneratedField::Title), - "description" => Ok(GeneratedField::Description), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CancelSoftwareUpgradeProposal; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut title__ = None; - let mut description__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Title => { - if title__.is_some() { - return Err(serde::de::Error::duplicate_field("title")); - } - title__ = Some(map_.next_value()?); - } - GeneratedField::Description => { - if description__.is_some() { - return Err(serde::de::Error::duplicate_field("description")); - } - description__ = Some(map_.next_value()?); - } - } - } - Ok(CancelSoftwareUpgradeProposal { - title: title__.unwrap_or_default(), - description: description__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for ModuleVersion { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.ModuleVersion", len)?; - if true { - struct_ser.serialize_field("name", &self.name)?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("version", ::alloc::string::ToString::to_string(&self.version).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ModuleVersion { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "name", - "version", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Name, - Version, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "name" => Ok(GeneratedField::Name), - "version" => Ok(GeneratedField::Version), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ModuleVersion; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.upgrade.v1beta1.ModuleVersion") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut name__ = None; - let mut version__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); - } - name__ = Some(map_.next_value()?); - } - GeneratedField::Version => { - if version__.is_some() { - return Err(serde::de::Error::duplicate_field("version")); - } - version__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(ModuleVersion { - name: name__.unwrap_or_default(), - version: version__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.upgrade.v1beta1.ModuleVersion", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgCancelUpgrade { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.MsgCancelUpgrade", len)?; - if true { - struct_ser.serialize_field("authority", &self.authority)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgCancelUpgrade { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "authority", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Authority, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "authority" => Ok(GeneratedField::Authority), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgCancelUpgrade; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.upgrade.v1beta1.MsgCancelUpgrade") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut authority__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Authority => { - if authority__.is_some() { - return Err(serde::de::Error::duplicate_field("authority")); - } - authority__ = Some(map_.next_value()?); - } - } - } - Ok(MsgCancelUpgrade { - authority: authority__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.upgrade.v1beta1.MsgCancelUpgrade", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgCancelUpgradeResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgCancelUpgradeResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgCancelUpgradeResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(MsgCancelUpgradeResponse { - }) - } - } - deserializer.deserialize_struct("cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgSoftwareUpgrade { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", len)?; - if true { - struct_ser.serialize_field("authority", &self.authority)?; - } - if let Some(v) = self.plan.as_ref() { - struct_ser.serialize_field("plan", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgSoftwareUpgrade { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "authority", - "plan", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Authority, - Plan, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "authority" => Ok(GeneratedField::Authority), - "plan" => Ok(GeneratedField::Plan), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgSoftwareUpgrade; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.upgrade.v1beta1.MsgSoftwareUpgrade") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut authority__ = None; - let mut plan__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Authority => { - if authority__.is_some() { - return Err(serde::de::Error::duplicate_field("authority")); - } - authority__ = Some(map_.next_value()?); - } - GeneratedField::Plan => { - if plan__.is_some() { - return Err(serde::de::Error::duplicate_field("plan")); - } - plan__ = map_.next_value()?; - } - } - } - Ok(MsgSoftwareUpgrade { - authority: authority__.unwrap_or_default(), - plan: plan__, - }) - } - } - deserializer.deserialize_struct("cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgSoftwareUpgradeResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgSoftwareUpgradeResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgSoftwareUpgradeResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(MsgSoftwareUpgradeResponse { - }) - } - } - deserializer.deserialize_struct("cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Plan { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.Plan", len)?; - if true { - struct_ser.serialize_field("name", &self.name)?; - } - if let Some(v) = self.time.as_ref() { - struct_ser.serialize_field("time", v)?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("height", ::alloc::string::ToString::to_string(&self.height).as_str())?; - } - if true { - struct_ser.serialize_field("info", &self.info)?; - } - if let Some(v) = self.upgraded_client_state.as_ref() { - struct_ser.serialize_field("upgradedClientState", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Plan { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "name", - "time", - "height", - "info", - "upgraded_client_state", - "upgradedClientState", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Name, - Time, - Height, - Info, - UpgradedClientState, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "name" => Ok(GeneratedField::Name), - "time" => Ok(GeneratedField::Time), - "height" => Ok(GeneratedField::Height), - "info" => Ok(GeneratedField::Info), - "upgradedClientState" | "upgraded_client_state" => Ok(GeneratedField::UpgradedClientState), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Plan; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.upgrade.v1beta1.Plan") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut name__ = None; - let mut time__ = None; - let mut height__ = None; - let mut info__ = None; - let mut upgraded_client_state__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); - } - name__ = Some(map_.next_value()?); - } - GeneratedField::Time => { - if time__.is_some() { - return Err(serde::de::Error::duplicate_field("time")); - } - time__ = map_.next_value()?; - } - GeneratedField::Height => { - if height__.is_some() { - return Err(serde::de::Error::duplicate_field("height")); - } - height__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Info => { - if info__.is_some() { - return Err(serde::de::Error::duplicate_field("info")); - } - info__ = Some(map_.next_value()?); - } - GeneratedField::UpgradedClientState => { - if upgraded_client_state__.is_some() { - return Err(serde::de::Error::duplicate_field("upgradedClientState")); - } - upgraded_client_state__ = map_.next_value()?; - } - } - } - Ok(Plan { - name: name__.unwrap_or_default(), - time: time__, - height: height__.unwrap_or_default(), - info: info__.unwrap_or_default(), - upgraded_client_state: upgraded_client_state__, - }) - } - } - deserializer.deserialize_struct("cosmos.upgrade.v1beta1.Plan", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryAppliedPlanRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.QueryAppliedPlanRequest", len)?; - if true { - struct_ser.serialize_field("name", &self.name)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryAppliedPlanRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "name", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Name, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "name" => Ok(GeneratedField::Name), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryAppliedPlanRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.upgrade.v1beta1.QueryAppliedPlanRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut name__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); - } - name__ = Some(map_.next_value()?); - } - } - } - Ok(QueryAppliedPlanRequest { - name: name__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.upgrade.v1beta1.QueryAppliedPlanRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryAppliedPlanResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.QueryAppliedPlanResponse", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("height", ::alloc::string::ToString::to_string(&self.height).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryAppliedPlanResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "height", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Height, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "height" => Ok(GeneratedField::Height), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryAppliedPlanResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.upgrade.v1beta1.QueryAppliedPlanResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut height__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Height => { - if height__.is_some() { - return Err(serde::de::Error::duplicate_field("height")); - } - height__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(QueryAppliedPlanResponse { - height: height__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.upgrade.v1beta1.QueryAppliedPlanResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryAuthorityRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.QueryAuthorityRequest", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryAuthorityRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryAuthorityRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.upgrade.v1beta1.QueryAuthorityRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(QueryAuthorityRequest { - }) - } - } - deserializer.deserialize_struct("cosmos.upgrade.v1beta1.QueryAuthorityRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryAuthorityResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.QueryAuthorityResponse", len)?; - if true { - struct_ser.serialize_field("address", &self.address)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryAuthorityResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "address", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Address, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "address" => Ok(GeneratedField::Address), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryAuthorityResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.upgrade.v1beta1.QueryAuthorityResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut address__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Address => { - if address__.is_some() { - return Err(serde::de::Error::duplicate_field("address")); - } - address__ = Some(map_.next_value()?); - } - } - } - Ok(QueryAuthorityResponse { - address: address__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.upgrade.v1beta1.QueryAuthorityResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryCurrentPlanRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.QueryCurrentPlanRequest", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryCurrentPlanRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryCurrentPlanRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.upgrade.v1beta1.QueryCurrentPlanRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(QueryCurrentPlanRequest { - }) - } - } - deserializer.deserialize_struct("cosmos.upgrade.v1beta1.QueryCurrentPlanRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryCurrentPlanResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.QueryCurrentPlanResponse", len)?; - if let Some(v) = self.plan.as_ref() { - struct_ser.serialize_field("plan", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryCurrentPlanResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "plan", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Plan, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "plan" => Ok(GeneratedField::Plan), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryCurrentPlanResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.upgrade.v1beta1.QueryCurrentPlanResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut plan__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Plan => { - if plan__.is_some() { - return Err(serde::de::Error::duplicate_field("plan")); - } - plan__ = map_.next_value()?; - } - } - } - Ok(QueryCurrentPlanResponse { - plan: plan__, - }) - } - } - deserializer.deserialize_struct("cosmos.upgrade.v1beta1.QueryCurrentPlanResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryModuleVersionsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.QueryModuleVersionsRequest", len)?; - if true { - struct_ser.serialize_field("moduleName", &self.module_name)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryModuleVersionsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "module_name", - "moduleName", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ModuleName, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "moduleName" | "module_name" => Ok(GeneratedField::ModuleName), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryModuleVersionsRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.upgrade.v1beta1.QueryModuleVersionsRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut module_name__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ModuleName => { - if module_name__.is_some() { - return Err(serde::de::Error::duplicate_field("moduleName")); - } - module_name__ = Some(map_.next_value()?); - } - } - } - Ok(QueryModuleVersionsRequest { - module_name: module_name__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.upgrade.v1beta1.QueryModuleVersionsRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryModuleVersionsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.QueryModuleVersionsResponse", len)?; - if true { - struct_ser.serialize_field("moduleVersions", &self.module_versions)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryModuleVersionsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "module_versions", - "moduleVersions", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ModuleVersions, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "moduleVersions" | "module_versions" => Ok(GeneratedField::ModuleVersions), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryModuleVersionsResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.upgrade.v1beta1.QueryModuleVersionsResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut module_versions__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ModuleVersions => { - if module_versions__.is_some() { - return Err(serde::de::Error::duplicate_field("moduleVersions")); - } - module_versions__ = Some(map_.next_value()?); - } - } - } - Ok(QueryModuleVersionsResponse { - module_versions: module_versions__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.upgrade.v1beta1.QueryModuleVersionsResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryUpgradedConsensusStateRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("lastHeight", ::alloc::string::ToString::to_string(&self.last_height).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryUpgradedConsensusStateRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "last_height", - "lastHeight", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - LastHeight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "lastHeight" | "last_height" => Ok(GeneratedField::LastHeight), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryUpgradedConsensusStateRequest; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut last_height__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::LastHeight => { - if last_height__.is_some() { - return Err(serde::de::Error::duplicate_field("lastHeight")); - } - last_height__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(QueryUpgradedConsensusStateRequest { - last_height: last_height__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryUpgradedConsensusStateResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("upgradedConsensusState", pbjson::private::base64::encode(&self.upgraded_consensus_state).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryUpgradedConsensusStateResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "upgraded_consensus_state", - "upgradedConsensusState", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - UpgradedConsensusState, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "upgradedConsensusState" | "upgraded_consensus_state" => Ok(GeneratedField::UpgradedConsensusState), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryUpgradedConsensusStateResponse; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut upgraded_consensus_state__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::UpgradedConsensusState => { - if upgraded_consensus_state__.is_some() { - return Err(serde::de::Error::duplicate_field("upgradedConsensusState")); - } - upgraded_consensus_state__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - } - } - Ok(QueryUpgradedConsensusStateResponse { - upgraded_consensus_state: upgraded_consensus_state__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for SoftwareUpgradeProposal { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", len)?; - if true { - struct_ser.serialize_field("title", &self.title)?; - } - if true { - struct_ser.serialize_field("description", &self.description)?; - } - if let Some(v) = self.plan.as_ref() { - struct_ser.serialize_field("plan", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SoftwareUpgradeProposal { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "title", - "description", - "plan", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Title, - Description, - Plan, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "title" => Ok(GeneratedField::Title), - "description" => Ok(GeneratedField::Description), - "plan" => Ok(GeneratedField::Plan), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SoftwareUpgradeProposal; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.upgrade.v1beta1.SoftwareUpgradeProposal") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut title__ = None; - let mut description__ = None; - let mut plan__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Title => { - if title__.is_some() { - return Err(serde::de::Error::duplicate_field("title")); - } - title__ = Some(map_.next_value()?); - } - GeneratedField::Description => { - if description__.is_some() { - return Err(serde::de::Error::duplicate_field("description")); - } - description__ = Some(map_.next_value()?); - } - GeneratedField::Plan => { - if plan__.is_some() { - return Err(serde::de::Error::duplicate_field("plan")); - } - plan__ = map_.next_value()?; - } - } - } - Ok(SoftwareUpgradeProposal { - title: title__.unwrap_or_default(), - description: description__.unwrap_or_default(), - plan: plan__, - }) - } - } - deserializer.deserialize_struct("cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos_proto.rs b/src/prost/cosmos_proto.rs deleted file mode 100644 index e45172e7..00000000 --- a/src/prost/cosmos_proto.rs +++ /dev/null @@ -1,94 +0,0 @@ -// This file is @generated by prost-build. -/// InterfaceDescriptor describes an interface type to be used with -/// accepts_interface and implements_interface and declared by declare_interface. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct InterfaceDescriptor { - /// name is the name of the interface. It should be a short-name (without - /// a period) such that the fully qualified name of the interface will be - /// package.name, ex. for the package a.b and interface named C, the - /// fully-qualified name will be a.b.C. - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - /// description is a human-readable description of the interface and its - /// purpose. - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, -} -impl ::prost::Name for InterfaceDescriptor { - const NAME: &'static str = "InterfaceDescriptor"; - const PACKAGE: &'static str = "cosmos_proto"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos_proto.InterfaceDescriptor".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos_proto.InterfaceDescriptor".into() - } -} -/// ScalarDescriptor describes an scalar type to be used with -/// the scalar field option and declared by declare_scalar. -/// Scalars extend simple protobuf built-in types with additional -/// syntax and semantics, for instance to represent big integers. -/// Scalars should ideally define an encoding such that there is only one -/// valid syntactical representation for a given semantic meaning, -/// i.e. the encoding should be deterministic. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ScalarDescriptor { - /// name is the name of the scalar. It should be a short-name (without - /// a period) such that the fully qualified name of the scalar will be - /// package.name, ex. for the package a.b and scalar named C, the - /// fully-qualified name will be a.b.C. - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - /// description is a human-readable description of the scalar and its - /// encoding format. For instance a big integer or decimal scalar should - /// specify precisely the expected encoding format. - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - /// field_type is the type of field with which this scalar can be used. - /// Scalars can be used with one and only one type of field so that - /// encoding standards and simple and clear. Currently only string and - /// bytes fields are supported for scalars. - #[prost(enumeration = "ScalarType", repeated, tag = "3")] - pub field_type: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for ScalarDescriptor { - const NAME: &'static str = "ScalarDescriptor"; - const PACKAGE: &'static str = "cosmos_proto"; - fn full_name() -> ::prost::alloc::string::String { - "cosmos_proto.ScalarDescriptor".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/cosmos_proto.ScalarDescriptor".into() - } -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum ScalarType { - Unspecified = 0, - String = 1, - Bytes = 2, -} -impl ScalarType { - /// 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 { - ScalarType::Unspecified => "SCALAR_TYPE_UNSPECIFIED", - ScalarType::String => "SCALAR_TYPE_STRING", - ScalarType::Bytes => "SCALAR_TYPE_BYTES", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "SCALAR_TYPE_UNSPECIFIED" => Some(Self::Unspecified), - "SCALAR_TYPE_STRING" => Some(Self::String), - "SCALAR_TYPE_BYTES" => Some(Self::Bytes), - _ => None, - } - } -} diff --git a/src/prost/google.api.rs b/src/prost/google.api.rs new file mode 100644 index 00000000..b5d53f9e --- /dev/null +++ b/src/prost/google.api.rs @@ -0,0 +1,398 @@ +// This file is @generated by prost-build. +/// Defines the HTTP configuration for an API service. It contains a list of +/// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method +/// to one or more HTTP REST API methods. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Http { + /// A list of HTTP configuration rules that apply to individual API methods. + /// + /// **NOTE:** All service configuration rules follow "last one wins" order. + #[prost(message, repeated, tag = "1")] + pub rules: ::prost::alloc::vec::Vec, + /// When set to true, URL path parameters will be fully URI-decoded except in + /// cases of single segment matches in reserved expansion, where "%2F" will be + /// left encoded. + /// + /// The default behavior is to not decode RFC 6570 reserved characters in multi + /// segment matches. + #[prost(bool, tag = "2")] + pub fully_decode_reserved_expansion: bool, +} +impl ::prost::Name for Http { + const NAME: &'static str = "Http"; + const PACKAGE: &'static str = "google.api"; + fn full_name() -> ::prost::alloc::string::String { + "google.api.Http".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/google.api.Http".into() + } +} +/// # gRPC Transcoding +/// +/// gRPC Transcoding is a feature for mapping between a gRPC method and one or +/// more HTTP REST endpoints. It allows developers to build a single API service +/// that supports both gRPC APIs and REST APIs. Many systems, including [Google +/// APIs](), +/// [Cloud Endpoints](), [gRPC +/// Gateway](), +/// and [Envoy]() proxy support this feature +/// and use it for large scale production services. +/// +/// `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies +/// how different portions of the gRPC request message are mapped to the URL +/// path, URL query parameters, and HTTP request body. It also controls how the +/// gRPC response message is mapped to the HTTP response body. `HttpRule` is +/// typically specified as an `google.api.http` annotation on the gRPC method. +/// +/// Each mapping specifies a URL path template and an HTTP method. The path +/// template may refer to one or more fields in the gRPC request message, as long +/// as each field is a non-repeated field with a primitive (non-message) type. +/// The path template controls how fields of the request message are mapped to +/// the URL path. +/// +/// Example: +/// +/// service Messaging { +/// rpc GetMessage(GetMessageRequest) returns (Message) { +/// option (google.api.http) = { +/// get: "/v1/{name=messages/*}" +/// }; +/// } +/// } +/// message GetMessageRequest { +/// string name = 1; // Mapped to URL path. +/// } +/// message Message { +/// string text = 1; // The resource content. +/// } +/// +/// This enables an HTTP REST to gRPC mapping as below: +/// +/// HTTP | gRPC +/// -----|----- +/// `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` +/// +/// Any fields in the request message which are not bound by the path template +/// automatically become HTTP query parameters if there is no HTTP request body. +/// For example: +/// +/// service Messaging { +/// rpc GetMessage(GetMessageRequest) returns (Message) { +/// option (google.api.http) = { +/// get:"/v1/messages/{message_id}" +/// }; +/// } +/// } +/// message GetMessageRequest { +/// message SubMessage { +/// string subfield = 1; +/// } +/// string message_id = 1; // Mapped to URL path. +/// int64 revision = 2; // Mapped to URL query parameter `revision`. +/// SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. +/// } +/// +/// This enables a HTTP JSON to RPC mapping as below: +/// +/// HTTP | gRPC +/// -----|----- +/// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | +/// `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: +/// "foo"))` +/// +/// Note that fields which are mapped to URL query parameters must have a +/// primitive type or a repeated primitive type or a non-repeated message type. +/// In the case of a repeated type, the parameter can be repeated in the URL +/// as `...?param=A¶m=B`. In the case of a message type, each field of the +/// message is mapped to a separate parameter, such as +/// `...?foo.a=A&foo.b=B&foo.c=C`. +/// +/// For HTTP methods that allow a request body, the `body` field +/// specifies the mapping. Consider a REST update method on the +/// message resource collection: +/// +/// service Messaging { +/// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { +/// option (google.api.http) = { +/// patch: "/v1/messages/{message_id}" +/// body: "message" +/// }; +/// } +/// } +/// message UpdateMessageRequest { +/// string message_id = 1; // mapped to the URL +/// Message message = 2; // mapped to the body +/// } +/// +/// The following HTTP JSON to RPC mapping is enabled, where the +/// representation of the JSON in the request body is determined by +/// protos JSON encoding: +/// +/// HTTP | gRPC +/// -----|----- +/// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: +/// "123456" message { text: "Hi!" })` +/// +/// The special name `*` can be used in the body mapping to define that +/// every field not bound by the path template should be mapped to the +/// request body. This enables the following alternative definition of +/// the update method: +/// +/// service Messaging { +/// rpc UpdateMessage(Message) returns (Message) { +/// option (google.api.http) = { +/// patch: "/v1/messages/{message_id}" +/// body: "*" +/// }; +/// } +/// } +/// message Message { +/// string message_id = 1; +/// string text = 2; +/// } +/// +/// +/// The following HTTP JSON to RPC mapping is enabled: +/// +/// HTTP | gRPC +/// -----|----- +/// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: +/// "123456" text: "Hi!")` +/// +/// Note that when using `*` in the body mapping, it is not possible to +/// have HTTP parameters, as all fields not bound by the path end in +/// the body. This makes this option more rarely used in practice when +/// defining REST APIs. The common usage of `*` is in custom methods +/// which don't use the URL at all for transferring data. +/// +/// It is possible to define multiple HTTP methods for one RPC by using +/// the `additional_bindings` option. Example: +/// +/// service Messaging { +/// rpc GetMessage(GetMessageRequest) returns (Message) { +/// option (google.api.http) = { +/// get: "/v1/messages/{message_id}" +/// additional_bindings { +/// get: "/v1/users/{user_id}/messages/{message_id}" +/// } +/// }; +/// } +/// } +/// message GetMessageRequest { +/// string message_id = 1; +/// string user_id = 2; +/// } +/// +/// This enables the following two alternative HTTP JSON to RPC mappings: +/// +/// HTTP | gRPC +/// -----|----- +/// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` +/// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: +/// "123456")` +/// +/// ## Rules for HTTP mapping +/// +/// 1. Leaf request fields (recursive expansion nested messages in the request +/// message) are classified into three categories: +/// - Fields referred by the path template. They are passed via the URL path. +/// - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP +/// request body. +/// - All other fields are passed via the URL query parameters, and the +/// parameter name is the field path in the request message. A repeated +/// field can be represented as multiple query parameters under the same +/// name. +/// 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields +/// are passed via URL path and HTTP request body. +/// 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all +/// fields are passed via URL path and URL query parameters. +/// +/// ### Path template syntax +/// +/// Template = "/" Segments \[ Verb \] ; +/// Segments = Segment { "/" Segment } ; +/// Segment = "*" | "**" | LITERAL | Variable ; +/// Variable = "{" FieldPath \[ "=" Segments \] "}" ; +/// FieldPath = IDENT { "." IDENT } ; +/// Verb = ":" LITERAL ; +/// +/// The syntax `*` matches a single URL path segment. The syntax `**` matches +/// zero or more URL path segments, which must be the last part of the URL path +/// except the `Verb`. +/// +/// The syntax `Variable` matches part of the URL path as specified by its +/// template. A variable template must not contain other variables. If a variable +/// matches a single path segment, its template may be omitted, e.g. `{var}` +/// is equivalent to `{var=*}`. +/// +/// The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` +/// contains any reserved character, such characters should be percent-encoded +/// before the matching. +/// +/// If a variable contains exactly one path segment, such as `"{var}"` or +/// `"{var=*}"`, when such a variable is expanded into a URL path on the client +/// side, all characters except `\[-_.~0-9a-zA-Z\]` are percent-encoded. The +/// server side does the reverse decoding. Such variables show up in the +/// [Discovery +/// Document]() as +/// `{var}`. +/// +/// If a variable contains multiple path segments, such as `"{var=foo/*}"` +/// or `"{var=**}"`, when such a variable is expanded into a URL path on the +/// client side, all characters except `\[-_.~/0-9a-zA-Z\]` are percent-encoded. +/// The server side does the reverse decoding, except "%2F" and "%2f" are left +/// unchanged. Such variables show up in the +/// [Discovery +/// Document]() as +/// `{+var}`. +/// +/// ## Using gRPC API Service Configuration +/// +/// gRPC API Service Configuration (service config) is a configuration language +/// for configuring a gRPC service to become a user-facing product. The +/// service config is simply the YAML representation of the `google.api.Service` +/// proto message. +/// +/// As an alternative to annotating your proto file, you can configure gRPC +/// transcoding in your service config YAML files. You do this by specifying a +/// `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same +/// effect as the proto annotation. This can be particularly useful if you +/// have a proto that is reused in multiple services. Note that any transcoding +/// specified in the service config will override any matching transcoding +/// configuration in the proto. +/// +/// Example: +/// +/// http: +/// rules: +/// # Selects a gRPC method and applies HttpRule to it. +/// - selector: example.v1.Messaging.GetMessage +/// get: /v1/messages/{message_id}/{sub.subfield} +/// +/// ## Special notes +/// +/// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the +/// proto to JSON conversion must follow the [proto3 +/// specification](). +/// +/// While the single segment variable follows the semantics of +/// [RFC 6570]() Section 3.2.2 Simple String +/// Expansion, the multi segment variable **does not** follow RFC 6570 Section +/// 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion +/// does not expand special characters like `?` and `#`, which would lead +/// to invalid URLs. As the result, gRPC Transcoding uses a custom encoding +/// for multi segment variables. +/// +/// The path variables **must not** refer to any repeated or mapped field, +/// because client libraries are not capable of handling such variable expansion. +/// +/// The path variables **must not** capture the leading "/" character. The reason +/// is that the most common use case "{var}" does not capture the leading "/" +/// character. For consistency, all path variables must share the same behavior. +/// +/// Repeated message fields must not be mapped to URL query parameters, because +/// no client library can support such complicated mapping. +/// +/// If an API needs to use a JSON array for request or response body, it can map +/// the request or response body to a repeated field. However, some gRPC +/// Transcoding implementations may not support this feature. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct HttpRule { + /// Selects a method to which this rule applies. + /// + /// Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + #[prost(string, tag = "1")] + pub selector: ::prost::alloc::string::String, + /// The name of the request field whose value is mapped to the HTTP request + /// body, or `*` for mapping all request fields not captured by the path + /// pattern to the HTTP body, or omitted for not having any HTTP request body. + /// + /// NOTE: the referred field must be present at the top-level of the request + /// message type. + #[prost(string, tag = "7")] + pub body: ::prost::alloc::string::String, + /// Optional. The name of the response field whose value is mapped to the HTTP + /// response body. When omitted, the entire response message will be used + /// as the HTTP response body. + /// + /// NOTE: The referred field must be present at the top-level of the response + /// message type. + #[prost(string, tag = "12")] + pub response_body: ::prost::alloc::string::String, + /// Additional HTTP bindings for the selector. Nested bindings must + /// not contain an `additional_bindings` field themselves (that is, + /// the nesting may only be one level deep). + #[prost(message, repeated, tag = "11")] + pub additional_bindings: ::prost::alloc::vec::Vec, + /// Determines the URL pattern is matched by this rules. This pattern can be + /// used with any of the {get|put|post|delete|patch} methods. A custom method + /// can be defined using the 'custom' field. + #[prost(oneof = "http_rule::Pattern", tags = "2, 3, 4, 5, 6, 8")] + pub pattern: ::core::option::Option, +} +/// Nested message and enum types in `HttpRule`. +pub mod http_rule { + /// Determines the URL pattern is matched by this rules. This pattern can be + /// used with any of the {get|put|post|delete|patch} methods. A custom method + /// can be defined using the 'custom' field. + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Pattern { + /// Maps to HTTP GET. Used for listing and getting information about + /// resources. + #[prost(string, tag = "2")] + Get(::prost::alloc::string::String), + /// Maps to HTTP PUT. Used for replacing a resource. + #[prost(string, tag = "3")] + Put(::prost::alloc::string::String), + /// Maps to HTTP POST. Used for creating a resource or performing an action. + #[prost(string, tag = "4")] + Post(::prost::alloc::string::String), + /// Maps to HTTP DELETE. Used for deleting a resource. + #[prost(string, tag = "5")] + Delete(::prost::alloc::string::String), + /// Maps to HTTP PATCH. Used for updating a resource. + #[prost(string, tag = "6")] + Patch(::prost::alloc::string::String), + /// The custom pattern is used for specifying an HTTP method that is not + /// included in the `pattern` field, such as HEAD, or "*" to leave the + /// HTTP method unspecified for this rule. The wild-card rule is useful + /// for services that provide content to Web (HTML) clients. + #[prost(message, tag = "8")] + Custom(super::CustomHttpPattern), + } +} +impl ::prost::Name for HttpRule { + const NAME: &'static str = "HttpRule"; + const PACKAGE: &'static str = "google.api"; + fn full_name() -> ::prost::alloc::string::String { + "google.api.HttpRule".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/google.api.HttpRule".into() + } +} +/// A custom pattern is used for defining custom HTTP verb. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CustomHttpPattern { + /// The name of this custom HTTP verb. + #[prost(string, tag = "1")] + pub kind: ::prost::alloc::string::String, + /// The path matched by this custom verb. + #[prost(string, tag = "2")] + pub path: ::prost::alloc::string::String, +} +impl ::prost::Name for CustomHttpPattern { + const NAME: &'static str = "CustomHttpPattern"; + const PACKAGE: &'static str = "google.api"; + fn full_name() -> ::prost::alloc::string::String { + "google.api.CustomHttpPattern".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/google.api.CustomHttpPattern".into() + } +} diff --git a/src/prost/google.api.serde.rs b/src/prost/google.api.serde.rs new file mode 100644 index 00000000..9e4882b4 --- /dev/null +++ b/src/prost/google.api.serde.rs @@ -0,0 +1,443 @@ +impl serde::Serialize for CustomHttpPattern { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.api.CustomHttpPattern", len)?; + if true { + struct_ser.serialize_field("kind", &self.kind)?; + } + if true { + struct_ser.serialize_field("path", &self.path)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for CustomHttpPattern { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "kind", + "path", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Kind, + Path, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "kind" => Ok(GeneratedField::Kind), + "path" => Ok(GeneratedField::Path), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = CustomHttpPattern; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.api.CustomHttpPattern") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut kind__ = None; + let mut path__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Kind => { + if kind__.is_some() { + return Err(serde::de::Error::duplicate_field("kind")); + } + kind__ = Some(map_.next_value()?); + } + GeneratedField::Path => { + if path__.is_some() { + return Err(serde::de::Error::duplicate_field("path")); + } + path__ = Some(map_.next_value()?); + } + } + } + Ok(CustomHttpPattern { + kind: kind__.unwrap_or_default(), + path: path__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("google.api.CustomHttpPattern", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Http { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.api.Http", len)?; + if true { + struct_ser.serialize_field("rules", &self.rules)?; + } + if true { + struct_ser.serialize_field("fullyDecodeReservedExpansion", &self.fully_decode_reserved_expansion)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Http { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "rules", + "fully_decode_reserved_expansion", + "fullyDecodeReservedExpansion", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Rules, + FullyDecodeReservedExpansion, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "rules" => Ok(GeneratedField::Rules), + "fullyDecodeReservedExpansion" | "fully_decode_reserved_expansion" => Ok(GeneratedField::FullyDecodeReservedExpansion), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Http; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.api.Http") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut rules__ = None; + let mut fully_decode_reserved_expansion__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Rules => { + if rules__.is_some() { + return Err(serde::de::Error::duplicate_field("rules")); + } + rules__ = Some(map_.next_value()?); + } + GeneratedField::FullyDecodeReservedExpansion => { + if fully_decode_reserved_expansion__.is_some() { + return Err(serde::de::Error::duplicate_field("fullyDecodeReservedExpansion")); + } + fully_decode_reserved_expansion__ = Some(map_.next_value()?); + } + } + } + Ok(Http { + rules: rules__.unwrap_or_default(), + fully_decode_reserved_expansion: fully_decode_reserved_expansion__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("google.api.Http", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for HttpRule { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if self.pattern.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.api.HttpRule", len)?; + if true { + struct_ser.serialize_field("selector", &self.selector)?; + } + if true { + struct_ser.serialize_field("body", &self.body)?; + } + if true { + struct_ser.serialize_field("responseBody", &self.response_body)?; + } + if true { + struct_ser.serialize_field("additionalBindings", &self.additional_bindings)?; + } + if let Some(v) = self.pattern.as_ref() { + match v { + http_rule::Pattern::Get(v) => { + struct_ser.serialize_field("get", v)?; + } + http_rule::Pattern::Put(v) => { + struct_ser.serialize_field("put", v)?; + } + http_rule::Pattern::Post(v) => { + struct_ser.serialize_field("post", v)?; + } + http_rule::Pattern::Delete(v) => { + struct_ser.serialize_field("delete", v)?; + } + http_rule::Pattern::Patch(v) => { + struct_ser.serialize_field("patch", v)?; + } + http_rule::Pattern::Custom(v) => { + struct_ser.serialize_field("custom", v)?; + } + } + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for HttpRule { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "selector", + "body", + "response_body", + "responseBody", + "additional_bindings", + "additionalBindings", + "get", + "put", + "post", + "delete", + "patch", + "custom", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Selector, + Body, + ResponseBody, + AdditionalBindings, + Get, + Put, + Post, + Delete, + Patch, + Custom, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "selector" => Ok(GeneratedField::Selector), + "body" => Ok(GeneratedField::Body), + "responseBody" | "response_body" => Ok(GeneratedField::ResponseBody), + "additionalBindings" | "additional_bindings" => Ok(GeneratedField::AdditionalBindings), + "get" => Ok(GeneratedField::Get), + "put" => Ok(GeneratedField::Put), + "post" => Ok(GeneratedField::Post), + "delete" => Ok(GeneratedField::Delete), + "patch" => Ok(GeneratedField::Patch), + "custom" => Ok(GeneratedField::Custom), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = HttpRule; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.api.HttpRule") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut selector__ = None; + let mut body__ = None; + let mut response_body__ = None; + let mut additional_bindings__ = None; + let mut pattern__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Selector => { + if selector__.is_some() { + return Err(serde::de::Error::duplicate_field("selector")); + } + selector__ = Some(map_.next_value()?); + } + GeneratedField::Body => { + if body__.is_some() { + return Err(serde::de::Error::duplicate_field("body")); + } + body__ = Some(map_.next_value()?); + } + GeneratedField::ResponseBody => { + if response_body__.is_some() { + return Err(serde::de::Error::duplicate_field("responseBody")); + } + response_body__ = Some(map_.next_value()?); + } + GeneratedField::AdditionalBindings => { + if additional_bindings__.is_some() { + return Err(serde::de::Error::duplicate_field("additionalBindings")); + } + additional_bindings__ = Some(map_.next_value()?); + } + GeneratedField::Get => { + if pattern__.is_some() { + return Err(serde::de::Error::duplicate_field("get")); + } + pattern__ = map_.next_value::<::core::option::Option<_>>()?.map(http_rule::Pattern::Get); + } + GeneratedField::Put => { + if pattern__.is_some() { + return Err(serde::de::Error::duplicate_field("put")); + } + pattern__ = map_.next_value::<::core::option::Option<_>>()?.map(http_rule::Pattern::Put); + } + GeneratedField::Post => { + if pattern__.is_some() { + return Err(serde::de::Error::duplicate_field("post")); + } + pattern__ = map_.next_value::<::core::option::Option<_>>()?.map(http_rule::Pattern::Post); + } + GeneratedField::Delete => { + if pattern__.is_some() { + return Err(serde::de::Error::duplicate_field("delete")); + } + pattern__ = map_.next_value::<::core::option::Option<_>>()?.map(http_rule::Pattern::Delete); + } + GeneratedField::Patch => { + if pattern__.is_some() { + return Err(serde::de::Error::duplicate_field("patch")); + } + pattern__ = map_.next_value::<::core::option::Option<_>>()?.map(http_rule::Pattern::Patch); + } + GeneratedField::Custom => { + if pattern__.is_some() { + return Err(serde::de::Error::duplicate_field("custom")); + } + pattern__ = map_.next_value::<::core::option::Option<_>>()?.map(http_rule::Pattern::Custom) +; + } + } + } + Ok(HttpRule { + selector: selector__.unwrap_or_default(), + body: body__.unwrap_or_default(), + response_body: response_body__.unwrap_or_default(), + additional_bindings: additional_bindings__.unwrap_or_default(), + pattern: pattern__, + }) + } + } + deserializer.deserialize_struct("google.api.HttpRule", FIELDS, GeneratedVisitor) + } +} diff --git a/src/prost/google.protobuf.serde.rs b/src/prost/google.protobuf.serde.rs new file mode 100644 index 00000000..b47f4a59 --- /dev/null +++ b/src/prost/google.protobuf.serde.rs @@ -0,0 +1,7200 @@ +impl serde::Serialize for Any { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.Any", len)?; + if true { + struct_ser.serialize_field("typeUrl", &self.type_url)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("value", pbjson::private::base64::encode(&self.value).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Any { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "type_url", + "typeUrl", + "value", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + TypeUrl, + Value, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "typeUrl" | "type_url" => Ok(GeneratedField::TypeUrl), + "value" => Ok(GeneratedField::Value), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Any; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.Any") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut type_url__ = None; + let mut value__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::TypeUrl => { + if type_url__.is_some() { + return Err(serde::de::Error::duplicate_field("typeUrl")); + } + type_url__ = Some(map_.next_value()?); + } + GeneratedField::Value => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("value")); + } + value__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(Any { + type_url: type_url__.unwrap_or_default(), + value: value__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("google.protobuf.Any", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for DescriptorProto { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.DescriptorProto", len)?; + if let Some(v) = self.name.as_ref() { + struct_ser.serialize_field("name", v)?; + } + if true { + struct_ser.serialize_field("field", &self.field)?; + } + if true { + struct_ser.serialize_field("extension", &self.extension)?; + } + if true { + struct_ser.serialize_field("nestedType", &self.nested_type)?; + } + if true { + struct_ser.serialize_field("enumType", &self.enum_type)?; + } + if true { + struct_ser.serialize_field("extensionRange", &self.extension_range)?; + } + if true { + struct_ser.serialize_field("oneofDecl", &self.oneof_decl)?; + } + if let Some(v) = self.options.as_ref() { + struct_ser.serialize_field("options", v)?; + } + if true { + struct_ser.serialize_field("reservedRange", &self.reserved_range)?; + } + if true { + struct_ser.serialize_field("reservedName", &self.reserved_name)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for DescriptorProto { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "name", + "field", + "extension", + "nested_type", + "nestedType", + "enum_type", + "enumType", + "extension_range", + "extensionRange", + "oneof_decl", + "oneofDecl", + "options", + "reserved_range", + "reservedRange", + "reserved_name", + "reservedName", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Field, + Extension, + NestedType, + EnumType, + ExtensionRange, + OneofDecl, + Options, + ReservedRange, + ReservedName, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + "field" => Ok(GeneratedField::Field), + "extension" => Ok(GeneratedField::Extension), + "nestedType" | "nested_type" => Ok(GeneratedField::NestedType), + "enumType" | "enum_type" => Ok(GeneratedField::EnumType), + "extensionRange" | "extension_range" => Ok(GeneratedField::ExtensionRange), + "oneofDecl" | "oneof_decl" => Ok(GeneratedField::OneofDecl), + "options" => Ok(GeneratedField::Options), + "reservedRange" | "reserved_range" => Ok(GeneratedField::ReservedRange), + "reservedName" | "reserved_name" => Ok(GeneratedField::ReservedName), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = DescriptorProto; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.DescriptorProto") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut field__ = None; + let mut extension__ = None; + let mut nested_type__ = None; + let mut enum_type__ = None; + let mut extension_range__ = None; + let mut oneof_decl__ = None; + let mut options__ = None; + let mut reserved_range__ = None; + let mut reserved_name__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); + } + name__ = map_.next_value()?; + } + GeneratedField::Field => { + if field__.is_some() { + return Err(serde::de::Error::duplicate_field("field")); + } + field__ = Some(map_.next_value()?); + } + GeneratedField::Extension => { + if extension__.is_some() { + return Err(serde::de::Error::duplicate_field("extension")); + } + extension__ = Some(map_.next_value()?); + } + GeneratedField::NestedType => { + if nested_type__.is_some() { + return Err(serde::de::Error::duplicate_field("nestedType")); + } + nested_type__ = Some(map_.next_value()?); + } + GeneratedField::EnumType => { + if enum_type__.is_some() { + return Err(serde::de::Error::duplicate_field("enumType")); + } + enum_type__ = Some(map_.next_value()?); + } + GeneratedField::ExtensionRange => { + if extension_range__.is_some() { + return Err(serde::de::Error::duplicate_field("extensionRange")); + } + extension_range__ = Some(map_.next_value()?); + } + GeneratedField::OneofDecl => { + if oneof_decl__.is_some() { + return Err(serde::de::Error::duplicate_field("oneofDecl")); + } + oneof_decl__ = Some(map_.next_value()?); + } + GeneratedField::Options => { + if options__.is_some() { + return Err(serde::de::Error::duplicate_field("options")); + } + options__ = map_.next_value()?; + } + GeneratedField::ReservedRange => { + if reserved_range__.is_some() { + return Err(serde::de::Error::duplicate_field("reservedRange")); + } + reserved_range__ = Some(map_.next_value()?); + } + GeneratedField::ReservedName => { + if reserved_name__.is_some() { + return Err(serde::de::Error::duplicate_field("reservedName")); + } + reserved_name__ = Some(map_.next_value()?); + } + } + } + Ok(DescriptorProto { + name: name__, + field: field__.unwrap_or_default(), + extension: extension__.unwrap_or_default(), + nested_type: nested_type__.unwrap_or_default(), + enum_type: enum_type__.unwrap_or_default(), + extension_range: extension_range__.unwrap_or_default(), + oneof_decl: oneof_decl__.unwrap_or_default(), + options: options__, + reserved_range: reserved_range__.unwrap_or_default(), + reserved_name: reserved_name__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("google.protobuf.DescriptorProto", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for descriptor_proto::ExtensionRange { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.DescriptorProto.ExtensionRange", len)?; + if let Some(v) = self.start.as_ref() { + struct_ser.serialize_field("start", v)?; + } + if let Some(v) = self.end.as_ref() { + struct_ser.serialize_field("end", v)?; + } + if let Some(v) = self.options.as_ref() { + struct_ser.serialize_field("options", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for descriptor_proto::ExtensionRange { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "start", + "end", + "options", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Start, + End, + Options, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "start" => Ok(GeneratedField::Start), + "end" => Ok(GeneratedField::End), + "options" => Ok(GeneratedField::Options), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = descriptor_proto::ExtensionRange; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.DescriptorProto.ExtensionRange") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut start__ = None; + let mut end__ = None; + let mut options__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Start => { + if start__.is_some() { + return Err(serde::de::Error::duplicate_field("start")); + } + start__ = + map_.next_value::<::core::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0) + ; + } + GeneratedField::End => { + if end__.is_some() { + return Err(serde::de::Error::duplicate_field("end")); + } + end__ = + map_.next_value::<::core::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0) + ; + } + GeneratedField::Options => { + if options__.is_some() { + return Err(serde::de::Error::duplicate_field("options")); + } + options__ = map_.next_value()?; + } + } + } + Ok(descriptor_proto::ExtensionRange { + start: start__, + end: end__, + options: options__, + }) + } + } + deserializer.deserialize_struct("google.protobuf.DescriptorProto.ExtensionRange", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for descriptor_proto::ReservedRange { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.DescriptorProto.ReservedRange", len)?; + if let Some(v) = self.start.as_ref() { + struct_ser.serialize_field("start", v)?; + } + if let Some(v) = self.end.as_ref() { + struct_ser.serialize_field("end", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for descriptor_proto::ReservedRange { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "start", + "end", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Start, + End, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "start" => Ok(GeneratedField::Start), + "end" => Ok(GeneratedField::End), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = descriptor_proto::ReservedRange; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.DescriptorProto.ReservedRange") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut start__ = None; + let mut end__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Start => { + if start__.is_some() { + return Err(serde::de::Error::duplicate_field("start")); + } + start__ = + map_.next_value::<::core::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0) + ; + } + GeneratedField::End => { + if end__.is_some() { + return Err(serde::de::Error::duplicate_field("end")); + } + end__ = + map_.next_value::<::core::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0) + ; + } + } + } + Ok(descriptor_proto::ReservedRange { + start: start__, + end: end__, + }) + } + } + deserializer.deserialize_struct("google.protobuf.DescriptorProto.ReservedRange", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Duration { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.Duration", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("seconds", ::alloc::string::ToString::to_string(&self.seconds).as_str())?; + } + if true { + struct_ser.serialize_field("nanos", &self.nanos)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Duration { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "seconds", + "nanos", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Seconds, + Nanos, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "seconds" => Ok(GeneratedField::Seconds), + "nanos" => Ok(GeneratedField::Nanos), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Duration; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.Duration") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut seconds__ = None; + let mut nanos__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Seconds => { + if seconds__.is_some() { + return Err(serde::de::Error::duplicate_field("seconds")); + } + seconds__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Nanos => { + if nanos__.is_some() { + return Err(serde::de::Error::duplicate_field("nanos")); + } + nanos__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(Duration { + seconds: seconds__.unwrap_or_default(), + nanos: nanos__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("google.protobuf.Duration", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Edition { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unknown => "EDITION_UNKNOWN", + Self::Legacy => "EDITION_LEGACY", + Self::Proto2 => "EDITION_PROTO2", + Self::Proto3 => "EDITION_PROTO3", + Self::Edition2023 => "EDITION_2023", + Self::Edition2024 => "EDITION_2024", + Self::Edition1TestOnly => "EDITION_1_TEST_ONLY", + Self::Edition2TestOnly => "EDITION_2_TEST_ONLY", + Self::Edition99997TestOnly => "EDITION_99997_TEST_ONLY", + Self::Edition99998TestOnly => "EDITION_99998_TEST_ONLY", + Self::Edition99999TestOnly => "EDITION_99999_TEST_ONLY", + Self::Max => "EDITION_MAX", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for Edition { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "EDITION_UNKNOWN", + "EDITION_LEGACY", + "EDITION_PROTO2", + "EDITION_PROTO3", + "EDITION_2023", + "EDITION_2024", + "EDITION_1_TEST_ONLY", + "EDITION_2_TEST_ONLY", + "EDITION_99997_TEST_ONLY", + "EDITION_99998_TEST_ONLY", + "EDITION_99999_TEST_ONLY", + "EDITION_MAX", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Edition; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "EDITION_UNKNOWN" => Ok(Edition::Unknown), + "EDITION_LEGACY" => Ok(Edition::Legacy), + "EDITION_PROTO2" => Ok(Edition::Proto2), + "EDITION_PROTO3" => Ok(Edition::Proto3), + "EDITION_2023" => Ok(Edition::Edition2023), + "EDITION_2024" => Ok(Edition::Edition2024), + "EDITION_1_TEST_ONLY" => Ok(Edition::Edition1TestOnly), + "EDITION_2_TEST_ONLY" => Ok(Edition::Edition2TestOnly), + "EDITION_99997_TEST_ONLY" => Ok(Edition::Edition99997TestOnly), + "EDITION_99998_TEST_ONLY" => Ok(Edition::Edition99998TestOnly), + "EDITION_99999_TEST_ONLY" => Ok(Edition::Edition99999TestOnly), + "EDITION_MAX" => Ok(Edition::Max), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for EnumDescriptorProto { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.EnumDescriptorProto", len)?; + if let Some(v) = self.name.as_ref() { + struct_ser.serialize_field("name", v)?; + } + if true { + struct_ser.serialize_field("value", &self.value)?; + } + if let Some(v) = self.options.as_ref() { + struct_ser.serialize_field("options", v)?; + } + if true { + struct_ser.serialize_field("reservedRange", &self.reserved_range)?; + } + if true { + struct_ser.serialize_field("reservedName", &self.reserved_name)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for EnumDescriptorProto { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "name", + "value", + "options", + "reserved_range", + "reservedRange", + "reserved_name", + "reservedName", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Value, + Options, + ReservedRange, + ReservedName, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + "value" => Ok(GeneratedField::Value), + "options" => Ok(GeneratedField::Options), + "reservedRange" | "reserved_range" => Ok(GeneratedField::ReservedRange), + "reservedName" | "reserved_name" => Ok(GeneratedField::ReservedName), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = EnumDescriptorProto; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.EnumDescriptorProto") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut value__ = None; + let mut options__ = None; + let mut reserved_range__ = None; + let mut reserved_name__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); + } + name__ = map_.next_value()?; + } + GeneratedField::Value => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("value")); + } + value__ = Some(map_.next_value()?); + } + GeneratedField::Options => { + if options__.is_some() { + return Err(serde::de::Error::duplicate_field("options")); + } + options__ = map_.next_value()?; + } + GeneratedField::ReservedRange => { + if reserved_range__.is_some() { + return Err(serde::de::Error::duplicate_field("reservedRange")); + } + reserved_range__ = Some(map_.next_value()?); + } + GeneratedField::ReservedName => { + if reserved_name__.is_some() { + return Err(serde::de::Error::duplicate_field("reservedName")); + } + reserved_name__ = Some(map_.next_value()?); + } + } + } + Ok(EnumDescriptorProto { + name: name__, + value: value__.unwrap_or_default(), + options: options__, + reserved_range: reserved_range__.unwrap_or_default(), + reserved_name: reserved_name__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("google.protobuf.EnumDescriptorProto", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for enum_descriptor_proto::EnumReservedRange { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.EnumDescriptorProto.EnumReservedRange", len)?; + if let Some(v) = self.start.as_ref() { + struct_ser.serialize_field("start", v)?; + } + if let Some(v) = self.end.as_ref() { + struct_ser.serialize_field("end", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for enum_descriptor_proto::EnumReservedRange { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "start", + "end", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Start, + End, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "start" => Ok(GeneratedField::Start), + "end" => Ok(GeneratedField::End), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = enum_descriptor_proto::EnumReservedRange; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.EnumDescriptorProto.EnumReservedRange") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut start__ = None; + let mut end__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Start => { + if start__.is_some() { + return Err(serde::de::Error::duplicate_field("start")); + } + start__ = + map_.next_value::<::core::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0) + ; + } + GeneratedField::End => { + if end__.is_some() { + return Err(serde::de::Error::duplicate_field("end")); + } + end__ = + map_.next_value::<::core::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0) + ; + } + } + } + Ok(enum_descriptor_proto::EnumReservedRange { + start: start__, + end: end__, + }) + } + } + deserializer.deserialize_struct("google.protobuf.EnumDescriptorProto.EnumReservedRange", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for EnumOptions { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.EnumOptions", len)?; + if let Some(v) = self.allow_alias.as_ref() { + struct_ser.serialize_field("allowAlias", v)?; + } + if let Some(v) = self.deprecated.as_ref() { + struct_ser.serialize_field("deprecated", v)?; + } + if let Some(v) = self.deprecated_legacy_json_field_conflicts.as_ref() { + struct_ser.serialize_field("deprecatedLegacyJsonFieldConflicts", v)?; + } + if let Some(v) = self.features.as_ref() { + struct_ser.serialize_field("features", v)?; + } + if true { + struct_ser.serialize_field("uninterpretedOption", &self.uninterpreted_option)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for EnumOptions { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "allow_alias", + "allowAlias", + "deprecated", + "deprecated_legacy_json_field_conflicts", + "deprecatedLegacyJsonFieldConflicts", + "features", + "uninterpreted_option", + "uninterpretedOption", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AllowAlias, + Deprecated, + DeprecatedLegacyJsonFieldConflicts, + Features, + UninterpretedOption, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "allowAlias" | "allow_alias" => Ok(GeneratedField::AllowAlias), + "deprecated" => Ok(GeneratedField::Deprecated), + "deprecatedLegacyJsonFieldConflicts" | "deprecated_legacy_json_field_conflicts" => Ok(GeneratedField::DeprecatedLegacyJsonFieldConflicts), + "features" => Ok(GeneratedField::Features), + "uninterpretedOption" | "uninterpreted_option" => Ok(GeneratedField::UninterpretedOption), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = EnumOptions; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.EnumOptions") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut allow_alias__ = None; + let mut deprecated__ = None; + let mut deprecated_legacy_json_field_conflicts__ = None; + let mut features__ = None; + let mut uninterpreted_option__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::AllowAlias => { + if allow_alias__.is_some() { + return Err(serde::de::Error::duplicate_field("allowAlias")); + } + allow_alias__ = map_.next_value()?; + } + GeneratedField::Deprecated => { + if deprecated__.is_some() { + return Err(serde::de::Error::duplicate_field("deprecated")); + } + deprecated__ = map_.next_value()?; + } + GeneratedField::DeprecatedLegacyJsonFieldConflicts => { + if deprecated_legacy_json_field_conflicts__.is_some() { + return Err(serde::de::Error::duplicate_field("deprecatedLegacyJsonFieldConflicts")); + } + deprecated_legacy_json_field_conflicts__ = map_.next_value()?; + } + GeneratedField::Features => { + if features__.is_some() { + return Err(serde::de::Error::duplicate_field("features")); + } + features__ = map_.next_value()?; + } + GeneratedField::UninterpretedOption => { + if uninterpreted_option__.is_some() { + return Err(serde::de::Error::duplicate_field("uninterpretedOption")); + } + uninterpreted_option__ = Some(map_.next_value()?); + } + } + } + Ok(EnumOptions { + allow_alias: allow_alias__, + deprecated: deprecated__, + deprecated_legacy_json_field_conflicts: deprecated_legacy_json_field_conflicts__, + features: features__, + uninterpreted_option: uninterpreted_option__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("google.protobuf.EnumOptions", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for EnumValueDescriptorProto { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.EnumValueDescriptorProto", len)?; + if let Some(v) = self.name.as_ref() { + struct_ser.serialize_field("name", v)?; + } + if let Some(v) = self.number.as_ref() { + struct_ser.serialize_field("number", v)?; + } + if let Some(v) = self.options.as_ref() { + struct_ser.serialize_field("options", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for EnumValueDescriptorProto { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "name", + "number", + "options", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Number, + Options, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + "number" => Ok(GeneratedField::Number), + "options" => Ok(GeneratedField::Options), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = EnumValueDescriptorProto; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.EnumValueDescriptorProto") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut number__ = None; + let mut options__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); + } + name__ = map_.next_value()?; + } + GeneratedField::Number => { + if number__.is_some() { + return Err(serde::de::Error::duplicate_field("number")); + } + number__ = + map_.next_value::<::core::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0) + ; + } + GeneratedField::Options => { + if options__.is_some() { + return Err(serde::de::Error::duplicate_field("options")); + } + options__ = map_.next_value()?; + } + } + } + Ok(EnumValueDescriptorProto { + name: name__, + number: number__, + options: options__, + }) + } + } + deserializer.deserialize_struct("google.protobuf.EnumValueDescriptorProto", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for EnumValueOptions { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.EnumValueOptions", len)?; + if let Some(v) = self.deprecated.as_ref() { + struct_ser.serialize_field("deprecated", v)?; + } + if let Some(v) = self.features.as_ref() { + struct_ser.serialize_field("features", v)?; + } + if let Some(v) = self.debug_redact.as_ref() { + struct_ser.serialize_field("debugRedact", v)?; + } + if let Some(v) = self.feature_support.as_ref() { + struct_ser.serialize_field("featureSupport", v)?; + } + if true { + struct_ser.serialize_field("uninterpretedOption", &self.uninterpreted_option)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for EnumValueOptions { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "deprecated", + "features", + "debug_redact", + "debugRedact", + "feature_support", + "featureSupport", + "uninterpreted_option", + "uninterpretedOption", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Deprecated, + Features, + DebugRedact, + FeatureSupport, + UninterpretedOption, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "deprecated" => Ok(GeneratedField::Deprecated), + "features" => Ok(GeneratedField::Features), + "debugRedact" | "debug_redact" => Ok(GeneratedField::DebugRedact), + "featureSupport" | "feature_support" => Ok(GeneratedField::FeatureSupport), + "uninterpretedOption" | "uninterpreted_option" => Ok(GeneratedField::UninterpretedOption), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = EnumValueOptions; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.EnumValueOptions") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut deprecated__ = None; + let mut features__ = None; + let mut debug_redact__ = None; + let mut feature_support__ = None; + let mut uninterpreted_option__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Deprecated => { + if deprecated__.is_some() { + return Err(serde::de::Error::duplicate_field("deprecated")); + } + deprecated__ = map_.next_value()?; + } + GeneratedField::Features => { + if features__.is_some() { + return Err(serde::de::Error::duplicate_field("features")); + } + features__ = map_.next_value()?; + } + GeneratedField::DebugRedact => { + if debug_redact__.is_some() { + return Err(serde::de::Error::duplicate_field("debugRedact")); + } + debug_redact__ = map_.next_value()?; + } + GeneratedField::FeatureSupport => { + if feature_support__.is_some() { + return Err(serde::de::Error::duplicate_field("featureSupport")); + } + feature_support__ = map_.next_value()?; + } + GeneratedField::UninterpretedOption => { + if uninterpreted_option__.is_some() { + return Err(serde::de::Error::duplicate_field("uninterpretedOption")); + } + uninterpreted_option__ = Some(map_.next_value()?); + } + } + } + Ok(EnumValueOptions { + deprecated: deprecated__, + features: features__, + debug_redact: debug_redact__, + feature_support: feature_support__, + uninterpreted_option: uninterpreted_option__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("google.protobuf.EnumValueOptions", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ExtensionRangeOptions { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.ExtensionRangeOptions", len)?; + if true { + struct_ser.serialize_field("uninterpretedOption", &self.uninterpreted_option)?; + } + if true { + struct_ser.serialize_field("declaration", &self.declaration)?; + } + if let Some(v) = self.features.as_ref() { + struct_ser.serialize_field("features", v)?; + } + if let Some(v) = self.verification.as_ref() { + let v = extension_range_options::VerificationState::try_from(*v) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("verification", &v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ExtensionRangeOptions { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "uninterpreted_option", + "uninterpretedOption", + "declaration", + "features", + "verification", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + UninterpretedOption, + Declaration, + Features, + Verification, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "uninterpretedOption" | "uninterpreted_option" => Ok(GeneratedField::UninterpretedOption), + "declaration" => Ok(GeneratedField::Declaration), + "features" => Ok(GeneratedField::Features), + "verification" => Ok(GeneratedField::Verification), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ExtensionRangeOptions; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.ExtensionRangeOptions") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut uninterpreted_option__ = None; + let mut declaration__ = None; + let mut features__ = None; + let mut verification__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::UninterpretedOption => { + if uninterpreted_option__.is_some() { + return Err(serde::de::Error::duplicate_field("uninterpretedOption")); + } + uninterpreted_option__ = Some(map_.next_value()?); + } + GeneratedField::Declaration => { + if declaration__.is_some() { + return Err(serde::de::Error::duplicate_field("declaration")); + } + declaration__ = Some(map_.next_value()?); + } + GeneratedField::Features => { + if features__.is_some() { + return Err(serde::de::Error::duplicate_field("features")); + } + features__ = map_.next_value()?; + } + GeneratedField::Verification => { + if verification__.is_some() { + return Err(serde::de::Error::duplicate_field("verification")); + } + verification__ = map_.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + } + } + Ok(ExtensionRangeOptions { + uninterpreted_option: uninterpreted_option__.unwrap_or_default(), + declaration: declaration__.unwrap_or_default(), + features: features__, + verification: verification__, + }) + } + } + deserializer.deserialize_struct("google.protobuf.ExtensionRangeOptions", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for extension_range_options::Declaration { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.ExtensionRangeOptions.Declaration", len)?; + if let Some(v) = self.number.as_ref() { + struct_ser.serialize_field("number", v)?; + } + if let Some(v) = self.full_name.as_ref() { + struct_ser.serialize_field("fullName", v)?; + } + if let Some(v) = self.r#type.as_ref() { + struct_ser.serialize_field("type", v)?; + } + if let Some(v) = self.reserved.as_ref() { + struct_ser.serialize_field("reserved", v)?; + } + if let Some(v) = self.repeated.as_ref() { + struct_ser.serialize_field("repeated", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for extension_range_options::Declaration { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "number", + "full_name", + "fullName", + "type", + "reserved", + "repeated", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Number, + FullName, + Type, + Reserved, + Repeated, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "number" => Ok(GeneratedField::Number), + "fullName" | "full_name" => Ok(GeneratedField::FullName), + "type" => Ok(GeneratedField::Type), + "reserved" => Ok(GeneratedField::Reserved), + "repeated" => Ok(GeneratedField::Repeated), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = extension_range_options::Declaration; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.ExtensionRangeOptions.Declaration") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut number__ = None; + let mut full_name__ = None; + let mut r#type__ = None; + let mut reserved__ = None; + let mut repeated__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Number => { + if number__.is_some() { + return Err(serde::de::Error::duplicate_field("number")); + } + number__ = + map_.next_value::<::core::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0) + ; + } + GeneratedField::FullName => { + if full_name__.is_some() { + return Err(serde::de::Error::duplicate_field("fullName")); + } + full_name__ = map_.next_value()?; + } + GeneratedField::Type => { + if r#type__.is_some() { + return Err(serde::de::Error::duplicate_field("type")); + } + r#type__ = map_.next_value()?; + } + GeneratedField::Reserved => { + if reserved__.is_some() { + return Err(serde::de::Error::duplicate_field("reserved")); + } + reserved__ = map_.next_value()?; + } + GeneratedField::Repeated => { + if repeated__.is_some() { + return Err(serde::de::Error::duplicate_field("repeated")); + } + repeated__ = map_.next_value()?; + } + } + } + Ok(extension_range_options::Declaration { + number: number__, + full_name: full_name__, + r#type: r#type__, + reserved: reserved__, + repeated: repeated__, + }) + } + } + deserializer.deserialize_struct("google.protobuf.ExtensionRangeOptions.Declaration", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for extension_range_options::VerificationState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Declaration => "DECLARATION", + Self::Unverified => "UNVERIFIED", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for extension_range_options::VerificationState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "DECLARATION", + "UNVERIFIED", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = extension_range_options::VerificationState; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "DECLARATION" => Ok(extension_range_options::VerificationState::Declaration), + "UNVERIFIED" => Ok(extension_range_options::VerificationState::Unverified), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for FeatureSet { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.FeatureSet", len)?; + if let Some(v) = self.field_presence.as_ref() { + let v = feature_set::FieldPresence::try_from(*v) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("fieldPresence", &v)?; + } + if let Some(v) = self.enum_type.as_ref() { + let v = feature_set::EnumType::try_from(*v) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("enumType", &v)?; + } + if let Some(v) = self.repeated_field_encoding.as_ref() { + let v = feature_set::RepeatedFieldEncoding::try_from(*v) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("repeatedFieldEncoding", &v)?; + } + if let Some(v) = self.utf8_validation.as_ref() { + let v = feature_set::Utf8Validation::try_from(*v) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("utf8Validation", &v)?; + } + if let Some(v) = self.message_encoding.as_ref() { + let v = feature_set::MessageEncoding::try_from(*v) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("messageEncoding", &v)?; + } + if let Some(v) = self.json_format.as_ref() { + let v = feature_set::JsonFormat::try_from(*v) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("jsonFormat", &v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for FeatureSet { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "field_presence", + "fieldPresence", + "enum_type", + "enumType", + "repeated_field_encoding", + "repeatedFieldEncoding", + "utf8_validation", + "utf8Validation", + "message_encoding", + "messageEncoding", + "json_format", + "jsonFormat", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + FieldPresence, + EnumType, + RepeatedFieldEncoding, + Utf8Validation, + MessageEncoding, + JsonFormat, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "fieldPresence" | "field_presence" => Ok(GeneratedField::FieldPresence), + "enumType" | "enum_type" => Ok(GeneratedField::EnumType), + "repeatedFieldEncoding" | "repeated_field_encoding" => Ok(GeneratedField::RepeatedFieldEncoding), + "utf8Validation" | "utf8_validation" => Ok(GeneratedField::Utf8Validation), + "messageEncoding" | "message_encoding" => Ok(GeneratedField::MessageEncoding), + "jsonFormat" | "json_format" => Ok(GeneratedField::JsonFormat), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = FeatureSet; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.FeatureSet") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut field_presence__ = None; + let mut enum_type__ = None; + let mut repeated_field_encoding__ = None; + let mut utf8_validation__ = None; + let mut message_encoding__ = None; + let mut json_format__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::FieldPresence => { + if field_presence__.is_some() { + return Err(serde::de::Error::duplicate_field("fieldPresence")); + } + field_presence__ = map_.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + GeneratedField::EnumType => { + if enum_type__.is_some() { + return Err(serde::de::Error::duplicate_field("enumType")); + } + enum_type__ = map_.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + GeneratedField::RepeatedFieldEncoding => { + if repeated_field_encoding__.is_some() { + return Err(serde::de::Error::duplicate_field("repeatedFieldEncoding")); + } + repeated_field_encoding__ = map_.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + GeneratedField::Utf8Validation => { + if utf8_validation__.is_some() { + return Err(serde::de::Error::duplicate_field("utf8Validation")); + } + utf8_validation__ = map_.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + GeneratedField::MessageEncoding => { + if message_encoding__.is_some() { + return Err(serde::de::Error::duplicate_field("messageEncoding")); + } + message_encoding__ = map_.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + GeneratedField::JsonFormat => { + if json_format__.is_some() { + return Err(serde::de::Error::duplicate_field("jsonFormat")); + } + json_format__ = map_.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + } + } + Ok(FeatureSet { + field_presence: field_presence__, + enum_type: enum_type__, + repeated_field_encoding: repeated_field_encoding__, + utf8_validation: utf8_validation__, + message_encoding: message_encoding__, + json_format: json_format__, + }) + } + } + deserializer.deserialize_struct("google.protobuf.FeatureSet", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for feature_set::EnumType { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unknown => "ENUM_TYPE_UNKNOWN", + Self::Open => "OPEN", + Self::Closed => "CLOSED", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for feature_set::EnumType { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "ENUM_TYPE_UNKNOWN", + "OPEN", + "CLOSED", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = feature_set::EnumType; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "ENUM_TYPE_UNKNOWN" => Ok(feature_set::EnumType::Unknown), + "OPEN" => Ok(feature_set::EnumType::Open), + "CLOSED" => Ok(feature_set::EnumType::Closed), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for feature_set::FieldPresence { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unknown => "FIELD_PRESENCE_UNKNOWN", + Self::Explicit => "EXPLICIT", + Self::Implicit => "IMPLICIT", + Self::LegacyRequired => "LEGACY_REQUIRED", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for feature_set::FieldPresence { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "FIELD_PRESENCE_UNKNOWN", + "EXPLICIT", + "IMPLICIT", + "LEGACY_REQUIRED", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = feature_set::FieldPresence; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "FIELD_PRESENCE_UNKNOWN" => Ok(feature_set::FieldPresence::Unknown), + "EXPLICIT" => Ok(feature_set::FieldPresence::Explicit), + "IMPLICIT" => Ok(feature_set::FieldPresence::Implicit), + "LEGACY_REQUIRED" => Ok(feature_set::FieldPresence::LegacyRequired), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for feature_set::JsonFormat { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unknown => "JSON_FORMAT_UNKNOWN", + Self::Allow => "ALLOW", + Self::LegacyBestEffort => "LEGACY_BEST_EFFORT", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for feature_set::JsonFormat { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "JSON_FORMAT_UNKNOWN", + "ALLOW", + "LEGACY_BEST_EFFORT", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = feature_set::JsonFormat; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "JSON_FORMAT_UNKNOWN" => Ok(feature_set::JsonFormat::Unknown), + "ALLOW" => Ok(feature_set::JsonFormat::Allow), + "LEGACY_BEST_EFFORT" => Ok(feature_set::JsonFormat::LegacyBestEffort), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for feature_set::MessageEncoding { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unknown => "MESSAGE_ENCODING_UNKNOWN", + Self::LengthPrefixed => "LENGTH_PREFIXED", + Self::Delimited => "DELIMITED", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for feature_set::MessageEncoding { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "MESSAGE_ENCODING_UNKNOWN", + "LENGTH_PREFIXED", + "DELIMITED", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = feature_set::MessageEncoding; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "MESSAGE_ENCODING_UNKNOWN" => Ok(feature_set::MessageEncoding::Unknown), + "LENGTH_PREFIXED" => Ok(feature_set::MessageEncoding::LengthPrefixed), + "DELIMITED" => Ok(feature_set::MessageEncoding::Delimited), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for feature_set::RepeatedFieldEncoding { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unknown => "REPEATED_FIELD_ENCODING_UNKNOWN", + Self::Packed => "PACKED", + Self::Expanded => "EXPANDED", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for feature_set::RepeatedFieldEncoding { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "REPEATED_FIELD_ENCODING_UNKNOWN", + "PACKED", + "EXPANDED", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = feature_set::RepeatedFieldEncoding; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "REPEATED_FIELD_ENCODING_UNKNOWN" => Ok(feature_set::RepeatedFieldEncoding::Unknown), + "PACKED" => Ok(feature_set::RepeatedFieldEncoding::Packed), + "EXPANDED" => Ok(feature_set::RepeatedFieldEncoding::Expanded), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for feature_set::Utf8Validation { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unknown => "UTF8_VALIDATION_UNKNOWN", + Self::Verify => "VERIFY", + Self::None => "NONE", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for feature_set::Utf8Validation { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "UTF8_VALIDATION_UNKNOWN", + "VERIFY", + "NONE", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = feature_set::Utf8Validation; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "UTF8_VALIDATION_UNKNOWN" => Ok(feature_set::Utf8Validation::Unknown), + "VERIFY" => Ok(feature_set::Utf8Validation::Verify), + "NONE" => Ok(feature_set::Utf8Validation::None), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for FeatureSetDefaults { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.FeatureSetDefaults", len)?; + if true { + struct_ser.serialize_field("defaults", &self.defaults)?; + } + if let Some(v) = self.minimum_edition.as_ref() { + let v = Edition::try_from(*v) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("minimumEdition", &v)?; + } + if let Some(v) = self.maximum_edition.as_ref() { + let v = Edition::try_from(*v) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("maximumEdition", &v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for FeatureSetDefaults { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "defaults", + "minimum_edition", + "minimumEdition", + "maximum_edition", + "maximumEdition", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Defaults, + MinimumEdition, + MaximumEdition, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "defaults" => Ok(GeneratedField::Defaults), + "minimumEdition" | "minimum_edition" => Ok(GeneratedField::MinimumEdition), + "maximumEdition" | "maximum_edition" => Ok(GeneratedField::MaximumEdition), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = FeatureSetDefaults; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.FeatureSetDefaults") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut defaults__ = None; + let mut minimum_edition__ = None; + let mut maximum_edition__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Defaults => { + if defaults__.is_some() { + return Err(serde::de::Error::duplicate_field("defaults")); + } + defaults__ = Some(map_.next_value()?); + } + GeneratedField::MinimumEdition => { + if minimum_edition__.is_some() { + return Err(serde::de::Error::duplicate_field("minimumEdition")); + } + minimum_edition__ = map_.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + GeneratedField::MaximumEdition => { + if maximum_edition__.is_some() { + return Err(serde::de::Error::duplicate_field("maximumEdition")); + } + maximum_edition__ = map_.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + } + } + Ok(FeatureSetDefaults { + defaults: defaults__.unwrap_or_default(), + minimum_edition: minimum_edition__, + maximum_edition: maximum_edition__, + }) + } + } + deserializer.deserialize_struct("google.protobuf.FeatureSetDefaults", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for feature_set_defaults::FeatureSetEditionDefault { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault", len)?; + if let Some(v) = self.edition.as_ref() { + let v = Edition::try_from(*v) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("edition", &v)?; + } + if let Some(v) = self.overridable_features.as_ref() { + struct_ser.serialize_field("overridableFeatures", v)?; + } + if let Some(v) = self.fixed_features.as_ref() { + struct_ser.serialize_field("fixedFeatures", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for feature_set_defaults::FeatureSetEditionDefault { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "edition", + "overridable_features", + "overridableFeatures", + "fixed_features", + "fixedFeatures", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Edition, + OverridableFeatures, + FixedFeatures, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "edition" => Ok(GeneratedField::Edition), + "overridableFeatures" | "overridable_features" => Ok(GeneratedField::OverridableFeatures), + "fixedFeatures" | "fixed_features" => Ok(GeneratedField::FixedFeatures), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = feature_set_defaults::FeatureSetEditionDefault; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut edition__ = None; + let mut overridable_features__ = None; + let mut fixed_features__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Edition => { + if edition__.is_some() { + return Err(serde::de::Error::duplicate_field("edition")); + } + edition__ = map_.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + GeneratedField::OverridableFeatures => { + if overridable_features__.is_some() { + return Err(serde::de::Error::duplicate_field("overridableFeatures")); + } + overridable_features__ = map_.next_value()?; + } + GeneratedField::FixedFeatures => { + if fixed_features__.is_some() { + return Err(serde::de::Error::duplicate_field("fixedFeatures")); + } + fixed_features__ = map_.next_value()?; + } + } + } + Ok(feature_set_defaults::FeatureSetEditionDefault { + edition: edition__, + overridable_features: overridable_features__, + fixed_features: fixed_features__, + }) + } + } + deserializer.deserialize_struct("google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for FieldDescriptorProto { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.FieldDescriptorProto", len)?; + if let Some(v) = self.name.as_ref() { + struct_ser.serialize_field("name", v)?; + } + if let Some(v) = self.number.as_ref() { + struct_ser.serialize_field("number", v)?; + } + if let Some(v) = self.label.as_ref() { + let v = field_descriptor_proto::Label::try_from(*v) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("label", &v)?; + } + if let Some(v) = self.r#type.as_ref() { + let v = field_descriptor_proto::Type::try_from(*v) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("type", &v)?; + } + if let Some(v) = self.type_name.as_ref() { + struct_ser.serialize_field("typeName", v)?; + } + if let Some(v) = self.extendee.as_ref() { + struct_ser.serialize_field("extendee", v)?; + } + if let Some(v) = self.default_value.as_ref() { + struct_ser.serialize_field("defaultValue", v)?; + } + if let Some(v) = self.oneof_index.as_ref() { + struct_ser.serialize_field("oneofIndex", v)?; + } + if let Some(v) = self.json_name.as_ref() { + struct_ser.serialize_field("jsonName", v)?; + } + if let Some(v) = self.options.as_ref() { + struct_ser.serialize_field("options", v)?; + } + if let Some(v) = self.proto3_optional.as_ref() { + struct_ser.serialize_field("proto3Optional", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for FieldDescriptorProto { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "name", + "number", + "label", + "type", + "type_name", + "typeName", + "extendee", + "default_value", + "defaultValue", + "oneof_index", + "oneofIndex", + "json_name", + "jsonName", + "options", + "proto3_optional", + "proto3Optional", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Number, + Label, + Type, + TypeName, + Extendee, + DefaultValue, + OneofIndex, + JsonName, + Options, + Proto3Optional, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + "number" => Ok(GeneratedField::Number), + "label" => Ok(GeneratedField::Label), + "type" => Ok(GeneratedField::Type), + "typeName" | "type_name" => Ok(GeneratedField::TypeName), + "extendee" => Ok(GeneratedField::Extendee), + "defaultValue" | "default_value" => Ok(GeneratedField::DefaultValue), + "oneofIndex" | "oneof_index" => Ok(GeneratedField::OneofIndex), + "jsonName" | "json_name" => Ok(GeneratedField::JsonName), + "options" => Ok(GeneratedField::Options), + "proto3Optional" | "proto3_optional" => Ok(GeneratedField::Proto3Optional), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = FieldDescriptorProto; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.FieldDescriptorProto") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut number__ = None; + let mut label__ = None; + let mut r#type__ = None; + let mut type_name__ = None; + let mut extendee__ = None; + let mut default_value__ = None; + let mut oneof_index__ = None; + let mut json_name__ = None; + let mut options__ = None; + let mut proto3_optional__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); + } + name__ = map_.next_value()?; + } + GeneratedField::Number => { + if number__.is_some() { + return Err(serde::de::Error::duplicate_field("number")); + } + number__ = + map_.next_value::<::core::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0) + ; + } + GeneratedField::Label => { + if label__.is_some() { + return Err(serde::de::Error::duplicate_field("label")); + } + label__ = map_.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + GeneratedField::Type => { + if r#type__.is_some() { + return Err(serde::de::Error::duplicate_field("type")); + } + r#type__ = map_.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + GeneratedField::TypeName => { + if type_name__.is_some() { + return Err(serde::de::Error::duplicate_field("typeName")); + } + type_name__ = map_.next_value()?; + } + GeneratedField::Extendee => { + if extendee__.is_some() { + return Err(serde::de::Error::duplicate_field("extendee")); + } + extendee__ = map_.next_value()?; + } + GeneratedField::DefaultValue => { + if default_value__.is_some() { + return Err(serde::de::Error::duplicate_field("defaultValue")); + } + default_value__ = map_.next_value()?; + } + GeneratedField::OneofIndex => { + if oneof_index__.is_some() { + return Err(serde::de::Error::duplicate_field("oneofIndex")); + } + oneof_index__ = + map_.next_value::<::core::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0) + ; + } + GeneratedField::JsonName => { + if json_name__.is_some() { + return Err(serde::de::Error::duplicate_field("jsonName")); + } + json_name__ = map_.next_value()?; + } + GeneratedField::Options => { + if options__.is_some() { + return Err(serde::de::Error::duplicate_field("options")); + } + options__ = map_.next_value()?; + } + GeneratedField::Proto3Optional => { + if proto3_optional__.is_some() { + return Err(serde::de::Error::duplicate_field("proto3Optional")); + } + proto3_optional__ = map_.next_value()?; + } + } + } + Ok(FieldDescriptorProto { + name: name__, + number: number__, + label: label__, + r#type: r#type__, + type_name: type_name__, + extendee: extendee__, + default_value: default_value__, + oneof_index: oneof_index__, + json_name: json_name__, + options: options__, + proto3_optional: proto3_optional__, + }) + } + } + deserializer.deserialize_struct("google.protobuf.FieldDescriptorProto", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for field_descriptor_proto::Label { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Optional => "LABEL_OPTIONAL", + Self::Repeated => "LABEL_REPEATED", + Self::Required => "LABEL_REQUIRED", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for field_descriptor_proto::Label { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "LABEL_OPTIONAL", + "LABEL_REPEATED", + "LABEL_REQUIRED", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = field_descriptor_proto::Label; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "LABEL_OPTIONAL" => Ok(field_descriptor_proto::Label::Optional), + "LABEL_REPEATED" => Ok(field_descriptor_proto::Label::Repeated), + "LABEL_REQUIRED" => Ok(field_descriptor_proto::Label::Required), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for field_descriptor_proto::Type { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Double => "TYPE_DOUBLE", + Self::Float => "TYPE_FLOAT", + Self::Int64 => "TYPE_INT64", + Self::Uint64 => "TYPE_UINT64", + Self::Int32 => "TYPE_INT32", + Self::Fixed64 => "TYPE_FIXED64", + Self::Fixed32 => "TYPE_FIXED32", + Self::Bool => "TYPE_BOOL", + Self::String => "TYPE_STRING", + Self::Group => "TYPE_GROUP", + Self::Message => "TYPE_MESSAGE", + Self::Bytes => "TYPE_BYTES", + Self::Uint32 => "TYPE_UINT32", + Self::Enum => "TYPE_ENUM", + Self::Sfixed32 => "TYPE_SFIXED32", + Self::Sfixed64 => "TYPE_SFIXED64", + Self::Sint32 => "TYPE_SINT32", + Self::Sint64 => "TYPE_SINT64", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for field_descriptor_proto::Type { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "TYPE_DOUBLE", + "TYPE_FLOAT", + "TYPE_INT64", + "TYPE_UINT64", + "TYPE_INT32", + "TYPE_FIXED64", + "TYPE_FIXED32", + "TYPE_BOOL", + "TYPE_STRING", + "TYPE_GROUP", + "TYPE_MESSAGE", + "TYPE_BYTES", + "TYPE_UINT32", + "TYPE_ENUM", + "TYPE_SFIXED32", + "TYPE_SFIXED64", + "TYPE_SINT32", + "TYPE_SINT64", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = field_descriptor_proto::Type; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "TYPE_DOUBLE" => Ok(field_descriptor_proto::Type::Double), + "TYPE_FLOAT" => Ok(field_descriptor_proto::Type::Float), + "TYPE_INT64" => Ok(field_descriptor_proto::Type::Int64), + "TYPE_UINT64" => Ok(field_descriptor_proto::Type::Uint64), + "TYPE_INT32" => Ok(field_descriptor_proto::Type::Int32), + "TYPE_FIXED64" => Ok(field_descriptor_proto::Type::Fixed64), + "TYPE_FIXED32" => Ok(field_descriptor_proto::Type::Fixed32), + "TYPE_BOOL" => Ok(field_descriptor_proto::Type::Bool), + "TYPE_STRING" => Ok(field_descriptor_proto::Type::String), + "TYPE_GROUP" => Ok(field_descriptor_proto::Type::Group), + "TYPE_MESSAGE" => Ok(field_descriptor_proto::Type::Message), + "TYPE_BYTES" => Ok(field_descriptor_proto::Type::Bytes), + "TYPE_UINT32" => Ok(field_descriptor_proto::Type::Uint32), + "TYPE_ENUM" => Ok(field_descriptor_proto::Type::Enum), + "TYPE_SFIXED32" => Ok(field_descriptor_proto::Type::Sfixed32), + "TYPE_SFIXED64" => Ok(field_descriptor_proto::Type::Sfixed64), + "TYPE_SINT32" => Ok(field_descriptor_proto::Type::Sint32), + "TYPE_SINT64" => Ok(field_descriptor_proto::Type::Sint64), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for FieldOptions { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.FieldOptions", len)?; + if let Some(v) = self.ctype.as_ref() { + let v = field_options::CType::try_from(*v) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("ctype", &v)?; + } + if let Some(v) = self.packed.as_ref() { + struct_ser.serialize_field("packed", v)?; + } + if let Some(v) = self.jstype.as_ref() { + let v = field_options::JsType::try_from(*v) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("jstype", &v)?; + } + if let Some(v) = self.lazy.as_ref() { + struct_ser.serialize_field("lazy", v)?; + } + if let Some(v) = self.unverified_lazy.as_ref() { + struct_ser.serialize_field("unverifiedLazy", v)?; + } + if let Some(v) = self.deprecated.as_ref() { + struct_ser.serialize_field("deprecated", v)?; + } + if let Some(v) = self.weak.as_ref() { + struct_ser.serialize_field("weak", v)?; + } + if let Some(v) = self.debug_redact.as_ref() { + struct_ser.serialize_field("debugRedact", v)?; + } + if let Some(v) = self.retention.as_ref() { + let v = field_options::OptionRetention::try_from(*v) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("retention", &v)?; + } + if true { + let v = self.targets.iter().cloned().map(|v| { + field_options::OptionTargetType::try_from(v) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", v))) + }).collect::, _>>()?; + struct_ser.serialize_field("targets", &v)?; + } + if true { + struct_ser.serialize_field("editionDefaults", &self.edition_defaults)?; + } + if let Some(v) = self.features.as_ref() { + struct_ser.serialize_field("features", v)?; + } + if let Some(v) = self.feature_support.as_ref() { + struct_ser.serialize_field("featureSupport", v)?; + } + if true { + struct_ser.serialize_field("uninterpretedOption", &self.uninterpreted_option)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for FieldOptions { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "ctype", + "packed", + "jstype", + "lazy", + "unverified_lazy", + "unverifiedLazy", + "deprecated", + "weak", + "debug_redact", + "debugRedact", + "retention", + "targets", + "edition_defaults", + "editionDefaults", + "features", + "feature_support", + "featureSupport", + "uninterpreted_option", + "uninterpretedOption", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Ctype, + Packed, + Jstype, + Lazy, + UnverifiedLazy, + Deprecated, + Weak, + DebugRedact, + Retention, + Targets, + EditionDefaults, + Features, + FeatureSupport, + UninterpretedOption, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "ctype" => Ok(GeneratedField::Ctype), + "packed" => Ok(GeneratedField::Packed), + "jstype" => Ok(GeneratedField::Jstype), + "lazy" => Ok(GeneratedField::Lazy), + "unverifiedLazy" | "unverified_lazy" => Ok(GeneratedField::UnverifiedLazy), + "deprecated" => Ok(GeneratedField::Deprecated), + "weak" => Ok(GeneratedField::Weak), + "debugRedact" | "debug_redact" => Ok(GeneratedField::DebugRedact), + "retention" => Ok(GeneratedField::Retention), + "targets" => Ok(GeneratedField::Targets), + "editionDefaults" | "edition_defaults" => Ok(GeneratedField::EditionDefaults), + "features" => Ok(GeneratedField::Features), + "featureSupport" | "feature_support" => Ok(GeneratedField::FeatureSupport), + "uninterpretedOption" | "uninterpreted_option" => Ok(GeneratedField::UninterpretedOption), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = FieldOptions; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.FieldOptions") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut ctype__ = None; + let mut packed__ = None; + let mut jstype__ = None; + let mut lazy__ = None; + let mut unverified_lazy__ = None; + let mut deprecated__ = None; + let mut weak__ = None; + let mut debug_redact__ = None; + let mut retention__ = None; + let mut targets__ = None; + let mut edition_defaults__ = None; + let mut features__ = None; + let mut feature_support__ = None; + let mut uninterpreted_option__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Ctype => { + if ctype__.is_some() { + return Err(serde::de::Error::duplicate_field("ctype")); + } + ctype__ = map_.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + GeneratedField::Packed => { + if packed__.is_some() { + return Err(serde::de::Error::duplicate_field("packed")); + } + packed__ = map_.next_value()?; + } + GeneratedField::Jstype => { + if jstype__.is_some() { + return Err(serde::de::Error::duplicate_field("jstype")); + } + jstype__ = map_.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + GeneratedField::Lazy => { + if lazy__.is_some() { + return Err(serde::de::Error::duplicate_field("lazy")); + } + lazy__ = map_.next_value()?; + } + GeneratedField::UnverifiedLazy => { + if unverified_lazy__.is_some() { + return Err(serde::de::Error::duplicate_field("unverifiedLazy")); + } + unverified_lazy__ = map_.next_value()?; + } + GeneratedField::Deprecated => { + if deprecated__.is_some() { + return Err(serde::de::Error::duplicate_field("deprecated")); + } + deprecated__ = map_.next_value()?; + } + GeneratedField::Weak => { + if weak__.is_some() { + return Err(serde::de::Error::duplicate_field("weak")); + } + weak__ = map_.next_value()?; + } + GeneratedField::DebugRedact => { + if debug_redact__.is_some() { + return Err(serde::de::Error::duplicate_field("debugRedact")); + } + debug_redact__ = map_.next_value()?; + } + GeneratedField::Retention => { + if retention__.is_some() { + return Err(serde::de::Error::duplicate_field("retention")); + } + retention__ = map_.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + GeneratedField::Targets => { + if targets__.is_some() { + return Err(serde::de::Error::duplicate_field("targets")); + } + targets__ = Some(map_.next_value::<::alloc::vec::Vec>()?.into_iter().map(|x| x as i32).collect()); + } + GeneratedField::EditionDefaults => { + if edition_defaults__.is_some() { + return Err(serde::de::Error::duplicate_field("editionDefaults")); + } + edition_defaults__ = Some(map_.next_value()?); + } + GeneratedField::Features => { + if features__.is_some() { + return Err(serde::de::Error::duplicate_field("features")); + } + features__ = map_.next_value()?; + } + GeneratedField::FeatureSupport => { + if feature_support__.is_some() { + return Err(serde::de::Error::duplicate_field("featureSupport")); + } + feature_support__ = map_.next_value()?; + } + GeneratedField::UninterpretedOption => { + if uninterpreted_option__.is_some() { + return Err(serde::de::Error::duplicate_field("uninterpretedOption")); + } + uninterpreted_option__ = Some(map_.next_value()?); + } + } + } + Ok(FieldOptions { + ctype: ctype__, + packed: packed__, + jstype: jstype__, + lazy: lazy__, + unverified_lazy: unverified_lazy__, + deprecated: deprecated__, + weak: weak__, + debug_redact: debug_redact__, + retention: retention__, + targets: targets__.unwrap_or_default(), + edition_defaults: edition_defaults__.unwrap_or_default(), + features: features__, + feature_support: feature_support__, + uninterpreted_option: uninterpreted_option__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("google.protobuf.FieldOptions", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for field_options::CType { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::String => "STRING", + Self::Cord => "CORD", + Self::StringPiece => "STRING_PIECE", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for field_options::CType { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "STRING", + "CORD", + "STRING_PIECE", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = field_options::CType; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "STRING" => Ok(field_options::CType::String), + "CORD" => Ok(field_options::CType::Cord), + "STRING_PIECE" => Ok(field_options::CType::StringPiece), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for field_options::EditionDefault { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.FieldOptions.EditionDefault", len)?; + if let Some(v) = self.edition.as_ref() { + let v = Edition::try_from(*v) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("edition", &v)?; + } + if let Some(v) = self.value.as_ref() { + struct_ser.serialize_field("value", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for field_options::EditionDefault { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "edition", + "value", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Edition, + Value, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "edition" => Ok(GeneratedField::Edition), + "value" => Ok(GeneratedField::Value), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = field_options::EditionDefault; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.FieldOptions.EditionDefault") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut edition__ = None; + let mut value__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Edition => { + if edition__.is_some() { + return Err(serde::de::Error::duplicate_field("edition")); + } + edition__ = map_.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + GeneratedField::Value => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("value")); + } + value__ = map_.next_value()?; + } + } + } + Ok(field_options::EditionDefault { + edition: edition__, + value: value__, + }) + } + } + deserializer.deserialize_struct("google.protobuf.FieldOptions.EditionDefault", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for field_options::FeatureSupport { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.FieldOptions.FeatureSupport", len)?; + if let Some(v) = self.edition_introduced.as_ref() { + let v = Edition::try_from(*v) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("editionIntroduced", &v)?; + } + if let Some(v) = self.edition_deprecated.as_ref() { + let v = Edition::try_from(*v) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("editionDeprecated", &v)?; + } + if let Some(v) = self.deprecation_warning.as_ref() { + struct_ser.serialize_field("deprecationWarning", v)?; + } + if let Some(v) = self.edition_removed.as_ref() { + let v = Edition::try_from(*v) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("editionRemoved", &v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for field_options::FeatureSupport { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "edition_introduced", + "editionIntroduced", + "edition_deprecated", + "editionDeprecated", + "deprecation_warning", + "deprecationWarning", + "edition_removed", + "editionRemoved", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + EditionIntroduced, + EditionDeprecated, + DeprecationWarning, + EditionRemoved, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "editionIntroduced" | "edition_introduced" => Ok(GeneratedField::EditionIntroduced), + "editionDeprecated" | "edition_deprecated" => Ok(GeneratedField::EditionDeprecated), + "deprecationWarning" | "deprecation_warning" => Ok(GeneratedField::DeprecationWarning), + "editionRemoved" | "edition_removed" => Ok(GeneratedField::EditionRemoved), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = field_options::FeatureSupport; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.FieldOptions.FeatureSupport") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut edition_introduced__ = None; + let mut edition_deprecated__ = None; + let mut deprecation_warning__ = None; + let mut edition_removed__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::EditionIntroduced => { + if edition_introduced__.is_some() { + return Err(serde::de::Error::duplicate_field("editionIntroduced")); + } + edition_introduced__ = map_.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + GeneratedField::EditionDeprecated => { + if edition_deprecated__.is_some() { + return Err(serde::de::Error::duplicate_field("editionDeprecated")); + } + edition_deprecated__ = map_.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + GeneratedField::DeprecationWarning => { + if deprecation_warning__.is_some() { + return Err(serde::de::Error::duplicate_field("deprecationWarning")); + } + deprecation_warning__ = map_.next_value()?; + } + GeneratedField::EditionRemoved => { + if edition_removed__.is_some() { + return Err(serde::de::Error::duplicate_field("editionRemoved")); + } + edition_removed__ = map_.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + } + } + Ok(field_options::FeatureSupport { + edition_introduced: edition_introduced__, + edition_deprecated: edition_deprecated__, + deprecation_warning: deprecation_warning__, + edition_removed: edition_removed__, + }) + } + } + deserializer.deserialize_struct("google.protobuf.FieldOptions.FeatureSupport", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for field_options::JsType { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::JsNormal => "JS_NORMAL", + Self::JsString => "JS_STRING", + Self::JsNumber => "JS_NUMBER", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for field_options::JsType { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "JS_NORMAL", + "JS_STRING", + "JS_NUMBER", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = field_options::JsType; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "JS_NORMAL" => Ok(field_options::JsType::JsNormal), + "JS_STRING" => Ok(field_options::JsType::JsString), + "JS_NUMBER" => Ok(field_options::JsType::JsNumber), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for field_options::OptionRetention { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::RetentionUnknown => "RETENTION_UNKNOWN", + Self::RetentionRuntime => "RETENTION_RUNTIME", + Self::RetentionSource => "RETENTION_SOURCE", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for field_options::OptionRetention { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "RETENTION_UNKNOWN", + "RETENTION_RUNTIME", + "RETENTION_SOURCE", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = field_options::OptionRetention; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "RETENTION_UNKNOWN" => Ok(field_options::OptionRetention::RetentionUnknown), + "RETENTION_RUNTIME" => Ok(field_options::OptionRetention::RetentionRuntime), + "RETENTION_SOURCE" => Ok(field_options::OptionRetention::RetentionSource), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for field_options::OptionTargetType { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::TargetTypeUnknown => "TARGET_TYPE_UNKNOWN", + Self::TargetTypeFile => "TARGET_TYPE_FILE", + Self::TargetTypeExtensionRange => "TARGET_TYPE_EXTENSION_RANGE", + Self::TargetTypeMessage => "TARGET_TYPE_MESSAGE", + Self::TargetTypeField => "TARGET_TYPE_FIELD", + Self::TargetTypeOneof => "TARGET_TYPE_ONEOF", + Self::TargetTypeEnum => "TARGET_TYPE_ENUM", + Self::TargetTypeEnumEntry => "TARGET_TYPE_ENUM_ENTRY", + Self::TargetTypeService => "TARGET_TYPE_SERVICE", + Self::TargetTypeMethod => "TARGET_TYPE_METHOD", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for field_options::OptionTargetType { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "TARGET_TYPE_UNKNOWN", + "TARGET_TYPE_FILE", + "TARGET_TYPE_EXTENSION_RANGE", + "TARGET_TYPE_MESSAGE", + "TARGET_TYPE_FIELD", + "TARGET_TYPE_ONEOF", + "TARGET_TYPE_ENUM", + "TARGET_TYPE_ENUM_ENTRY", + "TARGET_TYPE_SERVICE", + "TARGET_TYPE_METHOD", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = field_options::OptionTargetType; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "TARGET_TYPE_UNKNOWN" => Ok(field_options::OptionTargetType::TargetTypeUnknown), + "TARGET_TYPE_FILE" => Ok(field_options::OptionTargetType::TargetTypeFile), + "TARGET_TYPE_EXTENSION_RANGE" => Ok(field_options::OptionTargetType::TargetTypeExtensionRange), + "TARGET_TYPE_MESSAGE" => Ok(field_options::OptionTargetType::TargetTypeMessage), + "TARGET_TYPE_FIELD" => Ok(field_options::OptionTargetType::TargetTypeField), + "TARGET_TYPE_ONEOF" => Ok(field_options::OptionTargetType::TargetTypeOneof), + "TARGET_TYPE_ENUM" => Ok(field_options::OptionTargetType::TargetTypeEnum), + "TARGET_TYPE_ENUM_ENTRY" => Ok(field_options::OptionTargetType::TargetTypeEnumEntry), + "TARGET_TYPE_SERVICE" => Ok(field_options::OptionTargetType::TargetTypeService), + "TARGET_TYPE_METHOD" => Ok(field_options::OptionTargetType::TargetTypeMethod), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for FileDescriptorProto { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.FileDescriptorProto", len)?; + if let Some(v) = self.name.as_ref() { + struct_ser.serialize_field("name", v)?; + } + if let Some(v) = self.package.as_ref() { + struct_ser.serialize_field("package", v)?; + } + if true { + struct_ser.serialize_field("dependency", &self.dependency)?; + } + if true { + struct_ser.serialize_field("publicDependency", &self.public_dependency)?; + } + if true { + struct_ser.serialize_field("weakDependency", &self.weak_dependency)?; + } + if true { + struct_ser.serialize_field("messageType", &self.message_type)?; + } + if true { + struct_ser.serialize_field("enumType", &self.enum_type)?; + } + if true { + struct_ser.serialize_field("service", &self.service)?; + } + if true { + struct_ser.serialize_field("extension", &self.extension)?; + } + if let Some(v) = self.options.as_ref() { + struct_ser.serialize_field("options", v)?; + } + if let Some(v) = self.source_code_info.as_ref() { + struct_ser.serialize_field("sourceCodeInfo", v)?; + } + if let Some(v) = self.syntax.as_ref() { + struct_ser.serialize_field("syntax", v)?; + } + if let Some(v) = self.edition.as_ref() { + let v = Edition::try_from(*v) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("edition", &v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for FileDescriptorProto { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "name", + "package", + "dependency", + "public_dependency", + "publicDependency", + "weak_dependency", + "weakDependency", + "message_type", + "messageType", + "enum_type", + "enumType", + "service", + "extension", + "options", + "source_code_info", + "sourceCodeInfo", + "syntax", + "edition", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Package, + Dependency, + PublicDependency, + WeakDependency, + MessageType, + EnumType, + Service, + Extension, + Options, + SourceCodeInfo, + Syntax, + Edition, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + "package" => Ok(GeneratedField::Package), + "dependency" => Ok(GeneratedField::Dependency), + "publicDependency" | "public_dependency" => Ok(GeneratedField::PublicDependency), + "weakDependency" | "weak_dependency" => Ok(GeneratedField::WeakDependency), + "messageType" | "message_type" => Ok(GeneratedField::MessageType), + "enumType" | "enum_type" => Ok(GeneratedField::EnumType), + "service" => Ok(GeneratedField::Service), + "extension" => Ok(GeneratedField::Extension), + "options" => Ok(GeneratedField::Options), + "sourceCodeInfo" | "source_code_info" => Ok(GeneratedField::SourceCodeInfo), + "syntax" => Ok(GeneratedField::Syntax), + "edition" => Ok(GeneratedField::Edition), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = FileDescriptorProto; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.FileDescriptorProto") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut package__ = None; + let mut dependency__ = None; + let mut public_dependency__ = None; + let mut weak_dependency__ = None; + let mut message_type__ = None; + let mut enum_type__ = None; + let mut service__ = None; + let mut extension__ = None; + let mut options__ = None; + let mut source_code_info__ = None; + let mut syntax__ = None; + let mut edition__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); + } + name__ = map_.next_value()?; + } + GeneratedField::Package => { + if package__.is_some() { + return Err(serde::de::Error::duplicate_field("package")); + } + package__ = map_.next_value()?; + } + GeneratedField::Dependency => { + if dependency__.is_some() { + return Err(serde::de::Error::duplicate_field("dependency")); + } + dependency__ = Some(map_.next_value()?); + } + GeneratedField::PublicDependency => { + if public_dependency__.is_some() { + return Err(serde::de::Error::duplicate_field("publicDependency")); + } + public_dependency__ = + Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::NumberDeserialize<_>>>()? + .into_iter().map(|x| x.0).collect()) + ; + } + GeneratedField::WeakDependency => { + if weak_dependency__.is_some() { + return Err(serde::de::Error::duplicate_field("weakDependency")); + } + weak_dependency__ = + Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::NumberDeserialize<_>>>()? + .into_iter().map(|x| x.0).collect()) + ; + } + GeneratedField::MessageType => { + if message_type__.is_some() { + return Err(serde::de::Error::duplicate_field("messageType")); + } + message_type__ = Some(map_.next_value()?); + } + GeneratedField::EnumType => { + if enum_type__.is_some() { + return Err(serde::de::Error::duplicate_field("enumType")); + } + enum_type__ = Some(map_.next_value()?); + } + GeneratedField::Service => { + if service__.is_some() { + return Err(serde::de::Error::duplicate_field("service")); + } + service__ = Some(map_.next_value()?); + } + GeneratedField::Extension => { + if extension__.is_some() { + return Err(serde::de::Error::duplicate_field("extension")); + } + extension__ = Some(map_.next_value()?); + } + GeneratedField::Options => { + if options__.is_some() { + return Err(serde::de::Error::duplicate_field("options")); + } + options__ = map_.next_value()?; + } + GeneratedField::SourceCodeInfo => { + if source_code_info__.is_some() { + return Err(serde::de::Error::duplicate_field("sourceCodeInfo")); + } + source_code_info__ = map_.next_value()?; + } + GeneratedField::Syntax => { + if syntax__.is_some() { + return Err(serde::de::Error::duplicate_field("syntax")); + } + syntax__ = map_.next_value()?; + } + GeneratedField::Edition => { + if edition__.is_some() { + return Err(serde::de::Error::duplicate_field("edition")); + } + edition__ = map_.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + } + } + Ok(FileDescriptorProto { + name: name__, + package: package__, + dependency: dependency__.unwrap_or_default(), + public_dependency: public_dependency__.unwrap_or_default(), + weak_dependency: weak_dependency__.unwrap_or_default(), + message_type: message_type__.unwrap_or_default(), + enum_type: enum_type__.unwrap_or_default(), + service: service__.unwrap_or_default(), + extension: extension__.unwrap_or_default(), + options: options__, + source_code_info: source_code_info__, + syntax: syntax__, + edition: edition__, + }) + } + } + deserializer.deserialize_struct("google.protobuf.FileDescriptorProto", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for FileDescriptorSet { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.FileDescriptorSet", len)?; + if true { + struct_ser.serialize_field("file", &self.file)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for FileDescriptorSet { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "file", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + File, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "file" => Ok(GeneratedField::File), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = FileDescriptorSet; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.FileDescriptorSet") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut file__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::File => { + if file__.is_some() { + return Err(serde::de::Error::duplicate_field("file")); + } + file__ = Some(map_.next_value()?); + } + } + } + Ok(FileDescriptorSet { + file: file__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("google.protobuf.FileDescriptorSet", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for FileOptions { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.FileOptions", len)?; + if let Some(v) = self.java_package.as_ref() { + struct_ser.serialize_field("javaPackage", v)?; + } + if let Some(v) = self.java_outer_classname.as_ref() { + struct_ser.serialize_field("javaOuterClassname", v)?; + } + if let Some(v) = self.java_multiple_files.as_ref() { + struct_ser.serialize_field("javaMultipleFiles", v)?; + } + if let Some(v) = self.java_generate_equals_and_hash.as_ref() { + struct_ser.serialize_field("javaGenerateEqualsAndHash", v)?; + } + if let Some(v) = self.java_string_check_utf8.as_ref() { + struct_ser.serialize_field("javaStringCheckUtf8", v)?; + } + if let Some(v) = self.optimize_for.as_ref() { + let v = file_options::OptimizeMode::try_from(*v) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("optimizeFor", &v)?; + } + if let Some(v) = self.go_package.as_ref() { + struct_ser.serialize_field("goPackage", v)?; + } + if let Some(v) = self.cc_generic_services.as_ref() { + struct_ser.serialize_field("ccGenericServices", v)?; + } + if let Some(v) = self.java_generic_services.as_ref() { + struct_ser.serialize_field("javaGenericServices", v)?; + } + if let Some(v) = self.py_generic_services.as_ref() { + struct_ser.serialize_field("pyGenericServices", v)?; + } + if let Some(v) = self.deprecated.as_ref() { + struct_ser.serialize_field("deprecated", v)?; + } + if let Some(v) = self.cc_enable_arenas.as_ref() { + struct_ser.serialize_field("ccEnableArenas", v)?; + } + if let Some(v) = self.objc_class_prefix.as_ref() { + struct_ser.serialize_field("objcClassPrefix", v)?; + } + if let Some(v) = self.csharp_namespace.as_ref() { + struct_ser.serialize_field("csharpNamespace", v)?; + } + if let Some(v) = self.swift_prefix.as_ref() { + struct_ser.serialize_field("swiftPrefix", v)?; + } + if let Some(v) = self.php_class_prefix.as_ref() { + struct_ser.serialize_field("phpClassPrefix", v)?; + } + if let Some(v) = self.php_namespace.as_ref() { + struct_ser.serialize_field("phpNamespace", v)?; + } + if let Some(v) = self.php_metadata_namespace.as_ref() { + struct_ser.serialize_field("phpMetadataNamespace", v)?; + } + if let Some(v) = self.ruby_package.as_ref() { + struct_ser.serialize_field("rubyPackage", v)?; + } + if let Some(v) = self.features.as_ref() { + struct_ser.serialize_field("features", v)?; + } + if true { + struct_ser.serialize_field("uninterpretedOption", &self.uninterpreted_option)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for FileOptions { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "java_package", + "javaPackage", + "java_outer_classname", + "javaOuterClassname", + "java_multiple_files", + "javaMultipleFiles", + "java_generate_equals_and_hash", + "javaGenerateEqualsAndHash", + "java_string_check_utf8", + "javaStringCheckUtf8", + "optimize_for", + "optimizeFor", + "go_package", + "goPackage", + "cc_generic_services", + "ccGenericServices", + "java_generic_services", + "javaGenericServices", + "py_generic_services", + "pyGenericServices", + "deprecated", + "cc_enable_arenas", + "ccEnableArenas", + "objc_class_prefix", + "objcClassPrefix", + "csharp_namespace", + "csharpNamespace", + "swift_prefix", + "swiftPrefix", + "php_class_prefix", + "phpClassPrefix", + "php_namespace", + "phpNamespace", + "php_metadata_namespace", + "phpMetadataNamespace", + "ruby_package", + "rubyPackage", + "features", + "uninterpreted_option", + "uninterpretedOption", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + JavaPackage, + JavaOuterClassname, + JavaMultipleFiles, + JavaGenerateEqualsAndHash, + JavaStringCheckUtf8, + OptimizeFor, + GoPackage, + CcGenericServices, + JavaGenericServices, + PyGenericServices, + Deprecated, + CcEnableArenas, + ObjcClassPrefix, + CsharpNamespace, + SwiftPrefix, + PhpClassPrefix, + PhpNamespace, + PhpMetadataNamespace, + RubyPackage, + Features, + UninterpretedOption, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "javaPackage" | "java_package" => Ok(GeneratedField::JavaPackage), + "javaOuterClassname" | "java_outer_classname" => Ok(GeneratedField::JavaOuterClassname), + "javaMultipleFiles" | "java_multiple_files" => Ok(GeneratedField::JavaMultipleFiles), + "javaGenerateEqualsAndHash" | "java_generate_equals_and_hash" => Ok(GeneratedField::JavaGenerateEqualsAndHash), + "javaStringCheckUtf8" | "java_string_check_utf8" => Ok(GeneratedField::JavaStringCheckUtf8), + "optimizeFor" | "optimize_for" => Ok(GeneratedField::OptimizeFor), + "goPackage" | "go_package" => Ok(GeneratedField::GoPackage), + "ccGenericServices" | "cc_generic_services" => Ok(GeneratedField::CcGenericServices), + "javaGenericServices" | "java_generic_services" => Ok(GeneratedField::JavaGenericServices), + "pyGenericServices" | "py_generic_services" => Ok(GeneratedField::PyGenericServices), + "deprecated" => Ok(GeneratedField::Deprecated), + "ccEnableArenas" | "cc_enable_arenas" => Ok(GeneratedField::CcEnableArenas), + "objcClassPrefix" | "objc_class_prefix" => Ok(GeneratedField::ObjcClassPrefix), + "csharpNamespace" | "csharp_namespace" => Ok(GeneratedField::CsharpNamespace), + "swiftPrefix" | "swift_prefix" => Ok(GeneratedField::SwiftPrefix), + "phpClassPrefix" | "php_class_prefix" => Ok(GeneratedField::PhpClassPrefix), + "phpNamespace" | "php_namespace" => Ok(GeneratedField::PhpNamespace), + "phpMetadataNamespace" | "php_metadata_namespace" => Ok(GeneratedField::PhpMetadataNamespace), + "rubyPackage" | "ruby_package" => Ok(GeneratedField::RubyPackage), + "features" => Ok(GeneratedField::Features), + "uninterpretedOption" | "uninterpreted_option" => Ok(GeneratedField::UninterpretedOption), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = FileOptions; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.FileOptions") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut java_package__ = None; + let mut java_outer_classname__ = None; + let mut java_multiple_files__ = None; + let mut java_generate_equals_and_hash__ = None; + let mut java_string_check_utf8__ = None; + let mut optimize_for__ = None; + let mut go_package__ = None; + let mut cc_generic_services__ = None; + let mut java_generic_services__ = None; + let mut py_generic_services__ = None; + let mut deprecated__ = None; + let mut cc_enable_arenas__ = None; + let mut objc_class_prefix__ = None; + let mut csharp_namespace__ = None; + let mut swift_prefix__ = None; + let mut php_class_prefix__ = None; + let mut php_namespace__ = None; + let mut php_metadata_namespace__ = None; + let mut ruby_package__ = None; + let mut features__ = None; + let mut uninterpreted_option__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::JavaPackage => { + if java_package__.is_some() { + return Err(serde::de::Error::duplicate_field("javaPackage")); + } + java_package__ = map_.next_value()?; + } + GeneratedField::JavaOuterClassname => { + if java_outer_classname__.is_some() { + return Err(serde::de::Error::duplicate_field("javaOuterClassname")); + } + java_outer_classname__ = map_.next_value()?; + } + GeneratedField::JavaMultipleFiles => { + if java_multiple_files__.is_some() { + return Err(serde::de::Error::duplicate_field("javaMultipleFiles")); + } + java_multiple_files__ = map_.next_value()?; + } + GeneratedField::JavaGenerateEqualsAndHash => { + if java_generate_equals_and_hash__.is_some() { + return Err(serde::de::Error::duplicate_field("javaGenerateEqualsAndHash")); + } + java_generate_equals_and_hash__ = map_.next_value()?; + } + GeneratedField::JavaStringCheckUtf8 => { + if java_string_check_utf8__.is_some() { + return Err(serde::de::Error::duplicate_field("javaStringCheckUtf8")); + } + java_string_check_utf8__ = map_.next_value()?; + } + GeneratedField::OptimizeFor => { + if optimize_for__.is_some() { + return Err(serde::de::Error::duplicate_field("optimizeFor")); + } + optimize_for__ = map_.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + GeneratedField::GoPackage => { + if go_package__.is_some() { + return Err(serde::de::Error::duplicate_field("goPackage")); + } + go_package__ = map_.next_value()?; + } + GeneratedField::CcGenericServices => { + if cc_generic_services__.is_some() { + return Err(serde::de::Error::duplicate_field("ccGenericServices")); + } + cc_generic_services__ = map_.next_value()?; + } + GeneratedField::JavaGenericServices => { + if java_generic_services__.is_some() { + return Err(serde::de::Error::duplicate_field("javaGenericServices")); + } + java_generic_services__ = map_.next_value()?; + } + GeneratedField::PyGenericServices => { + if py_generic_services__.is_some() { + return Err(serde::de::Error::duplicate_field("pyGenericServices")); + } + py_generic_services__ = map_.next_value()?; + } + GeneratedField::Deprecated => { + if deprecated__.is_some() { + return Err(serde::de::Error::duplicate_field("deprecated")); + } + deprecated__ = map_.next_value()?; + } + GeneratedField::CcEnableArenas => { + if cc_enable_arenas__.is_some() { + return Err(serde::de::Error::duplicate_field("ccEnableArenas")); + } + cc_enable_arenas__ = map_.next_value()?; + } + GeneratedField::ObjcClassPrefix => { + if objc_class_prefix__.is_some() { + return Err(serde::de::Error::duplicate_field("objcClassPrefix")); + } + objc_class_prefix__ = map_.next_value()?; + } + GeneratedField::CsharpNamespace => { + if csharp_namespace__.is_some() { + return Err(serde::de::Error::duplicate_field("csharpNamespace")); + } + csharp_namespace__ = map_.next_value()?; + } + GeneratedField::SwiftPrefix => { + if swift_prefix__.is_some() { + return Err(serde::de::Error::duplicate_field("swiftPrefix")); + } + swift_prefix__ = map_.next_value()?; + } + GeneratedField::PhpClassPrefix => { + if php_class_prefix__.is_some() { + return Err(serde::de::Error::duplicate_field("phpClassPrefix")); + } + php_class_prefix__ = map_.next_value()?; + } + GeneratedField::PhpNamespace => { + if php_namespace__.is_some() { + return Err(serde::de::Error::duplicate_field("phpNamespace")); + } + php_namespace__ = map_.next_value()?; + } + GeneratedField::PhpMetadataNamespace => { + if php_metadata_namespace__.is_some() { + return Err(serde::de::Error::duplicate_field("phpMetadataNamespace")); + } + php_metadata_namespace__ = map_.next_value()?; + } + GeneratedField::RubyPackage => { + if ruby_package__.is_some() { + return Err(serde::de::Error::duplicate_field("rubyPackage")); + } + ruby_package__ = map_.next_value()?; + } + GeneratedField::Features => { + if features__.is_some() { + return Err(serde::de::Error::duplicate_field("features")); + } + features__ = map_.next_value()?; + } + GeneratedField::UninterpretedOption => { + if uninterpreted_option__.is_some() { + return Err(serde::de::Error::duplicate_field("uninterpretedOption")); + } + uninterpreted_option__ = Some(map_.next_value()?); + } + } + } + Ok(FileOptions { + java_package: java_package__, + java_outer_classname: java_outer_classname__, + java_multiple_files: java_multiple_files__, + java_generate_equals_and_hash: java_generate_equals_and_hash__, + java_string_check_utf8: java_string_check_utf8__, + optimize_for: optimize_for__, + go_package: go_package__, + cc_generic_services: cc_generic_services__, + java_generic_services: java_generic_services__, + py_generic_services: py_generic_services__, + deprecated: deprecated__, + cc_enable_arenas: cc_enable_arenas__, + objc_class_prefix: objc_class_prefix__, + csharp_namespace: csharp_namespace__, + swift_prefix: swift_prefix__, + php_class_prefix: php_class_prefix__, + php_namespace: php_namespace__, + php_metadata_namespace: php_metadata_namespace__, + ruby_package: ruby_package__, + features: features__, + uninterpreted_option: uninterpreted_option__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("google.protobuf.FileOptions", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for file_options::OptimizeMode { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Speed => "SPEED", + Self::CodeSize => "CODE_SIZE", + Self::LiteRuntime => "LITE_RUNTIME", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for file_options::OptimizeMode { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "SPEED", + "CODE_SIZE", + "LITE_RUNTIME", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = file_options::OptimizeMode; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "SPEED" => Ok(file_options::OptimizeMode::Speed), + "CODE_SIZE" => Ok(file_options::OptimizeMode::CodeSize), + "LITE_RUNTIME" => Ok(file_options::OptimizeMode::LiteRuntime), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for GeneratedCodeInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.GeneratedCodeInfo", len)?; + if true { + struct_ser.serialize_field("annotation", &self.annotation)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GeneratedCodeInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "annotation", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Annotation, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "annotation" => Ok(GeneratedField::Annotation), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedCodeInfo; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.GeneratedCodeInfo") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut annotation__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Annotation => { + if annotation__.is_some() { + return Err(serde::de::Error::duplicate_field("annotation")); + } + annotation__ = Some(map_.next_value()?); + } + } + } + Ok(GeneratedCodeInfo { + annotation: annotation__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("google.protobuf.GeneratedCodeInfo", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for generated_code_info::Annotation { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.GeneratedCodeInfo.Annotation", len)?; + if true { + struct_ser.serialize_field("path", &self.path)?; + } + if let Some(v) = self.source_file.as_ref() { + struct_ser.serialize_field("sourceFile", v)?; + } + if let Some(v) = self.begin.as_ref() { + struct_ser.serialize_field("begin", v)?; + } + if let Some(v) = self.end.as_ref() { + struct_ser.serialize_field("end", v)?; + } + if let Some(v) = self.semantic.as_ref() { + let v = generated_code_info::annotation::Semantic::try_from(*v) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("semantic", &v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for generated_code_info::Annotation { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "path", + "source_file", + "sourceFile", + "begin", + "end", + "semantic", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Path, + SourceFile, + Begin, + End, + Semantic, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "path" => Ok(GeneratedField::Path), + "sourceFile" | "source_file" => Ok(GeneratedField::SourceFile), + "begin" => Ok(GeneratedField::Begin), + "end" => Ok(GeneratedField::End), + "semantic" => Ok(GeneratedField::Semantic), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = generated_code_info::Annotation; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.GeneratedCodeInfo.Annotation") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut path__ = None; + let mut source_file__ = None; + let mut begin__ = None; + let mut end__ = None; + let mut semantic__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Path => { + if path__.is_some() { + return Err(serde::de::Error::duplicate_field("path")); + } + path__ = + Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::NumberDeserialize<_>>>()? + .into_iter().map(|x| x.0).collect()) + ; + } + GeneratedField::SourceFile => { + if source_file__.is_some() { + return Err(serde::de::Error::duplicate_field("sourceFile")); + } + source_file__ = map_.next_value()?; + } + GeneratedField::Begin => { + if begin__.is_some() { + return Err(serde::de::Error::duplicate_field("begin")); + } + begin__ = + map_.next_value::<::core::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0) + ; + } + GeneratedField::End => { + if end__.is_some() { + return Err(serde::de::Error::duplicate_field("end")); + } + end__ = + map_.next_value::<::core::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0) + ; + } + GeneratedField::Semantic => { + if semantic__.is_some() { + return Err(serde::de::Error::duplicate_field("semantic")); + } + semantic__ = map_.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + } + } + Ok(generated_code_info::Annotation { + path: path__.unwrap_or_default(), + source_file: source_file__, + begin: begin__, + end: end__, + semantic: semantic__, + }) + } + } + deserializer.deserialize_struct("google.protobuf.GeneratedCodeInfo.Annotation", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for generated_code_info::annotation::Semantic { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::None => "NONE", + Self::Set => "SET", + Self::Alias => "ALIAS", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for generated_code_info::annotation::Semantic { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "NONE", + "SET", + "ALIAS", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = generated_code_info::annotation::Semantic; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "NONE" => Ok(generated_code_info::annotation::Semantic::None), + "SET" => Ok(generated_code_info::annotation::Semantic::Set), + "ALIAS" => Ok(generated_code_info::annotation::Semantic::Alias), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for MessageOptions { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.MessageOptions", len)?; + if let Some(v) = self.message_set_wire_format.as_ref() { + struct_ser.serialize_field("messageSetWireFormat", v)?; + } + if let Some(v) = self.no_standard_descriptor_accessor.as_ref() { + struct_ser.serialize_field("noStandardDescriptorAccessor", v)?; + } + if let Some(v) = self.deprecated.as_ref() { + struct_ser.serialize_field("deprecated", v)?; + } + if let Some(v) = self.map_entry.as_ref() { + struct_ser.serialize_field("mapEntry", v)?; + } + if let Some(v) = self.deprecated_legacy_json_field_conflicts.as_ref() { + struct_ser.serialize_field("deprecatedLegacyJsonFieldConflicts", v)?; + } + if let Some(v) = self.features.as_ref() { + struct_ser.serialize_field("features", v)?; + } + if true { + struct_ser.serialize_field("uninterpretedOption", &self.uninterpreted_option)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MessageOptions { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "message_set_wire_format", + "messageSetWireFormat", + "no_standard_descriptor_accessor", + "noStandardDescriptorAccessor", + "deprecated", + "map_entry", + "mapEntry", + "deprecated_legacy_json_field_conflicts", + "deprecatedLegacyJsonFieldConflicts", + "features", + "uninterpreted_option", + "uninterpretedOption", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + MessageSetWireFormat, + NoStandardDescriptorAccessor, + Deprecated, + MapEntry, + DeprecatedLegacyJsonFieldConflicts, + Features, + UninterpretedOption, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "messageSetWireFormat" | "message_set_wire_format" => Ok(GeneratedField::MessageSetWireFormat), + "noStandardDescriptorAccessor" | "no_standard_descriptor_accessor" => Ok(GeneratedField::NoStandardDescriptorAccessor), + "deprecated" => Ok(GeneratedField::Deprecated), + "mapEntry" | "map_entry" => Ok(GeneratedField::MapEntry), + "deprecatedLegacyJsonFieldConflicts" | "deprecated_legacy_json_field_conflicts" => Ok(GeneratedField::DeprecatedLegacyJsonFieldConflicts), + "features" => Ok(GeneratedField::Features), + "uninterpretedOption" | "uninterpreted_option" => Ok(GeneratedField::UninterpretedOption), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MessageOptions; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.MessageOptions") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut message_set_wire_format__ = None; + let mut no_standard_descriptor_accessor__ = None; + let mut deprecated__ = None; + let mut map_entry__ = None; + let mut deprecated_legacy_json_field_conflicts__ = None; + let mut features__ = None; + let mut uninterpreted_option__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::MessageSetWireFormat => { + if message_set_wire_format__.is_some() { + return Err(serde::de::Error::duplicate_field("messageSetWireFormat")); + } + message_set_wire_format__ = map_.next_value()?; + } + GeneratedField::NoStandardDescriptorAccessor => { + if no_standard_descriptor_accessor__.is_some() { + return Err(serde::de::Error::duplicate_field("noStandardDescriptorAccessor")); + } + no_standard_descriptor_accessor__ = map_.next_value()?; + } + GeneratedField::Deprecated => { + if deprecated__.is_some() { + return Err(serde::de::Error::duplicate_field("deprecated")); + } + deprecated__ = map_.next_value()?; + } + GeneratedField::MapEntry => { + if map_entry__.is_some() { + return Err(serde::de::Error::duplicate_field("mapEntry")); + } + map_entry__ = map_.next_value()?; + } + GeneratedField::DeprecatedLegacyJsonFieldConflicts => { + if deprecated_legacy_json_field_conflicts__.is_some() { + return Err(serde::de::Error::duplicate_field("deprecatedLegacyJsonFieldConflicts")); + } + deprecated_legacy_json_field_conflicts__ = map_.next_value()?; + } + GeneratedField::Features => { + if features__.is_some() { + return Err(serde::de::Error::duplicate_field("features")); + } + features__ = map_.next_value()?; + } + GeneratedField::UninterpretedOption => { + if uninterpreted_option__.is_some() { + return Err(serde::de::Error::duplicate_field("uninterpretedOption")); + } + uninterpreted_option__ = Some(map_.next_value()?); + } + } + } + Ok(MessageOptions { + message_set_wire_format: message_set_wire_format__, + no_standard_descriptor_accessor: no_standard_descriptor_accessor__, + deprecated: deprecated__, + map_entry: map_entry__, + deprecated_legacy_json_field_conflicts: deprecated_legacy_json_field_conflicts__, + features: features__, + uninterpreted_option: uninterpreted_option__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("google.protobuf.MessageOptions", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MethodDescriptorProto { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.MethodDescriptorProto", len)?; + if let Some(v) = self.name.as_ref() { + struct_ser.serialize_field("name", v)?; + } + if let Some(v) = self.input_type.as_ref() { + struct_ser.serialize_field("inputType", v)?; + } + if let Some(v) = self.output_type.as_ref() { + struct_ser.serialize_field("outputType", v)?; + } + if let Some(v) = self.options.as_ref() { + struct_ser.serialize_field("options", v)?; + } + if let Some(v) = self.client_streaming.as_ref() { + struct_ser.serialize_field("clientStreaming", v)?; + } + if let Some(v) = self.server_streaming.as_ref() { + struct_ser.serialize_field("serverStreaming", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MethodDescriptorProto { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "name", + "input_type", + "inputType", + "output_type", + "outputType", + "options", + "client_streaming", + "clientStreaming", + "server_streaming", + "serverStreaming", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + InputType, + OutputType, + Options, + ClientStreaming, + ServerStreaming, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + "inputType" | "input_type" => Ok(GeneratedField::InputType), + "outputType" | "output_type" => Ok(GeneratedField::OutputType), + "options" => Ok(GeneratedField::Options), + "clientStreaming" | "client_streaming" => Ok(GeneratedField::ClientStreaming), + "serverStreaming" | "server_streaming" => Ok(GeneratedField::ServerStreaming), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MethodDescriptorProto; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.MethodDescriptorProto") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut input_type__ = None; + let mut output_type__ = None; + let mut options__ = None; + let mut client_streaming__ = None; + let mut server_streaming__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); + } + name__ = map_.next_value()?; + } + GeneratedField::InputType => { + if input_type__.is_some() { + return Err(serde::de::Error::duplicate_field("inputType")); + } + input_type__ = map_.next_value()?; + } + GeneratedField::OutputType => { + if output_type__.is_some() { + return Err(serde::de::Error::duplicate_field("outputType")); + } + output_type__ = map_.next_value()?; + } + GeneratedField::Options => { + if options__.is_some() { + return Err(serde::de::Error::duplicate_field("options")); + } + options__ = map_.next_value()?; + } + GeneratedField::ClientStreaming => { + if client_streaming__.is_some() { + return Err(serde::de::Error::duplicate_field("clientStreaming")); + } + client_streaming__ = map_.next_value()?; + } + GeneratedField::ServerStreaming => { + if server_streaming__.is_some() { + return Err(serde::de::Error::duplicate_field("serverStreaming")); + } + server_streaming__ = map_.next_value()?; + } + } + } + Ok(MethodDescriptorProto { + name: name__, + input_type: input_type__, + output_type: output_type__, + options: options__, + client_streaming: client_streaming__, + server_streaming: server_streaming__, + }) + } + } + deserializer.deserialize_struct("google.protobuf.MethodDescriptorProto", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MethodOptions { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.MethodOptions", len)?; + if let Some(v) = self.deprecated.as_ref() { + struct_ser.serialize_field("deprecated", v)?; + } + if let Some(v) = self.idempotency_level.as_ref() { + let v = method_options::IdempotencyLevel::try_from(*v) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("idempotencyLevel", &v)?; + } + if let Some(v) = self.features.as_ref() { + struct_ser.serialize_field("features", v)?; + } + if true { + struct_ser.serialize_field("uninterpretedOption", &self.uninterpreted_option)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MethodOptions { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "deprecated", + "idempotency_level", + "idempotencyLevel", + "features", + "uninterpreted_option", + "uninterpretedOption", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Deprecated, + IdempotencyLevel, + Features, + UninterpretedOption, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "deprecated" => Ok(GeneratedField::Deprecated), + "idempotencyLevel" | "idempotency_level" => Ok(GeneratedField::IdempotencyLevel), + "features" => Ok(GeneratedField::Features), + "uninterpretedOption" | "uninterpreted_option" => Ok(GeneratedField::UninterpretedOption), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MethodOptions; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.MethodOptions") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut deprecated__ = None; + let mut idempotency_level__ = None; + let mut features__ = None; + let mut uninterpreted_option__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Deprecated => { + if deprecated__.is_some() { + return Err(serde::de::Error::duplicate_field("deprecated")); + } + deprecated__ = map_.next_value()?; + } + GeneratedField::IdempotencyLevel => { + if idempotency_level__.is_some() { + return Err(serde::de::Error::duplicate_field("idempotencyLevel")); + } + idempotency_level__ = map_.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + GeneratedField::Features => { + if features__.is_some() { + return Err(serde::de::Error::duplicate_field("features")); + } + features__ = map_.next_value()?; + } + GeneratedField::UninterpretedOption => { + if uninterpreted_option__.is_some() { + return Err(serde::de::Error::duplicate_field("uninterpretedOption")); + } + uninterpreted_option__ = Some(map_.next_value()?); + } + } + } + Ok(MethodOptions { + deprecated: deprecated__, + idempotency_level: idempotency_level__, + features: features__, + uninterpreted_option: uninterpreted_option__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("google.protobuf.MethodOptions", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for method_options::IdempotencyLevel { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::IdempotencyUnknown => "IDEMPOTENCY_UNKNOWN", + Self::NoSideEffects => "NO_SIDE_EFFECTS", + Self::Idempotent => "IDEMPOTENT", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for method_options::IdempotencyLevel { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "IDEMPOTENCY_UNKNOWN", + "NO_SIDE_EFFECTS", + "IDEMPOTENT", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = method_options::IdempotencyLevel; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "IDEMPOTENCY_UNKNOWN" => Ok(method_options::IdempotencyLevel::IdempotencyUnknown), + "NO_SIDE_EFFECTS" => Ok(method_options::IdempotencyLevel::NoSideEffects), + "IDEMPOTENT" => Ok(method_options::IdempotencyLevel::Idempotent), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for OneofDescriptorProto { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.OneofDescriptorProto", len)?; + if let Some(v) = self.name.as_ref() { + struct_ser.serialize_field("name", v)?; + } + if let Some(v) = self.options.as_ref() { + struct_ser.serialize_field("options", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for OneofDescriptorProto { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "name", + "options", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Options, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + "options" => Ok(GeneratedField::Options), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = OneofDescriptorProto; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.OneofDescriptorProto") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut options__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); + } + name__ = map_.next_value()?; + } + GeneratedField::Options => { + if options__.is_some() { + return Err(serde::de::Error::duplicate_field("options")); + } + options__ = map_.next_value()?; + } + } + } + Ok(OneofDescriptorProto { + name: name__, + options: options__, + }) + } + } + deserializer.deserialize_struct("google.protobuf.OneofDescriptorProto", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for OneofOptions { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.OneofOptions", len)?; + if let Some(v) = self.features.as_ref() { + struct_ser.serialize_field("features", v)?; + } + if true { + struct_ser.serialize_field("uninterpretedOption", &self.uninterpreted_option)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for OneofOptions { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "features", + "uninterpreted_option", + "uninterpretedOption", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Features, + UninterpretedOption, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "features" => Ok(GeneratedField::Features), + "uninterpretedOption" | "uninterpreted_option" => Ok(GeneratedField::UninterpretedOption), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = OneofOptions; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.OneofOptions") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut features__ = None; + let mut uninterpreted_option__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Features => { + if features__.is_some() { + return Err(serde::de::Error::duplicate_field("features")); + } + features__ = map_.next_value()?; + } + GeneratedField::UninterpretedOption => { + if uninterpreted_option__.is_some() { + return Err(serde::de::Error::duplicate_field("uninterpretedOption")); + } + uninterpreted_option__ = Some(map_.next_value()?); + } + } + } + Ok(OneofOptions { + features: features__, + uninterpreted_option: uninterpreted_option__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("google.protobuf.OneofOptions", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ServiceDescriptorProto { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.ServiceDescriptorProto", len)?; + if let Some(v) = self.name.as_ref() { + struct_ser.serialize_field("name", v)?; + } + if true { + struct_ser.serialize_field("method", &self.method)?; + } + if let Some(v) = self.options.as_ref() { + struct_ser.serialize_field("options", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ServiceDescriptorProto { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "name", + "method", + "options", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Method, + Options, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + "method" => Ok(GeneratedField::Method), + "options" => Ok(GeneratedField::Options), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ServiceDescriptorProto; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.ServiceDescriptorProto") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut method__ = None; + let mut options__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); + } + name__ = map_.next_value()?; + } + GeneratedField::Method => { + if method__.is_some() { + return Err(serde::de::Error::duplicate_field("method")); + } + method__ = Some(map_.next_value()?); + } + GeneratedField::Options => { + if options__.is_some() { + return Err(serde::de::Error::duplicate_field("options")); + } + options__ = map_.next_value()?; + } + } + } + Ok(ServiceDescriptorProto { + name: name__, + method: method__.unwrap_or_default(), + options: options__, + }) + } + } + deserializer.deserialize_struct("google.protobuf.ServiceDescriptorProto", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ServiceOptions { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.ServiceOptions", len)?; + if let Some(v) = self.features.as_ref() { + struct_ser.serialize_field("features", v)?; + } + if let Some(v) = self.deprecated.as_ref() { + struct_ser.serialize_field("deprecated", v)?; + } + if true { + struct_ser.serialize_field("uninterpretedOption", &self.uninterpreted_option)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ServiceOptions { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "features", + "deprecated", + "uninterpreted_option", + "uninterpretedOption", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Features, + Deprecated, + UninterpretedOption, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "features" => Ok(GeneratedField::Features), + "deprecated" => Ok(GeneratedField::Deprecated), + "uninterpretedOption" | "uninterpreted_option" => Ok(GeneratedField::UninterpretedOption), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ServiceOptions; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.ServiceOptions") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut features__ = None; + let mut deprecated__ = None; + let mut uninterpreted_option__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Features => { + if features__.is_some() { + return Err(serde::de::Error::duplicate_field("features")); + } + features__ = map_.next_value()?; + } + GeneratedField::Deprecated => { + if deprecated__.is_some() { + return Err(serde::de::Error::duplicate_field("deprecated")); + } + deprecated__ = map_.next_value()?; + } + GeneratedField::UninterpretedOption => { + if uninterpreted_option__.is_some() { + return Err(serde::de::Error::duplicate_field("uninterpretedOption")); + } + uninterpreted_option__ = Some(map_.next_value()?); + } + } + } + Ok(ServiceOptions { + features: features__, + deprecated: deprecated__, + uninterpreted_option: uninterpreted_option__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("google.protobuf.ServiceOptions", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SourceCodeInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.SourceCodeInfo", len)?; + if true { + struct_ser.serialize_field("location", &self.location)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SourceCodeInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "location", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Location, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "location" => Ok(GeneratedField::Location), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SourceCodeInfo; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.SourceCodeInfo") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut location__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Location => { + if location__.is_some() { + return Err(serde::de::Error::duplicate_field("location")); + } + location__ = Some(map_.next_value()?); + } + } + } + Ok(SourceCodeInfo { + location: location__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("google.protobuf.SourceCodeInfo", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for source_code_info::Location { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.SourceCodeInfo.Location", len)?; + if true { + struct_ser.serialize_field("path", &self.path)?; + } + if true { + struct_ser.serialize_field("span", &self.span)?; + } + if let Some(v) = self.leading_comments.as_ref() { + struct_ser.serialize_field("leadingComments", v)?; + } + if let Some(v) = self.trailing_comments.as_ref() { + struct_ser.serialize_field("trailingComments", v)?; + } + if true { + struct_ser.serialize_field("leadingDetachedComments", &self.leading_detached_comments)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for source_code_info::Location { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "path", + "span", + "leading_comments", + "leadingComments", + "trailing_comments", + "trailingComments", + "leading_detached_comments", + "leadingDetachedComments", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Path, + Span, + LeadingComments, + TrailingComments, + LeadingDetachedComments, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "path" => Ok(GeneratedField::Path), + "span" => Ok(GeneratedField::Span), + "leadingComments" | "leading_comments" => Ok(GeneratedField::LeadingComments), + "trailingComments" | "trailing_comments" => Ok(GeneratedField::TrailingComments), + "leadingDetachedComments" | "leading_detached_comments" => Ok(GeneratedField::LeadingDetachedComments), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = source_code_info::Location; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.SourceCodeInfo.Location") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut path__ = None; + let mut span__ = None; + let mut leading_comments__ = None; + let mut trailing_comments__ = None; + let mut leading_detached_comments__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Path => { + if path__.is_some() { + return Err(serde::de::Error::duplicate_field("path")); + } + path__ = + Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::NumberDeserialize<_>>>()? + .into_iter().map(|x| x.0).collect()) + ; + } + GeneratedField::Span => { + if span__.is_some() { + return Err(serde::de::Error::duplicate_field("span")); + } + span__ = + Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::NumberDeserialize<_>>>()? + .into_iter().map(|x| x.0).collect()) + ; + } + GeneratedField::LeadingComments => { + if leading_comments__.is_some() { + return Err(serde::de::Error::duplicate_field("leadingComments")); + } + leading_comments__ = map_.next_value()?; + } + GeneratedField::TrailingComments => { + if trailing_comments__.is_some() { + return Err(serde::de::Error::duplicate_field("trailingComments")); + } + trailing_comments__ = map_.next_value()?; + } + GeneratedField::LeadingDetachedComments => { + if leading_detached_comments__.is_some() { + return Err(serde::de::Error::duplicate_field("leadingDetachedComments")); + } + leading_detached_comments__ = Some(map_.next_value()?); + } + } + } + Ok(source_code_info::Location { + path: path__.unwrap_or_default(), + span: span__.unwrap_or_default(), + leading_comments: leading_comments__, + trailing_comments: trailing_comments__, + leading_detached_comments: leading_detached_comments__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("google.protobuf.SourceCodeInfo.Location", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Timestamp { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.Timestamp", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("seconds", ::alloc::string::ToString::to_string(&self.seconds).as_str())?; + } + if true { + struct_ser.serialize_field("nanos", &self.nanos)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Timestamp { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "seconds", + "nanos", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Seconds, + Nanos, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "seconds" => Ok(GeneratedField::Seconds), + "nanos" => Ok(GeneratedField::Nanos), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Timestamp; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.Timestamp") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut seconds__ = None; + let mut nanos__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Seconds => { + if seconds__.is_some() { + return Err(serde::de::Error::duplicate_field("seconds")); + } + seconds__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Nanos => { + if nanos__.is_some() { + return Err(serde::de::Error::duplicate_field("nanos")); + } + nanos__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(Timestamp { + seconds: seconds__.unwrap_or_default(), + nanos: nanos__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("google.protobuf.Timestamp", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for UninterpretedOption { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.UninterpretedOption", len)?; + if true { + struct_ser.serialize_field("name", &self.name)?; + } + if let Some(v) = self.identifier_value.as_ref() { + struct_ser.serialize_field("identifierValue", v)?; + } + if let Some(v) = self.positive_int_value.as_ref() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("positiveIntValue", ::alloc::string::ToString::to_string(&v).as_str())?; + } + if let Some(v) = self.negative_int_value.as_ref() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("negativeIntValue", ::alloc::string::ToString::to_string(&v).as_str())?; + } + if let Some(v) = self.double_value.as_ref() { + struct_ser.serialize_field("doubleValue", v)?; + } + if let Some(v) = self.string_value.as_ref() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("stringValue", pbjson::private::base64::encode(&v).as_str())?; + } + if let Some(v) = self.aggregate_value.as_ref() { + struct_ser.serialize_field("aggregateValue", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for UninterpretedOption { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "name", + "identifier_value", + "identifierValue", + "positive_int_value", + "positiveIntValue", + "negative_int_value", + "negativeIntValue", + "double_value", + "doubleValue", + "string_value", + "stringValue", + "aggregate_value", + "aggregateValue", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + IdentifierValue, + PositiveIntValue, + NegativeIntValue, + DoubleValue, + StringValue, + AggregateValue, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + "identifierValue" | "identifier_value" => Ok(GeneratedField::IdentifierValue), + "positiveIntValue" | "positive_int_value" => Ok(GeneratedField::PositiveIntValue), + "negativeIntValue" | "negative_int_value" => Ok(GeneratedField::NegativeIntValue), + "doubleValue" | "double_value" => Ok(GeneratedField::DoubleValue), + "stringValue" | "string_value" => Ok(GeneratedField::StringValue), + "aggregateValue" | "aggregate_value" => Ok(GeneratedField::AggregateValue), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = UninterpretedOption; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.UninterpretedOption") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut identifier_value__ = None; + let mut positive_int_value__ = None; + let mut negative_int_value__ = None; + let mut double_value__ = None; + let mut string_value__ = None; + let mut aggregate_value__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); + } + name__ = Some(map_.next_value()?); + } + GeneratedField::IdentifierValue => { + if identifier_value__.is_some() { + return Err(serde::de::Error::duplicate_field("identifierValue")); + } + identifier_value__ = map_.next_value()?; + } + GeneratedField::PositiveIntValue => { + if positive_int_value__.is_some() { + return Err(serde::de::Error::duplicate_field("positiveIntValue")); + } + positive_int_value__ = + map_.next_value::<::core::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0) + ; + } + GeneratedField::NegativeIntValue => { + if negative_int_value__.is_some() { + return Err(serde::de::Error::duplicate_field("negativeIntValue")); + } + negative_int_value__ = + map_.next_value::<::core::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0) + ; + } + GeneratedField::DoubleValue => { + if double_value__.is_some() { + return Err(serde::de::Error::duplicate_field("doubleValue")); + } + double_value__ = + map_.next_value::<::core::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0) + ; + } + GeneratedField::StringValue => { + if string_value__.is_some() { + return Err(serde::de::Error::duplicate_field("stringValue")); + } + string_value__ = + map_.next_value::<::core::option::Option<::pbjson::private::BytesDeserialize<_>>>()?.map(|x| x.0) + ; + } + GeneratedField::AggregateValue => { + if aggregate_value__.is_some() { + return Err(serde::de::Error::duplicate_field("aggregateValue")); + } + aggregate_value__ = map_.next_value()?; + } + } + } + Ok(UninterpretedOption { + name: name__.unwrap_or_default(), + identifier_value: identifier_value__, + positive_int_value: positive_int_value__, + negative_int_value: negative_int_value__, + double_value: double_value__, + string_value: string_value__, + aggregate_value: aggregate_value__, + }) + } + } + deserializer.deserialize_struct("google.protobuf.UninterpretedOption", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for uninterpreted_option::NamePart { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 2; + let mut struct_ser = serializer.serialize_struct("google.protobuf.UninterpretedOption.NamePart", len)?; + struct_ser.serialize_field("namePart", &self.name_part)?; + struct_ser.serialize_field("isExtension", &self.is_extension)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for uninterpreted_option::NamePart { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "name_part", + "namePart", + "is_extension", + "isExtension", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + NamePart, + IsExtension, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "namePart" | "name_part" => Ok(GeneratedField::NamePart), + "isExtension" | "is_extension" => Ok(GeneratedField::IsExtension), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = uninterpreted_option::NamePart; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.UninterpretedOption.NamePart") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name_part__ = None; + let mut is_extension__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::NamePart => { + if name_part__.is_some() { + return Err(serde::de::Error::duplicate_field("namePart")); + } + name_part__ = Some(map_.next_value()?); + } + GeneratedField::IsExtension => { + if is_extension__.is_some() { + return Err(serde::de::Error::duplicate_field("isExtension")); + } + is_extension__ = Some(map_.next_value()?); + } + } + } + Ok(uninterpreted_option::NamePart { + name_part: name_part__.ok_or_else(|| serde::de::Error::missing_field("namePart"))?, + is_extension: is_extension__.ok_or_else(|| serde::de::Error::missing_field("isExtension"))?, + }) + } + } + deserializer.deserialize_struct("google.protobuf.UninterpretedOption.NamePart", FIELDS, GeneratedVisitor) + } +} diff --git a/src/prost/ibc.core.commitment.v1.rs b/src/prost/ibc.core.commitment.v1.rs index 77d2ca9a..73e01a47 100644 --- a/src/prost/ibc.core.commitment.v1.rs +++ b/src/prost/ibc.core.commitment.v1.rs @@ -80,9 +80,7 @@ impl ::prost::Name for MerklePath { #[derive(Clone, PartialEq, ::prost::Message)] pub struct MerkleProof { #[prost(message, repeated, tag = "1")] - pub proofs: ::prost::alloc::vec::Vec< - super::super::super::super::cosmos::ics23::v1::CommitmentProof, - >, + pub proofs: ::prost::alloc::vec::Vec<::ics23::CommitmentProof>, } impl ::prost::Name for MerkleProof { const NAME: &'static str = "MerkleProof"; diff --git a/src/prost/ibc.lightclients.tendermint.v1.rs b/src/prost/ibc.lightclients.tendermint.v1.rs index b58c0e12..5ba8be8f 100644 --- a/src/prost/ibc.lightclients.tendermint.v1.rs +++ b/src/prost/ibc.lightclients.tendermint.v1.rs @@ -36,9 +36,7 @@ pub struct ClientState { >, /// Proof specifications used in verifying counterparty state #[prost(message, repeated, tag = "8")] - pub proof_specs: ::prost::alloc::vec::Vec< - super::super::super::super::cosmos::ics23::v1::ProofSpec, - >, + pub proof_specs: ::prost::alloc::vec::Vec<::ics23::ProofSpec>, /// 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 diff --git a/src/prost/proto_descriptor.bin b/src/prost/proto_descriptor.bin index 3603045b..a44e59cf 100644 Binary files a/src/prost/proto_descriptor.bin and b/src/prost/proto_descriptor.bin differ diff --git a/tools/proto-compiler/src/cmd/compile.rs b/tools/proto-compiler/src/cmd/compile.rs index 8c7fdb8d..264dc7be 100644 --- a/tools/proto-compiler/src/cmd/compile.rs +++ b/tools/proto-compiler/src/cmd/compile.rs @@ -13,10 +13,6 @@ pub struct CompileCmd { /// path to the IBC-Go proto files ibc: PathBuf, - #[argh(option, short = 's')] - /// path to the Cosmos SDK proto files - sdk: PathBuf, - #[argh(option, short = 'c')] /// path to the Cosmos ICS proto files ics: PathBuf, @@ -34,7 +30,6 @@ impl CompileCmd { pub fn run(&self) { Self::compile_ibc_protos( self.ibc.as_ref(), - self.sdk.as_ref(), self.ics.as_ref(), self.nft.as_ref(), self.out.as_ref(), @@ -59,7 +54,6 @@ impl CompileCmd { fn compile_ibc_protos( ibc_dir: &Path, - sdk_dir: &Path, ics_dir: &Path, nft_dir: &Path, out_dir: &Path, @@ -77,14 +71,6 @@ impl CompileCmd { root.join("../../definitions/ibc/lightclients/localhost/v1"), root.join("../../definitions/stride/interchainquery/v1"), ibc_dir.join("ibc"), - sdk_dir.join("cosmos/auth"), - sdk_dir.join("cosmos/gov"), - sdk_dir.join("cosmos/tx"), - sdk_dir.join("cosmos/base"), - sdk_dir.join("cosmos/crypto"), - sdk_dir.join("cosmos/bank"), - sdk_dir.join("cosmos/staking"), - sdk_dir.join("cosmos/upgrade"), ics_dir.join("interchain_security/ccv/v1"), ics_dir.join("interchain_security/ccv/provider"), ics_dir.join("interchain_security/ccv/consumer"), @@ -92,7 +78,6 @@ impl CompileCmd { ]; let proto_includes_paths = [ - sdk_dir.to_path_buf(), ibc_dir.to_path_buf(), ics_dir.to_path_buf(), nft_dir.to_path_buf(), @@ -105,6 +90,7 @@ impl CompileCmd { let mut protos: Vec = vec![]; for proto_path in &proto_paths { println!("Looking for proto files in '{}'", proto_path.display()); + protos.append( &mut WalkDir::new(proto_path) .into_iter() @@ -120,17 +106,17 @@ impl CompileCmd { } println!("Found the following protos:"); + // Show which protos will be compiled for proto in &protos { println!("\t-> {}", proto.display()); } + println!("[info ] Compiling.."); let attrs_jsonschema = r#"#[cfg_attr(all(feature = "json-schema", feature = "serde"), derive(::schemars::JsonSchema))]"#; let attrs_jsonschema_str = r#"#[cfg_attr(all(feature = "json-schema", feature = "serde"), schemars(with = "String"))]"#; - let attrs_ord = "#[derive(Eq, PartialOrd, Ord)]"; - let attrs_eq = "#[derive(Eq)]"; // Automatically derive a `prost::Name` implementation. let mut config = prost_build::Config::new(); @@ -155,7 +141,7 @@ impl CompileCmd { "::tendermint_proto::v0_34::abci::Event", ) .extern_path(".tendermint", "::tendermint_proto") - .extern_path(".ics23", "::ics23") + .extern_path(".cosmos.ics23.v1", "::ics23") .extern_path(".google.protobuf", "::tendermint_proto::google::protobuf") .type_attribute(".ibc.core.client.v1.Height", attrs_ord) .type_attribute(".ibc.core.client.v1.Height", attrs_jsonschema) @@ -183,35 +169,22 @@ impl CompileCmd { } fn build_pbjson_impls(out_dir: &Path) -> Result<(), Box> { - println!("[info] Building pbjson Serialize, Deserialize impls..."); + println!("[info ] Building pbjson Serialize, Deserialize impls..."); + let descriptor_set_path = out_dir.join("proto_descriptor.bin"); let descriptor_set = std::fs::read(descriptor_set_path)?; pbjson_build::Builder::new() .register_descriptors(&descriptor_set)? - .out_dir(&out_dir) + .out_dir(out_dir) .exclude([ - // The validator patch is not compatible with protojson builds - ".cosmos.staking.v1beta1.StakeAuthorization", - ".cosmos.staking.v1beta1.ValidatorUpdates", - // TODO: These have dependencies on tendermint-proto, which does not implement protojson. - // After it's implemented there, we can delete these exclusions. - ".cosmos.base.abci.v1beta1", - ".cosmos.tx.v1beta1", - ".cosmos.base.tendermint.v1beta1", ".interchain_security.ccv.v1", ".interchain_security.ccv.provider.v1", ".interchain_security.ccv.consumer.v1", ".stride.interchainquery.v1", ]) .emit_fields() - .build(&[ - ".ibc", - ".cosmos", - ".interchain_security", - ".stride", - ".google", - ])?; + .build(&[".ibc", ".interchain_security", ".stride", ".google"])?; Ok(()) } @@ -223,18 +196,6 @@ impl CompileCmd { ); const PATCHES: &[(&str, &[(&str, &str)])] = &[ - ( - "cosmos.staking.v1beta1.rs", - &[ - ("pub struct Validators", "pub struct ValidatorsVec"), - ( - "impl ::prost::Name for Validators {", - "impl ::prost::Name for ValidatorsVec {", - ), - ("AllowList(Validators)", "AllowList(ValidatorsVec)"), - ("DenyList(Validators)", "DenyList(ValidatorsVec)"), - ], - ), ( "ibc.applications.transfer.v1.rs", &[(