diff --git a/.changelog/unreleased/bug-fixes/171-restore-no-std-attribute.md b/.changelog/unreleased/bug-fixes/171-restore-no-std-attribute.md new file mode 100644 index 00000000..682c8313 --- /dev/null +++ b/.changelog/unreleased/bug-fixes/171-restore-no-std-attribute.md @@ -0,0 +1,2 @@ +- Fix `#[no_std]` attribute removal and add `informalsystems-pbjson/std` dependency + for `std` feature ([#171](https://github.com/cosmos/ibc-proto-rs/issues/171)). diff --git a/.changelog/unreleased/features/167-ics721-impl.md b/.changelog/unreleased/features/167-ics721-impl.md new file mode 100644 index 00000000..1281b08b --- /dev/null +++ b/.changelog/unreleased/features/167-ics721-impl.md @@ -0,0 +1,2 @@ +- Add ICS-721 proto: ([\#167](https://github.com/cosmos/ibc-proto- + rs/issues/167)) \ No newline at end of file diff --git a/.changelog/unreleased/features/168-add-wasm-client-protos.md b/.changelog/unreleased/features/168-add-wasm-client-protos.md new file mode 100644 index 00000000..f0c59e3d --- /dev/null +++ b/.changelog/unreleased/features/168-add-wasm-client-protos.md @@ -0,0 +1,3 @@ +- Integrate Wasm light client proto types by updating `IBC_GO_COMMIT` to the + hash associated with the ibc-go `wasm-v8.0.0` tag + ([#168](https://github.com/cosmos/ibc-proto-rs/issues/168)). diff --git a/.changelog/unreleased/features/172-sync-ibc-go-rev-to-add-counterparty-channel-upgrade-sequence.md b/.changelog/unreleased/features/172-sync-ibc-go-rev-to-add-counterparty-channel-upgrade-sequence.md new file mode 100644 index 00000000..43d87252 --- /dev/null +++ b/.changelog/unreleased/features/172-sync-ibc-go-rev-to-add-counterparty-channel-upgrade-sequence.md @@ -0,0 +1,3 @@ +- Sync ibc-go at `e1df7a6` to add `counterparty_upgrade_sequence` to + `MsgTimeoutOnClose` and `MsgChannelCloseConfirm` for Hermes support + ([#172](https://github.com/cosmos/ibc-proto-rs/issues/172)). diff --git a/.changelog/v0.39.1/features/163-prost-name.md b/.changelog/v0.39.1/features/163-prost-name.md new file mode 100644 index 00000000..e67677ec --- /dev/null +++ b/.changelog/v0.39.1/features/163-prost-name.md @@ -0,0 +1,2 @@ +- Derive the `prost::Name` trait for all Protobuf messages + ([\#163](https://github.com/cosmos/ibc-proto-rs/pull/163)) \ No newline at end of file diff --git a/.changelog/v0.39.1/summary.md b/.changelog/v0.39.1/summary.md new file mode 100644 index 00000000..70f1399d --- /dev/null +++ b/.changelog/v0.39.1/summary.md @@ -0,0 +1 @@ +*November 22nd, 2023* diff --git a/.changelog/v0.40.0/breaking-changes/166-protojson-support.md b/.changelog/v0.40.0/breaking-changes/166-protojson-support.md new file mode 100644 index 00000000..a94d06fa --- /dev/null +++ b/.changelog/v0.40.0/breaking-changes/166-protojson-support.md @@ -0,0 +1,4 @@ +- Added ProtoJSON support. + The `serde` feature flag now abides by [Protobuf JSON rules](https://protobuf.dev/programming-guides/proto3/#json) + when it comes to JSON serialization/deserialization. + ([#166](https://github.com/cosmos/ibc-proto-rs/pull/166)) diff --git a/.changelog/v0.40.0/summary.md b/.changelog/v0.40.0/summary.md new file mode 100644 index 00000000..82752295 --- /dev/null +++ b/.changelog/v0.40.0/summary.md @@ -0,0 +1 @@ +*December 29th, 2023* diff --git a/CHANGELOG.md b/CHANGELOG.md index 69ef118a..3831bcc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # CHANGELOG +## v0.40.0 + +*December 29th, 2023* + +### BREAKING CHANGES + +- Added ProtoJSON support. + The `serde` feature flag now abides by [Protobuf JSON rules](https://protobuf.dev/programming-guides/proto3/#json) + when it comes to JSON serialization/deserialization. + ([#166](https://github.com/cosmos/ibc-proto-rs/pull/166)) + +## v0.39.1 + +*November 22nd, 2023* + +### FEATURES + +- Derive the `prost::Name` trait for all Protobuf messages + ([\#163](https://github.com/cosmos/ibc-proto-rs/pull/163)) + ## v0.39.0 *November 15th, 2023* diff --git a/Cargo.toml b/Cargo.toml index c338e700..bfd16e40 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-proto" -version = "0.39.0" +version = "0.40.0" authors = ["Informal Systems "] edition = "2021" license = "Apache-2.0" @@ -28,15 +28,16 @@ doctest = false all-features = true [dependencies] -prost = { version = "0.12", default-features = false, features = ["prost-derive"] } -bytes = { version = "1.2", default-features = false } -tonic = { version = "0.10", default-features = false, optional = true } -serde = { version = "1.0", default-features = false, optional = true } -schemars = { version = "0.8", optional = true } -subtle-encoding = { version = "0.5", default-features = false } -base64 = { version = "0.21", default-features = false, features = ["alloc"] } -flex-error = { version = "0.4", default-features = false } -ics23 = { version = "0.11.0", default-features = false } +prost = { version = "0.12.3", default-features = false, features = ["prost-derive"] } +bytes = { version = "1.2", default-features = false } +tonic = { version = "0.10", default-features = false, optional = true } +serde = { version = "1.0", default-features = false, optional = true } +schemars = { version = "0.8", optional = true } +subtle-encoding = { version = "0.5", default-features = false } +base64 = { version = "0.21", default-features = false, features = ["alloc"] } +flex-error = { version = "0.4", default-features = false } +ics23 = { version = "0.11.0", default-features = false } +informalsystems-pbjson = { version = "0.7.0", optional = true, default-features = false } ## Optional: enabled by the `parity-scale-codec` feature parity-scale-codec = { version = "3.0.0", default-features = false, features = ["full"], optional = true } @@ -50,10 +51,13 @@ borsh = { version = "0.10", default-features = false, optional = true } version = "0.34" 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"] -serde = ["dep:serde", "ics23/serde"] +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"] json-schema = ["std", "serde", "dep:schemars"] server = ["std", "dep:tonic", "tonic/codegen", "tonic/transport", "tonic/prost"] diff --git a/scripts/sync-protobuf.sh b/scripts/sync-protobuf.sh index a7fe7268..94ba2a03 100755 --- a/scripts/sync-protobuf.sh +++ b/scripts/sync-protobuf.sh @@ -26,14 +26,17 @@ CACHE_PATH="${XDG_CACHE_HOME:-$HOME/.cache}" COSMOS_SDK_GIT="${COSMOS_SDK_GIT:-$CACHE_PATH/cosmos/cosmos-sdk.git}" IBC_GO_GIT="${IBC_GO_GIT:-$CACHE_PATH/ibc-go.git}" COSMOS_ICS_GIT="${COSMOS_ICS_GIT:-$CACHE_PATH/cosmos/interchain-security.git}" +NFT_TRANSFER_GIT="${NFT_TRANSFER_GIT:-$CACHE_PATH/bianjieai/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" # Use either --ics-commit flag for commit ID, # or --ics-tag for git tag. Because we can't modify @@ -89,6 +92,15 @@ else echo "Using existing ibc-go bare git repository at $IBC_GO_GIT" fi +if [[ ! -e "$NFT_TRANSFER_GIT" ]] +then + echo "Cloning nft-transfer source code to as bare git repository to $NFT_TRANSFER_GIT" + git clone --mirror https://github.com/bianjieai/nft-transfer.git "$NFT_TRANSFER_GIT" +else + echo "Using existing nft-transfer bare git repository at $NFT_TRANSFER_GIT" +fi + + # Update the repositories using git fetch. This is so that # we keep local copies of the repositories up to sync first. pushd "$COSMOS_ICS_GIT" @@ -103,6 +115,10 @@ pushd "$IBC_GO_GIT" git fetch popd +pushd "$NFT_TRANSFER_GIT" +git fetch +popd + # Create a new temporary directory to check out the # actual source files from the bare git repositories. # This is so that we do not accidentally use an unclean @@ -154,6 +170,17 @@ cd proto buf export -v -o ../proto-include popd +NFT_TRANSFER_DIR=$(mktemp -d /tmp/nft-transfer-XXXXXXXX) + +pushd "$NFT_TRANSFER_DIR" +git clone "$NFT_TRANSFER_GIT" . +git checkout -b "$NFT_TRANSFER_COMMIT" "$NFT_TRANSFER_COMMIT" + +cd proto +buf export -v -o ../proto-include +rm ../proto-include/ibc/core/client/v1/client.proto +popd + # Remove the existing generated protobuf files # so that the newly generated code does not # contain removed files. @@ -173,6 +200,7 @@ 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 cd ../.. @@ -192,3 +220,4 @@ rm -f src/prost/tendermint.abci.rs rm -rf "$COSMOS_ICS_DIR" rm -rf "$COSMOS_SDK_DIR" rm -rf "$IBC_GO_DIR" +rm -rf "$NFT_TRANSFER_DIR" diff --git a/src/IBC_GO_COMMIT b/src/IBC_GO_COMMIT index 47f08cce..960f7110 100644 --- a/src/IBC_GO_COMMIT +++ b/src/IBC_GO_COMMIT @@ -1 +1 @@ -2551dea41cd3c512845007ca895c8402afa9b79f +e1df7a6948d1dd94b7d2dadd226bee23d3e1e667 \ No newline at end of file diff --git a/src/NFT_TRANSFER_COMMIT b/src/NFT_TRANSFER_COMMIT new file mode 100644 index 00000000..9a642085 --- /dev/null +++ b/src/NFT_TRANSFER_COMMIT @@ -0,0 +1 @@ +986de3bb91434c9efc49a82544e3ba0b208e19a7 diff --git a/src/google.rs b/src/google.rs index 8a60c6c0..74acb0fb 100644 --- a/src/google.rs +++ b/src/google.rs @@ -1,6 +1,8 @@ pub mod protobuf { use crate::include_proto; include_proto!("google.protobuf.rs"); + #[cfg(feature = "serde")] + include_proto!("google.protobuf.serde.rs"); // source: https://github.com/tokio-rs/prost/blob/master/prost-types/src/lib.rs use core::convert::TryFrom; diff --git a/src/lib.rs b/src/lib.rs index 4287448b..5f2843a5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,10 +2,13 @@ // Todo: automate the creation of this module setup based on the dots in the filenames. // This module setup is necessary because the generated code contains "super::" calls for dependencies. - #![cfg_attr(not(feature = "std"), no_std)] #![deny(warnings, trivial_casts, trivial_numeric_casts, unused_import_braces)] -#![allow(clippy::large_enum_variant, clippy::derive_partial_eq_without_eq)] +#![allow( + clippy::large_enum_variant, + clippy::derive_partial_eq_without_eq, + clippy::needless_borrows_for_generic_args +)] #![allow(rustdoc::bare_urls)] #![forbid(unsafe_code)] @@ -35,6 +38,9 @@ pub const IBC_GO_COMMIT: &str = include_str!("IBC_GO_COMMIT"); /// The version (commit hash) of Interchain Security used when generating this library. pub const INTERCHAIN_SECURITY_COMMIT: &str = include_str!("INTERCHAIN_SECURITY_COMMIT"); +/// The version (commit hash) of nft-transfer used when generating this library. +pub const NFT_TRANSFER_COMMIT: &str = include_str!("NFT_TRANSFER_COMMIT"); + /// File descriptor set of compiled proto. #[cfg(feature = "proto-descriptor")] pub const FILE_DESCRIPTOR_SET: &[u8] = include_bytes!("prost/proto_descriptor.bin"); @@ -43,11 +49,15 @@ 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 @@ -64,26 +74,36 @@ pub mod cosmos { 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"); } } } @@ -96,20 +116,28 @@ pub mod cosmos { 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 { @@ -119,11 +147,15 @@ pub mod cosmos { 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"); } } } @@ -131,26 +163,40 @@ pub mod cosmos { 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"); } } } @@ -158,11 +204,15 @@ pub mod cosmos { 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 { @@ -172,23 +222,33 @@ pub mod cosmos { 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"); } } } @@ -206,56 +266,85 @@ pub mod ibc { pub mod transfer { pub mod v1 { include_proto!("ibc.applications.transfer.v1.rs"); + #[cfg(feature = "serde")] + include_proto!("ibc.applications.transfer.v1.serde.rs"); } pub mod v2 { include_proto!("ibc.applications.transfer.v2.rs"); + #[cfg(feature = "serde")] + include_proto!("ibc.applications.transfer.v2.serde.rs"); } } pub mod fee { pub mod v1 { include_proto!("ibc.applications.fee.v1.rs"); + #[cfg(feature = "serde")] + include_proto!("ibc.applications.fee.v1.serde.rs"); } } pub mod interchain_accounts { pub mod v1 { include_proto!("ibc.applications.interchain_accounts.v1.rs"); + #[cfg(feature = "serde")] + include_proto!("ibc.applications.interchain_accounts.v1.serde.rs"); } pub mod controller { pub mod v1 { include_proto!("ibc.applications.interchain_accounts.controller.v1.rs"); + #[cfg(feature = "serde")] + include_proto!("ibc.applications.interchain_accounts.controller.v1.serde.rs"); } } pub mod host { pub mod v1 { include_proto!("ibc.applications.interchain_accounts.host.v1.rs"); + #[cfg(feature = "serde")] + include_proto!("ibc.applications.interchain_accounts.host.v1.serde.rs"); } } } + pub mod nft_transfer { + pub mod v1 { + include_proto!("ibc.applications.nft_transfer.v1.rs"); + #[cfg(feature = "serde")] + include_proto!("ibc.applications.nft_transfer.v1.serde.rs"); + } + } } pub mod core { pub mod channel { pub mod v1 { include_proto!("ibc.core.channel.v1.rs"); + #[cfg(feature = "serde")] + include_proto!("ibc.core.channel.v1.serde.rs"); } } pub mod client { pub mod v1 { include_proto!("ibc.core.client.v1.rs"); + #[cfg(feature = "serde")] + include_proto!("ibc.core.client.v1.serde.rs"); } } pub mod commitment { pub mod v1 { include_proto!("ibc.core.commitment.v1.rs"); + #[cfg(feature = "serde")] + include_proto!("ibc.core.commitment.v1.serde.rs"); } } pub mod connection { pub mod v1 { include_proto!("ibc.core.connection.v1.rs"); + #[cfg(feature = "serde")] + include_proto!("ibc.core.connection.v1.serde.rs"); } } pub mod types { pub mod v1 { include_proto!("ibc.core.types.v1.rs"); + #[cfg(feature = "serde")] + include_proto!("ibc.core.types.v1.serde.rs"); } } } @@ -263,24 +352,41 @@ pub mod ibc { pub mod localhost { pub mod v1 { include_proto!("ibc.lightclients.localhost.v1.rs"); + #[cfg(feature = "serde")] + include_proto!("ibc.lightclients.localhost.v1.serde.rs"); } pub mod v2 { include_proto!("ibc.lightclients.localhost.v2.rs"); + #[cfg(feature = "serde")] + include_proto!("ibc.lightclients.localhost.v2.serde.rs"); } } pub mod solomachine { pub mod v3 { include_proto!("ibc.lightclients.solomachine.v3.rs"); + #[cfg(feature = "serde")] + include_proto!("ibc.lightclients.solomachine.v3.serde.rs"); } } pub mod tendermint { pub mod v1 { include_proto!("ibc.lightclients.tendermint.v1.rs"); + #[cfg(feature = "serde")] + include_proto!("ibc.lightclients.tendermint.v1.serde.rs"); + } + } + pub mod wasm { + pub mod v1 { + include_proto!("ibc.lightclients.wasm.v1.rs"); + #[cfg(feature = "serde")] + include_proto!("ibc.lightclients.wasm.v1.serde.rs"); } } } pub mod mock { include_proto!("ibc.mock.rs"); + #[cfg(feature = "serde")] + include_proto!("ibc.mock.serde.rs"); } } @@ -313,26 +419,3 @@ pub mod stride { } } } - -#[cfg(feature = "serde")] -pub(crate) mod base64 { - use alloc::string::String; - use alloc::vec::Vec; - - use base64::prelude::*; - use serde::{Deserialize, Deserializer, Serialize, Serializer}; - - pub fn serialize(bytes: &[u8], serializer: S) -> Result { - let encoded = BASE64_STANDARD.encode(bytes); - String::serialize(&encoded, serializer) - } - - pub fn deserialize<'de, D: Deserializer<'de>>(deserializer: D) -> Result, D::Error> { - let base64 = String::deserialize(deserializer)?; - let bytes = BASE64_STANDARD - .decode(base64.as_bytes()) - .map_err(serde::de::Error::custom)?; - - Ok(bytes) - } -} diff --git a/src/prost/cosmos.app.v1alpha1.rs b/src/prost/cosmos.app.v1alpha1.rs index 5460a59e..b70937bf 100644 --- a/src/prost/cosmos.app.v1alpha1.rs +++ b/src/prost/cosmos.app.v1alpha1.rs @@ -1,5 +1,4 @@ /// ModuleDescriptor describes an app module. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ModuleDescriptor { @@ -24,8 +23,14 @@ pub struct ModuleDescriptor { #[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 { + ::prost::alloc::format!("cosmos.app.v1alpha1.{}", Self::NAME) + } +} /// PackageReference is a reference to a protobuf package used by a module. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PackageReference { @@ -70,9 +75,15 @@ pub struct PackageReference { #[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 { + ::prost::alloc::format!("cosmos.app.v1alpha1.{}", Self::NAME) + } +} /// MigrateFromInfo is information on a module version that a newer module /// can migrate from. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MigrateFromInfo { @@ -81,3 +92,10 @@ pub struct MigrateFromInfo { #[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 { + ::prost::alloc::format!("cosmos.app.v1alpha1.{}", Self::NAME) + } +} diff --git a/src/prost/cosmos.app.v1alpha1.serde.rs b/src/prost/cosmos.app.v1alpha1.serde.rs new file mode 100644 index 00000000..95f7c7de --- /dev/null +++ b/src/prost/cosmos.app.v1alpha1.serde.rs @@ -0,0 +1,329 @@ +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 index 35a54c0e..59a0940d 100644 --- a/src/prost/cosmos.auth.module.v1.rs +++ b/src/prost/cosmos.auth.module.v1.rs @@ -12,6 +12,13 @@ pub struct 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 { + ::prost::alloc::format!("cosmos.auth.module.v1.{}", Self::NAME) + } +} /// ModuleAccountPermission represents permissions for a module account. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -24,3 +31,10 @@ pub struct ModuleAccountPermission { #[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 { + ::prost::alloc::format!("cosmos.auth.module.v1.{}", Self::NAME) + } +} diff --git a/src/prost/cosmos.auth.module.v1.serde.rs b/src/prost/cosmos.auth.module.v1.serde.rs new file mode 100644 index 00000000..72f892f8 --- /dev/null +++ b/src/prost/cosmos.auth.module.v1.serde.rs @@ -0,0 +1,235 @@ +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 index 900cad3a..b6c3e8d7 100644 --- a/src/prost/cosmos.auth.v1beta1.rs +++ b/src/prost/cosmos.auth.v1beta1.rs @@ -1,7 +1,6 @@ /// 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). -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BaseAccount { @@ -14,8 +13,14 @@ pub struct BaseAccount { #[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 { + ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + } +} /// ModuleAccount defines an account for modules that holds coins on a pool. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ModuleAccount { @@ -26,10 +31,16 @@ pub struct ModuleAccount { #[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 { + ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + } +} /// ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules. /// /// Since: cosmos-sdk 0.47 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ModuleCredential { @@ -41,8 +52,14 @@ pub struct ModuleCredential { #[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 { + ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + } +} /// Params defines the parameters for the auth module. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -57,10 +74,16 @@ pub struct Params { #[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 { + ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + } +} /// MsgUpdateParams is the Msg/UpdateParams request type. /// /// Since: cosmos-sdk 0.47 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -73,14 +96,27 @@ pub struct MsgUpdateParams { #[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 { + ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + } +} /// MsgUpdateParamsResponse defines the response structure for executing a /// MsgUpdateParams message. /// /// Since: cosmos-sdk 0.47 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod msg_client { @@ -387,7 +423,6 @@ pub mod msg_server { /// QueryAccountsRequest is the request type for the Query/Accounts RPC method. /// /// Since: cosmos-sdk 0.43 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAccountsRequest { @@ -397,10 +432,16 @@ pub struct QueryAccountsRequest { 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 { + ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + } +} /// QueryAccountsResponse is the response type for the Query/Accounts RPC method. /// /// Since: cosmos-sdk 0.43 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAccountsResponse { @@ -413,8 +454,14 @@ pub struct QueryAccountsResponse { 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 { + ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + } +} /// QueryAccountRequest is the request type for the Query/Account RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAccountRequest { @@ -422,8 +469,14 @@ pub struct QueryAccountRequest { #[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 { + ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + } +} /// QueryAccountResponse is the response type for the Query/Account RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAccountResponse { @@ -431,13 +484,25 @@ pub struct QueryAccountResponse { #[prost(message, optional, tag = "1")] pub account: ::core::option::Option, } +impl ::prost::Name for QueryAccountResponse { + const NAME: &'static str = "QueryAccountResponse"; + const PACKAGE: &'static str = "cosmos.auth.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + } +} /// QueryParamsRequest is the request type for the Query/Params RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + } +} /// QueryParamsResponse is the response type for the Query/Params RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { @@ -445,100 +510,166 @@ 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.auth.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + } +} /// QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. /// /// Since: cosmos-sdk 0.46 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + } +} /// QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. /// /// Since: cosmos-sdk 0.46 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[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, } +impl ::prost::Name for QueryModuleAccountsResponse { + const NAME: &'static str = "QueryModuleAccountsResponse"; + const PACKAGE: &'static str = "cosmos.auth.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + } +} /// QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[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 { + ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + } +} /// QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[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, } +impl ::prost::Name for QueryModuleAccountByNameResponse { + const NAME: &'static str = "QueryModuleAccountByNameResponse"; + const PACKAGE: &'static str = "cosmos.auth.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + } +} /// Bech32PrefixRequest is the request type for Bech32Prefix rpc method. /// /// Since: cosmos-sdk 0.46 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + } +} /// Bech32PrefixResponse is the response type for Bech32Prefix rpc method. /// /// Since: cosmos-sdk 0.46 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[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 { + ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + } +} /// AddressBytesToStringRequest is the request type for AddressString rpc method. /// /// Since: cosmos-sdk 0.46 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[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 { + ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + } +} /// AddressBytesToStringResponse is the response type for AddressString rpc method. /// /// Since: cosmos-sdk 0.46 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[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 { + ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + } +} /// AddressStringToBytesRequest is the request type for AccountBytes rpc method. /// /// Since: cosmos-sdk 0.46 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[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 { + ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + } +} /// AddressStringToBytesResponse is the response type for AddressBytes rpc method. /// /// Since: cosmos-sdk 0.46 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[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 { + ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + } +} /// QueryAccountAddressByIDRequest is the request type for AccountAddressByID rpc method /// /// Since: cosmos-sdk 0.46.2 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAccountAddressByIdRequest { @@ -556,20 +687,32 @@ pub struct QueryAccountAddressByIdRequest { #[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 { + ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + } +} /// QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method /// /// Since: cosmos-sdk 0.46.2 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[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 { + ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + } +} /// QueryAccountInfoRequest is the Query/AccountInfo request type. /// /// Since: cosmos-sdk 0.47 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAccountInfoRequest { @@ -577,10 +720,16 @@ pub struct QueryAccountInfoRequest { #[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 { + ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + } +} /// QueryAccountInfoResponse is the Query/AccountInfo response type. /// /// Since: cosmos-sdk 0.47 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAccountInfoResponse { @@ -588,6 +737,13 @@ pub struct QueryAccountInfoResponse { #[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 { + ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod query_client { @@ -1652,7 +1808,6 @@ pub mod query_server { } } /// GenesisState defines the auth module's genesis state. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -1663,3 +1818,10 @@ pub struct GenesisState { #[prost(message, repeated, tag = "2")] pub accounts: ::prost::alloc::vec::Vec, } +impl ::prost::Name for GenesisState { + const NAME: &'static str = "GenesisState"; + const PACKAGE: &'static str = "cosmos.auth.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + } +} diff --git a/src/prost/cosmos.auth.v1beta1.serde.rs b/src/prost/cosmos.auth.v1beta1.serde.rs new file mode 100644 index 00000000..2a8f69cb --- /dev/null +++ b/src/prost/cosmos.auth.v1beta1.serde.rs @@ -0,0 +1,2668 @@ +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 index 09361cdb..fe1abca4 100644 --- a/src/prost/cosmos.bank.module.v1.rs +++ b/src/prost/cosmos.bank.module.v1.rs @@ -13,3 +13,10 @@ pub struct 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 { + ::prost::alloc::format!("cosmos.bank.module.v1.{}", Self::NAME) + } +} diff --git a/src/prost/cosmos.bank.module.v1.serde.rs b/src/prost/cosmos.bank.module.v1.serde.rs new file mode 100644 index 00000000..d9196d61 --- /dev/null +++ b/src/prost/cosmos.bank.module.v1.serde.rs @@ -0,0 +1,109 @@ +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 index dfbb996b..842fd5c8 100644 --- a/src/prost/cosmos.bank.v1beta1.rs +++ b/src/prost/cosmos.bank.v1beta1.rs @@ -1,5 +1,4 @@ /// Params defines the parameters for the bank module. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -14,9 +13,15 @@ pub struct Params { #[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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// SendEnabled maps coin denom to a send_enabled status (whether a denom is /// sendable). -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SendEnabled { @@ -25,8 +30,14 @@ pub struct SendEnabled { #[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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// Input models transaction input. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Input { @@ -35,8 +46,14 @@ pub struct Input { #[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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// Output models transaction outputs. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Output { @@ -45,19 +62,31 @@ pub struct Output { #[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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// 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. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// DenomUnit represents a struct that describes a given /// denomination unit of the basic token. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DenomUnit { @@ -75,9 +104,15 @@ pub struct DenomUnit { #[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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// Metadata represents a struct that describes /// a basic token. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Metadata { @@ -116,8 +151,14 @@ pub struct Metadata { #[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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// MsgSend represents a message to send coins from one account to another. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSend { @@ -128,13 +169,25 @@ pub struct MsgSend { #[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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// MsgSendResponse defines the Msg/Send response type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// MsgMultiSend represents an arbitrary multi-in, multi-out send message. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgMultiSend { @@ -145,15 +198,27 @@ pub struct MsgMultiSend { #[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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// MsgMultiSendResponse defines the Msg/MultiSend response type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// MsgUpdateParams is the Msg/UpdateParams request type. /// /// Since: cosmos-sdk 0.47 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -166,14 +231,27 @@ pub struct MsgUpdateParams { #[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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// MsgUpdateParamsResponse defines the response structure for executing a /// MsgUpdateParams message. /// /// Since: cosmos-sdk 0.47 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// MsgSetSendEnabled is the Msg/SetSendEnabled request type. /// /// Only entries to add/update/delete need to be included. @@ -181,7 +259,6 @@ pub struct MsgUpdateParamsResponse {} /// message are left unchanged. /// /// Since: cosmos-sdk 0.47 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSetSendEnabled { @@ -197,13 +274,26 @@ pub struct MsgSetSendEnabled { #[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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. /// /// Since: cosmos-sdk 0.47 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod msg_client { @@ -749,7 +839,6 @@ pub mod msg_server { } } /// QueryBalanceRequest is the request type for the Query/Balance RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryBalanceRequest { @@ -760,8 +849,14 @@ pub struct QueryBalanceRequest { #[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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// QueryBalanceResponse is the response type for the Query/Balance RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryBalanceResponse { @@ -769,8 +864,14 @@ pub struct QueryBalanceResponse { #[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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// QueryBalanceRequest is the request type for the Query/AllBalances RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllBalancesRequest { @@ -783,9 +884,15 @@ pub struct QueryAllBalancesRequest { 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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// QueryAllBalancesResponse is the response type for the Query/AllBalances RPC /// method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllBalancesResponse { @@ -798,11 +905,17 @@ pub struct QueryAllBalancesResponse { 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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// QuerySpendableBalancesRequest defines the gRPC request structure for querying /// an account's spendable balances. /// /// Since: cosmos-sdk 0.46 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySpendableBalancesRequest { @@ -815,11 +928,17 @@ pub struct QuerySpendableBalancesRequest { 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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// QuerySpendableBalancesResponse defines the gRPC response structure for querying /// an account's spendable balances. /// /// Since: cosmos-sdk 0.46 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySpendableBalancesResponse { @@ -832,11 +951,17 @@ pub struct QuerySpendableBalancesResponse { 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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// QuerySpendableBalanceByDenomRequest defines the gRPC request structure for /// querying an account's spendable balance for a specific denom. /// /// Since: cosmos-sdk 0.47 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySpendableBalanceByDenomRequest { @@ -847,11 +972,17 @@ pub struct QuerySpendableBalanceByDenomRequest { #[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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// QuerySpendableBalanceByDenomResponse defines the gRPC response structure for /// querying an account's spendable balance for a specific denom. /// /// Since: cosmos-sdk 0.47 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySpendableBalanceByDenomResponse { @@ -859,9 +990,15 @@ pub struct QuerySpendableBalanceByDenomResponse { #[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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC /// method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTotalSupplyRequest { @@ -873,9 +1010,15 @@ pub struct QueryTotalSupplyRequest { 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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC /// method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTotalSupplyResponse { @@ -890,8 +1033,14 @@ pub struct QueryTotalSupplyResponse { 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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySupplyOfRequest { @@ -899,8 +1048,14 @@ pub struct QuerySupplyOfRequest { #[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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySupplyOfResponse { @@ -908,21 +1063,39 @@ pub struct QuerySupplyOfResponse { #[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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// QueryParamsRequest defines the request type for querying x/bank parameters. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// QueryParamsResponse defines the response type for querying x/bank parameters. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomsMetadataRequest { @@ -932,9 +1105,15 @@ pub struct QueryDenomsMetadataRequest { 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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC /// method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomsMetadataResponse { @@ -947,8 +1126,14 @@ pub struct QueryDenomsMetadataResponse { 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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomMetadataRequest { @@ -956,9 +1141,15 @@ pub struct QueryDenomMetadataRequest { #[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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC /// method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomMetadataResponse { @@ -966,10 +1157,16 @@ pub struct QueryDenomMetadataResponse { #[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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, /// which queries for a paginated set of all account holders of a particular /// denomination. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomOwnersRequest { @@ -982,12 +1179,18 @@ pub struct QueryDenomOwnersRequest { 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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// 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 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DenomOwner { @@ -998,10 +1201,16 @@ pub struct DenomOwner { #[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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. /// /// Since: cosmos-sdk 0.46 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomOwnersResponse { @@ -1013,10 +1222,16 @@ pub struct QueryDenomOwnersResponse { 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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. /// /// Since: cosmos-sdk 0.47 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySendEnabledRequest { @@ -1030,10 +1245,16 @@ pub struct QuerySendEnabledRequest { 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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// QuerySendEnabledResponse defines the RPC response of a SendEnable query. /// /// Since: cosmos-sdk 0.47 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySendEnabledResponse { @@ -1046,6 +1267,13 @@ pub struct QuerySendEnabledResponse { 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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod query_client { @@ -2226,7 +2454,6 @@ pub mod query_server { /// the granter's account. /// /// Since: cosmos-sdk 0.43 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SendAuthorization { @@ -2239,8 +2466,14 @@ pub struct SendAuthorization { #[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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// GenesisState defines the bank module's genesis state. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -2263,9 +2496,15 @@ pub struct GenesisState { #[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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// Balance defines an account address and balance pair used in the bank module's /// genesis state. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Balance { @@ -2276,3 +2515,10 @@ pub struct Balance { #[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 { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} diff --git a/src/prost/cosmos.bank.v1beta1.serde.rs b/src/prost/cosmos.bank.v1beta1.serde.rs new file mode 100644 index 00000000..6fc304d4 --- /dev/null +++ b/src/prost/cosmos.bank.v1beta1.serde.rs @@ -0,0 +1,4293 @@ +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 index b76eab19..fbf5862f 100644 --- a/src/prost/cosmos.base.abci.v1beta1.rs +++ b/src/prost/cosmos.base.abci.v1beta1.rs @@ -51,6 +51,13 @@ pub struct TxResponse { #[prost(message, repeated, tag = "13")] pub events: ::prost::alloc::vec::Vec<::tendermint_proto::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 { + ::prost::alloc::format!("cosmos.base.abci.v1beta1.{}", Self::NAME) + } +} /// ABCIMessageLog defines a structure containing an indexed tx ABCI message log. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -64,6 +71,13 @@ pub struct AbciMessageLog { #[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 { + ::prost::alloc::format!("cosmos.base.abci.v1beta1.{}", Self::NAME) + } +} /// 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)] @@ -74,6 +88,13 @@ pub struct StringEvent { #[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 { + ::prost::alloc::format!("cosmos.base.abci.v1beta1.{}", Self::NAME) + } +} /// Attribute defines an attribute wrapper where the key and value are /// strings instead of raw bytes. #[allow(clippy::derive_partial_eq_without_eq)] @@ -84,6 +105,13 @@ pub struct Attribute { #[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 { + ::prost::alloc::format!("cosmos.base.abci.v1beta1.{}", Self::NAME) + } +} /// GasInfo defines tx execution gas context. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -95,6 +123,13 @@ pub struct GasInfo { #[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 { + ::prost::alloc::format!("cosmos.base.abci.v1beta1.{}", Self::NAME) + } +} /// Result is the union of ResponseFormat and ResponseCheckTx. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -121,6 +156,13 @@ pub struct Result { super::super::super::super::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 { + ::prost::alloc::format!("cosmos.base.abci.v1beta1.{}", Self::NAME) + } +} /// SimulationResponse defines the response generated when a transaction is /// successfully simulated. #[allow(clippy::derive_partial_eq_without_eq)] @@ -131,6 +173,13 @@ pub struct SimulationResponse { #[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 { + ::prost::alloc::format!("cosmos.base.abci.v1beta1.{}", Self::NAME) + } +} /// MsgData defines the data returned in a Result object during message /// execution. #[allow(clippy::derive_partial_eq_without_eq)] @@ -141,6 +190,13 @@ pub struct MsgData { #[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 { + ::prost::alloc::format!("cosmos.base.abci.v1beta1.{}", Self::NAME) + } +} /// TxMsgData defines a list of MsgData. A transaction will have a MsgData object /// for each message. #[allow(clippy::derive_partial_eq_without_eq)] @@ -158,6 +214,13 @@ pub struct TxMsgData { super::super::super::super::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 { + ::prost::alloc::format!("cosmos.base.abci.v1beta1.{}", Self::NAME) + } +} /// SearchTxsResult defines a structure for querying txs pageable #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -181,3 +244,10 @@ pub struct SearchTxsResult { #[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 { + ::prost::alloc::format!("cosmos.base.abci.v1beta1.{}", Self::NAME) + } +} diff --git a/src/prost/cosmos.base.kv.v1beta1.rs b/src/prost/cosmos.base.kv.v1beta1.rs index 60bda62f..6bd5f9c6 100644 --- a/src/prost/cosmos.base.kv.v1beta1.rs +++ b/src/prost/cosmos.base.kv.v1beta1.rs @@ -5,6 +5,13 @@ 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 { + ::prost::alloc::format!("cosmos.base.kv.v1beta1.{}", Self::NAME) + } +} /// Pair defines a key/value bytes tuple. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -14,3 +21,10 @@ pub struct Pair { #[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 { + ::prost::alloc::format!("cosmos.base.kv.v1beta1.{}", Self::NAME) + } +} diff --git a/src/prost/cosmos.base.kv.v1beta1.serde.rs b/src/prost/cosmos.base.kv.v1beta1.serde.rs new file mode 100644 index 00000000..3e2ed8b5 --- /dev/null +++ b/src/prost/cosmos.base.kv.v1beta1.serde.rs @@ -0,0 +1,205 @@ +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 index a3c81017..69d16e40 100644 --- a/src/prost/cosmos.base.node.v1beta1.rs +++ b/src/prost/cosmos.base.node.v1beta1.rs @@ -2,6 +2,13 @@ #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.base.node.v1beta1.{}", Self::NAME) + } +} /// ConfigResponse defines the response structure for the Config gRPC query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -9,6 +16,13 @@ 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 { + ::prost::alloc::format!("cosmos.base.node.v1beta1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod service_client { diff --git a/src/prost/cosmos.base.node.v1beta1.serde.rs b/src/prost/cosmos.base.node.v1beta1.serde.rs new file mode 100644 index 00000000..24a688cd --- /dev/null +++ b/src/prost/cosmos.base.node.v1beta1.serde.rs @@ -0,0 +1,163 @@ +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 index 41258d9f..2a5124cf 100644 --- a/src/prost/cosmos.base.query.v1beta1.rs +++ b/src/prost/cosmos.base.query.v1beta1.rs @@ -5,7 +5,6 @@ /// Foo some_parameter = 1; /// PageRequest pagination = 2; /// } -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PageRequest { @@ -35,6 +34,13 @@ pub struct PageRequest { #[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 { + ::prost::alloc::format!("cosmos.base.query.v1beta1.{}", Self::NAME) + } +} /// PageResponse is to be embedded in gRPC response messages where the /// corresponding request message has used PageRequest. /// @@ -42,7 +48,6 @@ pub struct PageRequest { /// repeated Bar results = 1; /// PageResponse page = 2; /// } -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PageResponse { @@ -56,3 +61,10 @@ pub struct PageResponse { #[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 { + ::prost::alloc::format!("cosmos.base.query.v1beta1.{}", Self::NAME) + } +} diff --git a/src/prost/cosmos.base.query.v1beta1.serde.rs b/src/prost/cosmos.base.query.v1beta1.serde.rs new file mode 100644 index 00000000..b58155f7 --- /dev/null +++ b/src/prost/cosmos.base.query.v1beta1.serde.rs @@ -0,0 +1,284 @@ +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 index 59d25f91..09305595 100644 --- a/src/prost/cosmos.base.reflection.v1beta1.rs +++ b/src/prost/cosmos.base.reflection.v1beta1.rs @@ -2,6 +2,13 @@ #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.base.reflection.v1beta1.{}", Self::NAME) + } +} /// ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -10,6 +17,13 @@ pub struct ListAllInterfacesResponse { #[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 { + ::prost::alloc::format!("cosmos.base.reflection.v1beta1.{}", Self::NAME) + } +} /// ListImplementationsRequest is the request type of the ListImplementations /// RPC. #[allow(clippy::derive_partial_eq_without_eq)] @@ -19,6 +33,13 @@ pub struct ListImplementationsRequest { #[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 { + ::prost::alloc::format!("cosmos.base.reflection.v1beta1.{}", Self::NAME) + } +} /// ListImplementationsResponse is the response type of the ListImplementations /// RPC. #[allow(clippy::derive_partial_eq_without_eq)] @@ -29,6 +50,13 @@ pub struct ListImplementationsResponse { ::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 { + ::prost::alloc::format!("cosmos.base.reflection.v1beta1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod reflection_service_client { diff --git a/src/prost/cosmos.base.reflection.v1beta1.serde.rs b/src/prost/cosmos.base.reflection.v1beta1.serde.rs new file mode 100644 index 00000000..731bbdf0 --- /dev/null +++ b/src/prost/cosmos.base.reflection.v1beta1.serde.rs @@ -0,0 +1,347 @@ +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 index 702862b8..ec09ac3a 100644 --- a/src/prost/cosmos.base.reflection.v2alpha1.rs +++ b/src/prost/cosmos.base.reflection.v2alpha1.rs @@ -22,6 +22,13 @@ pub struct AppDescriptor { #[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 { + ::prost::alloc::format!("cosmos.base.reflection.v2alpha1.{}", Self::NAME) + } +} /// TxDescriptor describes the accepted transaction type #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -35,6 +42,13 @@ pub struct TxDescriptor { #[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 { + ::prost::alloc::format!("cosmos.base.reflection.v2alpha1.{}", Self::NAME) + } +} /// AuthnDescriptor provides information on how to sign transactions without relying /// on the online RPCs GetTxMetadata and CombineUnsignedTxAndSignatures #[allow(clippy::derive_partial_eq_without_eq)] @@ -44,6 +58,13 @@ pub struct AuthnDescriptor { #[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 { + ::prost::alloc::format!("cosmos.base.reflection.v2alpha1.{}", Self::NAME) + } +} /// 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 @@ -62,6 +83,13 @@ pub struct SigningModeDescriptor { #[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 { + ::prost::alloc::format!("cosmos.base.reflection.v2alpha1.{}", Self::NAME) + } +} /// ChainDescriptor describes chain information of the application #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -70,6 +98,13 @@ pub struct ChainDescriptor { #[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 { + ::prost::alloc::format!("cosmos.base.reflection.v2alpha1.{}", Self::NAME) + } +} /// CodecDescriptor describes the registered interfaces and provides metadata information on the types #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -78,6 +113,13 @@ pub struct CodecDescriptor { #[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 { + ::prost::alloc::format!("cosmos.base.reflection.v2alpha1.{}", Self::NAME) + } +} /// InterfaceDescriptor describes the implementation of an interface #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -95,6 +137,13 @@ pub struct InterfaceDescriptor { #[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 { + ::prost::alloc::format!("cosmos.base.reflection.v2alpha1.{}", Self::NAME) + } +} /// InterfaceImplementerDescriptor describes an interface implementer #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -109,6 +158,13 @@ pub struct InterfaceImplementerDescriptor { #[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 { + ::prost::alloc::format!("cosmos.base.reflection.v2alpha1.{}", Self::NAME) + } +} /// InterfaceAcceptingMessageDescriptor describes a protobuf message which contains /// an interface represented as a google.protobuf.Any #[allow(clippy::derive_partial_eq_without_eq)] @@ -123,6 +179,13 @@ pub struct InterfaceAcceptingMessageDescriptor { #[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 { + ::prost::alloc::format!("cosmos.base.reflection.v2alpha1.{}", Self::NAME) + } +} /// ConfigurationDescriptor contains metadata information on the sdk.Config #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -131,6 +194,13 @@ pub struct ConfigurationDescriptor { #[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 { + ::prost::alloc::format!("cosmos.base.reflection.v2alpha1.{}", Self::NAME) + } +} /// 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)] @@ -139,10 +209,24 @@ pub struct MsgDescriptor { #[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 { + ::prost::alloc::format!("cosmos.base.reflection.v2alpha1.{}", Self::NAME) + } +} /// GetAuthnDescriptorRequest is the request used for the GetAuthnDescriptor RPC #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.base.reflection.v2alpha1.{}", Self::NAME) + } +} /// GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -151,10 +235,24 @@ pub struct GetAuthnDescriptorResponse { #[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 { + ::prost::alloc::format!("cosmos.base.reflection.v2alpha1.{}", Self::NAME) + } +} /// GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.base.reflection.v2alpha1.{}", Self::NAME) + } +} /// GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -163,10 +261,24 @@ pub struct GetChainDescriptorResponse { #[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 { + ::prost::alloc::format!("cosmos.base.reflection.v2alpha1.{}", Self::NAME) + } +} /// GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.base.reflection.v2alpha1.{}", Self::NAME) + } +} /// GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -175,10 +287,24 @@ pub struct GetCodecDescriptorResponse { #[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 { + ::prost::alloc::format!("cosmos.base.reflection.v2alpha1.{}", Self::NAME) + } +} /// GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.base.reflection.v2alpha1.{}", Self::NAME) + } +} /// GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -187,10 +313,24 @@ pub struct GetConfigurationDescriptorResponse { #[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 { + ::prost::alloc::format!("cosmos.base.reflection.v2alpha1.{}", Self::NAME) + } +} /// GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.base.reflection.v2alpha1.{}", Self::NAME) + } +} /// GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -199,10 +339,24 @@ pub struct GetQueryServicesDescriptorResponse { #[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 { + ::prost::alloc::format!("cosmos.base.reflection.v2alpha1.{}", Self::NAME) + } +} /// GetTxDescriptorRequest is the request used for the GetTxDescriptor RPC #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.base.reflection.v2alpha1.{}", Self::NAME) + } +} /// GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -212,6 +366,13 @@ pub struct GetTxDescriptorResponse { #[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 { + ::prost::alloc::format!("cosmos.base.reflection.v2alpha1.{}", Self::NAME) + } +} /// QueryServicesDescriptor contains the list of cosmos-sdk queriable services #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -220,6 +381,13 @@ pub struct QueryServicesDescriptor { #[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 { + ::prost::alloc::format!("cosmos.base.reflection.v2alpha1.{}", Self::NAME) + } +} /// QueryServiceDescriptor describes a cosmos-sdk queryable service #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -234,6 +402,13 @@ pub struct QueryServiceDescriptor { #[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 { + ::prost::alloc::format!("cosmos.base.reflection.v2alpha1.{}", Self::NAME) + } +} /// 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 @@ -248,6 +423,13 @@ pub struct QueryMethodDescriptor { #[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 { + ::prost::alloc::format!("cosmos.base.reflection.v2alpha1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod reflection_service_client { diff --git a/src/prost/cosmos.base.reflection.v2alpha1.serde.rs b/src/prost/cosmos.base.reflection.v2alpha1.serde.rs new file mode 100644 index 00000000..9103b97c --- /dev/null +++ b/src/prost/cosmos.base.reflection.v2alpha1.serde.rs @@ -0,0 +1,2515 @@ +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 index 546f9d4f..614c936c 100644 --- a/src/prost/cosmos.base.snapshots.v1beta1.rs +++ b/src/prost/cosmos.base.snapshots.v1beta1.rs @@ -13,6 +13,13 @@ pub struct Snapshot { #[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 { + ::prost::alloc::format!("cosmos.base.snapshots.v1beta1.{}", Self::NAME) + } +} /// Metadata contains SDK-specific snapshot metadata. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -21,6 +28,13 @@ pub struct Metadata { #[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 { + ::prost::alloc::format!("cosmos.base.snapshots.v1beta1.{}", Self::NAME) + } +} /// SnapshotItem is an item contained in a rootmulti.Store snapshot. /// /// Since: cosmos-sdk 0.46 @@ -51,6 +65,13 @@ pub mod snapshot_item { 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 { + ::prost::alloc::format!("cosmos.base.snapshots.v1beta1.{}", Self::NAME) + } +} /// SnapshotStoreItem contains metadata about a snapshotted store. /// /// Since: cosmos-sdk 0.46 @@ -60,6 +81,13 @@ 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 { + ::prost::alloc::format!("cosmos.base.snapshots.v1beta1.{}", Self::NAME) + } +} /// SnapshotIAVLItem is an exported IAVL node. /// /// Since: cosmos-sdk 0.46 @@ -77,6 +105,13 @@ pub struct SnapshotIavlItem { #[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 { + ::prost::alloc::format!("cosmos.base.snapshots.v1beta1.{}", Self::NAME) + } +} /// SnapshotExtensionMeta contains metadata about an external snapshotter. /// /// Since: cosmos-sdk 0.46 @@ -88,6 +123,13 @@ pub struct SnapshotExtensionMeta { #[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 { + ::prost::alloc::format!("cosmos.base.snapshots.v1beta1.{}", Self::NAME) + } +} /// SnapshotExtensionPayload contains payloads of an external snapshotter. /// /// Since: cosmos-sdk 0.46 @@ -97,6 +139,13 @@ 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 { + ::prost::alloc::format!("cosmos.base.snapshots.v1beta1.{}", Self::NAME) + } +} /// SnapshotKVItem is an exported Key/Value Pair /// /// Since: cosmos-sdk 0.46 @@ -109,6 +158,13 @@ pub struct SnapshotKvItem { #[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 { + ::prost::alloc::format!("cosmos.base.snapshots.v1beta1.{}", Self::NAME) + } +} /// SnapshotSchema is an exported schema of smt store /// /// Since: cosmos-sdk 0.46 @@ -119,3 +175,10 @@ 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 { + ::prost::alloc::format!("cosmos.base.snapshots.v1beta1.{}", Self::NAME) + } +} diff --git a/src/prost/cosmos.base.snapshots.v1beta1.serde.rs b/src/prost/cosmos.base.snapshots.v1beta1.serde.rs new file mode 100644 index 00000000..f28fcfed --- /dev/null +++ b/src/prost/cosmos.base.snapshots.v1beta1.serde.rs @@ -0,0 +1,1082 @@ +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 new file mode 100644 index 00000000..2916d33c --- /dev/null +++ b/src/prost/cosmos.base.store.v1beta1.serde.rs @@ -0,0 +1,791 @@ +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 index 24af374f..82dd22d6 100644 --- a/src/prost/cosmos.base.tendermint.v1beta1.rs +++ b/src/prost/cosmos.base.tendermint.v1beta1.rs @@ -12,6 +12,13 @@ pub struct Block { #[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 { + ::prost::alloc::format!("cosmos.base.tendermint.v1beta1.{}", Self::NAME) + } +} /// Header defines the structure of a Tendermint block header. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -68,6 +75,13 @@ pub struct Header { #[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 { + ::prost::alloc::format!("cosmos.base.tendermint.v1beta1.{}", Self::NAME) + } +} /// GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -78,6 +92,13 @@ pub struct GetValidatorSetByHeightRequest { #[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 { + ::prost::alloc::format!("cosmos.base.tendermint.v1beta1.{}", Self::NAME) + } +} /// GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -90,6 +111,13 @@ pub struct GetValidatorSetByHeightResponse { #[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 { + ::prost::alloc::format!("cosmos.base.tendermint.v1beta1.{}", Self::NAME) + } +} /// GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -98,6 +126,13 @@ pub struct GetLatestValidatorSetRequest { #[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 { + ::prost::alloc::format!("cosmos.base.tendermint.v1beta1.{}", Self::NAME) + } +} /// GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -110,6 +145,13 @@ pub struct GetLatestValidatorSetResponse { #[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 { + ::prost::alloc::format!("cosmos.base.tendermint.v1beta1.{}", Self::NAME) + } +} /// Validator is the type for the validator-set. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -125,6 +167,13 @@ pub struct Validator { #[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 { + ::prost::alloc::format!("cosmos.base.tendermint.v1beta1.{}", Self::NAME) + } +} /// GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -132,6 +181,13 @@ 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 { + ::prost::alloc::format!("cosmos.base.tendermint.v1beta1.{}", Self::NAME) + } +} /// GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -145,10 +201,24 @@ pub struct GetBlockByHeightResponse { #[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 { + ::prost::alloc::format!("cosmos.base.tendermint.v1beta1.{}", Self::NAME) + } +} /// GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.base.tendermint.v1beta1.{}", Self::NAME) + } +} /// GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -162,10 +232,24 @@ pub struct GetLatestBlockResponse { #[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 { + ::prost::alloc::format!("cosmos.base.tendermint.v1beta1.{}", Self::NAME) + } +} /// GetSyncingRequest is the request type for the Query/GetSyncing RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.base.tendermint.v1beta1.{}", Self::NAME) + } +} /// GetSyncingResponse is the response type for the Query/GetSyncing RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -173,10 +257,24 @@ 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 { + ::prost::alloc::format!("cosmos.base.tendermint.v1beta1.{}", Self::NAME) + } +} /// GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.base.tendermint.v1beta1.{}", Self::NAME) + } +} /// GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -188,6 +286,13 @@ pub struct GetNodeInfoResponse { #[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 { + ::prost::alloc::format!("cosmos.base.tendermint.v1beta1.{}", Self::NAME) + } +} /// VersionInfo is the type for the GetNodeInfoResponse message. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -210,6 +315,13 @@ pub struct VersionInfo { #[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 { + ::prost::alloc::format!("cosmos.base.tendermint.v1beta1.{}", Self::NAME) + } +} /// Module is the type for VersionInfo #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -224,6 +336,13 @@ pub struct Module { #[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 { + ::prost::alloc::format!("cosmos.base.tendermint.v1beta1.{}", Self::NAME) + } +} /// ABCIQueryRequest defines the request structure for the ABCIQuery gRPC query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -237,6 +356,13 @@ pub struct AbciQueryRequest { #[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 { + ::prost::alloc::format!("cosmos.base.tendermint.v1beta1.{}", Self::NAME) + } +} /// ABCIQueryResponse defines the response structure for the ABCIQuery gRPC query. /// /// Note: This type is a duplicate of the ResponseQuery proto type defined in @@ -265,6 +391,13 @@ pub struct AbciQueryResponse { #[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 { + ::prost::alloc::format!("cosmos.base.tendermint.v1beta1.{}", Self::NAME) + } +} /// ProofOp defines an operation used for calculating Merkle root. The data could /// be arbitrary format, providing necessary data for example neighbouring node /// hash. @@ -280,6 +413,13 @@ pub struct ProofOp { #[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 { + ::prost::alloc::format!("cosmos.base.tendermint.v1beta1.{}", Self::NAME) + } +} /// ProofOps is Merkle proof defined by the list of ProofOps. /// /// Note: This type is a duplicate of the ProofOps proto type defined in Tendermint. @@ -289,6 +429,13 @@ 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 { + ::prost::alloc::format!("cosmos.base.tendermint.v1beta1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod service_client { diff --git a/src/prost/cosmos.base.v1beta1.rs b/src/prost/cosmos.base.v1beta1.rs index 6cedf8eb..e3497310 100644 --- a/src/prost/cosmos.base.v1beta1.rs +++ b/src/prost/cosmos.base.v1beta1.rs @@ -2,7 +2,6 @@ /// /// NOTE: The amount field is an Int which implements the custom method /// signatures required by gogoproto. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Coin { @@ -11,11 +10,17 @@ pub struct Coin { #[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 { + ::prost::alloc::format!("cosmos.base.v1beta1.{}", Self::NAME) + } +} /// 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. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DecCoin { @@ -24,19 +29,38 @@ pub struct DecCoin { #[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 { + ::prost::alloc::format!("cosmos.base.v1beta1.{}", Self::NAME) + } +} /// IntProto defines a Protobuf wrapper around an Int object. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[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 { + ::prost::alloc::format!("cosmos.base.v1beta1.{}", Self::NAME) + } +} /// DecProto defines a Protobuf wrapper around a Dec object. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[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 { + ::prost::alloc::format!("cosmos.base.v1beta1.{}", Self::NAME) + } +} diff --git a/src/prost/cosmos.base.v1beta1.serde.rs b/src/prost/cosmos.base.v1beta1.serde.rs new file mode 100644 index 00000000..91566588 --- /dev/null +++ b/src/prost/cosmos.base.v1beta1.serde.rs @@ -0,0 +1,398 @@ +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 index 99620e3a..4195c048 100644 --- a/src/prost/cosmos.crypto.ed25519.rs +++ b/src/prost/cosmos.crypto.ed25519.rs @@ -9,6 +9,13 @@ 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 { + ::prost::alloc::format!("cosmos.crypto.ed25519.{}", Self::NAME) + } +} /// 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)] @@ -17,3 +24,10 @@ 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 { + ::prost::alloc::format!("cosmos.crypto.ed25519.{}", Self::NAME) + } +} diff --git a/src/prost/cosmos.crypto.ed25519.serde.rs b/src/prost/cosmos.crypto.ed25519.serde.rs new file mode 100644 index 00000000..5d4a3dc7 --- /dev/null +++ b/src/prost/cosmos.crypto.ed25519.serde.rs @@ -0,0 +1,188 @@ +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 index 65fdd3fa..0561b040 100644 --- a/src/prost/cosmos.crypto.hd.v1.rs +++ b/src/prost/cosmos.crypto.hd.v1.rs @@ -19,3 +19,10 @@ pub struct Bip44Params { #[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 { + ::prost::alloc::format!("cosmos.crypto.hd.v1.{}", Self::NAME) + } +} diff --git a/src/prost/cosmos.crypto.hd.v1.serde.rs b/src/prost/cosmos.crypto.hd.v1.serde.rs new file mode 100644 index 00000000..1e466886 --- /dev/null +++ b/src/prost/cosmos.crypto.hd.v1.serde.rs @@ -0,0 +1,169 @@ +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 index 34ae205c..1990225d 100644 --- a/src/prost/cosmos.crypto.keyring.v1.rs +++ b/src/prost/cosmos.crypto.keyring.v1.rs @@ -26,6 +26,13 @@ pub mod record { super::super::super::super::super::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 { + ::prost::alloc::format!("cosmos.crypto.keyring.v1.Record.{}", Self::NAME) + } + } /// Ledger item #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -33,14 +40,35 @@ pub mod record { #[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 { + ::prost::alloc::format!("cosmos.crypto.keyring.v1.Record.{}", Self::NAME) + } + } /// Multi item #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.crypto.keyring.v1.Record.{}", Self::NAME) + } + } /// Offline item #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.crypto.keyring.v1.Record.{}", Self::NAME) + } + } /// Record contains one of the following items #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] @@ -59,3 +87,10 @@ pub mod record { 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 { + ::prost::alloc::format!("cosmos.crypto.keyring.v1.{}", Self::NAME) + } +} diff --git a/src/prost/cosmos.crypto.keyring.v1.serde.rs b/src/prost/cosmos.crypto.keyring.v1.serde.rs new file mode 100644 index 00000000..1141663a --- /dev/null +++ b/src/prost/cosmos.crypto.keyring.v1.serde.rs @@ -0,0 +1,495 @@ +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 index c843eb9f..6455fb3d 100644 --- a/src/prost/cosmos.crypto.multisig.rs +++ b/src/prost/cosmos.crypto.multisig.rs @@ -11,3 +11,10 @@ pub struct LegacyAminoPubKey { super::super::super::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 { + ::prost::alloc::format!("cosmos.crypto.multisig.{}", Self::NAME) + } +} diff --git a/src/prost/cosmos.crypto.multisig.serde.rs b/src/prost/cosmos.crypto.multisig.serde.rs new file mode 100644 index 00000000..f535b553 --- /dev/null +++ b/src/prost/cosmos.crypto.multisig.serde.rs @@ -0,0 +1,111 @@ +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 index c245db9e..1d784f69 100644 --- a/src/prost/cosmos.crypto.multisig.v1beta1.rs +++ b/src/prost/cosmos.crypto.multisig.v1beta1.rs @@ -7,6 +7,13 @@ 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 { + ::prost::alloc::format!("cosmos.crypto.multisig.v1beta1.{}", Self::NAME) + } +} /// 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. @@ -19,3 +26,10 @@ pub struct CompactBitArray { #[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 { + ::prost::alloc::format!("cosmos.crypto.multisig.v1beta1.{}", Self::NAME) + } +} diff --git a/src/prost/cosmos.crypto.multisig.v1beta1.serde.rs b/src/prost/cosmos.crypto.multisig.v1beta1.serde.rs new file mode 100644 index 00000000..3a12dfe6 --- /dev/null +++ b/src/prost/cosmos.crypto.multisig.v1beta1.serde.rs @@ -0,0 +1,208 @@ +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 index 9c8f647b..cafdb65e 100644 --- a/src/prost/cosmos.crypto.secp256k1.rs +++ b/src/prost/cosmos.crypto.secp256k1.rs @@ -9,6 +9,13 @@ 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 { + ::prost::alloc::format!("cosmos.crypto.secp256k1.{}", Self::NAME) + } +} /// PrivKey defines a secp256k1 private key. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -16,3 +23,10 @@ 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 { + ::prost::alloc::format!("cosmos.crypto.secp256k1.{}", Self::NAME) + } +} diff --git a/src/prost/cosmos.crypto.secp256k1.serde.rs b/src/prost/cosmos.crypto.secp256k1.serde.rs new file mode 100644 index 00000000..aaea5af5 --- /dev/null +++ b/src/prost/cosmos.crypto.secp256k1.serde.rs @@ -0,0 +1,188 @@ +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 index ee82db1e..067eef4b 100644 --- a/src/prost/cosmos.crypto.secp256r1.rs +++ b/src/prost/cosmos.crypto.secp256r1.rs @@ -7,6 +7,13 @@ 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.secp256r1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.crypto.secp256r1.{}", Self::NAME) + } +} /// PrivKey defines a secp256r1 ECDSA private key. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -15,3 +22,10 @@ pub struct PrivKey { #[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 { + ::prost::alloc::format!("cosmos.crypto.secp256r1.{}", Self::NAME) + } +} diff --git a/src/prost/cosmos.crypto.secp256r1.serde.rs b/src/prost/cosmos.crypto.secp256r1.serde.rs new file mode 100644 index 00000000..f1cca10b --- /dev/null +++ b/src/prost/cosmos.crypto.secp256r1.serde.rs @@ -0,0 +1,188 @@ +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 index 86a21aca..9a066d49 100644 --- a/src/prost/cosmos.gov.module.v1.rs +++ b/src/prost/cosmos.gov.module.v1.rs @@ -10,3 +10,10 @@ pub struct 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 { + ::prost::alloc::format!("cosmos.gov.module.v1.{}", Self::NAME) + } +} diff --git a/src/prost/cosmos.gov.module.v1.serde.rs b/src/prost/cosmos.gov.module.v1.serde.rs new file mode 100644 index 00000000..88377721 --- /dev/null +++ b/src/prost/cosmos.gov.module.v1.serde.rs @@ -0,0 +1,112 @@ +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 index f8377353..feb0a17d 100644 --- a/src/prost/cosmos.gov.v1.rs +++ b/src/prost/cosmos.gov.v1.rs @@ -9,6 +9,13 @@ pub struct WeightedVoteOption { #[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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// Deposit defines an amount deposited by an account address to an active /// proposal. #[allow(clippy::derive_partial_eq_without_eq)] @@ -24,6 +31,13 @@ pub struct Deposit { #[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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// Proposal defines the core field members of a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -84,6 +98,13 @@ pub struct Proposal { #[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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// TallyResult defines a standard tally for a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -101,6 +122,13 @@ pub struct TallyResult { #[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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// 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)] @@ -119,6 +147,13 @@ pub struct 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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// DepositParams defines the params for deposits on governance proposals. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -133,6 +168,13 @@ pub struct DepositParams { super::super::super::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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// VotingParams defines the params for voting on governance proposals. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -143,6 +185,13 @@ pub struct VotingParams { super::super::super::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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// TallyParams defines the params for tallying votes on governance proposals. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -159,6 +208,13 @@ pub struct TallyParams { #[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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// Params defines the parameters for the x/gov module. /// /// Since: cosmos-sdk 0.47 @@ -203,6 +259,13 @@ pub struct Params { #[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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// VoteOption enumerates the valid vote options for a given governance proposal. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] @@ -322,6 +385,13 @@ pub struct MsgSubmitProposal { #[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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -330,6 +400,13 @@ pub struct MsgSubmitProposalResponse { #[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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// 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)] @@ -342,10 +419,24 @@ pub struct MsgExecLegacyContent { #[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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// MsgVote defines a message to cast a vote. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -363,10 +454,24 @@ pub struct MsgVote { #[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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// MsgVoteResponse defines the Msg/Vote response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// MsgVoteWeighted defines a message to cast a vote. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -384,10 +489,24 @@ pub struct MsgVoteWeighted { #[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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// MsgDeposit defines a message to submit a deposit to an existing proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -402,10 +521,24 @@ pub struct MsgDeposit { #[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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// MsgDepositResponse defines the Msg/Deposit response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// MsgUpdateParams is the Msg/UpdateParams request type. /// /// Since: cosmos-sdk 0.47 @@ -421,6 +554,13 @@ pub struct MsgUpdateParams { #[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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// MsgUpdateParamsResponse defines the response structure for executing a /// MsgUpdateParams message. /// @@ -428,6 +568,13 @@ pub struct MsgUpdateParams { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod msg_client { @@ -1124,6 +1271,13 @@ pub struct QueryProposalRequest { #[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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// QueryProposalResponse is the response type for the Query/Proposal RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1132,6 +1286,13 @@ 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.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// QueryProposalsRequest is the request type for the Query/Proposals RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1151,6 +1312,13 @@ pub struct QueryProposalsRequest { 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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// QueryProposalsResponse is the response type for the Query/Proposals RPC /// method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -1165,6 +1333,13 @@ pub struct QueryProposalsResponse { 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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// QueryVoteRequest is the request type for the Query/Vote RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1176,6 +1351,13 @@ pub struct QueryVoteRequest { #[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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// QueryVoteResponse is the response type for the Query/Vote RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1184,6 +1366,13 @@ pub struct QueryVoteResponse { #[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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// QueryVotesRequest is the request type for the Query/Votes RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1197,6 +1386,13 @@ pub struct QueryVotesRequest { 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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// QueryVotesResponse is the response type for the Query/Votes RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1210,6 +1406,13 @@ pub struct QueryVotesResponse { 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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// QueryParamsRequest is the request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1219,6 +1422,13 @@ pub struct QueryParamsRequest { #[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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// QueryParamsResponse is the response type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1244,6 +1454,13 @@ pub struct QueryParamsResponse { #[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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// QueryDepositRequest is the request type for the Query/Deposit RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1255,6 +1472,13 @@ pub struct QueryDepositRequest { #[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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// QueryDepositResponse is the response type for the Query/Deposit RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1263,6 +1487,13 @@ pub struct QueryDepositResponse { #[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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// QueryDepositsRequest is the request type for the Query/Deposits RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1276,6 +1507,13 @@ pub struct QueryDepositsRequest { 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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// QueryDepositsResponse is the response type for the Query/Deposits RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1289,6 +1527,13 @@ pub struct QueryDepositsResponse { 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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// QueryTallyResultRequest is the request type for the Query/Tally RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1297,6 +1542,13 @@ pub struct QueryTallyResultRequest { #[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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// QueryTallyResultResponse is the response type for the Query/Tally RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1305,6 +1557,13 @@ pub struct QueryTallyResultResponse { #[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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod query_client { @@ -2191,3 +2450,10 @@ pub struct GenesisState { #[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 { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} diff --git a/src/prost/cosmos.gov.v1.serde.rs b/src/prost/cosmos.gov.v1.serde.rs new file mode 100644 index 00000000..82932543 --- /dev/null +++ b/src/prost/cosmos.gov.v1.serde.rs @@ -0,0 +1,4771 @@ +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 index ad4845e0..d421555b 100644 --- a/src/prost/cosmos.gov.v1beta1.rs +++ b/src/prost/cosmos.gov.v1beta1.rs @@ -11,6 +11,13 @@ pub struct WeightedVoteOption { #[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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// TextProposal defines a standard text proposal whose changes need to be /// manually updated in case of approval. #[allow(clippy::derive_partial_eq_without_eq)] @@ -23,6 +30,13 @@ pub struct TextProposal { #[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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// Deposit defines an amount deposited by an account address to an active /// proposal. #[allow(clippy::derive_partial_eq_without_eq)] @@ -38,6 +52,13 @@ pub struct Deposit { #[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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// Proposal defines the core field members of a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -80,6 +101,13 @@ pub struct Proposal { super::super::super::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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// TallyResult defines a standard tally for a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -97,6 +125,13 @@ pub struct TallyResult { #[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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// 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)] @@ -120,6 +155,13 @@ pub struct Vote { #[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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// DepositParams defines the params for deposits on governance proposals. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -134,6 +176,13 @@ pub struct DepositParams { super::super::super::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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// VotingParams defines the params for voting on governance proposals. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -144,6 +193,13 @@ pub struct VotingParams { super::super::super::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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// TallyParams defines the params for tallying votes on governance proposals. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -160,6 +216,13 @@ pub struct TallyParams { #[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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// VoteOption enumerates the valid vote options for a given governance proposal. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] @@ -266,6 +329,13 @@ pub struct MsgSubmitProposal { #[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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -274,6 +344,13 @@ pub struct MsgSubmitProposalResponse { #[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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// MsgVote defines a message to cast a vote. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -288,10 +365,24 @@ pub struct MsgVote { #[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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// MsgVoteResponse defines the Msg/Vote response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// MsgVoteWeighted defines a message to cast a vote. /// /// Since: cosmos-sdk 0.43 @@ -308,12 +399,26 @@ pub struct MsgVoteWeighted { #[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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. /// /// Since: cosmos-sdk 0.43 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// MsgDeposit defines a message to submit a deposit to an existing proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -328,10 +433,24 @@ pub struct MsgDeposit { #[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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// MsgDepositResponse defines the Msg/Deposit response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod msg_client { @@ -872,6 +991,13 @@ pub struct QueryProposalRequest { #[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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// QueryProposalResponse is the response type for the Query/Proposal RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -879,6 +1005,13 @@ 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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// QueryProposalsRequest is the request type for the Query/Proposals RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -898,6 +1031,13 @@ pub struct QueryProposalsRequest { 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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// QueryProposalsResponse is the response type for the Query/Proposals RPC /// method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -912,6 +1052,13 @@ pub struct QueryProposalsResponse { 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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// QueryVoteRequest is the request type for the Query/Vote RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -923,6 +1070,13 @@ pub struct QueryVoteRequest { #[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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// QueryVoteResponse is the response type for the Query/Vote RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -931,6 +1085,13 @@ pub struct QueryVoteResponse { #[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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// QueryVotesRequest is the request type for the Query/Votes RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -944,6 +1105,13 @@ pub struct QueryVotesRequest { 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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// QueryVotesResponse is the response type for the Query/Votes RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -957,6 +1125,13 @@ pub struct QueryVotesResponse { 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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// QueryParamsRequest is the request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -966,6 +1141,13 @@ pub struct QueryParamsRequest { #[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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// QueryParamsResponse is the response type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -980,6 +1162,13 @@ pub struct QueryParamsResponse { #[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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// QueryDepositRequest is the request type for the Query/Deposit RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -991,6 +1180,13 @@ pub struct QueryDepositRequest { #[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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// QueryDepositResponse is the response type for the Query/Deposit RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -999,6 +1195,13 @@ pub struct QueryDepositResponse { #[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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// QueryDepositsRequest is the request type for the Query/Deposits RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1012,6 +1215,13 @@ pub struct QueryDepositsRequest { 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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// QueryDepositsResponse is the response type for the Query/Deposits RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1025,6 +1235,13 @@ pub struct QueryDepositsResponse { 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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// QueryTallyResultRequest is the request type for the Query/Tally RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1033,6 +1250,13 @@ pub struct QueryTallyResultRequest { #[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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// QueryTallyResultResponse is the response type for the Query/Tally RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1041,6 +1265,13 @@ pub struct QueryTallyResultResponse { #[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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod query_client { @@ -1920,3 +2151,10 @@ pub struct GenesisState { #[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 { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} diff --git a/src/prost/cosmos.gov.v1beta1.serde.rs b/src/prost/cosmos.gov.v1beta1.serde.rs new file mode 100644 index 00000000..1e738333 --- /dev/null +++ b/src/prost/cosmos.gov.v1beta1.serde.rs @@ -0,0 +1,4091 @@ +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 new file mode 100644 index 00000000..776025f5 --- /dev/null +++ b/src/prost/cosmos.ics23.v1.serde.rs @@ -0,0 +1,1936 @@ +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 index a03ed2a9..2a8d086b 100644 --- a/src/prost/cosmos.staking.module.v1.rs +++ b/src/prost/cosmos.staking.module.v1.rs @@ -11,3 +11,10 @@ pub struct 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 { + ::prost::alloc::format!("cosmos.staking.module.v1.{}", Self::NAME) + } +} diff --git a/src/prost/cosmos.staking.module.v1.serde.rs b/src/prost/cosmos.staking.module.v1.serde.rs new file mode 100644 index 00000000..f9224074 --- /dev/null +++ b/src/prost/cosmos.staking.module.v1.serde.rs @@ -0,0 +1,109 @@ +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 index f5943f04..2c2c1b8d 100644 --- a/src/prost/cosmos.staking.v1beta1.rs +++ b/src/prost/cosmos.staking.v1beta1.rs @@ -10,6 +10,13 @@ pub struct HistoricalInfo { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// CommissionRates defines the initial commission rates to be used for creating /// a validator. #[allow(clippy::derive_partial_eq_without_eq)] @@ -25,6 +32,13 @@ pub struct CommissionRates { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// Commission defines commission parameters for a given validator. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -38,6 +52,13 @@ pub struct Commission { super::super::super::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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// Description defines a validator description. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -58,6 +79,13 @@ pub struct Description { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// 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 @@ -115,6 +143,13 @@ pub struct 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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// ValAddresses defines a repeated set of validator addresses. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -122,6 +157,13 @@ 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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// 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. @@ -133,6 +175,13 @@ pub struct DvPair { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// DVPairs defines an array of DVPair objects. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -140,6 +189,13 @@ 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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// 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 @@ -154,6 +210,13 @@ pub struct DvvTriplet { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// DVVTriplets defines an array of DVVTriplet objects. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -161,6 +224,13 @@ 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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// 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. @@ -177,6 +247,13 @@ pub struct Delegation { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// 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)] @@ -194,6 +271,13 @@ pub struct UnbondingDelegation { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// UnbondingDelegationEntry defines an unbonding object with relevant metadata. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -219,6 +303,13 @@ pub struct UnbondingDelegationEntry { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// RedelegationEntry defines a redelegation object with relevant metadata. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -244,6 +335,13 @@ pub struct RedelegationEntry { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// 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)] @@ -264,6 +362,13 @@ pub struct Redelegation { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// Params defines the parameters for the x/staking module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -289,6 +394,13 @@ pub struct Params { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// 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)] @@ -299,6 +411,13 @@ pub struct DelegationResponse { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// RedelegationEntryResponse is equivalent to a RedelegationEntry except that it /// contains a balance in addition to shares which is more suitable for client /// responses. @@ -310,6 +429,13 @@ pub struct RedelegationEntryResponse { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// RedelegationResponse is equivalent to a Redelegation except that its entries /// contain a balance in addition to shares which is more suitable for client /// responses. @@ -321,6 +447,13 @@ pub struct RedelegationResponse { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// Pool is used for tracking bonded and not-bonded token supply of the bond /// denomination. #[allow(clippy::derive_partial_eq_without_eq)] @@ -331,6 +464,13 @@ pub struct Pool { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// 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)] @@ -339,6 +479,13 @@ 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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// BondStatus is the status of a validator. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] @@ -461,10 +608,24 @@ pub struct MsgCreateValidator { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// MsgCreateValidatorResponse defines the Msg/CreateValidator response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// MsgEditValidator defines a SDK message for editing an existing validator. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -482,10 +643,24 @@ pub struct MsgEditValidator { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// MsgEditValidatorResponse defines the Msg/EditValidator response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// MsgDelegate defines a SDK message for performing a delegation of coins /// from a delegator to a validator. #[allow(clippy::derive_partial_eq_without_eq)] @@ -498,10 +673,24 @@ pub struct MsgDelegate { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// MsgDelegateResponse defines the Msg/Delegate response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// 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)] @@ -516,6 +705,13 @@ pub struct MsgBeginRedelegate { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -525,6 +721,13 @@ pub struct MsgBeginRedelegateResponse { super::super::super::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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// MsgUndelegate defines a SDK message for performing an undelegation from a /// delegate and a validator. #[allow(clippy::derive_partial_eq_without_eq)] @@ -537,6 +740,13 @@ pub struct MsgUndelegate { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// MsgUndelegateResponse defines the Msg/Undelegate response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -546,6 +756,13 @@ pub struct MsgUndelegateResponse { super::super::super::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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator /// /// Since: cosmos-sdk 0.46 @@ -563,12 +780,26 @@ pub struct MsgCancelUnbondingDelegation { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// MsgCancelUnbondingDelegationResponse /// /// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// MsgUpdateParams is the Msg/UpdateParams request type. /// /// Since: cosmos-sdk 0.47 @@ -584,6 +815,13 @@ pub struct MsgUpdateParams { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// MsgUpdateParamsResponse defines the response structure for executing a /// MsgUpdateParams message. /// @@ -591,6 +829,13 @@ pub struct MsgUpdateParams { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod msg_client { @@ -1397,6 +1642,13 @@ pub struct QueryValidatorsRequest { 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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// QueryValidatorsResponse is response type for the Query/Validators RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1410,6 +1662,13 @@ pub struct QueryValidatorsResponse { 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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// QueryValidatorRequest is response type for the Query/Validator RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1418,6 +1677,13 @@ pub struct QueryValidatorRequest { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// QueryValidatorResponse is response type for the Query/Validator RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1426,6 +1692,13 @@ pub struct QueryValidatorResponse { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// QueryValidatorDelegationsRequest is request type for the /// Query/ValidatorDelegations RPC method #[allow(clippy::derive_partial_eq_without_eq)] @@ -1440,6 +1713,13 @@ pub struct QueryValidatorDelegationsRequest { 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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// QueryValidatorDelegationsResponse is response type for the /// Query/ValidatorDelegations RPC method #[allow(clippy::derive_partial_eq_without_eq)] @@ -1453,6 +1733,13 @@ pub struct QueryValidatorDelegationsResponse { 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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// QueryValidatorUnbondingDelegationsRequest is required type for the /// Query/ValidatorUnbondingDelegations RPC method #[allow(clippy::derive_partial_eq_without_eq)] @@ -1467,6 +1754,13 @@ pub struct QueryValidatorUnbondingDelegationsRequest { 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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// QueryValidatorUnbondingDelegationsResponse is response type for the /// Query/ValidatorUnbondingDelegations RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -1480,6 +1774,13 @@ pub struct QueryValidatorUnbondingDelegationsResponse { 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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// QueryDelegationRequest is request type for the Query/Delegation RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1491,6 +1792,13 @@ pub struct QueryDelegationRequest { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// QueryDelegationResponse is response type for the Query/Delegation RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1499,6 +1807,13 @@ pub struct QueryDelegationResponse { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// QueryUnbondingDelegationRequest is request type for the /// Query/UnbondingDelegation RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -1511,6 +1826,13 @@ pub struct QueryUnbondingDelegationRequest { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// QueryDelegationResponse is response type for the Query/UnbondingDelegation /// RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -1520,6 +1842,13 @@ pub struct QueryUnbondingDelegationResponse { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// QueryDelegatorDelegationsRequest is request type for the /// Query/DelegatorDelegations RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -1534,6 +1863,13 @@ pub struct QueryDelegatorDelegationsRequest { 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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// QueryDelegatorDelegationsResponse is response type for the /// Query/DelegatorDelegations RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -1548,6 +1884,13 @@ pub struct QueryDelegatorDelegationsResponse { 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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// QueryDelegatorUnbondingDelegationsRequest is request type for the /// Query/DelegatorUnbondingDelegations RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -1562,6 +1905,13 @@ pub struct QueryDelegatorUnbondingDelegationsRequest { 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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// QueryUnbondingDelegatorDelegationsResponse is response type for the /// Query/UnbondingDelegatorDelegations RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -1575,6 +1925,13 @@ pub struct QueryDelegatorUnbondingDelegationsResponse { 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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// QueryRedelegationsRequest is request type for the Query/Redelegations RPC /// method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -1595,6 +1952,13 @@ pub struct QueryRedelegationsRequest { 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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// QueryRedelegationsResponse is response type for the Query/Redelegations RPC /// method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -1608,6 +1972,13 @@ pub struct QueryRedelegationsResponse { 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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// QueryDelegatorValidatorsRequest is request type for the /// Query/DelegatorValidators RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -1622,6 +1993,13 @@ pub struct QueryDelegatorValidatorsRequest { 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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// QueryDelegatorValidatorsResponse is response type for the /// Query/DelegatorValidators RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -1636,6 +2014,13 @@ pub struct QueryDelegatorValidatorsResponse { 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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// QueryDelegatorValidatorRequest is request type for the /// Query/DelegatorValidator RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -1648,6 +2033,13 @@ pub struct QueryDelegatorValidatorRequest { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// QueryDelegatorValidatorResponse response type for the /// Query/DelegatorValidator RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -1657,6 +2049,13 @@ pub struct QueryDelegatorValidatorResponse { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC /// method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -1666,6 +2065,13 @@ pub struct QueryHistoricalInfoRequest { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC /// method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -1675,10 +2081,24 @@ pub struct QueryHistoricalInfoResponse { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// QueryPoolRequest is request type for the Query/Pool RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// QueryPoolResponse is response type for the Query/Pool RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1687,10 +2107,24 @@ pub struct QueryPoolResponse { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// QueryParamsRequest is request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// QueryParamsResponse is response type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1699,6 +2133,13 @@ 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.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod query_client { @@ -3176,6 +3617,15 @@ pub mod stake_authorization { #[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 { + ::prost::alloc::format!( + "cosmos.staking.v1beta1.StakeAuthorization.{}", Self::NAME + ) + } + } /// validators is the oneof that represents either allow_list or deny_list #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] @@ -3189,6 +3639,13 @@ pub mod stake_authorization { 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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// AuthorizationType defines the type of staking module authorization type /// /// Since: cosmos-sdk 0.43 @@ -3258,6 +3715,13 @@ pub struct GenesisState { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} /// LastValidatorPower required for validator set update logic. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -3269,3 +3733,10 @@ pub struct LastValidatorPower { #[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 { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} diff --git a/src/prost/cosmos.staking.v1beta1.serde.rs b/src/prost/cosmos.staking.v1beta1.serde.rs new file mode 100644 index 00000000..38ca4a23 --- /dev/null +++ b/src/prost/cosmos.staking.v1beta1.serde.rs @@ -0,0 +1,7752 @@ +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 index b36bd58f..b79ab2e0 100644 --- a/src/prost/cosmos.tx.config.v1.rs +++ b/src/prost/cosmos.tx.config.v1.rs @@ -1,5 +1,4 @@ /// Config is the config object of the x/auth/tx package. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Config { @@ -12,3 +11,10 @@ pub struct Config { #[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 { + ::prost::alloc::format!("cosmos.tx.config.v1.{}", Self::NAME) + } +} diff --git a/src/prost/cosmos.tx.config.v1.serde.rs b/src/prost/cosmos.tx.config.v1.serde.rs new file mode 100644 index 00000000..d4283484 --- /dev/null +++ b/src/prost/cosmos.tx.config.v1.serde.rs @@ -0,0 +1,110 @@ +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 index bfed1a37..4685364f 100644 --- a/src/prost/cosmos.tx.signing.v1beta1.rs +++ b/src/prost/cosmos.tx.signing.v1beta1.rs @@ -6,6 +6,13 @@ pub struct SignatureDescriptors { #[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 { + ::prost::alloc::format!("cosmos.tx.signing.v1beta1.{}", Self::NAME) + } +} /// 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 @@ -49,6 +56,15 @@ pub mod signature_descriptor { #[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 { + ::prost::alloc::format!( + "cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.{}", Self::NAME + ) + } + } /// Multi is the signature data for a multisig public key #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -62,6 +78,15 @@ pub mod signature_descriptor { #[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 { + ::prost::alloc::format!( + "cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.{}", Self::NAME + ) + } + } /// 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)] @@ -74,6 +99,22 @@ pub mod signature_descriptor { 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 { + ::prost::alloc::format!( + "cosmos.tx.signing.v1beta1.SignatureDescriptor.{}", Self::NAME + ) + } + } +} +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 { + ::prost::alloc::format!("cosmos.tx.signing.v1beta1.{}", Self::NAME) + } } /// SignMode represents a signing mode with its own security guarantees. /// diff --git a/src/prost/cosmos.tx.signing.v1beta1.serde.rs b/src/prost/cosmos.tx.signing.v1beta1.serde.rs new file mode 100644 index 00000000..0a8c385c --- /dev/null +++ b/src/prost/cosmos.tx.signing.v1beta1.serde.rs @@ -0,0 +1,633 @@ +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 index db0d4c17..403722eb 100644 --- a/src/prost/cosmos.tx.v1beta1.rs +++ b/src/prost/cosmos.tx.v1beta1.rs @@ -15,6 +15,13 @@ pub struct Tx { #[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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) + } +} /// 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 @@ -37,6 +44,13 @@ pub struct TxRaw { #[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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) + } +} /// 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)] @@ -58,6 +72,13 @@ pub struct SignDoc { #[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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) + } +} /// SignDocDirectAux is the type used for generating sign bytes for /// SIGN_MODE_DIRECT_AUX. /// @@ -92,6 +113,13 @@ pub struct SignDocDirectAux { #[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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) + } +} /// TxBody is the body of a transaction that all signers sign over. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -129,6 +157,13 @@ pub struct TxBody { super::super::super::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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) + } +} /// AuthInfo describes the fee and signer modes that are used to sign a /// transaction. #[allow(clippy::derive_partial_eq_without_eq)] @@ -155,6 +190,13 @@ pub struct AuthInfo { #[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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) + } +} /// SignerInfo describes the public key and signing mode of a single top-level /// signer. #[allow(clippy::derive_partial_eq_without_eq)] @@ -175,6 +217,13 @@ pub struct SignerInfo { #[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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) + } +} /// ModeInfo describes the signing mode of a single or nested multisig signer. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -196,6 +245,13 @@ pub mod mode_info { #[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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.ModeInfo.{}", Self::NAME) + } + } /// Multi is the mode info for a multisig public key #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -210,6 +266,13 @@ pub mod mode_info { #[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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.ModeInfo.{}", Self::NAME) + } + } /// sum is the oneof that specifies whether this represents a single or nested /// multisig signer #[allow(clippy::derive_partial_eq_without_eq)] @@ -223,6 +286,13 @@ pub mod mode_info { 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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) + } +} /// 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. @@ -247,6 +317,13 @@ pub struct Fee { #[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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) + } +} /// Tip is the tip used for meta-transactions. /// /// Since: cosmos-sdk 0.46 @@ -260,6 +337,13 @@ pub struct 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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) + } +} /// 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 @@ -286,6 +370,13 @@ pub struct AuxSignerData { #[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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) + } +} /// GetTxsEventRequest is the request type for the Service.TxsByEvents /// RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -311,6 +402,13 @@ pub struct GetTxsEventRequest { #[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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) + } +} /// GetTxsEventResponse is the response type for the Service.TxsByEvents /// RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -335,6 +433,13 @@ pub struct GetTxsEventResponse { #[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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) + } +} /// BroadcastTxRequest is the request type for the Service.BroadcastTxRequest /// RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -346,6 +451,13 @@ pub struct BroadcastTxRequest { #[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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) + } +} /// BroadcastTxResponse is the response type for the /// Service.BroadcastTx method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -357,6 +469,13 @@ pub struct BroadcastTxResponse { 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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) + } +} /// SimulateRequest is the request type for the Service.Simulate /// RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -373,6 +492,13 @@ pub struct SimulateRequest { #[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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) + } +} /// SimulateResponse is the response type for the /// Service.SimulateRPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -385,6 +511,13 @@ pub struct SimulateResponse { #[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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) + } +} /// GetTxRequest is the request type for the Service.GetTx /// RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -394,6 +527,13 @@ pub struct GetTxRequest { #[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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) + } +} /// GetTxResponse is the response type for the Service.GetTx method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -407,6 +547,13 @@ pub struct GetTxResponse { 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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) + } +} /// GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs /// RPC method. /// @@ -423,6 +570,13 @@ pub struct GetBlockWithTxsRequest { 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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) + } +} /// GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. /// /// Since: cosmos-sdk 0.45.2 @@ -442,6 +596,13 @@ pub struct GetBlockWithTxsResponse { 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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) + } +} /// TxDecodeRequest is the request type for the Service.TxDecode /// RPC method. /// @@ -453,6 +614,13 @@ pub struct TxDecodeRequest { #[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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) + } +} /// TxDecodeResponse is the response type for the /// Service.TxDecode method. /// @@ -464,6 +632,13 @@ pub struct TxDecodeResponse { #[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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) + } +} /// TxEncodeRequest is the request type for the Service.TxEncode /// RPC method. /// @@ -475,6 +650,13 @@ pub struct TxEncodeRequest { #[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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) + } +} /// TxEncodeResponse is the response type for the /// Service.TxEncode method. /// @@ -486,6 +668,13 @@ pub struct TxEncodeResponse { #[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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) + } +} /// TxEncodeAminoRequest is the request type for the Service.TxEncodeAmino /// RPC method. /// @@ -496,6 +685,13 @@ 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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) + } +} /// TxEncodeAminoResponse is the response type for the Service.TxEncodeAmino /// RPC method. /// @@ -506,6 +702,13 @@ 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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) + } +} /// TxDecodeAminoRequest is the request type for the Service.TxDecodeAmino /// RPC method. /// @@ -516,6 +719,13 @@ 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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) + } +} /// TxDecodeAminoResponse is the response type for the Service.TxDecodeAmino /// RPC method. /// @@ -526,6 +736,13 @@ 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 { + ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) + } +} /// OrderBy defines the sorting order #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] diff --git a/src/prost/cosmos.upgrade.module.v1.rs b/src/prost/cosmos.upgrade.module.v1.rs index 2243196d..198df468 100644 --- a/src/prost/cosmos.upgrade.module.v1.rs +++ b/src/prost/cosmos.upgrade.module.v1.rs @@ -6,3 +6,10 @@ pub struct 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 { + ::prost::alloc::format!("cosmos.upgrade.module.v1.{}", Self::NAME) + } +} diff --git a/src/prost/cosmos.upgrade.module.v1.serde.rs b/src/prost/cosmos.upgrade.module.v1.serde.rs new file mode 100644 index 00000000..7aee8176 --- /dev/null +++ b/src/prost/cosmos.upgrade.module.v1.serde.rs @@ -0,0 +1,91 @@ +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 index fa445d90..2bb5cab7 100644 --- a/src/prost/cosmos.upgrade.v1beta1.rs +++ b/src/prost/cosmos.upgrade.v1beta1.rs @@ -1,5 +1,4 @@ /// Plan specifies information about a planned upgrade and when it should occur. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Plan { @@ -34,11 +33,17 @@ pub struct Plan { super::super::super::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 { + ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + } +} /// 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. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SoftwareUpgradeProposal { @@ -52,11 +57,17 @@ pub struct SoftwareUpgradeProposal { #[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 { + ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + } +} /// 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. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CancelSoftwareUpgradeProposal { @@ -67,10 +78,16 @@ pub struct CancelSoftwareUpgradeProposal { #[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 { + ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + } +} /// ModuleVersion specifies a module and its consensus version. /// /// Since: cosmos-sdk 0.43 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ModuleVersion { @@ -81,10 +98,16 @@ pub struct ModuleVersion { #[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 { + ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + } +} /// MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. /// /// Since: cosmos-sdk 0.46 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSoftwareUpgrade { @@ -95,17 +118,29 @@ pub struct MsgSoftwareUpgrade { #[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 { + ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + } +} /// MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. /// /// Since: cosmos-sdk 0.46 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + } +} /// MsgCancelUpgrade is the Msg/CancelUpgrade request type. /// /// Since: cosmos-sdk 0.46 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCancelUpgrade { @@ -113,13 +148,26 @@ pub struct MsgCancelUpgrade { #[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 { + ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + } +} /// MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. /// /// Since: cosmos-sdk 0.46 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod msg_client { @@ -509,13 +557,18 @@ pub mod msg_server { } /// QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC /// method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + } +} /// QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC /// method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryCurrentPlanResponse { @@ -523,9 +576,15 @@ pub struct QueryCurrentPlanResponse { #[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 { + ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + } +} /// QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC /// method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAppliedPlanRequest { @@ -533,9 +592,15 @@ pub struct QueryAppliedPlanRequest { #[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 { + ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + } +} /// QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC /// method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAppliedPlanResponse { @@ -543,9 +608,15 @@ pub struct QueryAppliedPlanResponse { #[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 { + ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + } +} /// QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState /// RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUpgradedConsensusStateRequest { @@ -554,9 +625,15 @@ pub struct QueryUpgradedConsensusStateRequest { #[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 { + ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + } +} /// QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState /// RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUpgradedConsensusStateResponse { @@ -564,11 +641,17 @@ pub struct QueryUpgradedConsensusStateResponse { #[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 { + ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + } +} /// QueryModuleVersionsRequest is the request type for the Query/ModuleVersions /// RPC method. /// /// Since: cosmos-sdk 0.43 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryModuleVersionsRequest { @@ -578,11 +661,17 @@ pub struct QueryModuleVersionsRequest { #[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 { + ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + } +} /// QueryModuleVersionsResponse is the response type for the Query/ModuleVersions /// RPC method. /// /// Since: cosmos-sdk 0.43 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryModuleVersionsResponse { @@ -590,23 +679,42 @@ pub struct QueryModuleVersionsResponse { #[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 { + ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + } +} /// QueryAuthorityRequest is the request type for Query/Authority /// /// Since: cosmos-sdk 0.46 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, 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 { + ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + } +} /// QueryAuthorityResponse is the response type for Query/Authority /// /// Since: cosmos-sdk 0.46 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[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 { + ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod query_client { diff --git a/src/prost/cosmos.upgrade.v1beta1.serde.rs b/src/prost/cosmos.upgrade.v1beta1.serde.rs new file mode 100644 index 00000000..de744724 --- /dev/null +++ b/src/prost/cosmos.upgrade.v1beta1.serde.rs @@ -0,0 +1,1731 @@ +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 index af80d5fc..053c6d52 100644 --- a/src/prost/cosmos_proto.rs +++ b/src/prost/cosmos_proto.rs @@ -14,6 +14,13 @@ pub struct InterfaceDescriptor { #[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 { + ::prost::alloc::format!("cosmos_proto.{}", Self::NAME) + } +} /// 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 @@ -42,6 +49,13 @@ pub struct ScalarDescriptor { #[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 { + ::prost::alloc::format!("cosmos_proto.{}", Self::NAME) + } +} #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum ScalarType { diff --git a/src/prost/google.api.rs b/src/prost/google.api.rs index 0817d31c..5aa04075 100644 --- a/src/prost/google.api.rs +++ b/src/prost/google.api.rs @@ -18,6 +18,13 @@ pub struct Http { #[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 { + ::prost::alloc::format!("google.api.{}", Self::NAME) + } +} /// # gRPC Transcoding /// /// gRPC Transcoding is a feature for mapping between a gRPC method and one or @@ -358,6 +365,13 @@ pub mod http_rule { 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 { + ::prost::alloc::format!("google.api.{}", Self::NAME) + } +} /// A custom pattern is used for defining custom HTTP verb. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -369,3 +383,10 @@ pub struct CustomHttpPattern { #[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 { + ::prost::alloc::format!("google.api.{}", Self::NAME) + } +} 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.rs b/src/prost/google.protobuf.rs index 3878889e..a0dfa109 100644 --- a/src/prost/google.protobuf.rs +++ b/src/prost/google.protobuf.rs @@ -22,8 +22,12 @@ /// if (any.is(Foo.class)) { /// foo = any.unpack(Foo.class); /// } +/// // or ... +/// if (any.isSameTypeAs(Foo.getDefaultInstance())) { +/// foo = any.unpack(Foo.getDefaultInstance()); +/// } /// -/// Example 3: Pack and unpack a message in Python. +/// Example 3: Pack and unpack a message in Python. /// /// foo = Foo(...) /// any = Any() @@ -33,7 +37,7 @@ /// any.Unpack(foo) /// ... /// -/// Example 4: Pack and unpack a message in Go +/// Example 4: Pack and unpack a message in Go /// /// foo := &pb.Foo{...} /// any, err := anypb.New(foo) @@ -52,9 +56,8 @@ /// in the type URL, for example "foo.bar.com/x/y.z" will yield type /// name "y.z". /// -/// /// JSON -/// +/// ==== /// The JSON representation of an `Any` value uses the regular /// representation of the deserialized, embedded message, with an /// additional field `@type` which contains the type URL. Example: @@ -81,7 +84,6 @@ /// "value": "1.212s" /// } /// -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[derive(Eq)] #[cfg_attr( all(feature = "json-schema", feature = "serde"), @@ -113,7 +115,8 @@ pub struct Any { /// /// Note: this functionality is not currently available in the official /// protobuf release, and it is not used for type URLs beginning with - /// type.googleapis.com. + /// type.googleapis.com. As of May 2023, there are no widely used type server + /// implementations and no plans to implement one. /// /// Schemes other than `http`, `https` (or the empty scheme) might be /// used with implementation specific semantics. @@ -124,6 +127,13 @@ pub struct Any { #[prost(bytes = "vec", tag = "2")] pub value: ::prost::alloc::vec::Vec, } +impl ::prost::Name for Any { + const NAME: &'static str = "Any"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.{}", Self::NAME) + } +} /// The protocol compiler can output a FileDescriptorSet containing the .proto /// files it parses. #[allow(clippy::derive_partial_eq_without_eq)] @@ -132,6 +142,13 @@ pub struct FileDescriptorSet { #[prost(message, repeated, tag = "1")] pub file: ::prost::alloc::vec::Vec, } +impl ::prost::Name for FileDescriptorSet { + const NAME: &'static str = "FileDescriptorSet"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.{}", Self::NAME) + } +} /// Describes a complete .proto file. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -170,9 +187,21 @@ pub struct FileDescriptorProto { #[prost(message, optional, tag = "9")] pub source_code_info: ::core::option::Option, /// The syntax of the proto file. - /// The supported values are "proto2" and "proto3". + /// The supported values are "proto2", "proto3", and "editions". + /// + /// If `edition` is present, this value must be "editions". #[prost(string, optional, tag = "12")] pub syntax: ::core::option::Option<::prost::alloc::string::String>, + /// The edition of the proto file, which is an opaque string. + #[prost(string, optional, tag = "13")] + pub edition: ::core::option::Option<::prost::alloc::string::String>, +} +impl ::prost::Name for FileDescriptorProto { + const NAME: &'static str = "FileDescriptorProto"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.{}", Self::NAME) + } } /// Describes a message type. #[allow(clippy::derive_partial_eq_without_eq)] @@ -215,6 +244,13 @@ pub mod descriptor_proto { #[prost(message, optional, tag = "3")] pub options: ::core::option::Option, } + impl ::prost::Name for ExtensionRange { + const NAME: &'static str = "ExtensionRange"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.DescriptorProto.{}", Self::NAME) + } + } /// Range of reserved tag numbers. Reserved tag numbers may not be used by /// fields or extension ranges in the same message. Reserved ranges may /// not overlap. @@ -228,6 +264,20 @@ pub mod descriptor_proto { #[prost(int32, optional, tag = "2")] pub end: ::core::option::Option, } + impl ::prost::Name for ReservedRange { + const NAME: &'static str = "ReservedRange"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.DescriptorProto.{}", Self::NAME) + } + } +} +impl ::prost::Name for DescriptorProto { + const NAME: &'static str = "DescriptorProto"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.{}", Self::NAME) + } } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -235,6 +285,106 @@ pub struct ExtensionRangeOptions { /// The parser stores options it doesn't recognize here. See above. #[prost(message, repeated, tag = "999")] pub uninterpreted_option: ::prost::alloc::vec::Vec, + /// For external users: DO NOT USE. We are in the process of open sourcing + /// extension declaration and executing internal cleanups before it can be + /// used externally. + #[prost(message, repeated, tag = "2")] + pub declaration: ::prost::alloc::vec::Vec, + /// Any features defined in the specific edition. + #[prost(message, optional, tag = "50")] + pub features: ::core::option::Option, + /// The verification state of the range. + /// TODO(b/278783756): flip the default to DECLARATION once all empty ranges + /// are marked as UNVERIFIED. + #[prost( + enumeration = "extension_range_options::VerificationState", + optional, + tag = "3", + default = "Unverified" + )] + pub verification: ::core::option::Option, +} +/// Nested message and enum types in `ExtensionRangeOptions`. +pub mod extension_range_options { + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Declaration { + /// The extension number declared within the extension range. + #[prost(int32, optional, tag = "1")] + pub number: ::core::option::Option, + /// The fully-qualified name of the extension field. There must be a leading + /// dot in front of the full name. + #[prost(string, optional, tag = "2")] + pub full_name: ::core::option::Option<::prost::alloc::string::String>, + /// The fully-qualified type name of the extension field. Unlike + /// Metadata.type, Declaration.type must have a leading dot for messages + /// and enums. + #[prost(string, optional, tag = "3")] + pub r#type: ::core::option::Option<::prost::alloc::string::String>, + /// If true, indicates that the number is reserved in the extension range, + /// and any extension field with the number will fail to compile. Set this + /// when a declared extension field is deleted. + #[prost(bool, optional, tag = "5")] + pub reserved: ::core::option::Option, + /// If true, indicates that the extension must be defined as repeated. + /// Otherwise the extension must be defined as optional. + #[prost(bool, optional, tag = "6")] + pub repeated: ::core::option::Option, + } + impl ::prost::Name for Declaration { + const NAME: &'static str = "Declaration"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!( + "google.protobuf.ExtensionRangeOptions.{}", Self::NAME + ) + } + } + /// The verification state of the extension range. + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum VerificationState { + /// All the extensions of the range must be declared. + Declaration = 0, + Unverified = 1, + } + impl VerificationState { + /// 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 { + VerificationState::Declaration => "DECLARATION", + VerificationState::Unverified => "UNVERIFIED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "DECLARATION" => Some(Self::Declaration), + "UNVERIFIED" => Some(Self::Unverified), + _ => None, + } + } + } +} +impl ::prost::Name for ExtensionRangeOptions { + const NAME: &'static str = "ExtensionRangeOptions"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.{}", Self::NAME) + } } /// Describes a field within a message. #[allow(clippy::derive_partial_eq_without_eq)] @@ -444,6 +594,13 @@ pub mod field_descriptor_proto { } } } +impl ::prost::Name for FieldDescriptorProto { + const NAME: &'static str = "FieldDescriptorProto"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.{}", Self::NAME) + } +} /// Describes a oneof. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -453,6 +610,13 @@ pub struct OneofDescriptorProto { #[prost(message, optional, tag = "2")] pub options: ::core::option::Option, } +impl ::prost::Name for OneofDescriptorProto { + const NAME: &'static str = "OneofDescriptorProto"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.{}", Self::NAME) + } +} /// Describes an enum type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -493,6 +657,20 @@ pub mod enum_descriptor_proto { #[prost(int32, optional, tag = "2")] pub end: ::core::option::Option, } + impl ::prost::Name for EnumReservedRange { + const NAME: &'static str = "EnumReservedRange"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.EnumDescriptorProto.{}", Self::NAME) + } + } +} +impl ::prost::Name for EnumDescriptorProto { + const NAME: &'static str = "EnumDescriptorProto"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.{}", Self::NAME) + } } /// Describes a value within an enum. #[allow(clippy::derive_partial_eq_without_eq)] @@ -505,6 +683,13 @@ pub struct EnumValueDescriptorProto { #[prost(message, optional, tag = "3")] pub options: ::core::option::Option, } +impl ::prost::Name for EnumValueDescriptorProto { + const NAME: &'static str = "EnumValueDescriptorProto"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.{}", Self::NAME) + } +} /// Describes a service. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -516,6 +701,13 @@ pub struct ServiceDescriptorProto { #[prost(message, optional, tag = "3")] pub options: ::core::option::Option, } +impl ::prost::Name for ServiceDescriptorProto { + const NAME: &'static str = "ServiceDescriptorProto"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.{}", Self::NAME) + } +} /// Describes a method of a service. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -537,6 +729,13 @@ pub struct MethodDescriptorProto { #[prost(bool, optional, tag = "6", default = "false")] pub server_streaming: ::core::option::Option, } +impl ::prost::Name for MethodDescriptorProto { + const NAME: &'static str = "MethodDescriptorProto"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FileOptions { @@ -647,6 +846,9 @@ pub struct FileOptions { /// determining the ruby package. #[prost(string, optional, tag = "45")] pub ruby_package: ::core::option::Option<::prost::alloc::string::String>, + /// Any features defined in the specific edition. + #[prost(message, optional, tag = "50")] + pub features: ::core::option::Option, /// The parser stores options it doesn't recognize here. /// See the documentation for the "Options" section above. #[prost(message, repeated, tag = "999")] @@ -700,6 +902,13 @@ pub mod file_options { } } } +impl ::prost::Name for FileOptions { + const NAME: &'static str = "FileOptions"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MessageOptions { @@ -734,6 +943,10 @@ pub struct MessageOptions { /// this is a formalization for deprecating messages. #[prost(bool, optional, tag = "3", default = "false")] pub deprecated: ::core::option::Option, + /// NOTE: Do not set the option in .proto files. Always use the maps syntax + /// instead. The option should only be implicitly set by the proto compiler + /// parser. + /// /// Whether the message is an automatically generated map entry type for the /// maps field. /// @@ -751,23 +964,44 @@ pub struct MessageOptions { /// use a native map in the target language to hold the keys and values. /// The reflection APIs in such implementations still need to work as /// if the field is a repeated message field. - /// - /// NOTE: Do not set the option in .proto files. Always use the maps syntax - /// instead. The option should only be implicitly set by the proto compiler - /// parser. #[prost(bool, optional, tag = "7")] pub map_entry: ::core::option::Option, + /// Enable the legacy handling of JSON field name conflicts. This lowercases + /// and strips underscored from the fields before comparison in proto3 only. + /// The new behavior takes `json_name` into account and applies to proto2 as + /// well. + /// + /// This should only be used as a temporary measure against broken builds due + /// to the change in behavior for JSON field name conflicts. + /// + /// TODO(b/261750190) This is legacy behavior we plan to remove once downstream + /// teams have had time to migrate. + #[deprecated] + #[prost(bool, optional, tag = "11")] + pub deprecated_legacy_json_field_conflicts: ::core::option::Option, + /// Any features defined in the specific edition. + #[prost(message, optional, tag = "12")] + pub features: ::core::option::Option, /// The parser stores options it doesn't recognize here. See above. #[prost(message, repeated, tag = "999")] pub uninterpreted_option: ::prost::alloc::vec::Vec, } +impl ::prost::Name for MessageOptions { + const NAME: &'static str = "MessageOptions"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FieldOptions { /// The ctype option instructs the C++ code generator to use a different /// representation of the field than it normally would. See the specific - /// options below. This option is not yet implemented in the open source - /// release -- sorry, we'll try to include it in a future version! + /// options below. This option is only implemented to support use of + /// \[ctype=CORD\] and \[ctype=STRING\] (the default) on non-repeated fields of + /// type "bytes" in the open source release -- sorry, we'll try to include + /// other types in a future version! #[prost( enumeration = "field_options::CType", optional, @@ -817,7 +1051,6 @@ pub struct FieldOptions { /// call from multiple threads concurrently, while non-const methods continue /// to require exclusive access. /// - /// /// Note that implementations may choose not to check required fields within /// a lazy sub-message. That is, calling IsInitialized() on the outer message /// may return true even if the inner message has missing required fields. @@ -829,11 +1062,8 @@ pub struct FieldOptions { /// check its required fields, regardless of whether or not the message has /// been parsed. /// - /// As of 2021, lazy does no correctness checks on the byte stream during - /// parsing. This may lead to crashes if and when an invalid byte stream is - /// finally parsed upon access. - /// - /// TODO(b/211906113): Enable validation on lazy fields. + /// As of May 2022, lazy verifies the contents of the byte stream during + /// parsing. An invalid byte stream will cause the overall parsing to fail. #[prost(bool, optional, tag = "5", default = "false")] pub lazy: ::core::option::Option, /// unverified_lazy does no correctness checks on the byte stream. This should @@ -850,12 +1080,46 @@ pub struct FieldOptions { /// For Google-internal migration only. Do not use. #[prost(bool, optional, tag = "10", default = "false")] pub weak: ::core::option::Option, + /// Indicate that the field value should not be printed out when using debug + /// formats, e.g. when the field contains sensitive credentials. + #[prost(bool, optional, tag = "16", default = "false")] + pub debug_redact: ::core::option::Option, + #[prost(enumeration = "field_options::OptionRetention", optional, tag = "17")] + pub retention: ::core::option::Option, + #[prost( + enumeration = "field_options::OptionTargetType", + repeated, + packed = "false", + tag = "19" + )] + pub targets: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "20")] + pub edition_defaults: ::prost::alloc::vec::Vec, + /// Any features defined in the specific edition. + #[prost(message, optional, tag = "21")] + pub features: ::core::option::Option, /// The parser stores options it doesn't recognize here. See above. #[prost(message, repeated, tag = "999")] pub uninterpreted_option: ::prost::alloc::vec::Vec, } /// Nested message and enum types in `FieldOptions`. pub mod field_options { + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct EditionDefault { + #[prost(string, optional, tag = "1")] + pub edition: ::core::option::Option<::prost::alloc::string::String>, + /// Textproto value. + #[prost(string, optional, tag = "2")] + pub value: ::core::option::Option<::prost::alloc::string::String>, + } + impl ::prost::Name for EditionDefault { + const NAME: &'static str = "EditionDefault"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.FieldOptions.{}", Self::NAME) + } + } #[derive( Clone, Copy, @@ -871,6 +1135,12 @@ pub mod field_options { pub enum CType { /// Default mode. String = 0, + /// The option \[ctype=CORD\] may be applied to a non-repeated field of type + /// "bytes". It indicates that in C++, the data should be stored in a Cord + /// instead of a string. For very large strings, this may reduce memory + /// fragmentation. It may also allow better performance when parsing from a + /// Cord, or when parsing with aliasing enabled, as the parsed Cord may then + /// alias the original buffer. Cord = 1, StringPiece = 2, } @@ -938,14 +1208,139 @@ pub mod field_options { } } } + /// If set to RETENTION_SOURCE, the option will be omitted from the binary. + /// Note: as of January 2023, support for this is in progress and does not yet + /// have an effect (b/264593489). + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum OptionRetention { + RetentionUnknown = 0, + RetentionRuntime = 1, + RetentionSource = 2, + } + impl OptionRetention { + /// 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 { + OptionRetention::RetentionUnknown => "RETENTION_UNKNOWN", + OptionRetention::RetentionRuntime => "RETENTION_RUNTIME", + OptionRetention::RetentionSource => "RETENTION_SOURCE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "RETENTION_UNKNOWN" => Some(Self::RetentionUnknown), + "RETENTION_RUNTIME" => Some(Self::RetentionRuntime), + "RETENTION_SOURCE" => Some(Self::RetentionSource), + _ => None, + } + } + } + /// This indicates the types of entities that the field may apply to when used + /// as an option. If it is unset, then the field may be freely used as an + /// option on any kind of entity. Note: as of January 2023, support for this is + /// in progress and does not yet have an effect (b/264593489). + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum OptionTargetType { + TargetTypeUnknown = 0, + TargetTypeFile = 1, + TargetTypeExtensionRange = 2, + TargetTypeMessage = 3, + TargetTypeField = 4, + TargetTypeOneof = 5, + TargetTypeEnum = 6, + TargetTypeEnumEntry = 7, + TargetTypeService = 8, + TargetTypeMethod = 9, + } + impl OptionTargetType { + /// 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 { + OptionTargetType::TargetTypeUnknown => "TARGET_TYPE_UNKNOWN", + OptionTargetType::TargetTypeFile => "TARGET_TYPE_FILE", + OptionTargetType::TargetTypeExtensionRange => { + "TARGET_TYPE_EXTENSION_RANGE" + } + OptionTargetType::TargetTypeMessage => "TARGET_TYPE_MESSAGE", + OptionTargetType::TargetTypeField => "TARGET_TYPE_FIELD", + OptionTargetType::TargetTypeOneof => "TARGET_TYPE_ONEOF", + OptionTargetType::TargetTypeEnum => "TARGET_TYPE_ENUM", + OptionTargetType::TargetTypeEnumEntry => "TARGET_TYPE_ENUM_ENTRY", + OptionTargetType::TargetTypeService => "TARGET_TYPE_SERVICE", + OptionTargetType::TargetTypeMethod => "TARGET_TYPE_METHOD", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "TARGET_TYPE_UNKNOWN" => Some(Self::TargetTypeUnknown), + "TARGET_TYPE_FILE" => Some(Self::TargetTypeFile), + "TARGET_TYPE_EXTENSION_RANGE" => Some(Self::TargetTypeExtensionRange), + "TARGET_TYPE_MESSAGE" => Some(Self::TargetTypeMessage), + "TARGET_TYPE_FIELD" => Some(Self::TargetTypeField), + "TARGET_TYPE_ONEOF" => Some(Self::TargetTypeOneof), + "TARGET_TYPE_ENUM" => Some(Self::TargetTypeEnum), + "TARGET_TYPE_ENUM_ENTRY" => Some(Self::TargetTypeEnumEntry), + "TARGET_TYPE_SERVICE" => Some(Self::TargetTypeService), + "TARGET_TYPE_METHOD" => Some(Self::TargetTypeMethod), + _ => None, + } + } + } +} +impl ::prost::Name for FieldOptions { + const NAME: &'static str = "FieldOptions"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.{}", Self::NAME) + } } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OneofOptions { + /// Any features defined in the specific edition. + #[prost(message, optional, tag = "1")] + pub features: ::core::option::Option, /// The parser stores options it doesn't recognize here. See above. #[prost(message, repeated, tag = "999")] pub uninterpreted_option: ::prost::alloc::vec::Vec, } +impl ::prost::Name for OneofOptions { + const NAME: &'static str = "OneofOptions"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EnumOptions { @@ -959,10 +1354,29 @@ pub struct EnumOptions { /// is a formalization for deprecating enums. #[prost(bool, optional, tag = "3", default = "false")] pub deprecated: ::core::option::Option, + /// Enable the legacy handling of JSON field name conflicts. This lowercases + /// and strips underscored from the fields before comparison in proto3 only. + /// The new behavior takes `json_name` into account and applies to proto2 as + /// well. + /// TODO(b/261750190) Remove this legacy behavior once downstream teams have + /// had time to migrate. + #[deprecated] + #[prost(bool, optional, tag = "6")] + pub deprecated_legacy_json_field_conflicts: ::core::option::Option, + /// Any features defined in the specific edition. + #[prost(message, optional, tag = "7")] + pub features: ::core::option::Option, /// The parser stores options it doesn't recognize here. See above. #[prost(message, repeated, tag = "999")] pub uninterpreted_option: ::prost::alloc::vec::Vec, } +impl ::prost::Name for EnumOptions { + const NAME: &'static str = "EnumOptions"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EnumValueOptions { @@ -972,13 +1386,31 @@ pub struct EnumValueOptions { /// this is a formalization for deprecating enum values. #[prost(bool, optional, tag = "1", default = "false")] pub deprecated: ::core::option::Option, + /// Any features defined in the specific edition. + #[prost(message, optional, tag = "2")] + pub features: ::core::option::Option, + /// Indicate that fields annotated with this enum value should not be printed + /// out when using debug formats, e.g. when the field contains sensitive + /// credentials. + #[prost(bool, optional, tag = "3", default = "false")] + pub debug_redact: ::core::option::Option, /// The parser stores options it doesn't recognize here. See above. #[prost(message, repeated, tag = "999")] pub uninterpreted_option: ::prost::alloc::vec::Vec, } +impl ::prost::Name for EnumValueOptions { + const NAME: &'static str = "EnumValueOptions"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ServiceOptions { + /// Any features defined in the specific edition. + #[prost(message, optional, tag = "34")] + pub features: ::core::option::Option, /// Is this service deprecated? /// Depending on the target platform, this can emit Deprecated annotations /// for the service, or it will be completely ignored; in the very least, @@ -989,6 +1421,13 @@ pub struct ServiceOptions { #[prost(message, repeated, tag = "999")] pub uninterpreted_option: ::prost::alloc::vec::Vec, } +impl ::prost::Name for ServiceOptions { + const NAME: &'static str = "ServiceOptions"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MethodOptions { @@ -1005,6 +1444,9 @@ pub struct MethodOptions { default = "IdempotencyUnknown" )] pub idempotency_level: ::core::option::Option, + /// Any features defined in the specific edition. + #[prost(message, optional, tag = "35")] + pub features: ::core::option::Option, /// The parser stores options it doesn't recognize here. See above. #[prost(message, repeated, tag = "999")] pub uninterpreted_option: ::prost::alloc::vec::Vec, @@ -1056,6 +1498,13 @@ pub mod method_options { } } } +impl ::prost::Name for MethodOptions { + const NAME: &'static str = "MethodOptions"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.{}", Self::NAME) + } +} /// A message representing a option the parser does not recognize. This only /// appears in options protos created by the compiler::Parser class. /// DescriptorPool resolves these when building Descriptor objects. Therefore, @@ -1097,6 +1546,294 @@ pub mod uninterpreted_option { #[prost(bool, required, tag = "2")] pub is_extension: bool, } + impl ::prost::Name for NamePart { + const NAME: &'static str = "NamePart"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.UninterpretedOption.{}", Self::NAME) + } + } +} +impl ::prost::Name for UninterpretedOption { + const NAME: &'static str = "UninterpretedOption"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.{}", Self::NAME) + } +} +/// TODO(b/274655146) Enums in C++ gencode (and potentially other languages) are +/// not well scoped. This means that each of the feature enums below can clash +/// with each other. The short names we've chosen maximize call-site +/// readability, but leave us very open to this scenario. A future feature will +/// be designed and implemented to handle this, hopefully before we ever hit a +/// conflict here. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FeatureSet { + #[prost(enumeration = "feature_set::FieldPresence", optional, tag = "1")] + pub field_presence: ::core::option::Option, + #[prost(enumeration = "feature_set::EnumType", optional, tag = "2")] + pub enum_type: ::core::option::Option, + #[prost(enumeration = "feature_set::RepeatedFieldEncoding", optional, tag = "3")] + pub repeated_field_encoding: ::core::option::Option, + #[prost(enumeration = "feature_set::StringFieldValidation", optional, tag = "4")] + pub string_field_validation: ::core::option::Option, + #[prost(enumeration = "feature_set::MessageEncoding", optional, tag = "5")] + pub message_encoding: ::core::option::Option, + #[prost(enumeration = "feature_set::JsonFormat", optional, tag = "6")] + pub json_format: ::core::option::Option, + #[prost(message, optional, boxed, tag = "999")] + pub raw_features: ::core::option::Option<::prost::alloc::boxed::Box>, +} +/// Nested message and enum types in `FeatureSet`. +pub mod feature_set { + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum FieldPresence { + Unknown = 0, + Explicit = 1, + Implicit = 2, + LegacyRequired = 3, + } + impl FieldPresence { + /// 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 { + FieldPresence::Unknown => "FIELD_PRESENCE_UNKNOWN", + FieldPresence::Explicit => "EXPLICIT", + FieldPresence::Implicit => "IMPLICIT", + FieldPresence::LegacyRequired => "LEGACY_REQUIRED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "FIELD_PRESENCE_UNKNOWN" => Some(Self::Unknown), + "EXPLICIT" => Some(Self::Explicit), + "IMPLICIT" => Some(Self::Implicit), + "LEGACY_REQUIRED" => Some(Self::LegacyRequired), + _ => None, + } + } + } + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum EnumType { + Unknown = 0, + Open = 1, + Closed = 2, + } + impl EnumType { + /// 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 { + EnumType::Unknown => "ENUM_TYPE_UNKNOWN", + EnumType::Open => "OPEN", + EnumType::Closed => "CLOSED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "ENUM_TYPE_UNKNOWN" => Some(Self::Unknown), + "OPEN" => Some(Self::Open), + "CLOSED" => Some(Self::Closed), + _ => None, + } + } + } + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum RepeatedFieldEncoding { + Unknown = 0, + Packed = 1, + Expanded = 2, + } + impl RepeatedFieldEncoding { + /// 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 { + RepeatedFieldEncoding::Unknown => "REPEATED_FIELD_ENCODING_UNKNOWN", + RepeatedFieldEncoding::Packed => "PACKED", + RepeatedFieldEncoding::Expanded => "EXPANDED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "REPEATED_FIELD_ENCODING_UNKNOWN" => Some(Self::Unknown), + "PACKED" => Some(Self::Packed), + "EXPANDED" => Some(Self::Expanded), + _ => None, + } + } + } + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum StringFieldValidation { + Unknown = 0, + Mandatory = 1, + Hint = 2, + None = 3, + } + impl StringFieldValidation { + /// 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 { + StringFieldValidation::Unknown => "STRING_FIELD_VALIDATION_UNKNOWN", + StringFieldValidation::Mandatory => "MANDATORY", + StringFieldValidation::Hint => "HINT", + StringFieldValidation::None => "NONE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "STRING_FIELD_VALIDATION_UNKNOWN" => Some(Self::Unknown), + "MANDATORY" => Some(Self::Mandatory), + "HINT" => Some(Self::Hint), + "NONE" => Some(Self::None), + _ => None, + } + } + } + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum MessageEncoding { + Unknown = 0, + LengthPrefixed = 1, + Delimited = 2, + } + impl MessageEncoding { + /// 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 { + MessageEncoding::Unknown => "MESSAGE_ENCODING_UNKNOWN", + MessageEncoding::LengthPrefixed => "LENGTH_PREFIXED", + MessageEncoding::Delimited => "DELIMITED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "MESSAGE_ENCODING_UNKNOWN" => Some(Self::Unknown), + "LENGTH_PREFIXED" => Some(Self::LengthPrefixed), + "DELIMITED" => Some(Self::Delimited), + _ => None, + } + } + } + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum JsonFormat { + Unknown = 0, + Allow = 1, + LegacyBestEffort = 2, + } + impl JsonFormat { + /// 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 { + JsonFormat::Unknown => "JSON_FORMAT_UNKNOWN", + JsonFormat::Allow => "ALLOW", + JsonFormat::LegacyBestEffort => "LEGACY_BEST_EFFORT", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "JSON_FORMAT_UNKNOWN" => Some(Self::Unknown), + "ALLOW" => Some(Self::Allow), + "LEGACY_BEST_EFFORT" => Some(Self::LegacyBestEffort), + _ => None, + } + } + } +} +impl ::prost::Name for FeatureSet { + const NAME: &'static str = "FeatureSet"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.{}", Self::NAME) + } } /// Encapsulates information about the original source file from which a /// FileDescriptorProto was generated. @@ -1242,6 +1979,20 @@ pub mod source_code_info { ::prost::alloc::string::String, >, } + impl ::prost::Name for Location { + const NAME: &'static str = "Location"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.SourceCodeInfo.{}", Self::NAME) + } + } +} +impl ::prost::Name for SourceCodeInfo { + const NAME: &'static str = "SourceCodeInfo"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.{}", Self::NAME) + } } /// Describes the relationship between generated code and its original source /// file. A GeneratedCodeInfo message is associated with only one generated @@ -1271,10 +2022,73 @@ pub mod generated_code_info { #[prost(int32, optional, tag = "3")] pub begin: ::core::option::Option, /// Identifies the ending offset in bytes in the generated code that - /// relates to the identified offset. The end offset should be one past + /// relates to the identified object. The end offset should be one past /// the last relevant byte (so the length of the text = end - begin). #[prost(int32, optional, tag = "4")] pub end: ::core::option::Option, + #[prost(enumeration = "annotation::Semantic", optional, tag = "5")] + pub semantic: ::core::option::Option, + } + /// Nested message and enum types in `Annotation`. + pub mod annotation { + /// Represents the identified object's effect on the element in the original + /// .proto file. + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum Semantic { + /// There is no effect or the effect is indescribable. + None = 0, + /// The element is set or otherwise mutated. + Set = 1, + /// An alias to the element is returned. + Alias = 2, + } + impl Semantic { + /// 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 { + Semantic::None => "NONE", + Semantic::Set => "SET", + Semantic::Alias => "ALIAS", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "NONE" => Some(Self::None), + "SET" => Some(Self::Set), + "ALIAS" => Some(Self::Alias), + _ => None, + } + } + } + } + impl ::prost::Name for Annotation { + const NAME: &'static str = "Annotation"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.GeneratedCodeInfo.{}", Self::NAME) + } + } +} +impl ::prost::Name for GeneratedCodeInfo { + const NAME: &'static str = "GeneratedCodeInfo"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.{}", Self::NAME) } } /// A Timestamp represents a point in time independent of any time zone or local @@ -1327,7 +2141,6 @@ pub mod generated_code_info { /// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) /// .setNanos((int) ((millis % 1000) * 1000000)).build(); /// -/// /// Example 5: Compute Timestamp from Java `Instant.now()`. /// /// Instant now = Instant.now(); @@ -1336,7 +2149,6 @@ pub mod generated_code_info { /// Timestamp.newBuilder().setSeconds(now.getEpochSecond()) /// .setNanos(now.getNano()).build(); /// -/// /// Example 6: Compute Timestamp from current time in Python. /// /// timestamp = Timestamp() @@ -1366,11 +2178,9 @@ pub mod generated_code_info { /// [`strftime`]() with /// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use /// the Joda Time's [`ISODateTimeFormat.dateTime()`]( -/// +/// ) /// ) to obtain a formatter capable of generating timestamps in this format. /// -/// -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Timestamp { @@ -1386,6 +2196,13 @@ pub struct Timestamp { #[prost(int32, tag = "2")] pub nanos: i32, } +impl ::prost::Name for Timestamp { + const NAME: &'static str = "Timestamp"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.{}", Self::NAME) + } +} /// A Duration represents a signed, fixed-length span of time represented /// as a count of seconds and fractions of seconds at nanosecond /// resolution. It is independent of any calendar and concepts like "day" @@ -1445,8 +2262,6 @@ pub struct Timestamp { /// be expressed in JSON format as "3.000000001s", and 3 seconds and 1 /// microsecond should be expressed in JSON format as "3.000001s". /// -/// -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[derive(Eq)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1465,3 +2280,10 @@ pub struct Duration { #[prost(int32, tag = "2")] pub nanos: i32, } +impl ::prost::Name for Duration { + const NAME: &'static str = "Duration"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.{}", Self::NAME) + } +} diff --git a/src/prost/google.protobuf.serde.rs b/src/prost/google.protobuf.serde.rs new file mode 100644 index 00000000..0c8064dd --- /dev/null +++ b/src/prost/google.protobuf.serde.rs @@ -0,0 +1,6686 @@ +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 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; + } + 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 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", + "uninterpreted_option", + "uninterpretedOption", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Deprecated, + Features, + DebugRedact, + 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), + "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 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::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__, + 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; + } + 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.string_field_validation.as_ref() { + let v = feature_set::StringFieldValidation::try_from(*v) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("stringFieldValidation", &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)?; + } + if let Some(v) = self.raw_features.as_ref() { + struct_ser.serialize_field("rawFeatures", 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", + "string_field_validation", + "stringFieldValidation", + "message_encoding", + "messageEncoding", + "json_format", + "jsonFormat", + "raw_features", + "rawFeatures", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + FieldPresence, + EnumType, + RepeatedFieldEncoding, + StringFieldValidation, + MessageEncoding, + JsonFormat, + RawFeatures, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "stringFieldValidation" | "string_field_validation" => Ok(GeneratedField::StringFieldValidation), + "messageEncoding" | "message_encoding" => Ok(GeneratedField::MessageEncoding), + "jsonFormat" | "json_format" => Ok(GeneratedField::JsonFormat), + "rawFeatures" | "raw_features" => Ok(GeneratedField::RawFeatures), + _ => 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 string_field_validation__ = None; + let mut message_encoding__ = None; + let mut json_format__ = None; + let mut raw_features__ = 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::StringFieldValidation => { + if string_field_validation__.is_some() { + return Err(serde::de::Error::duplicate_field("stringFieldValidation")); + } + string_field_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); + } + GeneratedField::RawFeatures => { + if raw_features__.is_some() { + return Err(serde::de::Error::duplicate_field("rawFeatures")); + } + raw_features__ = map_.next_value()?; + } + } + } + Ok(FeatureSet { + field_presence: field_presence__, + enum_type: enum_type__, + repeated_field_encoding: repeated_field_encoding__, + string_field_validation: string_field_validation__, + message_encoding: message_encoding__, + json_format: json_format__, + raw_features: raw_features__, + }) + } + } + 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::StringFieldValidation { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unknown => "STRING_FIELD_VALIDATION_UNKNOWN", + Self::Mandatory => "MANDATORY", + Self::Hint => "HINT", + Self::None => "NONE", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for feature_set::StringFieldValidation { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "STRING_FIELD_VALIDATION_UNKNOWN", + "MANDATORY", + "HINT", + "NONE", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = feature_set::StringFieldValidation; + + 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_FIELD_VALIDATION_UNKNOWN" => Ok(feature_set::StringFieldValidation::Unknown), + "MANDATORY" => Ok(feature_set::StringFieldValidation::Mandatory), + "HINT" => Ok(feature_set::StringFieldValidation::Hint), + "NONE" => Ok(feature_set::StringFieldValidation::None), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(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::Required => "LABEL_REQUIRED", + Self::Repeated => "LABEL_REPEATED", + }; + 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_REQUIRED", + "LABEL_REPEATED", + ]; + + 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_REQUIRED" => Ok(field_descriptor_proto::Label::Required), + "LABEL_REPEATED" => Ok(field_descriptor_proto::Label::Repeated), + _ => 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; + } + 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 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", + "uninterpreted_option", + "uninterpretedOption", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Ctype, + Packed, + Jstype, + Lazy, + UnverifiedLazy, + Deprecated, + Weak, + DebugRedact, + Retention, + Targets, + EditionDefaults, + 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 { + "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), + "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 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::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__, + 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() { + 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()?; + } + 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::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() { + 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()?; + } + } + } + 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; + } + 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.php_generic_services.as_ref() { + struct_ser.serialize_field("phpGenericServices", 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", + "php_generic_services", + "phpGenericServices", + "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, + PhpGenericServices, + 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), + "phpGenericServices" | "php_generic_services" => Ok(GeneratedField::PhpGenericServices), + "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 php_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::PhpGenericServices => { + if php_generic_services__.is_some() { + return Err(serde::de::Error::duplicate_field("phpGenericServices")); + } + php_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__, + php_generic_services: php_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.applications.fee.v1.rs b/src/prost/ibc.applications.fee.v1.rs index 0a0885f6..1dcf4340 100644 --- a/src/prost/ibc.applications.fee.v1.rs +++ b/src/prost/ibc.applications.fee.v1.rs @@ -18,6 +18,13 @@ pub struct Fee { super::super::super::super::cosmos::base::v1beta1::Coin, >, } +impl ::prost::Name for Fee { + const NAME: &'static str = "Fee"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// PacketFee contains ICS29 relayer fees, refund address and optional list of permitted relayers #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -32,6 +39,13 @@ pub struct PacketFee { #[prost(string, repeated, tag = "3")] pub relayers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +impl ::prost::Name for PacketFee { + const NAME: &'static str = "PacketFee"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// PacketFees contains a list of type PacketFee #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -40,6 +54,13 @@ pub struct PacketFees { #[prost(message, repeated, tag = "1")] pub packet_fees: ::prost::alloc::vec::Vec, } +impl ::prost::Name for PacketFees { + const NAME: &'static str = "PacketFees"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// IdentifiedPacketFees contains a list of type PacketFee and associated PacketId #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -53,6 +74,13 @@ pub struct IdentifiedPacketFees { #[prost(message, repeated, tag = "2")] pub packet_fees: ::prost::alloc::vec::Vec, } +impl ::prost::Name for IdentifiedPacketFees { + const NAME: &'static str = "IdentifiedPacketFees"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// MsgRegisterPayee defines the request type for the RegisterPayee rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -70,10 +98,24 @@ pub struct MsgRegisterPayee { #[prost(string, tag = "4")] pub payee: ::prost::alloc::string::String, } +impl ::prost::Name for MsgRegisterPayee { + const NAME: &'static str = "MsgRegisterPayee"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// MsgRegisterPayeeResponse defines the response type for the RegisterPayee rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRegisterPayeeResponse {} +impl ::prost::Name for MsgRegisterPayeeResponse { + const NAME: &'static str = "MsgRegisterPayeeResponse"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// MsgRegisterCounterpartyPayee defines the request type for the RegisterCounterpartyPayee rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -91,10 +133,24 @@ pub struct MsgRegisterCounterpartyPayee { #[prost(string, tag = "4")] pub counterparty_payee: ::prost::alloc::string::String, } +impl ::prost::Name for MsgRegisterCounterpartyPayee { + const NAME: &'static str = "MsgRegisterCounterpartyPayee"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// MsgRegisterCounterpartyPayeeResponse defines the response type for the RegisterCounterpartyPayee rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRegisterCounterpartyPayeeResponse {} +impl ::prost::Name for MsgRegisterCounterpartyPayeeResponse { + const NAME: &'static str = "MsgRegisterCounterpartyPayeeResponse"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// MsgPayPacketFee defines the request type for the PayPacketFee rpc /// This Msg can be used to pay for a packet at the next sequence send & should be combined with the Msg that will be /// paid for @@ -107,7 +163,7 @@ pub struct MsgPayPacketFee { /// the source port unique identifier #[prost(string, tag = "2")] pub source_port_id: ::prost::alloc::string::String, - /// the source channel unique identifer + /// the source channel unique identifier #[prost(string, tag = "3")] pub source_channel_id: ::prost::alloc::string::String, /// account address to refund fee if necessary @@ -117,10 +173,24 @@ pub struct MsgPayPacketFee { #[prost(string, repeated, tag = "5")] pub relayers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +impl ::prost::Name for MsgPayPacketFee { + const NAME: &'static str = "MsgPayPacketFee"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// MsgPayPacketFeeResponse defines the response type for the PayPacketFee rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgPayPacketFeeResponse {} +impl ::prost::Name for MsgPayPacketFeeResponse { + const NAME: &'static str = "MsgPayPacketFeeResponse"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// MsgPayPacketFeeAsync defines the request type for the PayPacketFeeAsync rpc /// This Msg can be used to pay for a packet at a specified sequence (instead of the next sequence send) #[allow(clippy::derive_partial_eq_without_eq)] @@ -135,10 +205,24 @@ pub struct MsgPayPacketFeeAsync { #[prost(message, optional, tag = "2")] pub packet_fee: ::core::option::Option, } +impl ::prost::Name for MsgPayPacketFeeAsync { + const NAME: &'static str = "MsgPayPacketFeeAsync"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// MsgPayPacketFeeAsyncResponse defines the response type for the PayPacketFeeAsync rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgPayPacketFeeAsyncResponse {} +impl ::prost::Name for MsgPayPacketFeeAsyncResponse { + const NAME: &'static str = "MsgPayPacketFeeAsyncResponse"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod msg_client { @@ -722,6 +806,13 @@ pub struct IncentivizedAcknowledgement { #[prost(bool, tag = "3")] pub underlying_app_success: bool, } +impl ::prost::Name for IncentivizedAcknowledgement { + const NAME: &'static str = "IncentivizedAcknowledgement"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// GenesisState defines the ICS29 fee middleware genesis state #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -744,6 +835,13 @@ pub struct GenesisState { #[prost(message, repeated, tag = "5")] pub forward_relayers: ::prost::alloc::vec::Vec, } +impl ::prost::Name for GenesisState { + const NAME: &'static str = "GenesisState"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// FeeEnabledChannel contains the PortID & ChannelID for a fee enabled channel #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -755,6 +853,13 @@ pub struct FeeEnabledChannel { #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, } +impl ::prost::Name for FeeEnabledChannel { + const NAME: &'static str = "FeeEnabledChannel"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// RegisteredPayee contains the relayer address and payee address for a specific channel #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -769,6 +874,13 @@ pub struct RegisteredPayee { #[prost(string, tag = "3")] pub payee: ::prost::alloc::string::String, } +impl ::prost::Name for RegisteredPayee { + const NAME: &'static str = "RegisteredPayee"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// RegisteredCounterpartyPayee contains the relayer address and counterparty payee address for a specific channel (used /// for recv fee distribution) #[allow(clippy::derive_partial_eq_without_eq)] @@ -784,6 +896,13 @@ pub struct RegisteredCounterpartyPayee { #[prost(string, tag = "3")] pub counterparty_payee: ::prost::alloc::string::String, } +impl ::prost::Name for RegisteredCounterpartyPayee { + const NAME: &'static str = "RegisteredCounterpartyPayee"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// ForwardRelayerAddress contains the forward relayer address and PacketId used for async acknowledgements #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -791,12 +910,19 @@ pub struct ForwardRelayerAddress { /// the forward relayer address #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, - /// unique packet identifer comprised of the channel ID, port ID and sequence + /// unique packet identifier comprised of the channel ID, port ID and sequence #[prost(message, optional, tag = "2")] pub packet_id: ::core::option::Option< super::super::super::core::channel::v1::PacketId, >, } +impl ::prost::Name for ForwardRelayerAddress { + const NAME: &'static str = "ForwardRelayerAddress"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// QueryIncentivizedPacketsRequest defines the request type for the IncentivizedPackets rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -810,6 +936,13 @@ pub struct QueryIncentivizedPacketsRequest { #[prost(uint64, tag = "2")] pub query_height: u64, } +impl ::prost::Name for QueryIncentivizedPacketsRequest { + const NAME: &'static str = "QueryIncentivizedPacketsRequest"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPackets rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -823,6 +956,13 @@ pub struct QueryIncentivizedPacketsResponse { super::super::super::super::cosmos::base::query::v1beta1::PageResponse, >, } +impl ::prost::Name for QueryIncentivizedPacketsResponse { + const NAME: &'static str = "QueryIncentivizedPacketsResponse"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// QueryIncentivizedPacketRequest defines the request type for the IncentivizedPacket rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -836,6 +976,13 @@ pub struct QueryIncentivizedPacketRequest { #[prost(uint64, tag = "2")] pub query_height: u64, } +impl ::prost::Name for QueryIncentivizedPacketRequest { + const NAME: &'static str = "QueryIncentivizedPacketRequest"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPacket rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -844,6 +991,13 @@ pub struct QueryIncentivizedPacketResponse { #[prost(message, optional, tag = "1")] pub incentivized_packet: ::core::option::Option, } +impl ::prost::Name for QueryIncentivizedPacketResponse { + const NAME: &'static str = "QueryIncentivizedPacketResponse"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// QueryIncentivizedPacketsForChannelRequest defines the request type for querying for all incentivized packets /// for a specific channel #[allow(clippy::derive_partial_eq_without_eq)] @@ -862,6 +1016,13 @@ pub struct QueryIncentivizedPacketsForChannelRequest { #[prost(uint64, tag = "4")] pub query_height: u64, } +impl ::prost::Name for QueryIncentivizedPacketsForChannelRequest { + const NAME: &'static str = "QueryIncentivizedPacketsForChannelRequest"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// QueryIncentivizedPacketsResponse defines the response type for the incentivized packets RPC #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -875,6 +1036,13 @@ pub struct QueryIncentivizedPacketsForChannelResponse { super::super::super::super::cosmos::base::query::v1beta1::PageResponse, >, } +impl ::prost::Name for QueryIncentivizedPacketsForChannelResponse { + const NAME: &'static str = "QueryIncentivizedPacketsForChannelResponse"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// QueryTotalRecvFeesRequest defines the request type for the TotalRecvFees rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -885,6 +1053,13 @@ pub struct QueryTotalRecvFeesRequest { super::super::super::core::channel::v1::PacketId, >, } +impl ::prost::Name for QueryTotalRecvFeesRequest { + const NAME: &'static str = "QueryTotalRecvFeesRequest"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// QueryTotalRecvFeesResponse defines the response type for the TotalRecvFees rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -895,6 +1070,13 @@ pub struct QueryTotalRecvFeesResponse { super::super::super::super::cosmos::base::v1beta1::Coin, >, } +impl ::prost::Name for QueryTotalRecvFeesResponse { + const NAME: &'static str = "QueryTotalRecvFeesResponse"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// QueryTotalAckFeesRequest defines the request type for the TotalAckFees rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -905,6 +1087,13 @@ pub struct QueryTotalAckFeesRequest { super::super::super::core::channel::v1::PacketId, >, } +impl ::prost::Name for QueryTotalAckFeesRequest { + const NAME: &'static str = "QueryTotalAckFeesRequest"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// QueryTotalAckFeesResponse defines the response type for the TotalAckFees rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -915,6 +1104,13 @@ pub struct QueryTotalAckFeesResponse { super::super::super::super::cosmos::base::v1beta1::Coin, >, } +impl ::prost::Name for QueryTotalAckFeesResponse { + const NAME: &'static str = "QueryTotalAckFeesResponse"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// QueryTotalTimeoutFeesRequest defines the request type for the TotalTimeoutFees rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -925,6 +1121,13 @@ pub struct QueryTotalTimeoutFeesRequest { super::super::super::core::channel::v1::PacketId, >, } +impl ::prost::Name for QueryTotalTimeoutFeesRequest { + const NAME: &'static str = "QueryTotalTimeoutFeesRequest"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// QueryTotalTimeoutFeesResponse defines the response type for the TotalTimeoutFees rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -935,6 +1138,13 @@ pub struct QueryTotalTimeoutFeesResponse { super::super::super::super::cosmos::base::v1beta1::Coin, >, } +impl ::prost::Name for QueryTotalTimeoutFeesResponse { + const NAME: &'static str = "QueryTotalTimeoutFeesResponse"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// QueryPayeeRequest defines the request type for the Payee rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -946,6 +1156,13 @@ pub struct QueryPayeeRequest { #[prost(string, tag = "2")] pub relayer: ::prost::alloc::string::String, } +impl ::prost::Name for QueryPayeeRequest { + const NAME: &'static str = "QueryPayeeRequest"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// QueryPayeeResponse defines the response type for the Payee rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -954,6 +1171,13 @@ pub struct QueryPayeeResponse { #[prost(string, tag = "1")] pub payee_address: ::prost::alloc::string::String, } +impl ::prost::Name for QueryPayeeResponse { + const NAME: &'static str = "QueryPayeeResponse"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// QueryCounterpartyPayeeRequest defines the request type for the CounterpartyPayee rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -965,6 +1189,13 @@ pub struct QueryCounterpartyPayeeRequest { #[prost(string, tag = "2")] pub relayer: ::prost::alloc::string::String, } +impl ::prost::Name for QueryCounterpartyPayeeRequest { + const NAME: &'static str = "QueryCounterpartyPayeeRequest"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// QueryCounterpartyPayeeResponse defines the response type for the CounterpartyPayee rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -973,6 +1204,13 @@ pub struct QueryCounterpartyPayeeResponse { #[prost(string, tag = "1")] pub counterparty_payee: ::prost::alloc::string::String, } +impl ::prost::Name for QueryCounterpartyPayeeResponse { + const NAME: &'static str = "QueryCounterpartyPayeeResponse"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// QueryFeeEnabledChannelsRequest defines the request type for the FeeEnabledChannels rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -986,6 +1224,13 @@ pub struct QueryFeeEnabledChannelsRequest { #[prost(uint64, tag = "2")] pub query_height: u64, } +impl ::prost::Name for QueryFeeEnabledChannelsRequest { + const NAME: &'static str = "QueryFeeEnabledChannelsRequest"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// QueryFeeEnabledChannelsResponse defines the response type for the FeeEnabledChannels rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -999,6 +1244,13 @@ pub struct QueryFeeEnabledChannelsResponse { super::super::super::super::cosmos::base::query::v1beta1::PageResponse, >, } +impl ::prost::Name for QueryFeeEnabledChannelsResponse { + const NAME: &'static str = "QueryFeeEnabledChannelsResponse"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// QueryFeeEnabledChannelRequest defines the request type for the FeeEnabledChannel rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1010,6 +1262,13 @@ pub struct QueryFeeEnabledChannelRequest { #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, } +impl ::prost::Name for QueryFeeEnabledChannelRequest { + const NAME: &'static str = "QueryFeeEnabledChannelRequest"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// QueryFeeEnabledChannelResponse defines the response type for the FeeEnabledChannel rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1018,6 +1277,13 @@ pub struct QueryFeeEnabledChannelResponse { #[prost(bool, tag = "1")] pub fee_enabled: bool, } +impl ::prost::Name for QueryFeeEnabledChannelResponse { + const NAME: &'static str = "QueryFeeEnabledChannelResponse"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod query_client { @@ -2092,3 +2358,10 @@ pub struct Metadata { #[prost(string, tag = "2")] pub app_version: ::prost::alloc::string::String, } +impl ::prost::Name for Metadata { + const NAME: &'static str = "Metadata"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} diff --git a/src/prost/ibc.applications.fee.v1.serde.rs b/src/prost/ibc.applications.fee.v1.serde.rs new file mode 100644 index 00000000..c7cf56b5 --- /dev/null +++ b/src/prost/ibc.applications.fee.v1.serde.rs @@ -0,0 +1,4237 @@ +impl serde::Serialize for Fee { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.Fee", len)?; + if true { + struct_ser.serialize_field("recvFee", &self.recv_fee)?; + } + if true { + struct_ser.serialize_field("ackFee", &self.ack_fee)?; + } + if true { + struct_ser.serialize_field("timeoutFee", &self.timeout_fee)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Fee { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "recv_fee", + "recvFee", + "ack_fee", + "ackFee", + "timeout_fee", + "timeoutFee", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + RecvFee, + AckFee, + TimeoutFee, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "recvFee" | "recv_fee" => Ok(GeneratedField::RecvFee), + "ackFee" | "ack_fee" => Ok(GeneratedField::AckFee), + "timeoutFee" | "timeout_fee" => Ok(GeneratedField::TimeoutFee), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Fee; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.Fee") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut recv_fee__ = None; + let mut ack_fee__ = None; + let mut timeout_fee__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::RecvFee => { + if recv_fee__.is_some() { + return Err(serde::de::Error::duplicate_field("recvFee")); + } + recv_fee__ = Some(map_.next_value()?); + } + GeneratedField::AckFee => { + if ack_fee__.is_some() { + return Err(serde::de::Error::duplicate_field("ackFee")); + } + ack_fee__ = Some(map_.next_value()?); + } + GeneratedField::TimeoutFee => { + if timeout_fee__.is_some() { + return Err(serde::de::Error::duplicate_field("timeoutFee")); + } + timeout_fee__ = Some(map_.next_value()?); + } + } + } + Ok(Fee { + recv_fee: recv_fee__.unwrap_or_default(), + ack_fee: ack_fee__.unwrap_or_default(), + timeout_fee: timeout_fee__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.Fee", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for FeeEnabledChannel { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.FeeEnabledChannel", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for FeeEnabledChannel { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = FeeEnabledChannel; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.FeeEnabledChannel") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + } + } + Ok(FeeEnabledChannel { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.FeeEnabledChannel", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ForwardRelayerAddress { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.ForwardRelayerAddress", len)?; + if true { + struct_ser.serialize_field("address", &self.address)?; + } + if let Some(v) = self.packet_id.as_ref() { + struct_ser.serialize_field("packetId", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ForwardRelayerAddress { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "address", + "packet_id", + "packetId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + PacketId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "packetId" | "packet_id" => Ok(GeneratedField::PacketId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ForwardRelayerAddress; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.ForwardRelayerAddress") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut address__ = None; + let mut packet_id__ = 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::PacketId => { + if packet_id__.is_some() { + return Err(serde::de::Error::duplicate_field("packetId")); + } + packet_id__ = map_.next_value()?; + } + } + } + Ok(ForwardRelayerAddress { + address: address__.unwrap_or_default(), + packet_id: packet_id__, + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.ForwardRelayerAddress", 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("ibc.applications.fee.v1.GenesisState", len)?; + if true { + struct_ser.serialize_field("identifiedFees", &self.identified_fees)?; + } + if true { + struct_ser.serialize_field("feeEnabledChannels", &self.fee_enabled_channels)?; + } + if true { + struct_ser.serialize_field("registeredPayees", &self.registered_payees)?; + } + if true { + struct_ser.serialize_field("registeredCounterpartyPayees", &self.registered_counterparty_payees)?; + } + if true { + struct_ser.serialize_field("forwardRelayers", &self.forward_relayers)?; + } + 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] = &[ + "identified_fees", + "identifiedFees", + "fee_enabled_channels", + "feeEnabledChannels", + "registered_payees", + "registeredPayees", + "registered_counterparty_payees", + "registeredCounterpartyPayees", + "forward_relayers", + "forwardRelayers", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + IdentifiedFees, + FeeEnabledChannels, + RegisteredPayees, + RegisteredCounterpartyPayees, + ForwardRelayers, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "identifiedFees" | "identified_fees" => Ok(GeneratedField::IdentifiedFees), + "feeEnabledChannels" | "fee_enabled_channels" => Ok(GeneratedField::FeeEnabledChannels), + "registeredPayees" | "registered_payees" => Ok(GeneratedField::RegisteredPayees), + "registeredCounterpartyPayees" | "registered_counterparty_payees" => Ok(GeneratedField::RegisteredCounterpartyPayees), + "forwardRelayers" | "forward_relayers" => Ok(GeneratedField::ForwardRelayers), + _ => 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 ibc.applications.fee.v1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut identified_fees__ = None; + let mut fee_enabled_channels__ = None; + let mut registered_payees__ = None; + let mut registered_counterparty_payees__ = None; + let mut forward_relayers__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::IdentifiedFees => { + if identified_fees__.is_some() { + return Err(serde::de::Error::duplicate_field("identifiedFees")); + } + identified_fees__ = Some(map_.next_value()?); + } + GeneratedField::FeeEnabledChannels => { + if fee_enabled_channels__.is_some() { + return Err(serde::de::Error::duplicate_field("feeEnabledChannels")); + } + fee_enabled_channels__ = Some(map_.next_value()?); + } + GeneratedField::RegisteredPayees => { + if registered_payees__.is_some() { + return Err(serde::de::Error::duplicate_field("registeredPayees")); + } + registered_payees__ = Some(map_.next_value()?); + } + GeneratedField::RegisteredCounterpartyPayees => { + if registered_counterparty_payees__.is_some() { + return Err(serde::de::Error::duplicate_field("registeredCounterpartyPayees")); + } + registered_counterparty_payees__ = Some(map_.next_value()?); + } + GeneratedField::ForwardRelayers => { + if forward_relayers__.is_some() { + return Err(serde::de::Error::duplicate_field("forwardRelayers")); + } + forward_relayers__ = Some(map_.next_value()?); + } + } + } + Ok(GenesisState { + identified_fees: identified_fees__.unwrap_or_default(), + fee_enabled_channels: fee_enabled_channels__.unwrap_or_default(), + registered_payees: registered_payees__.unwrap_or_default(), + registered_counterparty_payees: registered_counterparty_payees__.unwrap_or_default(), + forward_relayers: forward_relayers__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.GenesisState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for IdentifiedPacketFees { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.IdentifiedPacketFees", len)?; + if let Some(v) = self.packet_id.as_ref() { + struct_ser.serialize_field("packetId", v)?; + } + if true { + struct_ser.serialize_field("packetFees", &self.packet_fees)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for IdentifiedPacketFees { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "packet_id", + "packetId", + "packet_fees", + "packetFees", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PacketId, + PacketFees, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "packetId" | "packet_id" => Ok(GeneratedField::PacketId), + "packetFees" | "packet_fees" => Ok(GeneratedField::PacketFees), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = IdentifiedPacketFees; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.IdentifiedPacketFees") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut packet_id__ = None; + let mut packet_fees__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PacketId => { + if packet_id__.is_some() { + return Err(serde::de::Error::duplicate_field("packetId")); + } + packet_id__ = map_.next_value()?; + } + GeneratedField::PacketFees => { + if packet_fees__.is_some() { + return Err(serde::de::Error::duplicate_field("packetFees")); + } + packet_fees__ = Some(map_.next_value()?); + } + } + } + Ok(IdentifiedPacketFees { + packet_id: packet_id__, + packet_fees: packet_fees__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.IdentifiedPacketFees", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for IncentivizedAcknowledgement { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.IncentivizedAcknowledgement", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("appAcknowledgement", pbjson::private::base64::encode(&self.app_acknowledgement).as_str())?; + } + if true { + struct_ser.serialize_field("forwardRelayerAddress", &self.forward_relayer_address)?; + } + if true { + struct_ser.serialize_field("underlyingAppSuccess", &self.underlying_app_success)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for IncentivizedAcknowledgement { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "app_acknowledgement", + "appAcknowledgement", + "forward_relayer_address", + "forwardRelayerAddress", + "underlying_app_success", + "underlyingAppSuccess", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AppAcknowledgement, + ForwardRelayerAddress, + UnderlyingAppSuccess, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "appAcknowledgement" | "app_acknowledgement" => Ok(GeneratedField::AppAcknowledgement), + "forwardRelayerAddress" | "forward_relayer_address" => Ok(GeneratedField::ForwardRelayerAddress), + "underlyingAppSuccess" | "underlying_app_success" => Ok(GeneratedField::UnderlyingAppSuccess), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = IncentivizedAcknowledgement; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.IncentivizedAcknowledgement") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut app_acknowledgement__ = None; + let mut forward_relayer_address__ = None; + let mut underlying_app_success__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::AppAcknowledgement => { + if app_acknowledgement__.is_some() { + return Err(serde::de::Error::duplicate_field("appAcknowledgement")); + } + app_acknowledgement__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ForwardRelayerAddress => { + if forward_relayer_address__.is_some() { + return Err(serde::de::Error::duplicate_field("forwardRelayerAddress")); + } + forward_relayer_address__ = Some(map_.next_value()?); + } + GeneratedField::UnderlyingAppSuccess => { + if underlying_app_success__.is_some() { + return Err(serde::de::Error::duplicate_field("underlyingAppSuccess")); + } + underlying_app_success__ = Some(map_.next_value()?); + } + } + } + Ok(IncentivizedAcknowledgement { + app_acknowledgement: app_acknowledgement__.unwrap_or_default(), + forward_relayer_address: forward_relayer_address__.unwrap_or_default(), + underlying_app_success: underlying_app_success__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.IncentivizedAcknowledgement", 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; + } + let mut struct_ser = serializer.serialize_struct("ibc.applications.fee.v1.Metadata", len)?; + if true { + struct_ser.serialize_field("feeVersion", &self.fee_version)?; + } + if true { + struct_ser.serialize_field("appVersion", &self.app_version)?; + } + 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] = &[ + "fee_version", + "feeVersion", + "app_version", + "appVersion", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + FeeVersion, + AppVersion, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "feeVersion" | "fee_version" => Ok(GeneratedField::FeeVersion), + "appVersion" | "app_version" => Ok(GeneratedField::AppVersion), + _ => 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 ibc.applications.fee.v1.Metadata") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut fee_version__ = None; + let mut app_version__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::FeeVersion => { + if fee_version__.is_some() { + return Err(serde::de::Error::duplicate_field("feeVersion")); + } + fee_version__ = Some(map_.next_value()?); + } + GeneratedField::AppVersion => { + if app_version__.is_some() { + return Err(serde::de::Error::duplicate_field("appVersion")); + } + app_version__ = Some(map_.next_value()?); + } + } + } + Ok(Metadata { + fee_version: fee_version__.unwrap_or_default(), + app_version: app_version__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.Metadata", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgPayPacketFee { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.MsgPayPacketFee", len)?; + if let Some(v) = self.fee.as_ref() { + struct_ser.serialize_field("fee", v)?; + } + if true { + struct_ser.serialize_field("sourcePortId", &self.source_port_id)?; + } + if true { + struct_ser.serialize_field("sourceChannelId", &self.source_channel_id)?; + } + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + if true { + struct_ser.serialize_field("relayers", &self.relayers)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgPayPacketFee { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "fee", + "source_port_id", + "sourcePortId", + "source_channel_id", + "sourceChannelId", + "signer", + "relayers", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Fee, + SourcePortId, + SourceChannelId, + Signer, + Relayers, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "fee" => Ok(GeneratedField::Fee), + "sourcePortId" | "source_port_id" => Ok(GeneratedField::SourcePortId), + "sourceChannelId" | "source_channel_id" => Ok(GeneratedField::SourceChannelId), + "signer" => Ok(GeneratedField::Signer), + "relayers" => Ok(GeneratedField::Relayers), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgPayPacketFee; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.MsgPayPacketFee") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut fee__ = None; + let mut source_port_id__ = None; + let mut source_channel_id__ = None; + let mut signer__ = None; + let mut relayers__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Fee => { + if fee__.is_some() { + return Err(serde::de::Error::duplicate_field("fee")); + } + fee__ = map_.next_value()?; + } + GeneratedField::SourcePortId => { + if source_port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("sourcePortId")); + } + source_port_id__ = Some(map_.next_value()?); + } + GeneratedField::SourceChannelId => { + if source_channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("sourceChannelId")); + } + source_channel_id__ = Some(map_.next_value()?); + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + GeneratedField::Relayers => { + if relayers__.is_some() { + return Err(serde::de::Error::duplicate_field("relayers")); + } + relayers__ = Some(map_.next_value()?); + } + } + } + Ok(MsgPayPacketFee { + fee: fee__, + source_port_id: source_port_id__.unwrap_or_default(), + source_channel_id: source_channel_id__.unwrap_or_default(), + signer: signer__.unwrap_or_default(), + relayers: relayers__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.MsgPayPacketFee", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgPayPacketFeeAsync { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.MsgPayPacketFeeAsync", len)?; + if let Some(v) = self.packet_id.as_ref() { + struct_ser.serialize_field("packetId", v)?; + } + if let Some(v) = self.packet_fee.as_ref() { + struct_ser.serialize_field("packetFee", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgPayPacketFeeAsync { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "packet_id", + "packetId", + "packet_fee", + "packetFee", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PacketId, + PacketFee, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "packetId" | "packet_id" => Ok(GeneratedField::PacketId), + "packetFee" | "packet_fee" => Ok(GeneratedField::PacketFee), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgPayPacketFeeAsync; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.MsgPayPacketFeeAsync") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut packet_id__ = None; + let mut packet_fee__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PacketId => { + if packet_id__.is_some() { + return Err(serde::de::Error::duplicate_field("packetId")); + } + packet_id__ = map_.next_value()?; + } + GeneratedField::PacketFee => { + if packet_fee__.is_some() { + return Err(serde::de::Error::duplicate_field("packetFee")); + } + packet_fee__ = map_.next_value()?; + } + } + } + Ok(MsgPayPacketFeeAsync { + packet_id: packet_id__, + packet_fee: packet_fee__, + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.MsgPayPacketFeeAsync", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgPayPacketFeeAsyncResponse { + #[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("ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgPayPacketFeeAsyncResponse { + #[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 = MsgPayPacketFeeAsyncResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse") + } + + 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(MsgPayPacketFeeAsyncResponse { + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgPayPacketFeeResponse { + #[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("ibc.applications.fee.v1.MsgPayPacketFeeResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgPayPacketFeeResponse { + #[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 = MsgPayPacketFeeResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.MsgPayPacketFeeResponse") + } + + 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(MsgPayPacketFeeResponse { + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.MsgPayPacketFeeResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgRegisterCounterpartyPayee { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.MsgRegisterCounterpartyPayee", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if true { + struct_ser.serialize_field("relayer", &self.relayer)?; + } + if true { + struct_ser.serialize_field("counterpartyPayee", &self.counterparty_payee)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgRegisterCounterpartyPayee { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "relayer", + "counterparty_payee", + "counterpartyPayee", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + Relayer, + CounterpartyPayee, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "relayer" => Ok(GeneratedField::Relayer), + "counterpartyPayee" | "counterparty_payee" => Ok(GeneratedField::CounterpartyPayee), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgRegisterCounterpartyPayee; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.MsgRegisterCounterpartyPayee") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut relayer__ = None; + let mut counterparty_payee__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::Relayer => { + if relayer__.is_some() { + return Err(serde::de::Error::duplicate_field("relayer")); + } + relayer__ = Some(map_.next_value()?); + } + GeneratedField::CounterpartyPayee => { + if counterparty_payee__.is_some() { + return Err(serde::de::Error::duplicate_field("counterpartyPayee")); + } + counterparty_payee__ = Some(map_.next_value()?); + } + } + } + Ok(MsgRegisterCounterpartyPayee { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + relayer: relayer__.unwrap_or_default(), + counterparty_payee: counterparty_payee__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.MsgRegisterCounterpartyPayee", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgRegisterCounterpartyPayeeResponse { + #[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("ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgRegisterCounterpartyPayeeResponse { + #[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 = MsgRegisterCounterpartyPayeeResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse") + } + + 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(MsgRegisterCounterpartyPayeeResponse { + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgRegisterPayee { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.MsgRegisterPayee", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if true { + struct_ser.serialize_field("relayer", &self.relayer)?; + } + if true { + struct_ser.serialize_field("payee", &self.payee)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgRegisterPayee { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "relayer", + "payee", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + Relayer, + Payee, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "relayer" => Ok(GeneratedField::Relayer), + "payee" => Ok(GeneratedField::Payee), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgRegisterPayee; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.MsgRegisterPayee") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut relayer__ = None; + let mut payee__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::Relayer => { + if relayer__.is_some() { + return Err(serde::de::Error::duplicate_field("relayer")); + } + relayer__ = Some(map_.next_value()?); + } + GeneratedField::Payee => { + if payee__.is_some() { + return Err(serde::de::Error::duplicate_field("payee")); + } + payee__ = Some(map_.next_value()?); + } + } + } + Ok(MsgRegisterPayee { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + relayer: relayer__.unwrap_or_default(), + payee: payee__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.MsgRegisterPayee", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgRegisterPayeeResponse { + #[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("ibc.applications.fee.v1.MsgRegisterPayeeResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgRegisterPayeeResponse { + #[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 = MsgRegisterPayeeResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.MsgRegisterPayeeResponse") + } + + 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(MsgRegisterPayeeResponse { + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.MsgRegisterPayeeResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for PacketFee { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.PacketFee", len)?; + if let Some(v) = self.fee.as_ref() { + struct_ser.serialize_field("fee", v)?; + } + if true { + struct_ser.serialize_field("refundAddress", &self.refund_address)?; + } + if true { + struct_ser.serialize_field("relayers", &self.relayers)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for PacketFee { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "fee", + "refund_address", + "refundAddress", + "relayers", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Fee, + RefundAddress, + Relayers, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "fee" => Ok(GeneratedField::Fee), + "refundAddress" | "refund_address" => Ok(GeneratedField::RefundAddress), + "relayers" => Ok(GeneratedField::Relayers), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = PacketFee; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.PacketFee") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut fee__ = None; + let mut refund_address__ = None; + let mut relayers__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Fee => { + if fee__.is_some() { + return Err(serde::de::Error::duplicate_field("fee")); + } + fee__ = map_.next_value()?; + } + GeneratedField::RefundAddress => { + if refund_address__.is_some() { + return Err(serde::de::Error::duplicate_field("refundAddress")); + } + refund_address__ = Some(map_.next_value()?); + } + GeneratedField::Relayers => { + if relayers__.is_some() { + return Err(serde::de::Error::duplicate_field("relayers")); + } + relayers__ = Some(map_.next_value()?); + } + } + } + Ok(PacketFee { + fee: fee__, + refund_address: refund_address__.unwrap_or_default(), + relayers: relayers__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.PacketFee", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for PacketFees { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.PacketFees", len)?; + if true { + struct_ser.serialize_field("packetFees", &self.packet_fees)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for PacketFees { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "packet_fees", + "packetFees", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PacketFees, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "packetFees" | "packet_fees" => Ok(GeneratedField::PacketFees), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = PacketFees; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.PacketFees") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut packet_fees__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PacketFees => { + if packet_fees__.is_some() { + return Err(serde::de::Error::duplicate_field("packetFees")); + } + packet_fees__ = Some(map_.next_value()?); + } + } + } + Ok(PacketFees { + packet_fees: packet_fees__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.PacketFees", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryCounterpartyPayeeRequest { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.QueryCounterpartyPayeeRequest", len)?; + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if true { + struct_ser.serialize_field("relayer", &self.relayer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryCounterpartyPayeeRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "channel_id", + "channelId", + "relayer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ChannelId, + Relayer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "relayer" => Ok(GeneratedField::Relayer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryCounterpartyPayeeRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.QueryCounterpartyPayeeRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut channel_id__ = None; + let mut relayer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::Relayer => { + if relayer__.is_some() { + return Err(serde::de::Error::duplicate_field("relayer")); + } + relayer__ = Some(map_.next_value()?); + } + } + } + Ok(QueryCounterpartyPayeeRequest { + channel_id: channel_id__.unwrap_or_default(), + relayer: relayer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.QueryCounterpartyPayeeRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryCounterpartyPayeeResponse { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.QueryCounterpartyPayeeResponse", len)?; + if true { + struct_ser.serialize_field("counterpartyPayee", &self.counterparty_payee)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryCounterpartyPayeeResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "counterparty_payee", + "counterpartyPayee", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CounterpartyPayee, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "counterpartyPayee" | "counterparty_payee" => Ok(GeneratedField::CounterpartyPayee), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryCounterpartyPayeeResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.QueryCounterpartyPayeeResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut counterparty_payee__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::CounterpartyPayee => { + if counterparty_payee__.is_some() { + return Err(serde::de::Error::duplicate_field("counterpartyPayee")); + } + counterparty_payee__ = Some(map_.next_value()?); + } + } + } + Ok(QueryCounterpartyPayeeResponse { + counterparty_payee: counterparty_payee__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.QueryCounterpartyPayeeResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryFeeEnabledChannelRequest { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.QueryFeeEnabledChannelRequest", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryFeeEnabledChannelRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryFeeEnabledChannelRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.QueryFeeEnabledChannelRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + } + } + Ok(QueryFeeEnabledChannelRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.QueryFeeEnabledChannelRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryFeeEnabledChannelResponse { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.QueryFeeEnabledChannelResponse", len)?; + if true { + struct_ser.serialize_field("feeEnabled", &self.fee_enabled)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryFeeEnabledChannelResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "fee_enabled", + "feeEnabled", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + FeeEnabled, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "feeEnabled" | "fee_enabled" => Ok(GeneratedField::FeeEnabled), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryFeeEnabledChannelResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.QueryFeeEnabledChannelResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut fee_enabled__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::FeeEnabled => { + if fee_enabled__.is_some() { + return Err(serde::de::Error::duplicate_field("feeEnabled")); + } + fee_enabled__ = Some(map_.next_value()?); + } + } + } + Ok(QueryFeeEnabledChannelResponse { + fee_enabled: fee_enabled__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.QueryFeeEnabledChannelResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryFeeEnabledChannelsRequest { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest", len)?; + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("queryHeight", ::alloc::string::ToString::to_string(&self.query_height).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryFeeEnabledChannelsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "pagination", + "query_height", + "queryHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Pagination, + QueryHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "queryHeight" | "query_height" => Ok(GeneratedField::QueryHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryFeeEnabledChannelsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut pagination__ = None; + let mut query_height__ = 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()?; + } + GeneratedField::QueryHeight => { + if query_height__.is_some() { + return Err(serde::de::Error::duplicate_field("queryHeight")); + } + query_height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(QueryFeeEnabledChannelsRequest { + pagination: pagination__, + query_height: query_height__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryFeeEnabledChannelsResponse { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse", len)?; + if true { + struct_ser.serialize_field("feeEnabledChannels", &self.fee_enabled_channels)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryFeeEnabledChannelsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "fee_enabled_channels", + "feeEnabledChannels", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + FeeEnabledChannels, + 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 { + "feeEnabledChannels" | "fee_enabled_channels" => Ok(GeneratedField::FeeEnabledChannels), + "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 = QueryFeeEnabledChannelsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut fee_enabled_channels__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::FeeEnabledChannels => { + if fee_enabled_channels__.is_some() { + return Err(serde::de::Error::duplicate_field("feeEnabledChannels")); + } + fee_enabled_channels__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryFeeEnabledChannelsResponse { + fee_enabled_channels: fee_enabled_channels__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryIncentivizedPacketRequest { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.QueryIncentivizedPacketRequest", len)?; + if let Some(v) = self.packet_id.as_ref() { + struct_ser.serialize_field("packetId", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("queryHeight", ::alloc::string::ToString::to_string(&self.query_height).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryIncentivizedPacketRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "packet_id", + "packetId", + "query_height", + "queryHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PacketId, + QueryHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "packetId" | "packet_id" => Ok(GeneratedField::PacketId), + "queryHeight" | "query_height" => Ok(GeneratedField::QueryHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryIncentivizedPacketRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.QueryIncentivizedPacketRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut packet_id__ = None; + let mut query_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PacketId => { + if packet_id__.is_some() { + return Err(serde::de::Error::duplicate_field("packetId")); + } + packet_id__ = map_.next_value()?; + } + GeneratedField::QueryHeight => { + if query_height__.is_some() { + return Err(serde::de::Error::duplicate_field("queryHeight")); + } + query_height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(QueryIncentivizedPacketRequest { + packet_id: packet_id__, + query_height: query_height__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.QueryIncentivizedPacketRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryIncentivizedPacketResponse { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.QueryIncentivizedPacketResponse", len)?; + if let Some(v) = self.incentivized_packet.as_ref() { + struct_ser.serialize_field("incentivizedPacket", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryIncentivizedPacketResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "incentivized_packet", + "incentivizedPacket", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + IncentivizedPacket, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "incentivizedPacket" | "incentivized_packet" => Ok(GeneratedField::IncentivizedPacket), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryIncentivizedPacketResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.QueryIncentivizedPacketResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut incentivized_packet__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::IncentivizedPacket => { + if incentivized_packet__.is_some() { + return Err(serde::de::Error::duplicate_field("incentivizedPacket")); + } + incentivized_packet__ = map_.next_value()?; + } + } + } + Ok(QueryIncentivizedPacketResponse { + incentivized_packet: incentivized_packet__, + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.QueryIncentivizedPacketResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryIncentivizedPacketsForChannelRequest { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest", len)?; + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("queryHeight", ::alloc::string::ToString::to_string(&self.query_height).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryIncentivizedPacketsForChannelRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "pagination", + "port_id", + "portId", + "channel_id", + "channelId", + "query_height", + "queryHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Pagination, + PortId, + ChannelId, + QueryHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "queryHeight" | "query_height" => Ok(GeneratedField::QueryHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryIncentivizedPacketsForChannelRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut pagination__ = None; + let mut port_id__ = None; + let mut channel_id__ = None; + let mut query_height__ = 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()?; + } + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::QueryHeight => { + if query_height__.is_some() { + return Err(serde::de::Error::duplicate_field("queryHeight")); + } + query_height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(QueryIncentivizedPacketsForChannelRequest { + pagination: pagination__, + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + query_height: query_height__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryIncentivizedPacketsForChannelResponse { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse", len)?; + if true { + struct_ser.serialize_field("incentivizedPackets", &self.incentivized_packets)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryIncentivizedPacketsForChannelResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "incentivized_packets", + "incentivizedPackets", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + IncentivizedPackets, + 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 { + "incentivizedPackets" | "incentivized_packets" => Ok(GeneratedField::IncentivizedPackets), + "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 = QueryIncentivizedPacketsForChannelResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut incentivized_packets__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::IncentivizedPackets => { + if incentivized_packets__.is_some() { + return Err(serde::de::Error::duplicate_field("incentivizedPackets")); + } + incentivized_packets__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryIncentivizedPacketsForChannelResponse { + incentivized_packets: incentivized_packets__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryIncentivizedPacketsRequest { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.QueryIncentivizedPacketsRequest", len)?; + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("queryHeight", ::alloc::string::ToString::to_string(&self.query_height).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryIncentivizedPacketsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "pagination", + "query_height", + "queryHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Pagination, + QueryHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "queryHeight" | "query_height" => Ok(GeneratedField::QueryHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryIncentivizedPacketsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.QueryIncentivizedPacketsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut pagination__ = None; + let mut query_height__ = 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()?; + } + GeneratedField::QueryHeight => { + if query_height__.is_some() { + return Err(serde::de::Error::duplicate_field("queryHeight")); + } + query_height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(QueryIncentivizedPacketsRequest { + pagination: pagination__, + query_height: query_height__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.QueryIncentivizedPacketsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryIncentivizedPacketsResponse { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.QueryIncentivizedPacketsResponse", len)?; + if true { + struct_ser.serialize_field("incentivizedPackets", &self.incentivized_packets)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryIncentivizedPacketsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "incentivized_packets", + "incentivizedPackets", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + IncentivizedPackets, + 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 { + "incentivizedPackets" | "incentivized_packets" => Ok(GeneratedField::IncentivizedPackets), + "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 = QueryIncentivizedPacketsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.QueryIncentivizedPacketsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut incentivized_packets__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::IncentivizedPackets => { + if incentivized_packets__.is_some() { + return Err(serde::de::Error::duplicate_field("incentivizedPackets")); + } + incentivized_packets__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryIncentivizedPacketsResponse { + incentivized_packets: incentivized_packets__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.QueryIncentivizedPacketsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryPayeeRequest { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.QueryPayeeRequest", len)?; + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if true { + struct_ser.serialize_field("relayer", &self.relayer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryPayeeRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "channel_id", + "channelId", + "relayer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ChannelId, + Relayer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "relayer" => Ok(GeneratedField::Relayer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryPayeeRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.QueryPayeeRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut channel_id__ = None; + let mut relayer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::Relayer => { + if relayer__.is_some() { + return Err(serde::de::Error::duplicate_field("relayer")); + } + relayer__ = Some(map_.next_value()?); + } + } + } + Ok(QueryPayeeRequest { + channel_id: channel_id__.unwrap_or_default(), + relayer: relayer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.QueryPayeeRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryPayeeResponse { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.QueryPayeeResponse", len)?; + if true { + struct_ser.serialize_field("payeeAddress", &self.payee_address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryPayeeResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "payee_address", + "payeeAddress", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PayeeAddress, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "payeeAddress" | "payee_address" => Ok(GeneratedField::PayeeAddress), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryPayeeResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.QueryPayeeResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut payee_address__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PayeeAddress => { + if payee_address__.is_some() { + return Err(serde::de::Error::duplicate_field("payeeAddress")); + } + payee_address__ = Some(map_.next_value()?); + } + } + } + Ok(QueryPayeeResponse { + payee_address: payee_address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.QueryPayeeResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryTotalAckFeesRequest { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.QueryTotalAckFeesRequest", len)?; + if let Some(v) = self.packet_id.as_ref() { + struct_ser.serialize_field("packetId", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryTotalAckFeesRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "packet_id", + "packetId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PacketId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "packetId" | "packet_id" => Ok(GeneratedField::PacketId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryTotalAckFeesRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.QueryTotalAckFeesRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut packet_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PacketId => { + if packet_id__.is_some() { + return Err(serde::de::Error::duplicate_field("packetId")); + } + packet_id__ = map_.next_value()?; + } + } + } + Ok(QueryTotalAckFeesRequest { + packet_id: packet_id__, + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.QueryTotalAckFeesRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryTotalAckFeesResponse { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.QueryTotalAckFeesResponse", len)?; + if true { + struct_ser.serialize_field("ackFees", &self.ack_fees)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryTotalAckFeesResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "ack_fees", + "ackFees", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AckFees, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "ackFees" | "ack_fees" => Ok(GeneratedField::AckFees), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryTotalAckFeesResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.QueryTotalAckFeesResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut ack_fees__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::AckFees => { + if ack_fees__.is_some() { + return Err(serde::de::Error::duplicate_field("ackFees")); + } + ack_fees__ = Some(map_.next_value()?); + } + } + } + Ok(QueryTotalAckFeesResponse { + ack_fees: ack_fees__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.QueryTotalAckFeesResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryTotalRecvFeesRequest { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.QueryTotalRecvFeesRequest", len)?; + if let Some(v) = self.packet_id.as_ref() { + struct_ser.serialize_field("packetId", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryTotalRecvFeesRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "packet_id", + "packetId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PacketId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "packetId" | "packet_id" => Ok(GeneratedField::PacketId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryTotalRecvFeesRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.QueryTotalRecvFeesRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut packet_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PacketId => { + if packet_id__.is_some() { + return Err(serde::de::Error::duplicate_field("packetId")); + } + packet_id__ = map_.next_value()?; + } + } + } + Ok(QueryTotalRecvFeesRequest { + packet_id: packet_id__, + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.QueryTotalRecvFeesRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryTotalRecvFeesResponse { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.QueryTotalRecvFeesResponse", len)?; + if true { + struct_ser.serialize_field("recvFees", &self.recv_fees)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryTotalRecvFeesResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "recv_fees", + "recvFees", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + RecvFees, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "recvFees" | "recv_fees" => Ok(GeneratedField::RecvFees), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryTotalRecvFeesResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.QueryTotalRecvFeesResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut recv_fees__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::RecvFees => { + if recv_fees__.is_some() { + return Err(serde::de::Error::duplicate_field("recvFees")); + } + recv_fees__ = Some(map_.next_value()?); + } + } + } + Ok(QueryTotalRecvFeesResponse { + recv_fees: recv_fees__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.QueryTotalRecvFeesResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryTotalTimeoutFeesRequest { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest", len)?; + if let Some(v) = self.packet_id.as_ref() { + struct_ser.serialize_field("packetId", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryTotalTimeoutFeesRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "packet_id", + "packetId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PacketId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "packetId" | "packet_id" => Ok(GeneratedField::PacketId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryTotalTimeoutFeesRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut packet_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PacketId => { + if packet_id__.is_some() { + return Err(serde::de::Error::duplicate_field("packetId")); + } + packet_id__ = map_.next_value()?; + } + } + } + Ok(QueryTotalTimeoutFeesRequest { + packet_id: packet_id__, + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryTotalTimeoutFeesResponse { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse", len)?; + if true { + struct_ser.serialize_field("timeoutFees", &self.timeout_fees)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryTotalTimeoutFeesResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "timeout_fees", + "timeoutFees", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + TimeoutFees, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "timeoutFees" | "timeout_fees" => Ok(GeneratedField::TimeoutFees), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryTotalTimeoutFeesResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut timeout_fees__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::TimeoutFees => { + if timeout_fees__.is_some() { + return Err(serde::de::Error::duplicate_field("timeoutFees")); + } + timeout_fees__ = Some(map_.next_value()?); + } + } + } + Ok(QueryTotalTimeoutFeesResponse { + timeout_fees: timeout_fees__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for RegisteredCounterpartyPayee { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.RegisteredCounterpartyPayee", len)?; + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if true { + struct_ser.serialize_field("relayer", &self.relayer)?; + } + if true { + struct_ser.serialize_field("counterpartyPayee", &self.counterparty_payee)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for RegisteredCounterpartyPayee { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "channel_id", + "channelId", + "relayer", + "counterparty_payee", + "counterpartyPayee", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ChannelId, + Relayer, + CounterpartyPayee, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "relayer" => Ok(GeneratedField::Relayer), + "counterpartyPayee" | "counterparty_payee" => Ok(GeneratedField::CounterpartyPayee), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = RegisteredCounterpartyPayee; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.RegisteredCounterpartyPayee") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut channel_id__ = None; + let mut relayer__ = None; + let mut counterparty_payee__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::Relayer => { + if relayer__.is_some() { + return Err(serde::de::Error::duplicate_field("relayer")); + } + relayer__ = Some(map_.next_value()?); + } + GeneratedField::CounterpartyPayee => { + if counterparty_payee__.is_some() { + return Err(serde::de::Error::duplicate_field("counterpartyPayee")); + } + counterparty_payee__ = Some(map_.next_value()?); + } + } + } + Ok(RegisteredCounterpartyPayee { + channel_id: channel_id__.unwrap_or_default(), + relayer: relayer__.unwrap_or_default(), + counterparty_payee: counterparty_payee__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.RegisteredCounterpartyPayee", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for RegisteredPayee { + #[allow(deprecated)] + 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("ibc.applications.fee.v1.RegisteredPayee", len)?; + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if true { + struct_ser.serialize_field("relayer", &self.relayer)?; + } + if true { + struct_ser.serialize_field("payee", &self.payee)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for RegisteredPayee { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "channel_id", + "channelId", + "relayer", + "payee", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ChannelId, + Relayer, + Payee, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "relayer" => Ok(GeneratedField::Relayer), + "payee" => Ok(GeneratedField::Payee), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = RegisteredPayee; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.fee.v1.RegisteredPayee") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut channel_id__ = None; + let mut relayer__ = None; + let mut payee__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::Relayer => { + if relayer__.is_some() { + return Err(serde::de::Error::duplicate_field("relayer")); + } + relayer__ = Some(map_.next_value()?); + } + GeneratedField::Payee => { + if payee__.is_some() { + return Err(serde::de::Error::duplicate_field("payee")); + } + payee__ = Some(map_.next_value()?); + } + } + } + Ok(RegisteredPayee { + channel_id: channel_id__.unwrap_or_default(), + relayer: relayer__.unwrap_or_default(), + payee: payee__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.fee.v1.RegisteredPayee", FIELDS, GeneratedVisitor) + } +} diff --git a/src/prost/ibc.applications.interchain_accounts.controller.v1.rs b/src/prost/ibc.applications.interchain_accounts.controller.v1.rs index a351adda..00e306a3 100644 --- a/src/prost/ibc.applications.interchain_accounts.controller.v1.rs +++ b/src/prost/ibc.applications.interchain_accounts.controller.v1.rs @@ -1,6 +1,5 @@ /// Params defines the set of on-chain interchain accounts parameters. /// The following parameters may be used to disable the controller submodule. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -8,8 +7,16 @@ pub struct Params { #[prost(bool, tag = "1")] pub controller_enabled: bool, } +impl ::prost::Name for Params { + const NAME: &'static str = "Params"; + const PACKAGE: &'static str = "ibc.applications.interchain_accounts.controller.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!( + "ibc.applications.interchain_accounts.controller.v1.{}", Self::NAME + ) + } +} /// MsgRegisterInterchainAccount defines the payload for Msg/RegisterAccount -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRegisterInterchainAccount { @@ -20,8 +27,16 @@ pub struct MsgRegisterInterchainAccount { #[prost(string, tag = "3")] pub version: ::prost::alloc::string::String, } +impl ::prost::Name for MsgRegisterInterchainAccount { + const NAME: &'static str = "MsgRegisterInterchainAccount"; + const PACKAGE: &'static str = "ibc.applications.interchain_accounts.controller.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!( + "ibc.applications.interchain_accounts.controller.v1.{}", Self::NAME + ) + } +} /// MsgRegisterInterchainAccountResponse defines the response for Msg/RegisterAccount -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRegisterInterchainAccountResponse { @@ -30,8 +45,16 @@ pub struct MsgRegisterInterchainAccountResponse { #[prost(string, tag = "2")] pub port_id: ::prost::alloc::string::String, } +impl ::prost::Name for MsgRegisterInterchainAccountResponse { + const NAME: &'static str = "MsgRegisterInterchainAccountResponse"; + const PACKAGE: &'static str = "ibc.applications.interchain_accounts.controller.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!( + "ibc.applications.interchain_accounts.controller.v1.{}", Self::NAME + ) + } +} /// MsgSendTx defines the payload for Msg/SendTx -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSendTx { @@ -48,16 +71,32 @@ pub struct MsgSendTx { #[prost(uint64, tag = "4")] pub relative_timeout: u64, } +impl ::prost::Name for MsgSendTx { + const NAME: &'static str = "MsgSendTx"; + const PACKAGE: &'static str = "ibc.applications.interchain_accounts.controller.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!( + "ibc.applications.interchain_accounts.controller.v1.{}", Self::NAME + ) + } +} /// MsgSendTxResponse defines the response for MsgSendTx -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSendTxResponse { #[prost(uint64, tag = "1")] pub sequence: u64, } +impl ::prost::Name for MsgSendTxResponse { + const NAME: &'static str = "MsgSendTxResponse"; + const PACKAGE: &'static str = "ibc.applications.interchain_accounts.controller.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!( + "ibc.applications.interchain_accounts.controller.v1.{}", Self::NAME + ) + } +} /// MsgUpdateParams defines the payload for Msg/UpdateParams -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -70,11 +109,28 @@ pub struct MsgUpdateParams { #[prost(message, optional, tag = "2")] pub params: ::core::option::Option, } +impl ::prost::Name for MsgUpdateParams { + const NAME: &'static str = "MsgUpdateParams"; + const PACKAGE: &'static str = "ibc.applications.interchain_accounts.controller.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!( + "ibc.applications.interchain_accounts.controller.v1.{}", Self::NAME + ) + } +} /// MsgUpdateParamsResponse defines the response for Msg/UpdateParams -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} +impl ::prost::Name for MsgUpdateParamsResponse { + const NAME: &'static str = "MsgUpdateParamsResponse"; + const PACKAGE: &'static str = "ibc.applications.interchain_accounts.controller.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!( + "ibc.applications.interchain_accounts.controller.v1.{}", Self::NAME + ) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod msg_client { @@ -547,7 +603,6 @@ pub mod msg_server { } } /// QueryInterchainAccountRequest is the request type for the Query/InterchainAccount RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryInterchainAccountRequest { @@ -556,21 +611,45 @@ pub struct QueryInterchainAccountRequest { #[prost(string, tag = "2")] pub connection_id: ::prost::alloc::string::String, } +impl ::prost::Name for QueryInterchainAccountRequest { + const NAME: &'static str = "QueryInterchainAccountRequest"; + const PACKAGE: &'static str = "ibc.applications.interchain_accounts.controller.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!( + "ibc.applications.interchain_accounts.controller.v1.{}", Self::NAME + ) + } +} /// QueryInterchainAccountResponse the response type for the Query/InterchainAccount RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryInterchainAccountResponse { #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, } +impl ::prost::Name for QueryInterchainAccountResponse { + const NAME: &'static str = "QueryInterchainAccountResponse"; + const PACKAGE: &'static str = "ibc.applications.interchain_accounts.controller.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!( + "ibc.applications.interchain_accounts.controller.v1.{}", Self::NAME + ) + } +} /// QueryParamsRequest is the request type for the Query/Params RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} +impl ::prost::Name for QueryParamsRequest { + const NAME: &'static str = "QueryParamsRequest"; + const PACKAGE: &'static str = "ibc.applications.interchain_accounts.controller.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!( + "ibc.applications.interchain_accounts.controller.v1.{}", Self::NAME + ) + } +} /// QueryParamsResponse is the response type for the Query/Params RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { @@ -578,6 +657,15 @@ 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 = "ibc.applications.interchain_accounts.controller.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!( + "ibc.applications.interchain_accounts.controller.v1.{}", Self::NAME + ) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod query_client { diff --git a/src/prost/ibc.applications.interchain_accounts.controller.v1.serde.rs b/src/prost/ibc.applications.interchain_accounts.controller.v1.serde.rs new file mode 100644 index 00000000..b438d22c --- /dev/null +++ b/src/prost/ibc.applications.interchain_accounts.controller.v1.serde.rs @@ -0,0 +1,1111 @@ +impl serde::Serialize for MsgRegisterInterchainAccount { + #[allow(deprecated)] + 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("ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount", len)?; + if true { + struct_ser.serialize_field("owner", &self.owner)?; + } + if true { + struct_ser.serialize_field("connectionId", &self.connection_id)?; + } + if true { + struct_ser.serialize_field("version", &self.version)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgRegisterInterchainAccount { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "owner", + "connection_id", + "connectionId", + "version", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Owner, + ConnectionId, + 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 { + "owner" => Ok(GeneratedField::Owner), + "connectionId" | "connection_id" => Ok(GeneratedField::ConnectionId), + "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 = MsgRegisterInterchainAccount; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut owner__ = None; + let mut connection_id__ = None; + let mut version__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Owner => { + if owner__.is_some() { + return Err(serde::de::Error::duplicate_field("owner")); + } + owner__ = Some(map_.next_value()?); + } + GeneratedField::ConnectionId => { + if connection_id__.is_some() { + return Err(serde::de::Error::duplicate_field("connectionId")); + } + connection_id__ = Some(map_.next_value()?); + } + GeneratedField::Version => { + if version__.is_some() { + return Err(serde::de::Error::duplicate_field("version")); + } + version__ = Some(map_.next_value()?); + } + } + } + Ok(MsgRegisterInterchainAccount { + owner: owner__.unwrap_or_default(), + connection_id: connection_id__.unwrap_or_default(), + version: version__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgRegisterInterchainAccountResponse { + #[allow(deprecated)] + 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("ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccountResponse", len)?; + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgRegisterInterchainAccountResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "channel_id", + "channelId", + "port_id", + "portId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ChannelId, + PortId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "portId" | "port_id" => Ok(GeneratedField::PortId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgRegisterInterchainAccountResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccountResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut channel_id__ = None; + let mut port_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + } + } + Ok(MsgRegisterInterchainAccountResponse { + channel_id: channel_id__.unwrap_or_default(), + port_id: port_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccountResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgSendTx { + #[allow(deprecated)] + 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("ibc.applications.interchain_accounts.controller.v1.MsgSendTx", len)?; + if true { + struct_ser.serialize_field("owner", &self.owner)?; + } + if true { + struct_ser.serialize_field("connectionId", &self.connection_id)?; + } + if let Some(v) = self.packet_data.as_ref() { + struct_ser.serialize_field("packetData", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("relativeTimeout", ::alloc::string::ToString::to_string(&self.relative_timeout).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgSendTx { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "owner", + "connection_id", + "connectionId", + "packet_data", + "packetData", + "relative_timeout", + "relativeTimeout", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Owner, + ConnectionId, + PacketData, + RelativeTimeout, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "owner" => Ok(GeneratedField::Owner), + "connectionId" | "connection_id" => Ok(GeneratedField::ConnectionId), + "packetData" | "packet_data" => Ok(GeneratedField::PacketData), + "relativeTimeout" | "relative_timeout" => Ok(GeneratedField::RelativeTimeout), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgSendTx; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.interchain_accounts.controller.v1.MsgSendTx") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut owner__ = None; + let mut connection_id__ = None; + let mut packet_data__ = None; + let mut relative_timeout__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Owner => { + if owner__.is_some() { + return Err(serde::de::Error::duplicate_field("owner")); + } + owner__ = Some(map_.next_value()?); + } + GeneratedField::ConnectionId => { + if connection_id__.is_some() { + return Err(serde::de::Error::duplicate_field("connectionId")); + } + connection_id__ = Some(map_.next_value()?); + } + GeneratedField::PacketData => { + if packet_data__.is_some() { + return Err(serde::de::Error::duplicate_field("packetData")); + } + packet_data__ = map_.next_value()?; + } + GeneratedField::RelativeTimeout => { + if relative_timeout__.is_some() { + return Err(serde::de::Error::duplicate_field("relativeTimeout")); + } + relative_timeout__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgSendTx { + owner: owner__.unwrap_or_default(), + connection_id: connection_id__.unwrap_or_default(), + packet_data: packet_data__, + relative_timeout: relative_timeout__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.interchain_accounts.controller.v1.MsgSendTx", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgSendTxResponse { + #[allow(deprecated)] + 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("ibc.applications.interchain_accounts.controller.v1.MsgSendTxResponse", len)?; + 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 MsgSendTxResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "sequence", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + 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 { + "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 = MsgSendTxResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.interchain_accounts.controller.v1.MsgSendTxResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sequence__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Sequence => { + if sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("sequence")); + } + sequence__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgSendTxResponse { + sequence: sequence__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.interchain_accounts.controller.v1.MsgSendTxResponse", 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("ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams", len)?; + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + 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] = &[ + "signer", + "params", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Signer, + 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 { + "signer" => Ok(GeneratedField::Signer), + "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 ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut signer__ = None; + let mut params__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + } + } + Ok(MsgUpdateParams { + signer: signer__.unwrap_or_default(), + params: params__, + }) + } + } + deserializer.deserialize_struct("ibc.applications.interchain_accounts.controller.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("ibc.applications.interchain_accounts.controller.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 ibc.applications.interchain_accounts.controller.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("ibc.applications.interchain_accounts.controller.v1.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; + } + let mut struct_ser = serializer.serialize_struct("ibc.applications.interchain_accounts.controller.v1.Params", len)?; + if true { + struct_ser.serialize_field("controllerEnabled", &self.controller_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] = &[ + "controller_enabled", + "controllerEnabled", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ControllerEnabled, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "controllerEnabled" | "controller_enabled" => Ok(GeneratedField::ControllerEnabled), + _ => 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 ibc.applications.interchain_accounts.controller.v1.Params") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut controller_enabled__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ControllerEnabled => { + if controller_enabled__.is_some() { + return Err(serde::de::Error::duplicate_field("controllerEnabled")); + } + controller_enabled__ = Some(map_.next_value()?); + } + } + } + Ok(Params { + controller_enabled: controller_enabled__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.interchain_accounts.controller.v1.Params", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryInterchainAccountRequest { + #[allow(deprecated)] + 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("ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest", len)?; + if true { + struct_ser.serialize_field("owner", &self.owner)?; + } + if true { + struct_ser.serialize_field("connectionId", &self.connection_id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryInterchainAccountRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "owner", + "connection_id", + "connectionId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Owner, + ConnectionId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "owner" => Ok(GeneratedField::Owner), + "connectionId" | "connection_id" => Ok(GeneratedField::ConnectionId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryInterchainAccountRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut owner__ = None; + let mut connection_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Owner => { + if owner__.is_some() { + return Err(serde::de::Error::duplicate_field("owner")); + } + owner__ = Some(map_.next_value()?); + } + GeneratedField::ConnectionId => { + if connection_id__.is_some() { + return Err(serde::de::Error::duplicate_field("connectionId")); + } + connection_id__ = Some(map_.next_value()?); + } + } + } + Ok(QueryInterchainAccountRequest { + owner: owner__.unwrap_or_default(), + connection_id: connection_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryInterchainAccountResponse { + #[allow(deprecated)] + 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("ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse", len)?; + if true { + struct_ser.serialize_field("address", &self.address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryInterchainAccountResponse { + #[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 = QueryInterchainAccountResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse") + } + + 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(QueryInterchainAccountResponse { + address: address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse", 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("ibc.applications.interchain_accounts.controller.v1.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 ibc.applications.interchain_accounts.controller.v1.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("ibc.applications.interchain_accounts.controller.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; + } + let mut struct_ser = serializer.serialize_struct("ibc.applications.interchain_accounts.controller.v1.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 ibc.applications.interchain_accounts.controller.v1.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("ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse", FIELDS, GeneratedVisitor) + } +} diff --git a/src/prost/ibc.applications.interchain_accounts.genesis.v1.rs b/src/prost/ibc.applications.interchain_accounts.genesis.v1.rs index b6116a8c..10b5ab8c 100644 --- a/src/prost/ibc.applications.interchain_accounts.genesis.v1.rs +++ b/src/prost/ibc.applications.interchain_accounts.genesis.v1.rs @@ -1,5 +1,4 @@ /// GenesisState defines the interchain accounts genesis state -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -8,8 +7,16 @@ pub struct GenesisState { #[prost(message, optional, tag = "2")] pub host_genesis_state: ::core::option::Option, } +impl ::prost::Name for GenesisState { + const NAME: &'static str = "GenesisState"; + const PACKAGE: &'static str = "ibc.applications.interchain_accounts.genesis.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!( + "ibc.applications.interchain_accounts.genesis.v1.{}", Self::NAME + ) + } +} /// ControllerGenesisState defines the interchain accounts controller genesis state -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ControllerGenesisState { @@ -22,8 +29,16 @@ pub struct ControllerGenesisState { #[prost(message, optional, tag = "4")] pub params: ::core::option::Option, } +impl ::prost::Name for ControllerGenesisState { + const NAME: &'static str = "ControllerGenesisState"; + const PACKAGE: &'static str = "ibc.applications.interchain_accounts.genesis.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!( + "ibc.applications.interchain_accounts.genesis.v1.{}", Self::NAME + ) + } +} /// HostGenesisState defines the interchain accounts host genesis state -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct HostGenesisState { @@ -36,9 +51,17 @@ pub struct HostGenesisState { #[prost(message, optional, tag = "4")] pub params: ::core::option::Option, } +impl ::prost::Name for HostGenesisState { + const NAME: &'static str = "HostGenesisState"; + const PACKAGE: &'static str = "ibc.applications.interchain_accounts.genesis.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!( + "ibc.applications.interchain_accounts.genesis.v1.{}", Self::NAME + ) + } +} /// ActiveChannel contains a connection ID, port ID and associated active channel ID, as well as a boolean flag to /// indicate if the channel is middleware enabled -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ActiveChannel { @@ -51,8 +74,16 @@ pub struct ActiveChannel { #[prost(bool, tag = "4")] pub is_middleware_enabled: bool, } +impl ::prost::Name for ActiveChannel { + const NAME: &'static str = "ActiveChannel"; + const PACKAGE: &'static str = "ibc.applications.interchain_accounts.genesis.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!( + "ibc.applications.interchain_accounts.genesis.v1.{}", Self::NAME + ) + } +} /// RegisteredInterchainAccount contains a connection ID, port ID and associated interchain account address -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RegisteredInterchainAccount { @@ -63,3 +94,12 @@ pub struct RegisteredInterchainAccount { #[prost(string, tag = "3")] pub account_address: ::prost::alloc::string::String, } +impl ::prost::Name for RegisteredInterchainAccount { + const NAME: &'static str = "RegisteredInterchainAccount"; + const PACKAGE: &'static str = "ibc.applications.interchain_accounts.genesis.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!( + "ibc.applications.interchain_accounts.genesis.v1.{}", Self::NAME + ) + } +} diff --git a/src/prost/ibc.applications.interchain_accounts.genesis.v1.serde.rs b/src/prost/ibc.applications.interchain_accounts.genesis.v1.serde.rs new file mode 100644 index 00000000..76478f97 --- /dev/null +++ b/src/prost/ibc.applications.interchain_accounts.genesis.v1.serde.rs @@ -0,0 +1,672 @@ +impl serde::Serialize for ActiveChannel { + #[allow(deprecated)] + 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("ibc.applications.interchain_accounts.genesis.v1.ActiveChannel", len)?; + if true { + struct_ser.serialize_field("connectionId", &self.connection_id)?; + } + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if true { + struct_ser.serialize_field("isMiddlewareEnabled", &self.is_middleware_enabled)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ActiveChannel { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "connection_id", + "connectionId", + "port_id", + "portId", + "channel_id", + "channelId", + "is_middleware_enabled", + "isMiddlewareEnabled", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ConnectionId, + PortId, + ChannelId, + IsMiddlewareEnabled, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "connectionId" | "connection_id" => Ok(GeneratedField::ConnectionId), + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "isMiddlewareEnabled" | "is_middleware_enabled" => Ok(GeneratedField::IsMiddlewareEnabled), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ActiveChannel; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.interchain_accounts.genesis.v1.ActiveChannel") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut connection_id__ = None; + let mut port_id__ = None; + let mut channel_id__ = None; + let mut is_middleware_enabled__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ConnectionId => { + if connection_id__.is_some() { + return Err(serde::de::Error::duplicate_field("connectionId")); + } + connection_id__ = Some(map_.next_value()?); + } + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::IsMiddlewareEnabled => { + if is_middleware_enabled__.is_some() { + return Err(serde::de::Error::duplicate_field("isMiddlewareEnabled")); + } + is_middleware_enabled__ = Some(map_.next_value()?); + } + } + } + Ok(ActiveChannel { + connection_id: connection_id__.unwrap_or_default(), + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + is_middleware_enabled: is_middleware_enabled__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.interchain_accounts.genesis.v1.ActiveChannel", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ControllerGenesisState { + #[allow(deprecated)] + 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("ibc.applications.interchain_accounts.genesis.v1.ControllerGenesisState", len)?; + if true { + struct_ser.serialize_field("activeChannels", &self.active_channels)?; + } + if true { + struct_ser.serialize_field("interchainAccounts", &self.interchain_accounts)?; + } + if true { + struct_ser.serialize_field("ports", &self.ports)?; + } + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ControllerGenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "active_channels", + "activeChannels", + "interchain_accounts", + "interchainAccounts", + "ports", + "params", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ActiveChannels, + InterchainAccounts, + Ports, + 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 { + "activeChannels" | "active_channels" => Ok(GeneratedField::ActiveChannels), + "interchainAccounts" | "interchain_accounts" => Ok(GeneratedField::InterchainAccounts), + "ports" => Ok(GeneratedField::Ports), + "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 = ControllerGenesisState; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.interchain_accounts.genesis.v1.ControllerGenesisState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut active_channels__ = None; + let mut interchain_accounts__ = None; + let mut ports__ = None; + let mut params__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ActiveChannels => { + if active_channels__.is_some() { + return Err(serde::de::Error::duplicate_field("activeChannels")); + } + active_channels__ = Some(map_.next_value()?); + } + GeneratedField::InterchainAccounts => { + if interchain_accounts__.is_some() { + return Err(serde::de::Error::duplicate_field("interchainAccounts")); + } + interchain_accounts__ = Some(map_.next_value()?); + } + GeneratedField::Ports => { + if ports__.is_some() { + return Err(serde::de::Error::duplicate_field("ports")); + } + ports__ = Some(map_.next_value()?); + } + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + } + } + Ok(ControllerGenesisState { + active_channels: active_channels__.unwrap_or_default(), + interchain_accounts: interchain_accounts__.unwrap_or_default(), + ports: ports__.unwrap_or_default(), + params: params__, + }) + } + } + deserializer.deserialize_struct("ibc.applications.interchain_accounts.genesis.v1.ControllerGenesisState", 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("ibc.applications.interchain_accounts.genesis.v1.GenesisState", len)?; + if let Some(v) = self.controller_genesis_state.as_ref() { + struct_ser.serialize_field("controllerGenesisState", v)?; + } + if let Some(v) = self.host_genesis_state.as_ref() { + struct_ser.serialize_field("hostGenesisState", 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] = &[ + "controller_genesis_state", + "controllerGenesisState", + "host_genesis_state", + "hostGenesisState", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ControllerGenesisState, + HostGenesisState, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "controllerGenesisState" | "controller_genesis_state" => Ok(GeneratedField::ControllerGenesisState), + "hostGenesisState" | "host_genesis_state" => Ok(GeneratedField::HostGenesisState), + _ => 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 ibc.applications.interchain_accounts.genesis.v1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut controller_genesis_state__ = None; + let mut host_genesis_state__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ControllerGenesisState => { + if controller_genesis_state__.is_some() { + return Err(serde::de::Error::duplicate_field("controllerGenesisState")); + } + controller_genesis_state__ = map_.next_value()?; + } + GeneratedField::HostGenesisState => { + if host_genesis_state__.is_some() { + return Err(serde::de::Error::duplicate_field("hostGenesisState")); + } + host_genesis_state__ = map_.next_value()?; + } + } + } + Ok(GenesisState { + controller_genesis_state: controller_genesis_state__, + host_genesis_state: host_genesis_state__, + }) + } + } + deserializer.deserialize_struct("ibc.applications.interchain_accounts.genesis.v1.GenesisState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for HostGenesisState { + #[allow(deprecated)] + 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("ibc.applications.interchain_accounts.genesis.v1.HostGenesisState", len)?; + if true { + struct_ser.serialize_field("activeChannels", &self.active_channels)?; + } + if true { + struct_ser.serialize_field("interchainAccounts", &self.interchain_accounts)?; + } + if true { + struct_ser.serialize_field("port", &self.port)?; + } + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for HostGenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "active_channels", + "activeChannels", + "interchain_accounts", + "interchainAccounts", + "port", + "params", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ActiveChannels, + InterchainAccounts, + Port, + 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 { + "activeChannels" | "active_channels" => Ok(GeneratedField::ActiveChannels), + "interchainAccounts" | "interchain_accounts" => Ok(GeneratedField::InterchainAccounts), + "port" => Ok(GeneratedField::Port), + "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 = HostGenesisState; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.interchain_accounts.genesis.v1.HostGenesisState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut active_channels__ = None; + let mut interchain_accounts__ = None; + let mut port__ = None; + let mut params__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ActiveChannels => { + if active_channels__.is_some() { + return Err(serde::de::Error::duplicate_field("activeChannels")); + } + active_channels__ = Some(map_.next_value()?); + } + GeneratedField::InterchainAccounts => { + if interchain_accounts__.is_some() { + return Err(serde::de::Error::duplicate_field("interchainAccounts")); + } + interchain_accounts__ = Some(map_.next_value()?); + } + GeneratedField::Port => { + if port__.is_some() { + return Err(serde::de::Error::duplicate_field("port")); + } + port__ = Some(map_.next_value()?); + } + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + } + } + Ok(HostGenesisState { + active_channels: active_channels__.unwrap_or_default(), + interchain_accounts: interchain_accounts__.unwrap_or_default(), + port: port__.unwrap_or_default(), + params: params__, + }) + } + } + deserializer.deserialize_struct("ibc.applications.interchain_accounts.genesis.v1.HostGenesisState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for RegisteredInterchainAccount { + #[allow(deprecated)] + 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("ibc.applications.interchain_accounts.genesis.v1.RegisteredInterchainAccount", len)?; + if true { + struct_ser.serialize_field("connectionId", &self.connection_id)?; + } + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("accountAddress", &self.account_address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for RegisteredInterchainAccount { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "connection_id", + "connectionId", + "port_id", + "portId", + "account_address", + "accountAddress", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ConnectionId, + PortId, + 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 { + "connectionId" | "connection_id" => Ok(GeneratedField::ConnectionId), + "portId" | "port_id" => Ok(GeneratedField::PortId), + "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 = RegisteredInterchainAccount; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.interchain_accounts.genesis.v1.RegisteredInterchainAccount") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut connection_id__ = None; + let mut port_id__ = None; + let mut account_address__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ConnectionId => { + if connection_id__.is_some() { + return Err(serde::de::Error::duplicate_field("connectionId")); + } + connection_id__ = Some(map_.next_value()?); + } + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::AccountAddress => { + if account_address__.is_some() { + return Err(serde::de::Error::duplicate_field("accountAddress")); + } + account_address__ = Some(map_.next_value()?); + } + } + } + Ok(RegisteredInterchainAccount { + connection_id: connection_id__.unwrap_or_default(), + port_id: port_id__.unwrap_or_default(), + account_address: account_address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.interchain_accounts.genesis.v1.RegisteredInterchainAccount", FIELDS, GeneratedVisitor) + } +} diff --git a/src/prost/ibc.applications.interchain_accounts.host.v1.rs b/src/prost/ibc.applications.interchain_accounts.host.v1.rs index 00c7acb0..0cbc62ef 100644 --- a/src/prost/ibc.applications.interchain_accounts.host.v1.rs +++ b/src/prost/ibc.applications.interchain_accounts.host.v1.rs @@ -1,6 +1,5 @@ /// Params defines the set of on-chain interchain accounts parameters. /// The following parameters may be used to disable the host submodule. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -11,8 +10,16 @@ pub struct Params { #[prost(string, repeated, tag = "2")] pub allow_messages: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +impl ::prost::Name for Params { + const NAME: &'static str = "Params"; + const PACKAGE: &'static str = "ibc.applications.interchain_accounts.host.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!( + "ibc.applications.interchain_accounts.host.v1.{}", Self::NAME + ) + } +} /// MsgUpdateParams defines the payload for Msg/UpdateParams -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -25,11 +32,28 @@ pub struct MsgUpdateParams { #[prost(message, optional, tag = "2")] pub params: ::core::option::Option, } +impl ::prost::Name for MsgUpdateParams { + const NAME: &'static str = "MsgUpdateParams"; + const PACKAGE: &'static str = "ibc.applications.interchain_accounts.host.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!( + "ibc.applications.interchain_accounts.host.v1.{}", Self::NAME + ) + } +} /// MsgUpdateParamsResponse defines the response for Msg/UpdateParams -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} +impl ::prost::Name for MsgUpdateParamsResponse { + const NAME: &'static str = "MsgUpdateParamsResponse"; + const PACKAGE: &'static str = "ibc.applications.interchain_accounts.host.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!( + "ibc.applications.interchain_accounts.host.v1.{}", Self::NAME + ) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod msg_client { @@ -333,12 +357,19 @@ pub mod msg_server { } } /// QueryParamsRequest is the request type for the Query/Params RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} +impl ::prost::Name for QueryParamsRequest { + const NAME: &'static str = "QueryParamsRequest"; + const PACKAGE: &'static str = "ibc.applications.interchain_accounts.host.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!( + "ibc.applications.interchain_accounts.host.v1.{}", Self::NAME + ) + } +} /// QueryParamsResponse is the response type for the Query/Params RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { @@ -346,6 +377,15 @@ 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 = "ibc.applications.interchain_accounts.host.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!( + "ibc.applications.interchain_accounts.host.v1.{}", Self::NAME + ) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod query_client { diff --git a/src/prost/ibc.applications.interchain_accounts.host.v1.serde.rs b/src/prost/ibc.applications.interchain_accounts.host.v1.serde.rs new file mode 100644 index 00000000..8b52ba9b --- /dev/null +++ b/src/prost/ibc.applications.interchain_accounts.host.v1.serde.rs @@ -0,0 +1,451 @@ +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("ibc.applications.interchain_accounts.host.v1.MsgUpdateParams", len)?; + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + 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] = &[ + "signer", + "params", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Signer, + 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 { + "signer" => Ok(GeneratedField::Signer), + "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 ibc.applications.interchain_accounts.host.v1.MsgUpdateParams") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut signer__ = None; + let mut params__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + } + } + Ok(MsgUpdateParams { + signer: signer__.unwrap_or_default(), + params: params__, + }) + } + } + deserializer.deserialize_struct("ibc.applications.interchain_accounts.host.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("ibc.applications.interchain_accounts.host.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 ibc.applications.interchain_accounts.host.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("ibc.applications.interchain_accounts.host.v1.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; + } + let mut struct_ser = serializer.serialize_struct("ibc.applications.interchain_accounts.host.v1.Params", len)?; + if true { + struct_ser.serialize_field("hostEnabled", &self.host_enabled)?; + } + if true { + struct_ser.serialize_field("allowMessages", &self.allow_messages)?; + } + 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] = &[ + "host_enabled", + "hostEnabled", + "allow_messages", + "allowMessages", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + HostEnabled, + AllowMessages, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "hostEnabled" | "host_enabled" => Ok(GeneratedField::HostEnabled), + "allowMessages" | "allow_messages" => Ok(GeneratedField::AllowMessages), + _ => 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 ibc.applications.interchain_accounts.host.v1.Params") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut host_enabled__ = None; + let mut allow_messages__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::HostEnabled => { + if host_enabled__.is_some() { + return Err(serde::de::Error::duplicate_field("hostEnabled")); + } + host_enabled__ = Some(map_.next_value()?); + } + GeneratedField::AllowMessages => { + if allow_messages__.is_some() { + return Err(serde::de::Error::duplicate_field("allowMessages")); + } + allow_messages__ = Some(map_.next_value()?); + } + } + } + Ok(Params { + host_enabled: host_enabled__.unwrap_or_default(), + allow_messages: allow_messages__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.interchain_accounts.host.v1.Params", 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("ibc.applications.interchain_accounts.host.v1.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 ibc.applications.interchain_accounts.host.v1.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("ibc.applications.interchain_accounts.host.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; + } + let mut struct_ser = serializer.serialize_struct("ibc.applications.interchain_accounts.host.v1.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 ibc.applications.interchain_accounts.host.v1.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("ibc.applications.interchain_accounts.host.v1.QueryParamsResponse", FIELDS, GeneratedVisitor) + } +} diff --git a/src/prost/ibc.applications.interchain_accounts.v1.rs b/src/prost/ibc.applications.interchain_accounts.v1.rs index 09ec19d1..045606e3 100644 --- a/src/prost/ibc.applications.interchain_accounts.v1.rs +++ b/src/prost/ibc.applications.interchain_accounts.v1.rs @@ -1,5 +1,4 @@ /// An InterchainAccount is defined as a BaseAccount & the address of the account owner on the controller chain -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InterchainAccount { @@ -10,8 +9,14 @@ pub struct InterchainAccount { #[prost(string, tag = "2")] pub account_owner: ::prost::alloc::string::String, } +impl ::prost::Name for InterchainAccount { + const NAME: &'static str = "InterchainAccount"; + const PACKAGE: &'static str = "ibc.applications.interchain_accounts.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.interchain_accounts.v1.{}", Self::NAME) + } +} /// InterchainAccountPacketData is comprised of a raw transaction, type of transaction and optional memo field. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InterchainAccountPacketData { @@ -22,8 +27,14 @@ pub struct InterchainAccountPacketData { #[prost(string, tag = "3")] pub memo: ::prost::alloc::string::String, } +impl ::prost::Name for InterchainAccountPacketData { + const NAME: &'static str = "InterchainAccountPacketData"; + const PACKAGE: &'static str = "ibc.applications.interchain_accounts.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.interchain_accounts.v1.{}", Self::NAME) + } +} /// CosmosTx contains a list of sdk.Msg's. It should be used when sending transactions to an SDK host chain. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CosmosTx { @@ -32,9 +43,15 @@ pub struct CosmosTx { super::super::super::super::google::protobuf::Any, >, } +impl ::prost::Name for CosmosTx { + const NAME: &'static str = "CosmosTx"; + const PACKAGE: &'static str = "ibc.applications.interchain_accounts.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.interchain_accounts.v1.{}", Self::NAME) + } +} /// Type defines a classification of message issued from a controller chain to its associated interchain accounts /// host -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum Type { @@ -65,7 +82,6 @@ impl Type { } /// Metadata defines a set of protocol specific data encoded into the ICS27 channel version bytestring /// See ICS004: -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Metadata { @@ -89,3 +105,10 @@ pub struct Metadata { #[prost(string, tag = "6")] pub tx_type: ::prost::alloc::string::String, } +impl ::prost::Name for Metadata { + const NAME: &'static str = "Metadata"; + const PACKAGE: &'static str = "ibc.applications.interchain_accounts.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.interchain_accounts.v1.{}", Self::NAME) + } +} diff --git a/src/prost/ibc.applications.interchain_accounts.v1.serde.rs b/src/prost/ibc.applications.interchain_accounts.v1.serde.rs new file mode 100644 index 00000000..966bc3e9 --- /dev/null +++ b/src/prost/ibc.applications.interchain_accounts.v1.serde.rs @@ -0,0 +1,581 @@ +impl serde::Serialize for CosmosTx { + #[allow(deprecated)] + 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("ibc.applications.interchain_accounts.v1.CosmosTx", len)?; + if true { + struct_ser.serialize_field("messages", &self.messages)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for CosmosTx { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "messages", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Messages, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = CosmosTx; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.interchain_accounts.v1.CosmosTx") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut messages__ = 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()?); + } + } + } + Ok(CosmosTx { + messages: messages__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.interchain_accounts.v1.CosmosTx", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for InterchainAccount { + #[allow(deprecated)] + 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("ibc.applications.interchain_accounts.v1.InterchainAccount", len)?; + if let Some(v) = self.base_account.as_ref() { + struct_ser.serialize_field("baseAccount", v)?; + } + if true { + struct_ser.serialize_field("accountOwner", &self.account_owner)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for InterchainAccount { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "base_account", + "baseAccount", + "account_owner", + "accountOwner", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + BaseAccount, + AccountOwner, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "accountOwner" | "account_owner" => Ok(GeneratedField::AccountOwner), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = InterchainAccount; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.interchain_accounts.v1.InterchainAccount") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut base_account__ = None; + let mut account_owner__ = 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::AccountOwner => { + if account_owner__.is_some() { + return Err(serde::de::Error::duplicate_field("accountOwner")); + } + account_owner__ = Some(map_.next_value()?); + } + } + } + Ok(InterchainAccount { + base_account: base_account__, + account_owner: account_owner__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.interchain_accounts.v1.InterchainAccount", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for InterchainAccountPacketData { + #[allow(deprecated)] + 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("ibc.applications.interchain_accounts.v1.InterchainAccountPacketData", len)?; + if true { + let v = Type::try_from(self.r#type) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.r#type)))?; + struct_ser.serialize_field("type", &v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + if true { + struct_ser.serialize_field("memo", &self.memo)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for InterchainAccountPacketData { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "type", + "data", + "memo", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Type, + Data, + Memo, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "type" => Ok(GeneratedField::Type), + "data" => Ok(GeneratedField::Data), + "memo" => Ok(GeneratedField::Memo), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = InterchainAccountPacketData; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.interchain_accounts.v1.InterchainAccountPacketData") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut r#type__ = None; + let mut data__ = None; + let mut memo__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Type => { + if r#type__.is_some() { + return Err(serde::de::Error::duplicate_field("type")); + } + r#type__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Memo => { + if memo__.is_some() { + return Err(serde::de::Error::duplicate_field("memo")); + } + memo__ = Some(map_.next_value()?); + } + } + } + Ok(InterchainAccountPacketData { + r#type: r#type__.unwrap_or_default(), + data: data__.unwrap_or_default(), + memo: memo__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.interchain_accounts.v1.InterchainAccountPacketData", 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; + } + let mut struct_ser = serializer.serialize_struct("ibc.applications.interchain_accounts.v1.Metadata", len)?; + if true { + struct_ser.serialize_field("version", &self.version)?; + } + if true { + struct_ser.serialize_field("controllerConnectionId", &self.controller_connection_id)?; + } + if true { + struct_ser.serialize_field("hostConnectionId", &self.host_connection_id)?; + } + if true { + struct_ser.serialize_field("address", &self.address)?; + } + if true { + struct_ser.serialize_field("encoding", &self.encoding)?; + } + if true { + struct_ser.serialize_field("txType", &self.tx_type)?; + } + 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] = &[ + "version", + "controller_connection_id", + "controllerConnectionId", + "host_connection_id", + "hostConnectionId", + "address", + "encoding", + "tx_type", + "txType", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Version, + ControllerConnectionId, + HostConnectionId, + Address, + Encoding, + TxType, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "controllerConnectionId" | "controller_connection_id" => Ok(GeneratedField::ControllerConnectionId), + "hostConnectionId" | "host_connection_id" => Ok(GeneratedField::HostConnectionId), + "address" => Ok(GeneratedField::Address), + "encoding" => Ok(GeneratedField::Encoding), + "txType" | "tx_type" => Ok(GeneratedField::TxType), + _ => 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 ibc.applications.interchain_accounts.v1.Metadata") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut version__ = None; + let mut controller_connection_id__ = None; + let mut host_connection_id__ = None; + let mut address__ = None; + let mut encoding__ = None; + let mut tx_type__ = 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()?); + } + GeneratedField::ControllerConnectionId => { + if controller_connection_id__.is_some() { + return Err(serde::de::Error::duplicate_field("controllerConnectionId")); + } + controller_connection_id__ = Some(map_.next_value()?); + } + GeneratedField::HostConnectionId => { + if host_connection_id__.is_some() { + return Err(serde::de::Error::duplicate_field("hostConnectionId")); + } + host_connection_id__ = Some(map_.next_value()?); + } + GeneratedField::Address => { + if address__.is_some() { + return Err(serde::de::Error::duplicate_field("address")); + } + address__ = Some(map_.next_value()?); + } + GeneratedField::Encoding => { + if encoding__.is_some() { + return Err(serde::de::Error::duplicate_field("encoding")); + } + encoding__ = Some(map_.next_value()?); + } + GeneratedField::TxType => { + if tx_type__.is_some() { + return Err(serde::de::Error::duplicate_field("txType")); + } + tx_type__ = Some(map_.next_value()?); + } + } + } + Ok(Metadata { + version: version__.unwrap_or_default(), + controller_connection_id: controller_connection_id__.unwrap_or_default(), + host_connection_id: host_connection_id__.unwrap_or_default(), + address: address__.unwrap_or_default(), + encoding: encoding__.unwrap_or_default(), + tx_type: tx_type__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.interchain_accounts.v1.Metadata", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Type { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unspecified => "TYPE_UNSPECIFIED", + Self::ExecuteTx => "TYPE_EXECUTE_TX", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for Type { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "TYPE_UNSPECIFIED", + "TYPE_EXECUTE_TX", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = 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_UNSPECIFIED" => Ok(Type::Unspecified), + "TYPE_EXECUTE_TX" => Ok(Type::ExecuteTx), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} diff --git a/src/prost/ibc.applications.nft_transfer.v1.rs b/src/prost/ibc.applications.nft_transfer.v1.rs new file mode 100644 index 00000000..bea5ee5a --- /dev/null +++ b/src/prost/ibc.applications.nft_transfer.v1.rs @@ -0,0 +1,1387 @@ +/// ClassTrace contains the base classID for ICS721 non-fungible tokens and the +/// source tracing information path. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ClassTrace { + /// path defines the chain of port/channel identifiers used for tracing the + /// source of the non-fungible token. + #[prost(string, tag = "1")] + pub path: ::prost::alloc::string::String, + /// base classID of the relayed non-fungible token. + #[prost(string, tag = "2")] + pub base_class_id: ::prost::alloc::string::String, +} +impl ::prost::Name for ClassTrace { + const NAME: &'static str = "ClassTrace"; + const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME) + } +} +/// Params defines the set of IBC nft-transfer parameters. +/// NOTE: To prevent a nft from being transferred, set the +/// TransfersEnabled parameter to false. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Params { + /// send_enabled enables or disables all cross-chain nft transfers from this + /// chain. + #[prost(bool, tag = "1")] + pub send_enabled: bool, + /// receive_enabled enables or disables all cross-chain nft transfers to this + /// chain. + #[prost(bool, tag = "2")] + pub receive_enabled: bool, +} +impl ::prost::Name for Params { + const NAME: &'static str = "Params"; + const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME) + } +} +/// MsgTransfer defines a msg to transfer non fungible tokens between +/// ICS721 enabled chains. See ICS Spec here: +/// +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgTransfer { + /// the port on which the packet will be sent + #[prost(string, tag = "1")] + pub source_port: ::prost::alloc::string::String, + /// the channel by which the packet will be sent + #[prost(string, tag = "2")] + pub source_channel: ::prost::alloc::string::String, + /// the class_id of tokens to be transferred + #[prost(string, tag = "3")] + pub class_id: ::prost::alloc::string::String, + /// the non fungible tokens to be transferred + #[prost(string, repeated, tag = "4")] + pub token_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// the sender address + #[prost(string, tag = "5")] + pub sender: ::prost::alloc::string::String, + /// the recipient address on the destination chain + #[prost(string, tag = "6")] + pub receiver: ::prost::alloc::string::String, + /// Timeout height relative to the current block height. + /// The timeout is disabled when set to 0. + #[prost(message, optional, tag = "7")] + pub timeout_height: ::core::option::Option< + super::super::super::core::client::v1::Height, + >, + /// Timeout timestamp in absolute nanoseconds since unix epoch. + /// The timeout is disabled when set to 0. + #[prost(uint64, tag = "8")] + pub timeout_timestamp: u64, + /// optional memo + #[prost(string, tag = "9")] + pub memo: ::prost::alloc::string::String, +} +impl ::prost::Name for MsgTransfer { + const NAME: &'static str = "MsgTransfer"; + const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME) + } +} +/// MsgTransferResponse defines the Msg/Transfer response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgTransferResponse { + /// sequence number of the transfer packet sent + #[prost(uint64, tag = "1")] + pub sequence: u64, +} +impl ::prost::Name for MsgTransferResponse { + const NAME: &'static str = "MsgTransferResponse"; + const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME) + } +} +/// MsgUpdateParams is the Msg/UpdateParams request type. +/// +#[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 nft-transfer 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 = "ibc.applications.nft_transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME) + } +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} +impl ::prost::Name for MsgUpdateParamsResponse { + const NAME: &'static str = "MsgUpdateParamsResponse"; + const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME) + } +} +/// 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 ibc/nft-transfer Msg service. + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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 + } + /// Transfer defines a rpc handler method for MsgTransfer. + pub async fn transfer( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/ibc.applications.nft_transfer.v1.Msg/Transfer", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("ibc.applications.nft_transfer.v1.Msg", "Transfer"), + ); + self.inner.unary(req, path, codec).await + } + /// UpdateParams defines a governance operation for updating the nft-transfer module parameters. + /// The authority is defined in the keeper. + /// + 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( + "/ibc.applications.nft_transfer.v1.Msg/UpdateParams", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "ibc.applications.nft_transfer.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 { + /// Transfer defines a rpc handler method for MsgTransfer. + async fn transfer( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateParams defines a governance operation for updating the nft-transfer module parameters. + /// The authority is defined in the keeper. + /// + async fn update_params( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + /// Msg defines the ibc/nft-transfer Msg service. + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/ibc.applications.nft_transfer.v1.Msg/Transfer" => { + #[allow(non_camel_case_types)] + struct TransferSvc(pub Arc); + impl tonic::server::UnaryService + for TransferSvc { + type Response = super::MsgTransferResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::transfer(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = TransferSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/ibc.applications.nft_transfer.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 inner = inner.0; + 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", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "ibc.applications.nft_transfer.v1.Msg"; + } +} +/// NonFungibleTokenPacketData defines a struct for the packet payload +/// See NonFungibleTokenPacketData spec: +/// +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct NonFungibleTokenPacketData { + /// the class_id of class to be transferred + #[prost(string, tag = "1")] + pub class_id: ::prost::alloc::string::String, + /// the class_uri of class to be transferred + #[prost(string, tag = "2")] + pub class_uri: ::prost::alloc::string::String, + /// the class_data of class to be transferred + #[prost(string, tag = "3")] + pub class_data: ::prost::alloc::string::String, + /// the non fungible tokens to be transferred + #[prost(string, repeated, tag = "4")] + pub token_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// the non fungible tokens's uri to be transferred + #[prost(string, repeated, tag = "5")] + pub token_uris: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// the non fungible tokens's data to be transferred + #[prost(string, repeated, tag = "6")] + pub token_data: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// the sender address + #[prost(string, tag = "7")] + pub sender: ::prost::alloc::string::String, + /// the recipient address on the destination chain + #[prost(string, tag = "8")] + pub receiver: ::prost::alloc::string::String, + /// optional memo + #[prost(string, tag = "9")] + pub memo: ::prost::alloc::string::String, +} +impl ::prost::Name for NonFungibleTokenPacketData { + const NAME: &'static str = "NonFungibleTokenPacketData"; + const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME) + } +} +/// QueryClassTraceRequest is the request type for the Query/ClassDenom RPC +/// method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryClassTraceRequest { + /// hash (in hex format) or classID (full classID with ibc prefix) of the + /// denomination trace information. + #[prost(string, tag = "1")] + pub hash: ::prost::alloc::string::String, +} +impl ::prost::Name for QueryClassTraceRequest { + const NAME: &'static str = "QueryClassTraceRequest"; + const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME) + } +} +/// QueryClassTraceResponse is the response type for the Query/ClassDenom RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryClassTraceResponse { + /// class_trace returns the requested class trace information. + #[prost(message, optional, tag = "1")] + pub class_trace: ::core::option::Option, +} +impl ::prost::Name for QueryClassTraceResponse { + const NAME: &'static str = "QueryClassTraceResponse"; + const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME) + } +} +/// QueryConnectionsRequest is the request type for the Query/ClassTraces RPC +/// method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryClassTracesRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, +} +impl ::prost::Name for QueryClassTracesRequest { + const NAME: &'static str = "QueryClassTracesRequest"; + const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME) + } +} +/// QueryClassTracesResponse is the response type for the Query/ClassTraces RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryClassTracesResponse { + /// class_traces returns all class trace information. + #[prost(message, repeated, tag = "1")] + pub class_traces: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, +} +impl ::prost::Name for QueryClassTracesResponse { + const NAME: &'static str = "QueryClassTracesResponse"; + const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME) + } +} +/// QueryClassHashRequest is the request type for the Query/ClassHash RPC +/// method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryClassHashRequest { + /// The class trace `([port_id]/[channel_id])+/[class]` + #[prost(string, tag = "1")] + pub trace: ::prost::alloc::string::String, +} +impl ::prost::Name for QueryClassHashRequest { + const NAME: &'static str = "QueryClassHashRequest"; + const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME) + } +} +/// QueryClassHashResponse is the response type for the Query/ClassHash RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryClassHashResponse { + /// hash (in hex format) of the denomination trace information. + #[prost(string, tag = "1")] + pub hash: ::prost::alloc::string::String, +} +impl ::prost::Name for QueryClassHashResponse { + const NAME: &'static str = "QueryClassHashResponse"; + const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME) + } +} +/// QueryEscrowAddressRequest is the request type for the EscrowAddress RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryEscrowAddressRequest { + /// unique port identifier + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// unique channel identifier + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, +} +impl ::prost::Name for QueryEscrowAddressRequest { + const NAME: &'static str = "QueryEscrowAddressRequest"; + const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME) + } +} +/// QueryEscrowAddressResponse is the response type of the EscrowAddress RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryEscrowAddressResponse { + /// the escrow account address + #[prost(string, tag = "1")] + pub escrow_address: ::prost::alloc::string::String, +} +impl ::prost::Name for QueryEscrowAddressResponse { + const NAME: &'static str = "QueryEscrowAddressResponse"; + const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME) + } +} +/// QueryParamsRequest is request type for the Query/Params RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsRequest {} +impl ::prost::Name for QueryParamsRequest { + const NAME: &'static str = "QueryParamsRequest"; + const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME) + } +} +/// 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 = "ibc.applications.nft_transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME) + } +} +/// 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 provides 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 + } + /// ClassTrace queries a class trace information. + pub async fn class_trace( + &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( + "/ibc.applications.nft_transfer.v1.Query/ClassTrace", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "ibc.applications.nft_transfer.v1.Query", + "ClassTrace", + ), + ); + self.inner.unary(req, path, codec).await + } + /// ClassTraces queries all class traces. + pub async fn class_traces( + &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( + "/ibc.applications.nft_transfer.v1.Query/ClassTraces", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "ibc.applications.nft_transfer.v1.Query", + "ClassTraces", + ), + ); + self.inner.unary(req, path, codec).await + } + /// ClassHash queries a class hash information. + pub async fn class_hash( + &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( + "/ibc.applications.nft_transfer.v1.Query/ClassHash", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "ibc.applications.nft_transfer.v1.Query", + "ClassHash", + ), + ); + self.inner.unary(req, path, codec).await + } + /// EscrowAddress returns the escrow address for a particular port and channel + /// id. + pub async fn escrow_address( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/ibc.applications.nft_transfer.v1.Query/EscrowAddress", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "ibc.applications.nft_transfer.v1.Query", + "EscrowAddress", + ), + ); + self.inner.unary(req, path, codec).await + } + /// Params queries all parameters of the nft-transfer 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( + "/ibc.applications.nft_transfer.v1.Query/Params", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("ibc.applications.nft_transfer.v1.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 { + /// ClassTrace queries a class trace information. + async fn class_trace( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// ClassTraces queries all class traces. + async fn class_traces( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// ClassHash queries a class hash information. + async fn class_hash( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// EscrowAddress returns the escrow address for a particular port and channel + /// id. + async fn escrow_address( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Params queries all parameters of the nft-transfer module. + async fn params( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + /// Query provides defines the gRPC querier service. + #[derive(Debug)] + pub struct QueryServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/ibc.applications.nft_transfer.v1.Query/ClassTrace" => { + #[allow(non_camel_case_types)] + struct ClassTraceSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ClassTraceSvc { + type Response = super::QueryClassTraceResponse; + 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 { + ::class_trace(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ClassTraceSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/ibc.applications.nft_transfer.v1.Query/ClassTraces" => { + #[allow(non_camel_case_types)] + struct ClassTracesSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ClassTracesSvc { + type Response = super::QueryClassTracesResponse; + 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 { + ::class_traces(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ClassTracesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/ibc.applications.nft_transfer.v1.Query/ClassHash" => { + #[allow(non_camel_case_types)] + struct ClassHashSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ClassHashSvc { + type Response = super::QueryClassHashResponse; + 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 { + ::class_hash(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ClassHashSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/ibc.applications.nft_transfer.v1.Query/EscrowAddress" => { + #[allow(non_camel_case_types)] + struct EscrowAddressSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for EscrowAddressSvc { + type Response = super::QueryEscrowAddressResponse; + 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 { + ::escrow_address(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = EscrowAddressSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/ibc.applications.nft_transfer.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 inner = inner.0; + let method = ParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "ibc.applications.nft_transfer.v1.Query"; + } +} +/// GenesisState defines the ibc-nft-transfer genesis state +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub traces: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "3")] + pub params: ::core::option::Option, +} +impl ::prost::Name for GenesisState { + const NAME: &'static str = "GenesisState"; + const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME) + } +} diff --git a/src/prost/ibc.applications.nft_transfer.v1.serde.rs b/src/prost/ibc.applications.nft_transfer.v1.serde.rs new file mode 100644 index 00000000..b194a0c6 --- /dev/null +++ b/src/prost/ibc.applications.nft_transfer.v1.serde.rs @@ -0,0 +1,2016 @@ +impl serde::Serialize for ClassTrace { + #[allow(deprecated)] + 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("ibc.applications.nft_transfer.v1.ClassTrace", len)?; + if true { + struct_ser.serialize_field("path", &self.path)?; + } + if true { + struct_ser.serialize_field("baseClassId", &self.base_class_id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ClassTrace { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "path", + "base_class_id", + "baseClassId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Path, + BaseClassId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "baseClassId" | "base_class_id" => Ok(GeneratedField::BaseClassId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ClassTrace; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.nft_transfer.v1.ClassTrace") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut path__ = None; + let mut base_class_id__ = 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()?); + } + GeneratedField::BaseClassId => { + if base_class_id__.is_some() { + return Err(serde::de::Error::duplicate_field("baseClassId")); + } + base_class_id__ = Some(map_.next_value()?); + } + } + } + Ok(ClassTrace { + path: path__.unwrap_or_default(), + base_class_id: base_class_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.nft_transfer.v1.ClassTrace", 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; + } + let mut struct_ser = serializer.serialize_struct("ibc.applications.nft_transfer.v1.GenesisState", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("traces", &self.traces)?; + } + 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] = &[ + "port_id", + "portId", + "traces", + "params", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + Traces, + 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 { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "traces" => Ok(GeneratedField::Traces), + "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 ibc.applications.nft_transfer.v1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut traces__ = None; + let mut params__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::Traces => { + if traces__.is_some() { + return Err(serde::de::Error::duplicate_field("traces")); + } + traces__ = Some(map_.next_value()?); + } + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + } + } + Ok(GenesisState { + port_id: port_id__.unwrap_or_default(), + traces: traces__.unwrap_or_default(), + params: params__, + }) + } + } + deserializer.deserialize_struct("ibc.applications.nft_transfer.v1.GenesisState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgTransfer { + #[allow(deprecated)] + 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("ibc.applications.nft_transfer.v1.MsgTransfer", len)?; + if true { + struct_ser.serialize_field("sourcePort", &self.source_port)?; + } + if true { + struct_ser.serialize_field("sourceChannel", &self.source_channel)?; + } + if true { + struct_ser.serialize_field("classId", &self.class_id)?; + } + if true { + struct_ser.serialize_field("tokenIds", &self.token_ids)?; + } + if true { + struct_ser.serialize_field("sender", &self.sender)?; + } + if true { + struct_ser.serialize_field("receiver", &self.receiver)?; + } + if let Some(v) = self.timeout_height.as_ref() { + struct_ser.serialize_field("timeoutHeight", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("timeoutTimestamp", ::alloc::string::ToString::to_string(&self.timeout_timestamp).as_str())?; + } + if true { + struct_ser.serialize_field("memo", &self.memo)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgTransfer { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "source_port", + "sourcePort", + "source_channel", + "sourceChannel", + "class_id", + "classId", + "token_ids", + "tokenIds", + "sender", + "receiver", + "timeout_height", + "timeoutHeight", + "timeout_timestamp", + "timeoutTimestamp", + "memo", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + SourcePort, + SourceChannel, + ClassId, + TokenIds, + Sender, + Receiver, + TimeoutHeight, + TimeoutTimestamp, + Memo, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "sourcePort" | "source_port" => Ok(GeneratedField::SourcePort), + "sourceChannel" | "source_channel" => Ok(GeneratedField::SourceChannel), + "classId" | "class_id" => Ok(GeneratedField::ClassId), + "tokenIds" | "token_ids" => Ok(GeneratedField::TokenIds), + "sender" => Ok(GeneratedField::Sender), + "receiver" => Ok(GeneratedField::Receiver), + "timeoutHeight" | "timeout_height" => Ok(GeneratedField::TimeoutHeight), + "timeoutTimestamp" | "timeout_timestamp" => Ok(GeneratedField::TimeoutTimestamp), + "memo" => Ok(GeneratedField::Memo), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgTransfer; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.nft_transfer.v1.MsgTransfer") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut source_port__ = None; + let mut source_channel__ = None; + let mut class_id__ = None; + let mut token_ids__ = None; + let mut sender__ = None; + let mut receiver__ = None; + let mut timeout_height__ = None; + let mut timeout_timestamp__ = None; + let mut memo__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::SourcePort => { + if source_port__.is_some() { + return Err(serde::de::Error::duplicate_field("sourcePort")); + } + source_port__ = Some(map_.next_value()?); + } + GeneratedField::SourceChannel => { + if source_channel__.is_some() { + return Err(serde::de::Error::duplicate_field("sourceChannel")); + } + source_channel__ = Some(map_.next_value()?); + } + GeneratedField::ClassId => { + if class_id__.is_some() { + return Err(serde::de::Error::duplicate_field("classId")); + } + class_id__ = Some(map_.next_value()?); + } + GeneratedField::TokenIds => { + if token_ids__.is_some() { + return Err(serde::de::Error::duplicate_field("tokenIds")); + } + token_ids__ = Some(map_.next_value()?); + } + GeneratedField::Sender => { + if sender__.is_some() { + return Err(serde::de::Error::duplicate_field("sender")); + } + sender__ = Some(map_.next_value()?); + } + GeneratedField::Receiver => { + if receiver__.is_some() { + return Err(serde::de::Error::duplicate_field("receiver")); + } + receiver__ = Some(map_.next_value()?); + } + GeneratedField::TimeoutHeight => { + if timeout_height__.is_some() { + return Err(serde::de::Error::duplicate_field("timeoutHeight")); + } + timeout_height__ = map_.next_value()?; + } + GeneratedField::TimeoutTimestamp => { + if timeout_timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timeoutTimestamp")); + } + timeout_timestamp__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Memo => { + if memo__.is_some() { + return Err(serde::de::Error::duplicate_field("memo")); + } + memo__ = Some(map_.next_value()?); + } + } + } + Ok(MsgTransfer { + source_port: source_port__.unwrap_or_default(), + source_channel: source_channel__.unwrap_or_default(), + class_id: class_id__.unwrap_or_default(), + token_ids: token_ids__.unwrap_or_default(), + sender: sender__.unwrap_or_default(), + receiver: receiver__.unwrap_or_default(), + timeout_height: timeout_height__, + timeout_timestamp: timeout_timestamp__.unwrap_or_default(), + memo: memo__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.nft_transfer.v1.MsgTransfer", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgTransferResponse { + #[allow(deprecated)] + 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("ibc.applications.nft_transfer.v1.MsgTransferResponse", len)?; + 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 MsgTransferResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "sequence", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + 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 { + "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 = MsgTransferResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.nft_transfer.v1.MsgTransferResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sequence__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Sequence => { + if sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("sequence")); + } + sequence__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgTransferResponse { + sequence: sequence__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.nft_transfer.v1.MsgTransferResponse", 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("ibc.applications.nft_transfer.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 ibc.applications.nft_transfer.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("ibc.applications.nft_transfer.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("ibc.applications.nft_transfer.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 ibc.applications.nft_transfer.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("ibc.applications.nft_transfer.v1.MsgUpdateParamsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for NonFungibleTokenPacketData { + #[allow(deprecated)] + 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("ibc.applications.nft_transfer.v1.NonFungibleTokenPacketData", len)?; + if true { + struct_ser.serialize_field("classId", &self.class_id)?; + } + if true { + struct_ser.serialize_field("classUri", &self.class_uri)?; + } + if true { + struct_ser.serialize_field("classData", &self.class_data)?; + } + if true { + struct_ser.serialize_field("tokenIds", &self.token_ids)?; + } + if true { + struct_ser.serialize_field("tokenUris", &self.token_uris)?; + } + if true { + struct_ser.serialize_field("tokenData", &self.token_data)?; + } + if true { + struct_ser.serialize_field("sender", &self.sender)?; + } + if true { + struct_ser.serialize_field("receiver", &self.receiver)?; + } + if true { + struct_ser.serialize_field("memo", &self.memo)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for NonFungibleTokenPacketData { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "class_id", + "classId", + "class_uri", + "classUri", + "class_data", + "classData", + "token_ids", + "tokenIds", + "token_uris", + "tokenUris", + "token_data", + "tokenData", + "sender", + "receiver", + "memo", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClassId, + ClassUri, + ClassData, + TokenIds, + TokenUris, + TokenData, + Sender, + Receiver, + Memo, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "classId" | "class_id" => Ok(GeneratedField::ClassId), + "classUri" | "class_uri" => Ok(GeneratedField::ClassUri), + "classData" | "class_data" => Ok(GeneratedField::ClassData), + "tokenIds" | "token_ids" => Ok(GeneratedField::TokenIds), + "tokenUris" | "token_uris" => Ok(GeneratedField::TokenUris), + "tokenData" | "token_data" => Ok(GeneratedField::TokenData), + "sender" => Ok(GeneratedField::Sender), + "receiver" => Ok(GeneratedField::Receiver), + "memo" => Ok(GeneratedField::Memo), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = NonFungibleTokenPacketData; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.nft_transfer.v1.NonFungibleTokenPacketData") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut class_id__ = None; + let mut class_uri__ = None; + let mut class_data__ = None; + let mut token_ids__ = None; + let mut token_uris__ = None; + let mut token_data__ = None; + let mut sender__ = None; + let mut receiver__ = None; + let mut memo__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClassId => { + if class_id__.is_some() { + return Err(serde::de::Error::duplicate_field("classId")); + } + class_id__ = Some(map_.next_value()?); + } + GeneratedField::ClassUri => { + if class_uri__.is_some() { + return Err(serde::de::Error::duplicate_field("classUri")); + } + class_uri__ = Some(map_.next_value()?); + } + GeneratedField::ClassData => { + if class_data__.is_some() { + return Err(serde::de::Error::duplicate_field("classData")); + } + class_data__ = Some(map_.next_value()?); + } + GeneratedField::TokenIds => { + if token_ids__.is_some() { + return Err(serde::de::Error::duplicate_field("tokenIds")); + } + token_ids__ = Some(map_.next_value()?); + } + GeneratedField::TokenUris => { + if token_uris__.is_some() { + return Err(serde::de::Error::duplicate_field("tokenUris")); + } + token_uris__ = Some(map_.next_value()?); + } + GeneratedField::TokenData => { + if token_data__.is_some() { + return Err(serde::de::Error::duplicate_field("tokenData")); + } + token_data__ = Some(map_.next_value()?); + } + GeneratedField::Sender => { + if sender__.is_some() { + return Err(serde::de::Error::duplicate_field("sender")); + } + sender__ = Some(map_.next_value()?); + } + GeneratedField::Receiver => { + if receiver__.is_some() { + return Err(serde::de::Error::duplicate_field("receiver")); + } + receiver__ = Some(map_.next_value()?); + } + GeneratedField::Memo => { + if memo__.is_some() { + return Err(serde::de::Error::duplicate_field("memo")); + } + memo__ = Some(map_.next_value()?); + } + } + } + Ok(NonFungibleTokenPacketData { + class_id: class_id__.unwrap_or_default(), + class_uri: class_uri__.unwrap_or_default(), + class_data: class_data__.unwrap_or_default(), + token_ids: token_ids__.unwrap_or_default(), + token_uris: token_uris__.unwrap_or_default(), + token_data: token_data__.unwrap_or_default(), + sender: sender__.unwrap_or_default(), + receiver: receiver__.unwrap_or_default(), + memo: memo__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.nft_transfer.v1.NonFungibleTokenPacketData", 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("ibc.applications.nft_transfer.v1.Params", len)?; + if true { + struct_ser.serialize_field("sendEnabled", &self.send_enabled)?; + } + if true { + struct_ser.serialize_field("receiveEnabled", &self.receive_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", + "receive_enabled", + "receiveEnabled", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + SendEnabled, + ReceiveEnabled, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "receiveEnabled" | "receive_enabled" => Ok(GeneratedField::ReceiveEnabled), + _ => 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 ibc.applications.nft_transfer.v1.Params") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut send_enabled__ = None; + let mut receive_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::ReceiveEnabled => { + if receive_enabled__.is_some() { + return Err(serde::de::Error::duplicate_field("receiveEnabled")); + } + receive_enabled__ = Some(map_.next_value()?); + } + } + } + Ok(Params { + send_enabled: send_enabled__.unwrap_or_default(), + receive_enabled: receive_enabled__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.nft_transfer.v1.Params", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryClassHashRequest { + #[allow(deprecated)] + 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("ibc.applications.nft_transfer.v1.QueryClassHashRequest", len)?; + if true { + struct_ser.serialize_field("trace", &self.trace)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryClassHashRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "trace", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Trace, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "trace" => Ok(GeneratedField::Trace), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryClassHashRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.nft_transfer.v1.QueryClassHashRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut trace__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Trace => { + if trace__.is_some() { + return Err(serde::de::Error::duplicate_field("trace")); + } + trace__ = Some(map_.next_value()?); + } + } + } + Ok(QueryClassHashRequest { + trace: trace__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.nft_transfer.v1.QueryClassHashRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryClassHashResponse { + #[allow(deprecated)] + 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("ibc.applications.nft_transfer.v1.QueryClassHashResponse", len)?; + if true { + struct_ser.serialize_field("hash", &self.hash)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryClassHashResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "hash", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + 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 { + "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 = QueryClassHashResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.nft_transfer.v1.QueryClassHashResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut hash__ = 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()?); + } + } + } + Ok(QueryClassHashResponse { + hash: hash__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.nft_transfer.v1.QueryClassHashResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryClassTraceRequest { + #[allow(deprecated)] + 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("ibc.applications.nft_transfer.v1.QueryClassTraceRequest", len)?; + if true { + struct_ser.serialize_field("hash", &self.hash)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryClassTraceRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "hash", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + 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 { + "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 = QueryClassTraceRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.nft_transfer.v1.QueryClassTraceRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut hash__ = 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()?); + } + } + } + Ok(QueryClassTraceRequest { + hash: hash__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.nft_transfer.v1.QueryClassTraceRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryClassTraceResponse { + #[allow(deprecated)] + 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("ibc.applications.nft_transfer.v1.QueryClassTraceResponse", len)?; + if let Some(v) = self.class_trace.as_ref() { + struct_ser.serialize_field("classTrace", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryClassTraceResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "class_trace", + "classTrace", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClassTrace, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "classTrace" | "class_trace" => Ok(GeneratedField::ClassTrace), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryClassTraceResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.nft_transfer.v1.QueryClassTraceResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut class_trace__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClassTrace => { + if class_trace__.is_some() { + return Err(serde::de::Error::duplicate_field("classTrace")); + } + class_trace__ = map_.next_value()?; + } + } + } + Ok(QueryClassTraceResponse { + class_trace: class_trace__, + }) + } + } + deserializer.deserialize_struct("ibc.applications.nft_transfer.v1.QueryClassTraceResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryClassTracesRequest { + #[allow(deprecated)] + 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("ibc.applications.nft_transfer.v1.QueryClassTracesRequest", len)?; + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryClassTracesRequest { + #[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 = QueryClassTracesRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.nft_transfer.v1.QueryClassTracesRequest") + } + + 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(QueryClassTracesRequest { + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("ibc.applications.nft_transfer.v1.QueryClassTracesRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryClassTracesResponse { + #[allow(deprecated)] + 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("ibc.applications.nft_transfer.v1.QueryClassTracesResponse", len)?; + if true { + struct_ser.serialize_field("classTraces", &self.class_traces)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryClassTracesResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "class_traces", + "classTraces", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClassTraces, + 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 { + "classTraces" | "class_traces" => Ok(GeneratedField::ClassTraces), + "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 = QueryClassTracesResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.nft_transfer.v1.QueryClassTracesResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut class_traces__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClassTraces => { + if class_traces__.is_some() { + return Err(serde::de::Error::duplicate_field("classTraces")); + } + class_traces__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryClassTracesResponse { + class_traces: class_traces__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("ibc.applications.nft_transfer.v1.QueryClassTracesResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryEscrowAddressRequest { + #[allow(deprecated)] + 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("ibc.applications.nft_transfer.v1.QueryEscrowAddressRequest", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryEscrowAddressRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryEscrowAddressRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.nft_transfer.v1.QueryEscrowAddressRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + } + } + Ok(QueryEscrowAddressRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.nft_transfer.v1.QueryEscrowAddressRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryEscrowAddressResponse { + #[allow(deprecated)] + 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("ibc.applications.nft_transfer.v1.QueryEscrowAddressResponse", len)?; + if true { + struct_ser.serialize_field("escrowAddress", &self.escrow_address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryEscrowAddressResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "escrow_address", + "escrowAddress", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + EscrowAddress, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "escrowAddress" | "escrow_address" => Ok(GeneratedField::EscrowAddress), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryEscrowAddressResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.nft_transfer.v1.QueryEscrowAddressResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut escrow_address__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::EscrowAddress => { + if escrow_address__.is_some() { + return Err(serde::de::Error::duplicate_field("escrowAddress")); + } + escrow_address__ = Some(map_.next_value()?); + } + } + } + Ok(QueryEscrowAddressResponse { + escrow_address: escrow_address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.nft_transfer.v1.QueryEscrowAddressResponse", 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("ibc.applications.nft_transfer.v1.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 ibc.applications.nft_transfer.v1.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("ibc.applications.nft_transfer.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; + } + let mut struct_ser = serializer.serialize_struct("ibc.applications.nft_transfer.v1.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 ibc.applications.nft_transfer.v1.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("ibc.applications.nft_transfer.v1.QueryParamsResponse", FIELDS, GeneratedVisitor) + } +} diff --git a/src/prost/ibc.applications.transfer.v1.rs b/src/prost/ibc.applications.transfer.v1.rs index ba523ebd..70c3a6c7 100644 --- a/src/prost/ibc.applications.transfer.v1.rs +++ b/src/prost/ibc.applications.transfer.v1.rs @@ -1,6 +1,5 @@ /// DenomTrace contains the base denomination for ICS20 fungible tokens and the /// source tracing information path. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DenomTrace { @@ -12,11 +11,17 @@ pub struct DenomTrace { #[prost(string, tag = "2")] pub base_denom: ::prost::alloc::string::String, } +impl ::prost::Name for DenomTrace { + const NAME: &'static str = "DenomTrace"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} /// Params defines the set of IBC transfer parameters. /// NOTE: To prevent a single token from being transferred, set the /// TransfersEnabled parameter to true and then set the bank module's SendEnabled /// parameter for the denomination to false. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -29,10 +34,16 @@ pub struct Params { #[prost(bool, tag = "2")] pub receive_enabled: bool, } +impl ::prost::Name for Params { + const NAME: &'static str = "Params"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} /// MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between /// ICS20 enabled chains. See ICS Spec here: /// -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgTransfer { @@ -65,11 +76,16 @@ pub struct MsgTransfer { pub timeout_timestamp: u64, /// optional memo #[prost(string, tag = "8")] - #[cfg_attr(feature = "serde", serde(default))] pub memo: ::prost::alloc::string::String, } +impl ::prost::Name for MsgTransfer { + const NAME: &'static str = "MsgTransfer"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} /// MsgTransferResponse defines the Msg/Transfer response type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgTransferResponse { @@ -77,8 +93,14 @@ pub struct MsgTransferResponse { #[prost(uint64, tag = "1")] pub sequence: u64, } +impl ::prost::Name for MsgTransferResponse { + const NAME: &'static str = "MsgTransferResponse"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} /// MsgUpdateParams is the Msg/UpdateParams request type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -91,12 +113,25 @@ pub struct MsgUpdateParams { #[prost(message, optional, tag = "2")] pub params: ::core::option::Option, } +impl ::prost::Name for MsgUpdateParams { + const NAME: &'static str = "MsgUpdateParams"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} /// MsgUpdateParamsResponse defines the response structure for executing a /// MsgUpdateParams message. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} +impl ::prost::Name for MsgUpdateParamsResponse { + const NAME: &'static str = "MsgUpdateParamsResponse"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod msg_client { @@ -476,7 +511,6 @@ pub mod msg_server { } /// QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC /// method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomTraceRequest { @@ -484,9 +518,15 @@ pub struct QueryDenomTraceRequest { #[prost(string, tag = "1")] pub hash: ::prost::alloc::string::String, } +impl ::prost::Name for QueryDenomTraceRequest { + const NAME: &'static str = "QueryDenomTraceRequest"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} /// QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC /// method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomTraceResponse { @@ -494,9 +534,15 @@ pub struct QueryDenomTraceResponse { #[prost(message, optional, tag = "1")] pub denom_trace: ::core::option::Option, } +impl ::prost::Name for QueryDenomTraceResponse { + const NAME: &'static str = "QueryDenomTraceResponse"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} /// QueryConnectionsRequest is the request type for the Query/DenomTraces RPC /// method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomTracesRequest { @@ -506,9 +552,15 @@ pub struct QueryDenomTracesRequest { super::super::super::super::cosmos::base::query::v1beta1::PageRequest, >, } +impl ::prost::Name for QueryDenomTracesRequest { + const NAME: &'static str = "QueryDenomTracesRequest"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} /// QueryConnectionsResponse is the response type for the Query/DenomTraces RPC /// method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomTracesResponse { @@ -521,13 +573,25 @@ pub struct QueryDenomTracesResponse { super::super::super::super::cosmos::base::query::v1beta1::PageResponse, >, } +impl ::prost::Name for QueryDenomTracesResponse { + const NAME: &'static str = "QueryDenomTracesResponse"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} /// QueryParamsRequest is the request type for the Query/Params RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} +impl ::prost::Name for QueryParamsRequest { + const NAME: &'static str = "QueryParamsRequest"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} /// QueryParamsResponse is the response type for the Query/Params RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { @@ -535,9 +599,15 @@ 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 = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} /// QueryDenomHashRequest is the request type for the Query/DenomHash RPC /// method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomHashRequest { @@ -545,9 +615,15 @@ pub struct QueryDenomHashRequest { #[prost(string, tag = "1")] pub trace: ::prost::alloc::string::String, } +impl ::prost::Name for QueryDenomHashRequest { + const NAME: &'static str = "QueryDenomHashRequest"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} /// QueryDenomHashResponse is the response type for the Query/DenomHash RPC /// method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomHashResponse { @@ -555,8 +631,14 @@ pub struct QueryDenomHashResponse { #[prost(string, tag = "1")] pub hash: ::prost::alloc::string::String, } +impl ::prost::Name for QueryDenomHashResponse { + const NAME: &'static str = "QueryDenomHashResponse"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} /// QueryEscrowAddressRequest is the request type for the EscrowAddress RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryEscrowAddressRequest { @@ -567,8 +649,14 @@ pub struct QueryEscrowAddressRequest { #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, } +impl ::prost::Name for QueryEscrowAddressRequest { + const NAME: &'static str = "QueryEscrowAddressRequest"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} /// QueryEscrowAddressResponse is the response type of the EscrowAddress RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryEscrowAddressResponse { @@ -576,16 +664,28 @@ pub struct QueryEscrowAddressResponse { #[prost(string, tag = "1")] pub escrow_address: ::prost::alloc::string::String, } +impl ::prost::Name for QueryEscrowAddressResponse { + const NAME: &'static str = "QueryEscrowAddressResponse"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} /// QueryTotalEscrowForDenomRequest is the request type for TotalEscrowForDenom RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTotalEscrowForDenomRequest { #[prost(string, tag = "1")] pub denom: ::prost::alloc::string::String, } +impl ::prost::Name for QueryTotalEscrowForDenomRequest { + const NAME: &'static str = "QueryTotalEscrowForDenomRequest"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} /// QueryTotalEscrowForDenomResponse is the response type for TotalEscrowForDenom RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTotalEscrowForDenomResponse { @@ -594,6 +694,13 @@ pub struct QueryTotalEscrowForDenomResponse { super::super::super::super::cosmos::base::v1beta1::Coin, >, } +impl ::prost::Name for QueryTotalEscrowForDenomResponse { + const NAME: &'static str = "QueryTotalEscrowForDenomResponse"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod query_client { @@ -1310,7 +1417,6 @@ pub mod query_server { } } /// Allocation defines the spend limit for a particular port and channel -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Allocation { @@ -1328,10 +1434,20 @@ pub struct Allocation { /// allow list of receivers, an empty allow list permits any receiver address #[prost(string, repeated, tag = "4")] pub allow_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// allow list of packet data keys, an empty list prohibits all packet data keys; + /// a list only with "*" permits any packet data key + #[prost(string, repeated, tag = "5")] + pub allowed_packet_data: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +impl ::prost::Name for Allocation { + const NAME: &'static str = "Allocation"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } } /// TransferAuthorization allows the grantee to spend up to spend_limit coins from /// the granter's account for ibc transfer on a specific channel -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TransferAuthorization { @@ -1339,8 +1455,14 @@ pub struct TransferAuthorization { #[prost(message, repeated, tag = "1")] pub allocations: ::prost::alloc::vec::Vec, } +impl ::prost::Name for TransferAuthorization { + const NAME: &'static str = "TransferAuthorization"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} /// GenesisState defines the ibc-transfer genesis state -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -1357,3 +1479,10 @@ pub struct GenesisState { super::super::super::super::cosmos::base::v1beta1::Coin, >, } +impl ::prost::Name for GenesisState { + const NAME: &'static str = "GenesisState"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} diff --git a/src/prost/ibc.applications.transfer.v1.serde.rs b/src/prost/ibc.applications.transfer.v1.serde.rs new file mode 100644 index 00000000..2daf7aae --- /dev/null +++ b/src/prost/ibc.applications.transfer.v1.serde.rs @@ -0,0 +1,2220 @@ +impl serde::Serialize for Allocation { + #[allow(deprecated)] + 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("ibc.applications.transfer.v1.Allocation", len)?; + if true { + struct_ser.serialize_field("sourcePort", &self.source_port)?; + } + if true { + struct_ser.serialize_field("sourceChannel", &self.source_channel)?; + } + if true { + struct_ser.serialize_field("spendLimit", &self.spend_limit)?; + } + if true { + struct_ser.serialize_field("allowList", &self.allow_list)?; + } + if true { + struct_ser.serialize_field("allowedPacketData", &self.allowed_packet_data)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Allocation { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "source_port", + "sourcePort", + "source_channel", + "sourceChannel", + "spend_limit", + "spendLimit", + "allow_list", + "allowList", + "allowed_packet_data", + "allowedPacketData", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + SourcePort, + SourceChannel, + SpendLimit, + AllowList, + AllowedPacketData, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "sourcePort" | "source_port" => Ok(GeneratedField::SourcePort), + "sourceChannel" | "source_channel" => Ok(GeneratedField::SourceChannel), + "spendLimit" | "spend_limit" => Ok(GeneratedField::SpendLimit), + "allowList" | "allow_list" => Ok(GeneratedField::AllowList), + "allowedPacketData" | "allowed_packet_data" => Ok(GeneratedField::AllowedPacketData), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Allocation; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.transfer.v1.Allocation") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut source_port__ = None; + let mut source_channel__ = None; + let mut spend_limit__ = None; + let mut allow_list__ = None; + let mut allowed_packet_data__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::SourcePort => { + if source_port__.is_some() { + return Err(serde::de::Error::duplicate_field("sourcePort")); + } + source_port__ = Some(map_.next_value()?); + } + GeneratedField::SourceChannel => { + if source_channel__.is_some() { + return Err(serde::de::Error::duplicate_field("sourceChannel")); + } + source_channel__ = Some(map_.next_value()?); + } + 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()?); + } + GeneratedField::AllowedPacketData => { + if allowed_packet_data__.is_some() { + return Err(serde::de::Error::duplicate_field("allowedPacketData")); + } + allowed_packet_data__ = Some(map_.next_value()?); + } + } + } + Ok(Allocation { + source_port: source_port__.unwrap_or_default(), + source_channel: source_channel__.unwrap_or_default(), + spend_limit: spend_limit__.unwrap_or_default(), + allow_list: allow_list__.unwrap_or_default(), + allowed_packet_data: allowed_packet_data__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.transfer.v1.Allocation", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for DenomTrace { + #[allow(deprecated)] + 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("ibc.applications.transfer.v1.DenomTrace", len)?; + if true { + struct_ser.serialize_field("path", &self.path)?; + } + if true { + struct_ser.serialize_field("baseDenom", &self.base_denom)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for DenomTrace { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "path", + "base_denom", + "baseDenom", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Path, + BaseDenom, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "baseDenom" | "base_denom" => Ok(GeneratedField::BaseDenom), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = DenomTrace; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.transfer.v1.DenomTrace") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut path__ = None; + let mut base_denom__ = 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()?); + } + GeneratedField::BaseDenom => { + if base_denom__.is_some() { + return Err(serde::de::Error::duplicate_field("baseDenom")); + } + base_denom__ = Some(map_.next_value()?); + } + } + } + Ok(DenomTrace { + path: path__.unwrap_or_default(), + base_denom: base_denom__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.transfer.v1.DenomTrace", 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; + } + let mut struct_ser = serializer.serialize_struct("ibc.applications.transfer.v1.GenesisState", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("denomTraces", &self.denom_traces)?; + } + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + if true { + struct_ser.serialize_field("totalEscrowed", &self.total_escrowed)?; + } + 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] = &[ + "port_id", + "portId", + "denom_traces", + "denomTraces", + "params", + "total_escrowed", + "totalEscrowed", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + DenomTraces, + Params, + TotalEscrowed, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "denomTraces" | "denom_traces" => Ok(GeneratedField::DenomTraces), + "params" => Ok(GeneratedField::Params), + "totalEscrowed" | "total_escrowed" => Ok(GeneratedField::TotalEscrowed), + _ => 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 ibc.applications.transfer.v1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut denom_traces__ = None; + let mut params__ = None; + let mut total_escrowed__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::DenomTraces => { + if denom_traces__.is_some() { + return Err(serde::de::Error::duplicate_field("denomTraces")); + } + denom_traces__ = Some(map_.next_value()?); + } + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + GeneratedField::TotalEscrowed => { + if total_escrowed__.is_some() { + return Err(serde::de::Error::duplicate_field("totalEscrowed")); + } + total_escrowed__ = Some(map_.next_value()?); + } + } + } + Ok(GenesisState { + port_id: port_id__.unwrap_or_default(), + denom_traces: denom_traces__.unwrap_or_default(), + params: params__, + total_escrowed: total_escrowed__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.transfer.v1.GenesisState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgTransfer { + #[allow(deprecated)] + 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("ibc.applications.transfer.v1.MsgTransfer", len)?; + if true { + struct_ser.serialize_field("sourcePort", &self.source_port)?; + } + if true { + struct_ser.serialize_field("sourceChannel", &self.source_channel)?; + } + if let Some(v) = self.token.as_ref() { + struct_ser.serialize_field("token", v)?; + } + if true { + struct_ser.serialize_field("sender", &self.sender)?; + } + if true { + struct_ser.serialize_field("receiver", &self.receiver)?; + } + if let Some(v) = self.timeout_height.as_ref() { + struct_ser.serialize_field("timeoutHeight", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("timeoutTimestamp", ::alloc::string::ToString::to_string(&self.timeout_timestamp).as_str())?; + } + if true { + struct_ser.serialize_field("memo", &self.memo)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgTransfer { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "source_port", + "sourcePort", + "source_channel", + "sourceChannel", + "token", + "sender", + "receiver", + "timeout_height", + "timeoutHeight", + "timeout_timestamp", + "timeoutTimestamp", + "memo", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + SourcePort, + SourceChannel, + Token, + Sender, + Receiver, + TimeoutHeight, + TimeoutTimestamp, + Memo, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "sourcePort" | "source_port" => Ok(GeneratedField::SourcePort), + "sourceChannel" | "source_channel" => Ok(GeneratedField::SourceChannel), + "token" => Ok(GeneratedField::Token), + "sender" => Ok(GeneratedField::Sender), + "receiver" => Ok(GeneratedField::Receiver), + "timeoutHeight" | "timeout_height" => Ok(GeneratedField::TimeoutHeight), + "timeoutTimestamp" | "timeout_timestamp" => Ok(GeneratedField::TimeoutTimestamp), + "memo" => Ok(GeneratedField::Memo), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgTransfer; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.transfer.v1.MsgTransfer") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut source_port__ = None; + let mut source_channel__ = None; + let mut token__ = None; + let mut sender__ = None; + let mut receiver__ = None; + let mut timeout_height__ = None; + let mut timeout_timestamp__ = None; + let mut memo__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::SourcePort => { + if source_port__.is_some() { + return Err(serde::de::Error::duplicate_field("sourcePort")); + } + source_port__ = Some(map_.next_value()?); + } + GeneratedField::SourceChannel => { + if source_channel__.is_some() { + return Err(serde::de::Error::duplicate_field("sourceChannel")); + } + source_channel__ = Some(map_.next_value()?); + } + GeneratedField::Token => { + if token__.is_some() { + return Err(serde::de::Error::duplicate_field("token")); + } + token__ = map_.next_value()?; + } + GeneratedField::Sender => { + if sender__.is_some() { + return Err(serde::de::Error::duplicate_field("sender")); + } + sender__ = Some(map_.next_value()?); + } + GeneratedField::Receiver => { + if receiver__.is_some() { + return Err(serde::de::Error::duplicate_field("receiver")); + } + receiver__ = Some(map_.next_value()?); + } + GeneratedField::TimeoutHeight => { + if timeout_height__.is_some() { + return Err(serde::de::Error::duplicate_field("timeoutHeight")); + } + timeout_height__ = map_.next_value()?; + } + GeneratedField::TimeoutTimestamp => { + if timeout_timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timeoutTimestamp")); + } + timeout_timestamp__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Memo => { + if memo__.is_some() { + return Err(serde::de::Error::duplicate_field("memo")); + } + memo__ = Some(map_.next_value()?); + } + } + } + Ok(MsgTransfer { + source_port: source_port__.unwrap_or_default(), + source_channel: source_channel__.unwrap_or_default(), + token: token__, + sender: sender__.unwrap_or_default(), + receiver: receiver__.unwrap_or_default(), + timeout_height: timeout_height__, + timeout_timestamp: timeout_timestamp__.unwrap_or_default(), + memo: memo__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.transfer.v1.MsgTransfer", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgTransferResponse { + #[allow(deprecated)] + 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("ibc.applications.transfer.v1.MsgTransferResponse", len)?; + 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 MsgTransferResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "sequence", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + 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 { + "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 = MsgTransferResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.transfer.v1.MsgTransferResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sequence__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Sequence => { + if sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("sequence")); + } + sequence__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgTransferResponse { + sequence: sequence__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.transfer.v1.MsgTransferResponse", 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("ibc.applications.transfer.v1.MsgUpdateParams", len)?; + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + 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] = &[ + "signer", + "params", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Signer, + 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 { + "signer" => Ok(GeneratedField::Signer), + "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 ibc.applications.transfer.v1.MsgUpdateParams") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut signer__ = None; + let mut params__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + } + } + Ok(MsgUpdateParams { + signer: signer__.unwrap_or_default(), + params: params__, + }) + } + } + deserializer.deserialize_struct("ibc.applications.transfer.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("ibc.applications.transfer.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 ibc.applications.transfer.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("ibc.applications.transfer.v1.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; + } + let mut struct_ser = serializer.serialize_struct("ibc.applications.transfer.v1.Params", len)?; + if true { + struct_ser.serialize_field("sendEnabled", &self.send_enabled)?; + } + if true { + struct_ser.serialize_field("receiveEnabled", &self.receive_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", + "receive_enabled", + "receiveEnabled", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + SendEnabled, + ReceiveEnabled, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "receiveEnabled" | "receive_enabled" => Ok(GeneratedField::ReceiveEnabled), + _ => 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 ibc.applications.transfer.v1.Params") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut send_enabled__ = None; + let mut receive_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::ReceiveEnabled => { + if receive_enabled__.is_some() { + return Err(serde::de::Error::duplicate_field("receiveEnabled")); + } + receive_enabled__ = Some(map_.next_value()?); + } + } + } + Ok(Params { + send_enabled: send_enabled__.unwrap_or_default(), + receive_enabled: receive_enabled__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.transfer.v1.Params", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDenomHashRequest { + #[allow(deprecated)] + 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("ibc.applications.transfer.v1.QueryDenomHashRequest", len)?; + if true { + struct_ser.serialize_field("trace", &self.trace)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDenomHashRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "trace", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Trace, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "trace" => Ok(GeneratedField::Trace), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDenomHashRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.transfer.v1.QueryDenomHashRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut trace__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Trace => { + if trace__.is_some() { + return Err(serde::de::Error::duplicate_field("trace")); + } + trace__ = Some(map_.next_value()?); + } + } + } + Ok(QueryDenomHashRequest { + trace: trace__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.transfer.v1.QueryDenomHashRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDenomHashResponse { + #[allow(deprecated)] + 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("ibc.applications.transfer.v1.QueryDenomHashResponse", len)?; + if true { + struct_ser.serialize_field("hash", &self.hash)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDenomHashResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "hash", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + 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 { + "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 = QueryDenomHashResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.transfer.v1.QueryDenomHashResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut hash__ = 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()?); + } + } + } + Ok(QueryDenomHashResponse { + hash: hash__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.transfer.v1.QueryDenomHashResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDenomTraceRequest { + #[allow(deprecated)] + 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("ibc.applications.transfer.v1.QueryDenomTraceRequest", len)?; + if true { + struct_ser.serialize_field("hash", &self.hash)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDenomTraceRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "hash", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + 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 { + "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 = QueryDenomTraceRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.transfer.v1.QueryDenomTraceRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut hash__ = 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()?); + } + } + } + Ok(QueryDenomTraceRequest { + hash: hash__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.transfer.v1.QueryDenomTraceRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDenomTraceResponse { + #[allow(deprecated)] + 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("ibc.applications.transfer.v1.QueryDenomTraceResponse", len)?; + if let Some(v) = self.denom_trace.as_ref() { + struct_ser.serialize_field("denomTrace", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDenomTraceResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "denom_trace", + "denomTrace", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DenomTrace, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "denomTrace" | "denom_trace" => Ok(GeneratedField::DenomTrace), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDenomTraceResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.transfer.v1.QueryDenomTraceResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut denom_trace__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::DenomTrace => { + if denom_trace__.is_some() { + return Err(serde::de::Error::duplicate_field("denomTrace")); + } + denom_trace__ = map_.next_value()?; + } + } + } + Ok(QueryDenomTraceResponse { + denom_trace: denom_trace__, + }) + } + } + deserializer.deserialize_struct("ibc.applications.transfer.v1.QueryDenomTraceResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDenomTracesRequest { + #[allow(deprecated)] + 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("ibc.applications.transfer.v1.QueryDenomTracesRequest", len)?; + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDenomTracesRequest { + #[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 = QueryDenomTracesRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.transfer.v1.QueryDenomTracesRequest") + } + + 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(QueryDenomTracesRequest { + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("ibc.applications.transfer.v1.QueryDenomTracesRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDenomTracesResponse { + #[allow(deprecated)] + 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("ibc.applications.transfer.v1.QueryDenomTracesResponse", len)?; + if true { + struct_ser.serialize_field("denomTraces", &self.denom_traces)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDenomTracesResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "denom_traces", + "denomTraces", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DenomTraces, + 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 { + "denomTraces" | "denom_traces" => Ok(GeneratedField::DenomTraces), + "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 = QueryDenomTracesResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.transfer.v1.QueryDenomTracesResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut denom_traces__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::DenomTraces => { + if denom_traces__.is_some() { + return Err(serde::de::Error::duplicate_field("denomTraces")); + } + denom_traces__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryDenomTracesResponse { + denom_traces: denom_traces__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("ibc.applications.transfer.v1.QueryDenomTracesResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryEscrowAddressRequest { + #[allow(deprecated)] + 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("ibc.applications.transfer.v1.QueryEscrowAddressRequest", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryEscrowAddressRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryEscrowAddressRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.transfer.v1.QueryEscrowAddressRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + } + } + Ok(QueryEscrowAddressRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.transfer.v1.QueryEscrowAddressRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryEscrowAddressResponse { + #[allow(deprecated)] + 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("ibc.applications.transfer.v1.QueryEscrowAddressResponse", len)?; + if true { + struct_ser.serialize_field("escrowAddress", &self.escrow_address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryEscrowAddressResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "escrow_address", + "escrowAddress", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + EscrowAddress, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "escrowAddress" | "escrow_address" => Ok(GeneratedField::EscrowAddress), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryEscrowAddressResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.transfer.v1.QueryEscrowAddressResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut escrow_address__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::EscrowAddress => { + if escrow_address__.is_some() { + return Err(serde::de::Error::duplicate_field("escrowAddress")); + } + escrow_address__ = Some(map_.next_value()?); + } + } + } + Ok(QueryEscrowAddressResponse { + escrow_address: escrow_address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.transfer.v1.QueryEscrowAddressResponse", 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("ibc.applications.transfer.v1.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 ibc.applications.transfer.v1.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("ibc.applications.transfer.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; + } + let mut struct_ser = serializer.serialize_struct("ibc.applications.transfer.v1.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 ibc.applications.transfer.v1.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("ibc.applications.transfer.v1.QueryParamsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryTotalEscrowForDenomRequest { + #[allow(deprecated)] + 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("ibc.applications.transfer.v1.QueryTotalEscrowForDenomRequest", len)?; + if true { + struct_ser.serialize_field("denom", &self.denom)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryTotalEscrowForDenomRequest { + #[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 = QueryTotalEscrowForDenomRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.transfer.v1.QueryTotalEscrowForDenomRequest") + } + + 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(QueryTotalEscrowForDenomRequest { + denom: denom__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.transfer.v1.QueryTotalEscrowForDenomRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryTotalEscrowForDenomResponse { + #[allow(deprecated)] + 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("ibc.applications.transfer.v1.QueryTotalEscrowForDenomResponse", len)?; + if let Some(v) = self.amount.as_ref() { + struct_ser.serialize_field("amount", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryTotalEscrowForDenomResponse { + #[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 = QueryTotalEscrowForDenomResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.transfer.v1.QueryTotalEscrowForDenomResponse") + } + + 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(QueryTotalEscrowForDenomResponse { + amount: amount__, + }) + } + } + deserializer.deserialize_struct("ibc.applications.transfer.v1.QueryTotalEscrowForDenomResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for TransferAuthorization { + #[allow(deprecated)] + 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("ibc.applications.transfer.v1.TransferAuthorization", len)?; + if true { + struct_ser.serialize_field("allocations", &self.allocations)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for TransferAuthorization { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "allocations", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Allocations, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "allocations" => Ok(GeneratedField::Allocations), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = TransferAuthorization; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.transfer.v1.TransferAuthorization") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut allocations__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Allocations => { + if allocations__.is_some() { + return Err(serde::de::Error::duplicate_field("allocations")); + } + allocations__ = Some(map_.next_value()?); + } + } + } + Ok(TransferAuthorization { + allocations: allocations__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.transfer.v1.TransferAuthorization", FIELDS, GeneratedVisitor) + } +} diff --git a/src/prost/ibc.applications.transfer.v2.rs b/src/prost/ibc.applications.transfer.v2.rs index d1b76cc6..33fa7869 100644 --- a/src/prost/ibc.applications.transfer.v2.rs +++ b/src/prost/ibc.applications.transfer.v2.rs @@ -1,7 +1,6 @@ /// FungibleTokenPacketData defines a struct for the packet payload /// See FungibleTokenPacketData spec: /// -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FungibleTokenPacketData { @@ -19,6 +18,12 @@ pub struct FungibleTokenPacketData { pub receiver: ::prost::alloc::string::String, /// optional memo #[prost(string, tag = "5")] - #[cfg_attr(feature = "serde", serde(default))] pub memo: ::prost::alloc::string::String, } +impl ::prost::Name for FungibleTokenPacketData { + const NAME: &'static str = "FungibleTokenPacketData"; + const PACKAGE: &'static str = "ibc.applications.transfer.v2"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v2.{}", Self::NAME) + } +} diff --git a/src/prost/ibc.applications.transfer.v2.serde.rs b/src/prost/ibc.applications.transfer.v2.serde.rs new file mode 100644 index 00000000..251c80e2 --- /dev/null +++ b/src/prost/ibc.applications.transfer.v2.serde.rs @@ -0,0 +1,159 @@ +impl serde::Serialize for FungibleTokenPacketData { + #[allow(deprecated)] + 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("ibc.applications.transfer.v2.FungibleTokenPacketData", len)?; + if true { + struct_ser.serialize_field("denom", &self.denom)?; + } + if true { + struct_ser.serialize_field("amount", &self.amount)?; + } + if true { + struct_ser.serialize_field("sender", &self.sender)?; + } + if true { + struct_ser.serialize_field("receiver", &self.receiver)?; + } + if true { + struct_ser.serialize_field("memo", &self.memo)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for FungibleTokenPacketData { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "denom", + "amount", + "sender", + "receiver", + "memo", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Denom, + Amount, + Sender, + Receiver, + Memo, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "sender" => Ok(GeneratedField::Sender), + "receiver" => Ok(GeneratedField::Receiver), + "memo" => Ok(GeneratedField::Memo), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = FungibleTokenPacketData; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.applications.transfer.v2.FungibleTokenPacketData") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut denom__ = None; + let mut amount__ = None; + let mut sender__ = None; + let mut receiver__ = None; + let mut memo__ = 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()?); + } + GeneratedField::Sender => { + if sender__.is_some() { + return Err(serde::de::Error::duplicate_field("sender")); + } + sender__ = Some(map_.next_value()?); + } + GeneratedField::Receiver => { + if receiver__.is_some() { + return Err(serde::de::Error::duplicate_field("receiver")); + } + receiver__ = Some(map_.next_value()?); + } + GeneratedField::Memo => { + if memo__.is_some() { + return Err(serde::de::Error::duplicate_field("memo")); + } + memo__ = Some(map_.next_value()?); + } + } + } + Ok(FungibleTokenPacketData { + denom: denom__.unwrap_or_default(), + amount: amount__.unwrap_or_default(), + sender: sender__.unwrap_or_default(), + receiver: receiver__.unwrap_or_default(), + memo: memo__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.applications.transfer.v2.FungibleTokenPacketData", FIELDS, GeneratedVisitor) + } +} diff --git a/src/prost/ibc.core.channel.v1.rs b/src/prost/ibc.core.channel.v1.rs index 9e13647a..aeafba50 100644 --- a/src/prost/ibc.core.channel.v1.rs +++ b/src/prost/ibc.core.channel.v1.rs @@ -1,7 +1,6 @@ /// Channel defines pipeline for exactly-once packet delivery between specific /// modules on separate blockchains, which has at least one end capable of /// sending packets and one end capable of receiving packets. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[cfg_attr( all(feature = "json-schema", feature = "serde"), derive(::schemars::JsonSchema) @@ -30,9 +29,15 @@ pub struct Channel { #[prost(uint64, tag = "6")] pub upgrade_sequence: u64, } +impl ::prost::Name for Channel { + const NAME: &'static str = "Channel"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// IdentifiedChannel defines a channel with additional port and channel /// identifier fields. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IdentifiedChannel { @@ -58,9 +63,19 @@ pub struct IdentifiedChannel { /// channel identifier #[prost(string, tag = "7")] pub channel_id: ::prost::alloc::string::String, + /// upgrade sequence indicates the latest upgrade attempt performed by this channel + /// the value of 0 indicates the channel has never been upgraded + #[prost(uint64, tag = "8")] + pub upgrade_sequence: u64, +} +impl ::prost::Name for IdentifiedChannel { + const NAME: &'static str = "IdentifiedChannel"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } } /// Counterparty defines a channel end counterparty -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[cfg_attr( all(feature = "json-schema", feature = "serde"), derive(::schemars::JsonSchema) @@ -75,8 +90,14 @@ pub struct Counterparty { #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, } +impl ::prost::Name for Counterparty { + const NAME: &'static str = "Counterparty"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// Packet defines a type that carries data across different chains through IBC -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Packet { @@ -107,11 +128,17 @@ pub struct Packet { #[prost(uint64, tag = "8")] pub timeout_timestamp: u64, } +impl ::prost::Name for Packet { + const NAME: &'static str = "Packet"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// PacketState defines the generic type necessary to retrieve and store /// packet commitments, acknowledgements, and receipts. /// Caller is responsible for knowing the context necessary to interpret this /// state as a commitment, acknowledgement, or a receipt. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PacketState { @@ -128,10 +155,16 @@ pub struct PacketState { #[prost(bytes = "vec", tag = "4")] pub data: ::prost::alloc::vec::Vec, } -/// PacketId is an identifer for a unique Packet +impl ::prost::Name for PacketState { + const NAME: &'static str = "PacketState"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} +/// PacketId is an identifier for a unique Packet /// Source chains refer to packets by source port/channel /// Destination chains refer to packets by destination port/channel -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PacketId { @@ -145,6 +178,13 @@ pub struct PacketId { #[prost(uint64, tag = "3")] pub sequence: u64, } +impl ::prost::Name for PacketId { + const NAME: &'static str = "PacketId"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// Acknowledgement is the recommended acknowledgement format to be used by /// app-specific protocols. /// NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental @@ -152,7 +192,6 @@ pub struct PacketId { /// The first byte of any message with this format will be the non-ASCII values /// `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: /// -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Acknowledgement { @@ -163,7 +202,6 @@ pub struct Acknowledgement { /// Nested message and enum types in `Acknowledgement`. pub mod acknowledgement { /// response contains either a result or an error and must be non-empty - #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Response { @@ -173,10 +211,16 @@ pub mod acknowledgement { Error(::prost::alloc::string::String), } } +impl ::prost::Name for Acknowledgement { + const NAME: &'static str = "Acknowledgement"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// Timeout defines an execution deadline structure for 04-channel handlers. /// This includes packet lifecycle handlers as well as the upgrade handshake handlers. /// A valid Timeout contains either one or both of a timestamp and block height (sequence). -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Timeout { @@ -187,8 +231,14 @@ pub struct Timeout { #[prost(uint64, tag = "2")] pub timestamp: u64, } +impl ::prost::Name for Timeout { + const NAME: &'static str = "Timeout"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// Params defines the set of IBC channel parameters. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -196,9 +246,15 @@ pub struct Params { #[prost(message, optional, tag = "1")] pub upgrade_timeout: ::core::option::Option, } +impl ::prost::Name for Params { + const NAME: &'static str = "Params"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// State defines if a channel is in one of the following states: /// CLOSED, INIT, TRYOPEN, OPEN, FLUSHING, FLUSHCOMPLETE or UNINITIALIZED. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum State { @@ -250,7 +306,6 @@ impl State { } } /// Order defines if a channel is ORDERED or UNORDERED -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum Order { @@ -285,7 +340,6 @@ impl Order { } } /// GenesisState defines the ibc channel submodule's genesis state. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -309,9 +363,15 @@ pub struct GenesisState { #[prost(message, optional, tag = "9")] pub params: ::core::option::Option, } +impl ::prost::Name for GenesisState { + const NAME: &'static str = "GenesisState"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// PacketSequence defines the genesis type necessary to retrieve and store /// next send and receive sequences. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PacketSequence { @@ -322,11 +382,18 @@ pub struct PacketSequence { #[prost(uint64, tag = "3")] pub sequence: u64, } +impl ::prost::Name for PacketSequence { + const NAME: &'static str = "PacketSequence"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// Upgrade is a verifiable type which contains the relevant information /// for an attempted upgrade. It provides the proposed changes to the channel -/// end, the timeout for this upgrade attempt and the latest packet sequence sent -/// to allow the counterparty to block sends after the upgrade has started. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] +/// end, the timeout for this upgrade attempt and the next packet sequence +/// which allows the counterparty to efficiently know the highest sequence it has received. +/// The next sequence send is used for pruning and upgrading from unordered to ordered channels. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Upgrade { @@ -335,11 +402,17 @@ pub struct Upgrade { #[prost(message, optional, tag = "2")] pub timeout: ::core::option::Option, #[prost(uint64, tag = "3")] - pub latest_sequence_send: u64, + pub next_sequence_send: u64, +} +impl ::prost::Name for Upgrade { + const NAME: &'static str = "Upgrade"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } } /// UpgradeFields are the fields in a channel end which may be changed /// during a channel upgrade. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UpgradeFields { @@ -350,10 +423,16 @@ pub struct UpgradeFields { #[prost(string, tag = "3")] pub version: ::prost::alloc::string::String, } +impl ::prost::Name for UpgradeFields { + const NAME: &'static str = "UpgradeFields"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// ErrorReceipt defines a type which encapsulates the upgrade sequence and error associated with the /// upgrade handshake failure. When a channel upgrade handshake is aborted both chains are expected to increment to the /// next sequence. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ErrorReceipt { @@ -364,9 +443,15 @@ pub struct ErrorReceipt { #[prost(string, tag = "2")] pub message: ::prost::alloc::string::String, } +impl ::prost::Name for ErrorReceipt { + const NAME: &'static str = "ErrorReceipt"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It /// is called by a relayer on Chain A. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelOpenInit { @@ -377,8 +462,14 @@ pub struct MsgChannelOpenInit { #[prost(string, tag = "3")] pub signer: ::prost::alloc::string::String, } +impl ::prost::Name for MsgChannelOpenInit { + const NAME: &'static str = "MsgChannelOpenInit"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelOpenInitResponse { @@ -387,10 +478,16 @@ pub struct MsgChannelOpenInitResponse { #[prost(string, tag = "2")] pub version: ::prost::alloc::string::String, } +impl ::prost::Name for MsgChannelOpenInitResponse { + const NAME: &'static str = "MsgChannelOpenInitResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel /// on Chain B. The version field within the Channel field has been deprecated. Its /// value will be ignored by core IBC. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelOpenTry { @@ -412,8 +509,14 @@ pub struct MsgChannelOpenTry { #[prost(string, tag = "7")] pub signer: ::prost::alloc::string::String, } +impl ::prost::Name for MsgChannelOpenTry { + const NAME: &'static str = "MsgChannelOpenTry"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelOpenTryResponse { @@ -422,9 +525,15 @@ pub struct MsgChannelOpenTryResponse { #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, } +impl ::prost::Name for MsgChannelOpenTryResponse { + const NAME: &'static str = "MsgChannelOpenTryResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge /// the change of channel state to TRYOPEN on Chain B. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelOpenAck { @@ -443,14 +552,26 @@ pub struct MsgChannelOpenAck { #[prost(string, tag = "7")] pub signer: ::prost::alloc::string::String, } +impl ::prost::Name for MsgChannelOpenAck { + const NAME: &'static str = "MsgChannelOpenAck"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelOpenAckResponse {} +impl ::prost::Name for MsgChannelOpenAckResponse { + const NAME: &'static str = "MsgChannelOpenAckResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to /// acknowledge the change of channel state to OPEN on Chain A. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelOpenConfirm { @@ -465,15 +586,27 @@ pub struct MsgChannelOpenConfirm { #[prost(string, tag = "5")] pub signer: ::prost::alloc::string::String, } +impl ::prost::Name for MsgChannelOpenConfirm { + const NAME: &'static str = "MsgChannelOpenConfirm"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response /// type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelOpenConfirmResponse {} +impl ::prost::Name for MsgChannelOpenConfirmResponse { + const NAME: &'static str = "MsgChannelOpenConfirmResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgChannelCloseInit defines a msg sent by a Relayer to Chain A /// to close a channel with Chain B. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelCloseInit { @@ -484,14 +617,26 @@ pub struct MsgChannelCloseInit { #[prost(string, tag = "3")] pub signer: ::prost::alloc::string::String, } +impl ::prost::Name for MsgChannelCloseInit { + const NAME: &'static str = "MsgChannelCloseInit"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelCloseInitResponse {} +impl ::prost::Name for MsgChannelCloseInitResponse { + const NAME: &'static str = "MsgChannelCloseInitResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B /// to acknowledge the change of channel state to CLOSED on Chain A. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelCloseConfirm { @@ -505,15 +650,29 @@ pub struct MsgChannelCloseConfirm { pub proof_height: ::core::option::Option, #[prost(string, tag = "5")] pub signer: ::prost::alloc::string::String, + #[prost(uint64, tag = "6")] + pub counterparty_upgrade_sequence: u64, +} +impl ::prost::Name for MsgChannelCloseConfirm { + const NAME: &'static str = "MsgChannelCloseConfirm"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } } /// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response /// type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelCloseConfirmResponse {} +impl ::prost::Name for MsgChannelCloseConfirmResponse { + const NAME: &'static str = "MsgChannelCloseConfirmResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgRecvPacket receives incoming IBC packet -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRecvPacket { @@ -526,16 +685,28 @@ pub struct MsgRecvPacket { #[prost(string, tag = "4")] pub signer: ::prost::alloc::string::String, } +impl ::prost::Name for MsgRecvPacket { + const NAME: &'static str = "MsgRecvPacket"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgRecvPacketResponse defines the Msg/RecvPacket response type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRecvPacketResponse { #[prost(enumeration = "ResponseResultType", tag = "1")] pub result: i32, } +impl ::prost::Name for MsgRecvPacketResponse { + const NAME: &'static str = "MsgRecvPacketResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgTimeout receives timed-out packet -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgTimeout { @@ -550,16 +721,28 @@ pub struct MsgTimeout { #[prost(string, tag = "5")] pub signer: ::prost::alloc::string::String, } +impl ::prost::Name for MsgTimeout { + const NAME: &'static str = "MsgTimeout"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgTimeoutResponse defines the Msg/Timeout response type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgTimeoutResponse { #[prost(enumeration = "ResponseResultType", tag = "1")] pub result: i32, } +impl ::prost::Name for MsgTimeoutResponse { + const NAME: &'static str = "MsgTimeoutResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgTimeoutOnClose timed-out packet upon counterparty channel closure. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgTimeoutOnClose { @@ -575,17 +758,31 @@ pub struct MsgTimeoutOnClose { pub next_sequence_recv: u64, #[prost(string, tag = "6")] pub signer: ::prost::alloc::string::String, + #[prost(uint64, tag = "7")] + pub counterparty_upgrade_sequence: u64, +} +impl ::prost::Name for MsgTimeoutOnClose { + const NAME: &'static str = "MsgTimeoutOnClose"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } } /// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgTimeoutOnCloseResponse { #[prost(enumeration = "ResponseResultType", tag = "1")] pub result: i32, } +impl ::prost::Name for MsgTimeoutOnCloseResponse { + const NAME: &'static str = "MsgTimeoutOnCloseResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgAcknowledgement receives incoming IBC acknowledgement -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgAcknowledgement { @@ -600,16 +797,28 @@ pub struct MsgAcknowledgement { #[prost(string, tag = "5")] pub signer: ::prost::alloc::string::String, } +impl ::prost::Name for MsgAcknowledgement { + const NAME: &'static str = "MsgAcknowledgement"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgAcknowledgementResponse { #[prost(enumeration = "ResponseResultType", tag = "1")] pub result: i32, } +impl ::prost::Name for MsgAcknowledgementResponse { + const NAME: &'static str = "MsgAcknowledgementResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgChannelUpgradeInit defines the request type for the ChannelUpgradeInit rpc -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelUpgradeInit { @@ -622,20 +831,30 @@ pub struct MsgChannelUpgradeInit { #[prost(string, tag = "4")] pub signer: ::prost::alloc::string::String, } +impl ::prost::Name for MsgChannelUpgradeInit { + const NAME: &'static str = "MsgChannelUpgradeInit"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgChannelUpgradeInitResponse defines the MsgChannelUpgradeInit response type -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelUpgradeInitResponse { - #[prost(string, tag = "1")] - pub channel_id: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] + #[prost(message, optional, tag = "1")] pub upgrade: ::core::option::Option, - #[prost(uint64, tag = "3")] + #[prost(uint64, tag = "2")] pub upgrade_sequence: u64, } +impl ::prost::Name for MsgChannelUpgradeInitResponse { + const NAME: &'static str = "MsgChannelUpgradeInitResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgChannelUpgradeTry defines the request type for the ChannelUpgradeTry rpc -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelUpgradeTry { @@ -660,22 +879,32 @@ pub struct MsgChannelUpgradeTry { #[prost(string, tag = "9")] pub signer: ::prost::alloc::string::String, } +impl ::prost::Name for MsgChannelUpgradeTry { + const NAME: &'static str = "MsgChannelUpgradeTry"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgChannelUpgradeTryResponse defines the MsgChannelUpgradeTry response type -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelUpgradeTryResponse { - #[prost(string, tag = "1")] - pub channel_id: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] + #[prost(message, optional, tag = "1")] pub upgrade: ::core::option::Option, - #[prost(uint64, tag = "3")] + #[prost(uint64, tag = "2")] pub upgrade_sequence: u64, - #[prost(enumeration = "ResponseResultType", tag = "4")] + #[prost(enumeration = "ResponseResultType", tag = "3")] pub result: i32, } +impl ::prost::Name for MsgChannelUpgradeTryResponse { + const NAME: &'static str = "MsgChannelUpgradeTryResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgChannelUpgradeAck defines the request type for the ChannelUpgradeAck rpc -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelUpgradeAck { @@ -694,16 +923,28 @@ pub struct MsgChannelUpgradeAck { #[prost(string, tag = "7")] pub signer: ::prost::alloc::string::String, } +impl ::prost::Name for MsgChannelUpgradeAck { + const NAME: &'static str = "MsgChannelUpgradeAck"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgChannelUpgradeAckResponse defines MsgChannelUpgradeAck response type -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelUpgradeAckResponse { #[prost(enumeration = "ResponseResultType", tag = "1")] pub result: i32, } +impl ::prost::Name for MsgChannelUpgradeAckResponse { + const NAME: &'static str = "MsgChannelUpgradeAckResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgChannelUpgradeConfirm defines the request type for the ChannelUpgradeConfirm rpc -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelUpgradeConfirm { @@ -724,16 +965,28 @@ pub struct MsgChannelUpgradeConfirm { #[prost(string, tag = "8")] pub signer: ::prost::alloc::string::String, } +impl ::prost::Name for MsgChannelUpgradeConfirm { + const NAME: &'static str = "MsgChannelUpgradeConfirm"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgChannelUpgradeConfirmResponse defines MsgChannelUpgradeConfirm response type -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelUpgradeConfirmResponse { #[prost(enumeration = "ResponseResultType", tag = "1")] pub result: i32, } +impl ::prost::Name for MsgChannelUpgradeConfirmResponse { + const NAME: &'static str = "MsgChannelUpgradeConfirmResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgChannelUpgradeOpen defines the request type for the ChannelUpgradeOpen rpc -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelUpgradeOpen { @@ -750,13 +1003,25 @@ pub struct MsgChannelUpgradeOpen { #[prost(string, tag = "6")] pub signer: ::prost::alloc::string::String, } +impl ::prost::Name for MsgChannelUpgradeOpen { + const NAME: &'static str = "MsgChannelUpgradeOpen"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgChannelUpgradeOpenResponse defines the MsgChannelUpgradeOpen response type -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelUpgradeOpenResponse {} +impl ::prost::Name for MsgChannelUpgradeOpenResponse { + const NAME: &'static str = "MsgChannelUpgradeOpenResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgChannelUpgradeTimeout defines the request type for the ChannelUpgradeTimeout rpc -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelUpgradeTimeout { @@ -773,16 +1038,25 @@ pub struct MsgChannelUpgradeTimeout { #[prost(string, tag = "6")] pub signer: ::prost::alloc::string::String, } +impl ::prost::Name for MsgChannelUpgradeTimeout { + const NAME: &'static str = "MsgChannelUpgradeTimeout"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgChannelUpgradeTimeoutRepsonse defines the MsgChannelUpgradeTimeout response type -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelUpgradeTimeoutResponse { - #[prost(enumeration = "ResponseResultType", tag = "1")] - pub result: i32, +pub struct MsgChannelUpgradeTimeoutResponse {} +impl ::prost::Name for MsgChannelUpgradeTimeoutResponse { + const NAME: &'static str = "MsgChannelUpgradeTimeoutResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } } /// MsgChannelUpgradeCancel defines the request type for the ChannelUpgradeCancel rpc -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelUpgradeCancel { @@ -799,13 +1073,25 @@ pub struct MsgChannelUpgradeCancel { #[prost(string, tag = "6")] pub signer: ::prost::alloc::string::String, } +impl ::prost::Name for MsgChannelUpgradeCancel { + const NAME: &'static str = "MsgChannelUpgradeCancel"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgChannelUpgradeCancelResponse defines the MsgChannelUpgradeCancel response type -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelUpgradeCancelResponse {} +impl ::prost::Name for MsgChannelUpgradeCancelResponse { + const NAME: &'static str = "MsgChannelUpgradeCancelResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgUpdateParams is the MsgUpdateParams request type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -818,13 +1104,63 @@ pub struct MsgUpdateParams { #[prost(message, optional, tag = "2")] pub params: ::core::option::Option, } +impl ::prost::Name for MsgUpdateParams { + const NAME: &'static str = "MsgUpdateParams"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// MsgUpdateParamsResponse defines the MsgUpdateParams response type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} +impl ::prost::Name for MsgUpdateParamsResponse { + const NAME: &'static str = "MsgUpdateParamsResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} +/// MsgPruneAcknowledgements defines the request type for the PruneAcknowledgements rpc. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgPruneAcknowledgements { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + pub limit: u64, + #[prost(string, tag = "4")] + pub signer: ::prost::alloc::string::String, +} +impl ::prost::Name for MsgPruneAcknowledgements { + const NAME: &'static str = "MsgPruneAcknowledgements"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} +/// MsgPruneAcknowledgementsResponse defines the response type for the PruneAcknowledgements rpc. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgPruneAcknowledgementsResponse { + /// Number of sequences pruned (includes both packet acknowledgements and packet receipts where appropriate). + #[prost(uint64, tag = "1")] + pub total_pruned_sequences: u64, + /// Number of sequences left after pruning. + #[prost(uint64, tag = "2")] + pub total_remaining_sequences: u64, +} +impl ::prost::Name for MsgPruneAcknowledgementsResponse { + const NAME: &'static str = "MsgPruneAcknowledgementsResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// ResponseResultType defines the possible outcomes of the execution of a message -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum ResponseResultType { @@ -1433,6 +1769,34 @@ pub mod msg_client { ); self.inner.unary(req, path, codec).await } + /// PruneAcknowledgements defines a rpc handler method for MsgPruneAcknowledgements. + pub async fn prune_acknowledgements( + &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( + "/ibc.core.channel.v1.Msg/PruneAcknowledgements", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("ibc.core.channel.v1.Msg", "PruneAcknowledgements"), + ); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -1588,6 +1952,14 @@ pub mod msg_server { tonic::Response, tonic::Status, >; + /// PruneAcknowledgements defines a rpc handler method for MsgPruneAcknowledgements. + async fn prune_acknowledgements( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; } /// Msg defines the ibc/channel Msg service. #[derive(Debug)] @@ -2475,6 +2847,52 @@ pub mod msg_server { }; Box::pin(fut) } + "/ibc.core.channel.v1.Msg/PruneAcknowledgements" => { + #[allow(non_camel_case_types)] + struct PruneAcknowledgementsSvc(pub Arc); + impl< + T: Msg, + > tonic::server::UnaryService + for PruneAcknowledgementsSvc { + type Response = super::MsgPruneAcknowledgementsResponse; + 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 { + ::prune_acknowledgements(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = PruneAcknowledgementsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_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( @@ -2517,7 +2935,6 @@ pub mod msg_server { } } /// QueryChannelRequest is the request type for the Query/Channel RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryChannelRequest { @@ -2528,10 +2945,16 @@ pub struct QueryChannelRequest { #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, } +impl ::prost::Name for QueryChannelRequest { + const NAME: &'static str = "QueryChannelRequest"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryChannelResponse is the response type for the Query/Channel RPC method. /// Besides the Channel end, it includes a proof and the height from which the /// proof was retrieved. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryChannelResponse { @@ -2545,8 +2968,14 @@ pub struct QueryChannelResponse { #[prost(message, optional, tag = "3")] pub proof_height: ::core::option::Option, } +impl ::prost::Name for QueryChannelResponse { + const NAME: &'static str = "QueryChannelResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryChannelsRequest is the request type for the Query/Channels RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryChannelsRequest { @@ -2556,8 +2985,14 @@ pub struct QueryChannelsRequest { super::super::super::super::cosmos::base::query::v1beta1::PageRequest, >, } +impl ::prost::Name for QueryChannelsRequest { + const NAME: &'static str = "QueryChannelsRequest"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryChannelsResponse is the response type for the Query/Channels RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryChannelsResponse { @@ -2573,9 +3008,15 @@ pub struct QueryChannelsResponse { #[prost(message, optional, tag = "3")] pub height: ::core::option::Option, } +impl ::prost::Name for QueryChannelsResponse { + const NAME: &'static str = "QueryChannelsResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryConnectionChannelsRequest is the request type for the /// Query/QueryConnectionChannels RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionChannelsRequest { @@ -2588,9 +3029,15 @@ pub struct QueryConnectionChannelsRequest { super::super::super::super::cosmos::base::query::v1beta1::PageRequest, >, } +impl ::prost::Name for QueryConnectionChannelsRequest { + const NAME: &'static str = "QueryConnectionChannelsRequest"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryConnectionChannelsResponse is the Response type for the /// Query/QueryConnectionChannels RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionChannelsResponse { @@ -2606,9 +3053,15 @@ pub struct QueryConnectionChannelsResponse { #[prost(message, optional, tag = "3")] pub height: ::core::option::Option, } +impl ::prost::Name for QueryConnectionChannelsResponse { + const NAME: &'static str = "QueryConnectionChannelsResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryChannelClientStateRequest is the request type for the Query/ClientState /// RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryChannelClientStateRequest { @@ -2619,9 +3072,15 @@ pub struct QueryChannelClientStateRequest { #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, } +impl ::prost::Name for QueryChannelClientStateRequest { + const NAME: &'static str = "QueryChannelClientStateRequest"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryChannelClientStateResponse is the Response type for the /// Query/QueryChannelClientState RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryChannelClientStateResponse { @@ -2637,9 +3096,15 @@ pub struct QueryChannelClientStateResponse { #[prost(message, optional, tag = "3")] pub proof_height: ::core::option::Option, } +impl ::prost::Name for QueryChannelClientStateResponse { + const NAME: &'static str = "QueryChannelClientStateResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryChannelConsensusStateRequest is the request type for the /// Query/ConsensusState RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryChannelConsensusStateRequest { @@ -2656,9 +3121,15 @@ pub struct QueryChannelConsensusStateRequest { #[prost(uint64, tag = "4")] pub revision_height: u64, } +impl ::prost::Name for QueryChannelConsensusStateRequest { + const NAME: &'static str = "QueryChannelConsensusStateRequest"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryChannelClientStateResponse is the Response type for the /// Query/QueryChannelClientState RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryChannelConsensusStateResponse { @@ -2677,9 +3148,15 @@ pub struct QueryChannelConsensusStateResponse { #[prost(message, optional, tag = "4")] pub proof_height: ::core::option::Option, } +impl ::prost::Name for QueryChannelConsensusStateResponse { + const NAME: &'static str = "QueryChannelConsensusStateResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryPacketCommitmentRequest is the request type for the /// Query/PacketCommitment RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketCommitmentRequest { @@ -2693,10 +3170,16 @@ pub struct QueryPacketCommitmentRequest { #[prost(uint64, tag = "3")] pub sequence: u64, } +impl ::prost::Name for QueryPacketCommitmentRequest { + const NAME: &'static str = "QueryPacketCommitmentRequest"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryPacketCommitmentResponse defines the client query response for a packet /// which also includes a proof and the height from which the proof was /// retrieved -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketCommitmentResponse { @@ -2710,9 +3193,15 @@ pub struct QueryPacketCommitmentResponse { #[prost(message, optional, tag = "3")] pub proof_height: ::core::option::Option, } +impl ::prost::Name for QueryPacketCommitmentResponse { + const NAME: &'static str = "QueryPacketCommitmentResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryPacketCommitmentsRequest is the request type for the /// Query/QueryPacketCommitments RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketCommitmentsRequest { @@ -2728,9 +3217,15 @@ pub struct QueryPacketCommitmentsRequest { super::super::super::super::cosmos::base::query::v1beta1::PageRequest, >, } +impl ::prost::Name for QueryPacketCommitmentsRequest { + const NAME: &'static str = "QueryPacketCommitmentsRequest"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryPacketCommitmentsResponse is the request type for the /// Query/QueryPacketCommitments RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketCommitmentsResponse { @@ -2745,9 +3240,15 @@ pub struct QueryPacketCommitmentsResponse { #[prost(message, optional, tag = "3")] pub height: ::core::option::Option, } +impl ::prost::Name for QueryPacketCommitmentsResponse { + const NAME: &'static str = "QueryPacketCommitmentsResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryPacketReceiptRequest is the request type for the /// Query/PacketReceipt RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketReceiptRequest { @@ -2761,10 +3262,16 @@ pub struct QueryPacketReceiptRequest { #[prost(uint64, tag = "3")] pub sequence: u64, } +impl ::prost::Name for QueryPacketReceiptRequest { + const NAME: &'static str = "QueryPacketReceiptRequest"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryPacketReceiptResponse defines the client query response for a packet /// receipt which also includes a proof, and the height from which the proof was /// retrieved -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketReceiptResponse { @@ -2778,9 +3285,15 @@ pub struct QueryPacketReceiptResponse { #[prost(message, optional, tag = "4")] pub proof_height: ::core::option::Option, } +impl ::prost::Name for QueryPacketReceiptResponse { + const NAME: &'static str = "QueryPacketReceiptResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryPacketAcknowledgementRequest is the request type for the /// Query/PacketAcknowledgement RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketAcknowledgementRequest { @@ -2794,10 +3307,16 @@ pub struct QueryPacketAcknowledgementRequest { #[prost(uint64, tag = "3")] pub sequence: u64, } +impl ::prost::Name for QueryPacketAcknowledgementRequest { + const NAME: &'static str = "QueryPacketAcknowledgementRequest"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryPacketAcknowledgementResponse defines the client query response for a /// packet which also includes a proof and the height from which the /// proof was retrieved -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketAcknowledgementResponse { @@ -2811,9 +3330,15 @@ pub struct QueryPacketAcknowledgementResponse { #[prost(message, optional, tag = "3")] pub proof_height: ::core::option::Option, } +impl ::prost::Name for QueryPacketAcknowledgementResponse { + const NAME: &'static str = "QueryPacketAcknowledgementResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryPacketAcknowledgementsRequest is the request type for the /// Query/QueryPacketCommitments RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketAcknowledgementsRequest { @@ -2832,9 +3357,15 @@ pub struct QueryPacketAcknowledgementsRequest { #[prost(uint64, repeated, tag = "4")] pub packet_commitment_sequences: ::prost::alloc::vec::Vec, } +impl ::prost::Name for QueryPacketAcknowledgementsRequest { + const NAME: &'static str = "QueryPacketAcknowledgementsRequest"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryPacketAcknowledgemetsResponse is the request type for the /// Query/QueryPacketAcknowledgements RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketAcknowledgementsResponse { @@ -2849,9 +3380,15 @@ pub struct QueryPacketAcknowledgementsResponse { #[prost(message, optional, tag = "3")] pub height: ::core::option::Option, } +impl ::prost::Name for QueryPacketAcknowledgementsResponse { + const NAME: &'static str = "QueryPacketAcknowledgementsResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryUnreceivedPacketsRequest is the request type for the /// Query/UnreceivedPackets RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUnreceivedPacketsRequest { @@ -2865,9 +3402,15 @@ pub struct QueryUnreceivedPacketsRequest { #[prost(uint64, repeated, tag = "3")] pub packet_commitment_sequences: ::prost::alloc::vec::Vec, } +impl ::prost::Name for QueryUnreceivedPacketsRequest { + const NAME: &'static str = "QueryUnreceivedPacketsRequest"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryUnreceivedPacketsResponse is the response type for the /// Query/UnreceivedPacketCommitments RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUnreceivedPacketsResponse { @@ -2878,9 +3421,15 @@ pub struct QueryUnreceivedPacketsResponse { #[prost(message, optional, tag = "2")] pub height: ::core::option::Option, } +impl ::prost::Name for QueryUnreceivedPacketsResponse { + const NAME: &'static str = "QueryUnreceivedPacketsResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryUnreceivedAcks is the request type for the /// Query/UnreceivedAcks RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUnreceivedAcksRequest { @@ -2894,9 +3443,15 @@ pub struct QueryUnreceivedAcksRequest { #[prost(uint64, repeated, tag = "3")] pub packet_ack_sequences: ::prost::alloc::vec::Vec, } +impl ::prost::Name for QueryUnreceivedAcksRequest { + const NAME: &'static str = "QueryUnreceivedAcksRequest"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryUnreceivedAcksResponse is the response type for the /// Query/UnreceivedAcks RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUnreceivedAcksResponse { @@ -2907,9 +3462,15 @@ pub struct QueryUnreceivedAcksResponse { #[prost(message, optional, tag = "2")] pub height: ::core::option::Option, } +impl ::prost::Name for QueryUnreceivedAcksResponse { + const NAME: &'static str = "QueryUnreceivedAcksResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryNextSequenceReceiveRequest is the request type for the /// Query/QueryNextSequenceReceiveRequest RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryNextSequenceReceiveRequest { @@ -2920,9 +3481,15 @@ pub struct QueryNextSequenceReceiveRequest { #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, } +impl ::prost::Name for QueryNextSequenceReceiveRequest { + const NAME: &'static str = "QueryNextSequenceReceiveRequest"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QuerySequenceResponse is the response type for the /// Query/QueryNextSequenceReceiveResponse RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryNextSequenceReceiveResponse { @@ -2936,9 +3503,15 @@ pub struct QueryNextSequenceReceiveResponse { #[prost(message, optional, tag = "3")] pub proof_height: ::core::option::Option, } +impl ::prost::Name for QueryNextSequenceReceiveResponse { + const NAME: &'static str = "QueryNextSequenceReceiveResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryNextSequenceSendRequest is the request type for the /// Query/QueryNextSequenceSend RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryNextSequenceSendRequest { @@ -2949,9 +3522,15 @@ pub struct QueryNextSequenceSendRequest { #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, } +impl ::prost::Name for QueryNextSequenceSendRequest { + const NAME: &'static str = "QueryNextSequenceSendRequest"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryNextSequenceSendResponse is the request type for the /// Query/QueryNextSequenceSend RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryNextSequenceSendResponse { @@ -2965,8 +3544,14 @@ pub struct QueryNextSequenceSendResponse { #[prost(message, optional, tag = "3")] pub proof_height: ::core::option::Option, } +impl ::prost::Name for QueryNextSequenceSendResponse { + const NAME: &'static str = "QueryNextSequenceSendResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryUpgradeErrorRequest is the request type for the Query/QueryUpgradeError RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUpgradeErrorRequest { @@ -2975,8 +3560,14 @@ pub struct QueryUpgradeErrorRequest { #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, } +impl ::prost::Name for QueryUpgradeErrorRequest { + const NAME: &'static str = "QueryUpgradeErrorRequest"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryUpgradeErrorResponse is the response type for the Query/QueryUpgradeError RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUpgradeErrorResponse { @@ -2989,8 +3580,14 @@ pub struct QueryUpgradeErrorResponse { #[prost(message, optional, tag = "3")] pub proof_height: ::core::option::Option, } +impl ::prost::Name for QueryUpgradeErrorResponse { + const NAME: &'static str = "QueryUpgradeErrorResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryUpgradeRequest is the request type for the QueryUpgradeRequest RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUpgradeRequest { @@ -2999,8 +3596,14 @@ pub struct QueryUpgradeRequest { #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, } +impl ::prost::Name for QueryUpgradeRequest { + const NAME: &'static str = "QueryUpgradeRequest"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// QueryUpgradeResponse is the response type for the QueryUpgradeResponse RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUpgradeResponse { @@ -3013,6 +3616,39 @@ pub struct QueryUpgradeResponse { #[prost(message, optional, tag = "3")] pub proof_height: ::core::option::Option, } +impl ::prost::Name for QueryUpgradeResponse { + const NAME: &'static str = "QueryUpgradeResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} +/// QueryChannelParamsRequest is the request type for the Query/ChannelParams RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryChannelParamsRequest {} +impl ::prost::Name for QueryChannelParamsRequest { + const NAME: &'static str = "QueryChannelParamsRequest"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} +/// QueryChannelParamsResponse is the response type for the Query/ChannelParams RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryChannelParamsResponse { + /// params defines the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +impl ::prost::Name for QueryChannelParamsResponse { + const NAME: &'static str = "QueryChannelParamsResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod query_client { @@ -3547,6 +4183,32 @@ pub mod query_client { .insert(GrpcMethod::new("ibc.core.channel.v1.Query", "Upgrade")); self.inner.unary(req, path, codec).await } + /// ChannelParams queries all parameters of the ibc channel submodule. + pub async fn channel_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( + "/ibc.core.channel.v1.Query/ChannelParams", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("ibc.core.channel.v1.Query", "ChannelParams")); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -3693,6 +4355,14 @@ pub mod query_server { tonic::Response, tonic::Status, >; + /// ChannelParams queries all parameters of the ibc channel submodule. + async fn channel_params( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; } /// Query provides defines the gRPC querier service #[derive(Debug)] @@ -4525,6 +5195,52 @@ pub mod query_server { }; Box::pin(fut) } + "/ibc.core.channel.v1.Query/ChannelParams" => { + #[allow(non_camel_case_types)] + struct ChannelParamsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ChannelParamsSvc { + type Response = super::QueryChannelParamsResponse; + 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 { + ::channel_params(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ChannelParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_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( diff --git a/src/prost/ibc.core.channel.v1.serde.rs b/src/prost/ibc.core.channel.v1.serde.rs new file mode 100644 index 00000000..4235d280 --- /dev/null +++ b/src/prost/ibc.core.channel.v1.serde.rs @@ -0,0 +1,11479 @@ +impl serde::Serialize for Acknowledgement { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.response.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("ibc.core.channel.v1.Acknowledgement", len)?; + if let Some(v) = self.response.as_ref() { + match v { + acknowledgement::Response::Result(v) => { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("result", pbjson::private::base64::encode(&v).as_str())?; + } + acknowledgement::Response::Error(v) => { + struct_ser.serialize_field("error", v)?; + } + } + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Acknowledgement { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "result", + "error", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Result, + Error, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "result" => Ok(GeneratedField::Result), + "error" => Ok(GeneratedField::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 = Acknowledgement; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.Acknowledgement") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut response__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Result => { + if response__.is_some() { + return Err(serde::de::Error::duplicate_field("result")); + } + response__ = map_.next_value::<::core::option::Option<::pbjson::private::BytesDeserialize<_>>>()?.map(|x| acknowledgement::Response::Result(x.0)); + } + GeneratedField::Error => { + if response__.is_some() { + return Err(serde::de::Error::duplicate_field("error")); + } + response__ = map_.next_value::<::core::option::Option<_>>()?.map(acknowledgement::Response::Error); + } + } + } + Ok(Acknowledgement { + response: response__, + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.Acknowledgement", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Channel { + #[allow(deprecated)] + 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("ibc.core.channel.v1.Channel", len)?; + if true { + let v = State::try_from(self.state) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.state)))?; + struct_ser.serialize_field("state", &v)?; + } + if true { + let v = Order::try_from(self.ordering) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.ordering)))?; + struct_ser.serialize_field("ordering", &v)?; + } + if let Some(v) = self.counterparty.as_ref() { + struct_ser.serialize_field("counterparty", v)?; + } + if true { + struct_ser.serialize_field("connectionHops", &self.connection_hops)?; + } + if true { + struct_ser.serialize_field("version", &self.version)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("upgradeSequence", ::alloc::string::ToString::to_string(&self.upgrade_sequence).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Channel { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "state", + "ordering", + "counterparty", + "connection_hops", + "connectionHops", + "version", + "upgrade_sequence", + "upgradeSequence", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + State, + Ordering, + Counterparty, + ConnectionHops, + Version, + UpgradeSequence, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "state" => Ok(GeneratedField::State), + "ordering" => Ok(GeneratedField::Ordering), + "counterparty" => Ok(GeneratedField::Counterparty), + "connectionHops" | "connection_hops" => Ok(GeneratedField::ConnectionHops), + "version" => Ok(GeneratedField::Version), + "upgradeSequence" | "upgrade_sequence" => Ok(GeneratedField::UpgradeSequence), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Channel; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.Channel") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut state__ = None; + let mut ordering__ = None; + let mut counterparty__ = None; + let mut connection_hops__ = None; + let mut version__ = None; + let mut upgrade_sequence__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::State => { + if state__.is_some() { + return Err(serde::de::Error::duplicate_field("state")); + } + state__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Ordering => { + if ordering__.is_some() { + return Err(serde::de::Error::duplicate_field("ordering")); + } + ordering__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Counterparty => { + if counterparty__.is_some() { + return Err(serde::de::Error::duplicate_field("counterparty")); + } + counterparty__ = map_.next_value()?; + } + GeneratedField::ConnectionHops => { + if connection_hops__.is_some() { + return Err(serde::de::Error::duplicate_field("connectionHops")); + } + connection_hops__ = Some(map_.next_value()?); + } + GeneratedField::Version => { + if version__.is_some() { + return Err(serde::de::Error::duplicate_field("version")); + } + version__ = Some(map_.next_value()?); + } + GeneratedField::UpgradeSequence => { + if upgrade_sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("upgradeSequence")); + } + upgrade_sequence__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(Channel { + state: state__.unwrap_or_default(), + ordering: ordering__.unwrap_or_default(), + counterparty: counterparty__, + connection_hops: connection_hops__.unwrap_or_default(), + version: version__.unwrap_or_default(), + upgrade_sequence: upgrade_sequence__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.Channel", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Counterparty { + #[allow(deprecated)] + 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("ibc.core.channel.v1.Counterparty", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Counterparty { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Counterparty; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.Counterparty") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + } + } + Ok(Counterparty { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.Counterparty", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ErrorReceipt { + #[allow(deprecated)] + 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("ibc.core.channel.v1.ErrorReceipt", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ::alloc::string::ToString::to_string(&self.sequence).as_str())?; + } + if true { + struct_ser.serialize_field("message", &self.message)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ErrorReceipt { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "sequence", + "message", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sequence, + Message, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "sequence" => Ok(GeneratedField::Sequence), + "message" => Ok(GeneratedField::Message), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ErrorReceipt; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.ErrorReceipt") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sequence__ = None; + let mut message__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Sequence => { + if sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("sequence")); + } + sequence__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Message => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("message")); + } + message__ = Some(map_.next_value()?); + } + } + } + Ok(ErrorReceipt { + sequence: sequence__.unwrap_or_default(), + message: message__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.ErrorReceipt", 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; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("ibc.core.channel.v1.GenesisState", len)?; + if true { + struct_ser.serialize_field("channels", &self.channels)?; + } + if true { + struct_ser.serialize_field("acknowledgements", &self.acknowledgements)?; + } + if true { + struct_ser.serialize_field("commitments", &self.commitments)?; + } + if true { + struct_ser.serialize_field("receipts", &self.receipts)?; + } + if true { + struct_ser.serialize_field("sendSequences", &self.send_sequences)?; + } + if true { + struct_ser.serialize_field("recvSequences", &self.recv_sequences)?; + } + if true { + struct_ser.serialize_field("ackSequences", &self.ack_sequences)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("nextChannelSequence", ::alloc::string::ToString::to_string(&self.next_channel_sequence).as_str())?; + } + 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] = &[ + "channels", + "acknowledgements", + "commitments", + "receipts", + "send_sequences", + "sendSequences", + "recv_sequences", + "recvSequences", + "ack_sequences", + "ackSequences", + "next_channel_sequence", + "nextChannelSequence", + "params", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Channels, + Acknowledgements, + Commitments, + Receipts, + SendSequences, + RecvSequences, + AckSequences, + NextChannelSequence, + 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 { + "channels" => Ok(GeneratedField::Channels), + "acknowledgements" => Ok(GeneratedField::Acknowledgements), + "commitments" => Ok(GeneratedField::Commitments), + "receipts" => Ok(GeneratedField::Receipts), + "sendSequences" | "send_sequences" => Ok(GeneratedField::SendSequences), + "recvSequences" | "recv_sequences" => Ok(GeneratedField::RecvSequences), + "ackSequences" | "ack_sequences" => Ok(GeneratedField::AckSequences), + "nextChannelSequence" | "next_channel_sequence" => Ok(GeneratedField::NextChannelSequence), + "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 ibc.core.channel.v1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut channels__ = None; + let mut acknowledgements__ = None; + let mut commitments__ = None; + let mut receipts__ = None; + let mut send_sequences__ = None; + let mut recv_sequences__ = None; + let mut ack_sequences__ = None; + let mut next_channel_sequence__ = None; + let mut params__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Channels => { + if channels__.is_some() { + return Err(serde::de::Error::duplicate_field("channels")); + } + channels__ = Some(map_.next_value()?); + } + GeneratedField::Acknowledgements => { + if acknowledgements__.is_some() { + return Err(serde::de::Error::duplicate_field("acknowledgements")); + } + acknowledgements__ = Some(map_.next_value()?); + } + GeneratedField::Commitments => { + if commitments__.is_some() { + return Err(serde::de::Error::duplicate_field("commitments")); + } + commitments__ = Some(map_.next_value()?); + } + GeneratedField::Receipts => { + if receipts__.is_some() { + return Err(serde::de::Error::duplicate_field("receipts")); + } + receipts__ = Some(map_.next_value()?); + } + GeneratedField::SendSequences => { + if send_sequences__.is_some() { + return Err(serde::de::Error::duplicate_field("sendSequences")); + } + send_sequences__ = Some(map_.next_value()?); + } + GeneratedField::RecvSequences => { + if recv_sequences__.is_some() { + return Err(serde::de::Error::duplicate_field("recvSequences")); + } + recv_sequences__ = Some(map_.next_value()?); + } + GeneratedField::AckSequences => { + if ack_sequences__.is_some() { + return Err(serde::de::Error::duplicate_field("ackSequences")); + } + ack_sequences__ = Some(map_.next_value()?); + } + GeneratedField::NextChannelSequence => { + if next_channel_sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("nextChannelSequence")); + } + next_channel_sequence__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + } + } + Ok(GenesisState { + channels: channels__.unwrap_or_default(), + acknowledgements: acknowledgements__.unwrap_or_default(), + commitments: commitments__.unwrap_or_default(), + receipts: receipts__.unwrap_or_default(), + send_sequences: send_sequences__.unwrap_or_default(), + recv_sequences: recv_sequences__.unwrap_or_default(), + ack_sequences: ack_sequences__.unwrap_or_default(), + next_channel_sequence: next_channel_sequence__.unwrap_or_default(), + params: params__, + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.GenesisState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for IdentifiedChannel { + #[allow(deprecated)] + 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("ibc.core.channel.v1.IdentifiedChannel", len)?; + if true { + let v = State::try_from(self.state) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.state)))?; + struct_ser.serialize_field("state", &v)?; + } + if true { + let v = Order::try_from(self.ordering) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.ordering)))?; + struct_ser.serialize_field("ordering", &v)?; + } + if let Some(v) = self.counterparty.as_ref() { + struct_ser.serialize_field("counterparty", v)?; + } + if true { + struct_ser.serialize_field("connectionHops", &self.connection_hops)?; + } + if true { + struct_ser.serialize_field("version", &self.version)?; + } + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("upgradeSequence", ::alloc::string::ToString::to_string(&self.upgrade_sequence).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for IdentifiedChannel { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "state", + "ordering", + "counterparty", + "connection_hops", + "connectionHops", + "version", + "port_id", + "portId", + "channel_id", + "channelId", + "upgrade_sequence", + "upgradeSequence", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + State, + Ordering, + Counterparty, + ConnectionHops, + Version, + PortId, + ChannelId, + UpgradeSequence, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "state" => Ok(GeneratedField::State), + "ordering" => Ok(GeneratedField::Ordering), + "counterparty" => Ok(GeneratedField::Counterparty), + "connectionHops" | "connection_hops" => Ok(GeneratedField::ConnectionHops), + "version" => Ok(GeneratedField::Version), + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "upgradeSequence" | "upgrade_sequence" => Ok(GeneratedField::UpgradeSequence), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = IdentifiedChannel; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.IdentifiedChannel") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut state__ = None; + let mut ordering__ = None; + let mut counterparty__ = None; + let mut connection_hops__ = None; + let mut version__ = None; + let mut port_id__ = None; + let mut channel_id__ = None; + let mut upgrade_sequence__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::State => { + if state__.is_some() { + return Err(serde::de::Error::duplicate_field("state")); + } + state__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Ordering => { + if ordering__.is_some() { + return Err(serde::de::Error::duplicate_field("ordering")); + } + ordering__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Counterparty => { + if counterparty__.is_some() { + return Err(serde::de::Error::duplicate_field("counterparty")); + } + counterparty__ = map_.next_value()?; + } + GeneratedField::ConnectionHops => { + if connection_hops__.is_some() { + return Err(serde::de::Error::duplicate_field("connectionHops")); + } + connection_hops__ = Some(map_.next_value()?); + } + GeneratedField::Version => { + if version__.is_some() { + return Err(serde::de::Error::duplicate_field("version")); + } + version__ = Some(map_.next_value()?); + } + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::UpgradeSequence => { + if upgrade_sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("upgradeSequence")); + } + upgrade_sequence__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(IdentifiedChannel { + state: state__.unwrap_or_default(), + ordering: ordering__.unwrap_or_default(), + counterparty: counterparty__, + connection_hops: connection_hops__.unwrap_or_default(), + version: version__.unwrap_or_default(), + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + upgrade_sequence: upgrade_sequence__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.IdentifiedChannel", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgAcknowledgement { + #[allow(deprecated)] + 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("ibc.core.channel.v1.MsgAcknowledgement", len)?; + if let Some(v) = self.packet.as_ref() { + struct_ser.serialize_field("packet", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("acknowledgement", pbjson::private::base64::encode(&self.acknowledgement).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proofAcked", pbjson::private::base64::encode(&self.proof_acked).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgAcknowledgement { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "packet", + "acknowledgement", + "proof_acked", + "proofAcked", + "proof_height", + "proofHeight", + "signer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Packet, + Acknowledgement, + ProofAcked, + ProofHeight, + Signer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "packet" => Ok(GeneratedField::Packet), + "acknowledgement" => Ok(GeneratedField::Acknowledgement), + "proofAcked" | "proof_acked" => Ok(GeneratedField::ProofAcked), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + "signer" => Ok(GeneratedField::Signer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgAcknowledgement; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgAcknowledgement") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut packet__ = None; + let mut acknowledgement__ = None; + let mut proof_acked__ = None; + let mut proof_height__ = None; + let mut signer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Packet => { + if packet__.is_some() { + return Err(serde::de::Error::duplicate_field("packet")); + } + packet__ = map_.next_value()?; + } + GeneratedField::Acknowledgement => { + if acknowledgement__.is_some() { + return Err(serde::de::Error::duplicate_field("acknowledgement")); + } + acknowledgement__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofAcked => { + if proof_acked__.is_some() { + return Err(serde::de::Error::duplicate_field("proofAcked")); + } + proof_acked__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + } + } + Ok(MsgAcknowledgement { + packet: packet__, + acknowledgement: acknowledgement__.unwrap_or_default(), + proof_acked: proof_acked__.unwrap_or_default(), + proof_height: proof_height__, + signer: signer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgAcknowledgement", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgAcknowledgementResponse { + #[allow(deprecated)] + 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("ibc.core.channel.v1.MsgAcknowledgementResponse", len)?; + if true { + let v = ResponseResultType::try_from(self.result) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.result)))?; + struct_ser.serialize_field("result", &v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgAcknowledgementResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "result", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Result, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "result" => Ok(GeneratedField::Result), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgAcknowledgementResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgAcknowledgementResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut result__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Result => { + if result__.is_some() { + return Err(serde::de::Error::duplicate_field("result")); + } + result__ = Some(map_.next_value::()? as i32); + } + } + } + Ok(MsgAcknowledgementResponse { + result: result__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgAcknowledgementResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgChannelCloseConfirm { + #[allow(deprecated)] + 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("ibc.core.channel.v1.MsgChannelCloseConfirm", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proofInit", pbjson::private::base64::encode(&self.proof_init).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("counterpartyUpgradeSequence", ::alloc::string::ToString::to_string(&self.counterparty_upgrade_sequence).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgChannelCloseConfirm { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "proof_init", + "proofInit", + "proof_height", + "proofHeight", + "signer", + "counterparty_upgrade_sequence", + "counterpartyUpgradeSequence", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + ProofInit, + ProofHeight, + Signer, + CounterpartyUpgradeSequence, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "proofInit" | "proof_init" => Ok(GeneratedField::ProofInit), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + "signer" => Ok(GeneratedField::Signer), + "counterpartyUpgradeSequence" | "counterparty_upgrade_sequence" => Ok(GeneratedField::CounterpartyUpgradeSequence), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgChannelCloseConfirm; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelCloseConfirm") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut proof_init__ = None; + let mut proof_height__ = None; + let mut signer__ = None; + let mut counterparty_upgrade_sequence__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::ProofInit => { + if proof_init__.is_some() { + return Err(serde::de::Error::duplicate_field("proofInit")); + } + proof_init__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + GeneratedField::CounterpartyUpgradeSequence => { + if counterparty_upgrade_sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("counterpartyUpgradeSequence")); + } + counterparty_upgrade_sequence__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgChannelCloseConfirm { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + proof_init: proof_init__.unwrap_or_default(), + proof_height: proof_height__, + signer: signer__.unwrap_or_default(), + counterparty_upgrade_sequence: counterparty_upgrade_sequence__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelCloseConfirm", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgChannelCloseConfirmResponse { + #[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("ibc.core.channel.v1.MsgChannelCloseConfirmResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgChannelCloseConfirmResponse { + #[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 = MsgChannelCloseConfirmResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelCloseConfirmResponse") + } + + 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(MsgChannelCloseConfirmResponse { + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelCloseConfirmResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgChannelCloseInit { + #[allow(deprecated)] + 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("ibc.core.channel.v1.MsgChannelCloseInit", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgChannelCloseInit { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "signer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + Signer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "signer" => Ok(GeneratedField::Signer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgChannelCloseInit; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelCloseInit") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut signer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + } + } + Ok(MsgChannelCloseInit { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + signer: signer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelCloseInit", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgChannelCloseInitResponse { + #[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("ibc.core.channel.v1.MsgChannelCloseInitResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgChannelCloseInitResponse { + #[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 = MsgChannelCloseInitResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelCloseInitResponse") + } + + 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(MsgChannelCloseInitResponse { + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelCloseInitResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgChannelOpenAck { + #[allow(deprecated)] + 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("ibc.core.channel.v1.MsgChannelOpenAck", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if true { + struct_ser.serialize_field("counterpartyChannelId", &self.counterparty_channel_id)?; + } + if true { + struct_ser.serialize_field("counterpartyVersion", &self.counterparty_version)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proofTry", pbjson::private::base64::encode(&self.proof_try).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgChannelOpenAck { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "counterparty_channel_id", + "counterpartyChannelId", + "counterparty_version", + "counterpartyVersion", + "proof_try", + "proofTry", + "proof_height", + "proofHeight", + "signer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + CounterpartyChannelId, + CounterpartyVersion, + ProofTry, + ProofHeight, + Signer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "counterpartyChannelId" | "counterparty_channel_id" => Ok(GeneratedField::CounterpartyChannelId), + "counterpartyVersion" | "counterparty_version" => Ok(GeneratedField::CounterpartyVersion), + "proofTry" | "proof_try" => Ok(GeneratedField::ProofTry), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + "signer" => Ok(GeneratedField::Signer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgChannelOpenAck; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelOpenAck") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut counterparty_channel_id__ = None; + let mut counterparty_version__ = None; + let mut proof_try__ = None; + let mut proof_height__ = None; + let mut signer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::CounterpartyChannelId => { + if counterparty_channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("counterpartyChannelId")); + } + counterparty_channel_id__ = Some(map_.next_value()?); + } + GeneratedField::CounterpartyVersion => { + if counterparty_version__.is_some() { + return Err(serde::de::Error::duplicate_field("counterpartyVersion")); + } + counterparty_version__ = Some(map_.next_value()?); + } + GeneratedField::ProofTry => { + if proof_try__.is_some() { + return Err(serde::de::Error::duplicate_field("proofTry")); + } + proof_try__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + } + } + Ok(MsgChannelOpenAck { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + counterparty_channel_id: counterparty_channel_id__.unwrap_or_default(), + counterparty_version: counterparty_version__.unwrap_or_default(), + proof_try: proof_try__.unwrap_or_default(), + proof_height: proof_height__, + signer: signer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelOpenAck", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgChannelOpenAckResponse { + #[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("ibc.core.channel.v1.MsgChannelOpenAckResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgChannelOpenAckResponse { + #[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 = MsgChannelOpenAckResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelOpenAckResponse") + } + + 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(MsgChannelOpenAckResponse { + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelOpenAckResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgChannelOpenConfirm { + #[allow(deprecated)] + 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("ibc.core.channel.v1.MsgChannelOpenConfirm", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proofAck", pbjson::private::base64::encode(&self.proof_ack).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgChannelOpenConfirm { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "proof_ack", + "proofAck", + "proof_height", + "proofHeight", + "signer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + ProofAck, + ProofHeight, + Signer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "proofAck" | "proof_ack" => Ok(GeneratedField::ProofAck), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + "signer" => Ok(GeneratedField::Signer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgChannelOpenConfirm; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelOpenConfirm") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut proof_ack__ = None; + let mut proof_height__ = None; + let mut signer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::ProofAck => { + if proof_ack__.is_some() { + return Err(serde::de::Error::duplicate_field("proofAck")); + } + proof_ack__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + } + } + Ok(MsgChannelOpenConfirm { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + proof_ack: proof_ack__.unwrap_or_default(), + proof_height: proof_height__, + signer: signer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelOpenConfirm", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgChannelOpenConfirmResponse { + #[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("ibc.core.channel.v1.MsgChannelOpenConfirmResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgChannelOpenConfirmResponse { + #[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 = MsgChannelOpenConfirmResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelOpenConfirmResponse") + } + + 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(MsgChannelOpenConfirmResponse { + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelOpenConfirmResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgChannelOpenInit { + #[allow(deprecated)] + 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("ibc.core.channel.v1.MsgChannelOpenInit", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if let Some(v) = self.channel.as_ref() { + struct_ser.serialize_field("channel", v)?; + } + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgChannelOpenInit { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel", + "signer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + Channel, + Signer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channel" => Ok(GeneratedField::Channel), + "signer" => Ok(GeneratedField::Signer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgChannelOpenInit; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelOpenInit") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel__ = None; + let mut signer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::Channel => { + if channel__.is_some() { + return Err(serde::de::Error::duplicate_field("channel")); + } + channel__ = map_.next_value()?; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + } + } + Ok(MsgChannelOpenInit { + port_id: port_id__.unwrap_or_default(), + channel: channel__, + signer: signer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelOpenInit", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgChannelOpenInitResponse { + #[allow(deprecated)] + 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("ibc.core.channel.v1.MsgChannelOpenInitResponse", len)?; + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if true { + struct_ser.serialize_field("version", &self.version)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgChannelOpenInitResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "channel_id", + "channelId", + "version", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ChannelId, + 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 { + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "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 = MsgChannelOpenInitResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelOpenInitResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut channel_id__ = None; + let mut version__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::Version => { + if version__.is_some() { + return Err(serde::de::Error::duplicate_field("version")); + } + version__ = Some(map_.next_value()?); + } + } + } + Ok(MsgChannelOpenInitResponse { + channel_id: channel_id__.unwrap_or_default(), + version: version__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelOpenInitResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgChannelOpenTry { + #[allow(deprecated)] + 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("ibc.core.channel.v1.MsgChannelOpenTry", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("previousChannelId", &self.previous_channel_id)?; + } + if let Some(v) = self.channel.as_ref() { + struct_ser.serialize_field("channel", v)?; + } + if true { + struct_ser.serialize_field("counterpartyVersion", &self.counterparty_version)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proofInit", pbjson::private::base64::encode(&self.proof_init).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgChannelOpenTry { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "previous_channel_id", + "previousChannelId", + "channel", + "counterparty_version", + "counterpartyVersion", + "proof_init", + "proofInit", + "proof_height", + "proofHeight", + "signer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + PreviousChannelId, + Channel, + CounterpartyVersion, + ProofInit, + ProofHeight, + Signer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "previousChannelId" | "previous_channel_id" => Ok(GeneratedField::PreviousChannelId), + "channel" => Ok(GeneratedField::Channel), + "counterpartyVersion" | "counterparty_version" => Ok(GeneratedField::CounterpartyVersion), + "proofInit" | "proof_init" => Ok(GeneratedField::ProofInit), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + "signer" => Ok(GeneratedField::Signer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgChannelOpenTry; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelOpenTry") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut previous_channel_id__ = None; + let mut channel__ = None; + let mut counterparty_version__ = None; + let mut proof_init__ = None; + let mut proof_height__ = None; + let mut signer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::PreviousChannelId => { + if previous_channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("previousChannelId")); + } + previous_channel_id__ = Some(map_.next_value()?); + } + GeneratedField::Channel => { + if channel__.is_some() { + return Err(serde::de::Error::duplicate_field("channel")); + } + channel__ = map_.next_value()?; + } + GeneratedField::CounterpartyVersion => { + if counterparty_version__.is_some() { + return Err(serde::de::Error::duplicate_field("counterpartyVersion")); + } + counterparty_version__ = Some(map_.next_value()?); + } + GeneratedField::ProofInit => { + if proof_init__.is_some() { + return Err(serde::de::Error::duplicate_field("proofInit")); + } + proof_init__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + } + } + Ok(MsgChannelOpenTry { + port_id: port_id__.unwrap_or_default(), + previous_channel_id: previous_channel_id__.unwrap_or_default(), + channel: channel__, + counterparty_version: counterparty_version__.unwrap_or_default(), + proof_init: proof_init__.unwrap_or_default(), + proof_height: proof_height__, + signer: signer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelOpenTry", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgChannelOpenTryResponse { + #[allow(deprecated)] + 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("ibc.core.channel.v1.MsgChannelOpenTryResponse", len)?; + if true { + struct_ser.serialize_field("version", &self.version)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgChannelOpenTryResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "version", + "channel_id", + "channelId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Version, + ChannelId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgChannelOpenTryResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelOpenTryResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut version__ = None; + let mut channel_id__ = 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()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + } + } + Ok(MsgChannelOpenTryResponse { + version: version__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelOpenTryResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgChannelUpgradeAck { + #[allow(deprecated)] + 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("ibc.core.channel.v1.MsgChannelUpgradeAck", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if let Some(v) = self.counterparty_upgrade.as_ref() { + struct_ser.serialize_field("counterpartyUpgrade", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proofChannel", pbjson::private::base64::encode(&self.proof_channel).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proofUpgrade", pbjson::private::base64::encode(&self.proof_upgrade).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgChannelUpgradeAck { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "counterparty_upgrade", + "counterpartyUpgrade", + "proof_channel", + "proofChannel", + "proof_upgrade", + "proofUpgrade", + "proof_height", + "proofHeight", + "signer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + CounterpartyUpgrade, + ProofChannel, + ProofUpgrade, + ProofHeight, + Signer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "counterpartyUpgrade" | "counterparty_upgrade" => Ok(GeneratedField::CounterpartyUpgrade), + "proofChannel" | "proof_channel" => Ok(GeneratedField::ProofChannel), + "proofUpgrade" | "proof_upgrade" => Ok(GeneratedField::ProofUpgrade), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + "signer" => Ok(GeneratedField::Signer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgChannelUpgradeAck; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelUpgradeAck") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut counterparty_upgrade__ = None; + let mut proof_channel__ = None; + let mut proof_upgrade__ = None; + let mut proof_height__ = None; + let mut signer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::CounterpartyUpgrade => { + if counterparty_upgrade__.is_some() { + return Err(serde::de::Error::duplicate_field("counterpartyUpgrade")); + } + counterparty_upgrade__ = map_.next_value()?; + } + GeneratedField::ProofChannel => { + if proof_channel__.is_some() { + return Err(serde::de::Error::duplicate_field("proofChannel")); + } + proof_channel__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofUpgrade => { + if proof_upgrade__.is_some() { + return Err(serde::de::Error::duplicate_field("proofUpgrade")); + } + proof_upgrade__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + } + } + Ok(MsgChannelUpgradeAck { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + counterparty_upgrade: counterparty_upgrade__, + proof_channel: proof_channel__.unwrap_or_default(), + proof_upgrade: proof_upgrade__.unwrap_or_default(), + proof_height: proof_height__, + signer: signer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelUpgradeAck", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgChannelUpgradeAckResponse { + #[allow(deprecated)] + 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("ibc.core.channel.v1.MsgChannelUpgradeAckResponse", len)?; + if true { + let v = ResponseResultType::try_from(self.result) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.result)))?; + struct_ser.serialize_field("result", &v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgChannelUpgradeAckResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "result", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Result, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "result" => Ok(GeneratedField::Result), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgChannelUpgradeAckResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelUpgradeAckResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut result__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Result => { + if result__.is_some() { + return Err(serde::de::Error::duplicate_field("result")); + } + result__ = Some(map_.next_value::()? as i32); + } + } + } + Ok(MsgChannelUpgradeAckResponse { + result: result__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelUpgradeAckResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgChannelUpgradeCancel { + #[allow(deprecated)] + 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("ibc.core.channel.v1.MsgChannelUpgradeCancel", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if let Some(v) = self.error_receipt.as_ref() { + struct_ser.serialize_field("errorReceipt", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proofErrorReceipt", pbjson::private::base64::encode(&self.proof_error_receipt).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgChannelUpgradeCancel { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "error_receipt", + "errorReceipt", + "proof_error_receipt", + "proofErrorReceipt", + "proof_height", + "proofHeight", + "signer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + ErrorReceipt, + ProofErrorReceipt, + ProofHeight, + Signer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "errorReceipt" | "error_receipt" => Ok(GeneratedField::ErrorReceipt), + "proofErrorReceipt" | "proof_error_receipt" => Ok(GeneratedField::ProofErrorReceipt), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + "signer" => Ok(GeneratedField::Signer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgChannelUpgradeCancel; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelUpgradeCancel") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut error_receipt__ = None; + let mut proof_error_receipt__ = None; + let mut proof_height__ = None; + let mut signer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::ErrorReceipt => { + if error_receipt__.is_some() { + return Err(serde::de::Error::duplicate_field("errorReceipt")); + } + error_receipt__ = map_.next_value()?; + } + GeneratedField::ProofErrorReceipt => { + if proof_error_receipt__.is_some() { + return Err(serde::de::Error::duplicate_field("proofErrorReceipt")); + } + proof_error_receipt__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + } + } + Ok(MsgChannelUpgradeCancel { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + error_receipt: error_receipt__, + proof_error_receipt: proof_error_receipt__.unwrap_or_default(), + proof_height: proof_height__, + signer: signer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelUpgradeCancel", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgChannelUpgradeCancelResponse { + #[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("ibc.core.channel.v1.MsgChannelUpgradeCancelResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgChannelUpgradeCancelResponse { + #[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 = MsgChannelUpgradeCancelResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelUpgradeCancelResponse") + } + + 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(MsgChannelUpgradeCancelResponse { + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelUpgradeCancelResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgChannelUpgradeConfirm { + #[allow(deprecated)] + 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("ibc.core.channel.v1.MsgChannelUpgradeConfirm", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if true { + let v = State::try_from(self.counterparty_channel_state) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.counterparty_channel_state)))?; + struct_ser.serialize_field("counterpartyChannelState", &v)?; + } + if let Some(v) = self.counterparty_upgrade.as_ref() { + struct_ser.serialize_field("counterpartyUpgrade", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proofChannel", pbjson::private::base64::encode(&self.proof_channel).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proofUpgrade", pbjson::private::base64::encode(&self.proof_upgrade).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgChannelUpgradeConfirm { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "counterparty_channel_state", + "counterpartyChannelState", + "counterparty_upgrade", + "counterpartyUpgrade", + "proof_channel", + "proofChannel", + "proof_upgrade", + "proofUpgrade", + "proof_height", + "proofHeight", + "signer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + CounterpartyChannelState, + CounterpartyUpgrade, + ProofChannel, + ProofUpgrade, + ProofHeight, + Signer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "counterpartyChannelState" | "counterparty_channel_state" => Ok(GeneratedField::CounterpartyChannelState), + "counterpartyUpgrade" | "counterparty_upgrade" => Ok(GeneratedField::CounterpartyUpgrade), + "proofChannel" | "proof_channel" => Ok(GeneratedField::ProofChannel), + "proofUpgrade" | "proof_upgrade" => Ok(GeneratedField::ProofUpgrade), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + "signer" => Ok(GeneratedField::Signer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgChannelUpgradeConfirm; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelUpgradeConfirm") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut counterparty_channel_state__ = None; + let mut counterparty_upgrade__ = None; + let mut proof_channel__ = None; + let mut proof_upgrade__ = None; + let mut proof_height__ = None; + let mut signer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::CounterpartyChannelState => { + if counterparty_channel_state__.is_some() { + return Err(serde::de::Error::duplicate_field("counterpartyChannelState")); + } + counterparty_channel_state__ = Some(map_.next_value::()? as i32); + } + GeneratedField::CounterpartyUpgrade => { + if counterparty_upgrade__.is_some() { + return Err(serde::de::Error::duplicate_field("counterpartyUpgrade")); + } + counterparty_upgrade__ = map_.next_value()?; + } + GeneratedField::ProofChannel => { + if proof_channel__.is_some() { + return Err(serde::de::Error::duplicate_field("proofChannel")); + } + proof_channel__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofUpgrade => { + if proof_upgrade__.is_some() { + return Err(serde::de::Error::duplicate_field("proofUpgrade")); + } + proof_upgrade__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + } + } + Ok(MsgChannelUpgradeConfirm { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + counterparty_channel_state: counterparty_channel_state__.unwrap_or_default(), + counterparty_upgrade: counterparty_upgrade__, + proof_channel: proof_channel__.unwrap_or_default(), + proof_upgrade: proof_upgrade__.unwrap_or_default(), + proof_height: proof_height__, + signer: signer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelUpgradeConfirm", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgChannelUpgradeConfirmResponse { + #[allow(deprecated)] + 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("ibc.core.channel.v1.MsgChannelUpgradeConfirmResponse", len)?; + if true { + let v = ResponseResultType::try_from(self.result) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.result)))?; + struct_ser.serialize_field("result", &v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgChannelUpgradeConfirmResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "result", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Result, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "result" => Ok(GeneratedField::Result), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgChannelUpgradeConfirmResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelUpgradeConfirmResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut result__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Result => { + if result__.is_some() { + return Err(serde::de::Error::duplicate_field("result")); + } + result__ = Some(map_.next_value::()? as i32); + } + } + } + Ok(MsgChannelUpgradeConfirmResponse { + result: result__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelUpgradeConfirmResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgChannelUpgradeInit { + #[allow(deprecated)] + 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("ibc.core.channel.v1.MsgChannelUpgradeInit", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if let Some(v) = self.fields.as_ref() { + struct_ser.serialize_field("fields", v)?; + } + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgChannelUpgradeInit { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "fields", + "signer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + Fields, + Signer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "fields" => Ok(GeneratedField::Fields), + "signer" => Ok(GeneratedField::Signer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgChannelUpgradeInit; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelUpgradeInit") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut fields__ = None; + let mut signer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::Fields => { + if fields__.is_some() { + return Err(serde::de::Error::duplicate_field("fields")); + } + fields__ = map_.next_value()?; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + } + } + Ok(MsgChannelUpgradeInit { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + fields: fields__, + signer: signer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelUpgradeInit", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgChannelUpgradeInitResponse { + #[allow(deprecated)] + 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("ibc.core.channel.v1.MsgChannelUpgradeInitResponse", len)?; + if let Some(v) = self.upgrade.as_ref() { + struct_ser.serialize_field("upgrade", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("upgradeSequence", ::alloc::string::ToString::to_string(&self.upgrade_sequence).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgChannelUpgradeInitResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "upgrade", + "upgrade_sequence", + "upgradeSequence", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Upgrade, + UpgradeSequence, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "upgrade" => Ok(GeneratedField::Upgrade), + "upgradeSequence" | "upgrade_sequence" => Ok(GeneratedField::UpgradeSequence), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgChannelUpgradeInitResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelUpgradeInitResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut upgrade__ = None; + let mut upgrade_sequence__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Upgrade => { + if upgrade__.is_some() { + return Err(serde::de::Error::duplicate_field("upgrade")); + } + upgrade__ = map_.next_value()?; + } + GeneratedField::UpgradeSequence => { + if upgrade_sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("upgradeSequence")); + } + upgrade_sequence__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgChannelUpgradeInitResponse { + upgrade: upgrade__, + upgrade_sequence: upgrade_sequence__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelUpgradeInitResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgChannelUpgradeOpen { + #[allow(deprecated)] + 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("ibc.core.channel.v1.MsgChannelUpgradeOpen", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if true { + let v = State::try_from(self.counterparty_channel_state) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.counterparty_channel_state)))?; + struct_ser.serialize_field("counterpartyChannelState", &v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proofChannel", pbjson::private::base64::encode(&self.proof_channel).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgChannelUpgradeOpen { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "counterparty_channel_state", + "counterpartyChannelState", + "proof_channel", + "proofChannel", + "proof_height", + "proofHeight", + "signer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + CounterpartyChannelState, + ProofChannel, + ProofHeight, + Signer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "counterpartyChannelState" | "counterparty_channel_state" => Ok(GeneratedField::CounterpartyChannelState), + "proofChannel" | "proof_channel" => Ok(GeneratedField::ProofChannel), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + "signer" => Ok(GeneratedField::Signer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgChannelUpgradeOpen; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelUpgradeOpen") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut counterparty_channel_state__ = None; + let mut proof_channel__ = None; + let mut proof_height__ = None; + let mut signer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::CounterpartyChannelState => { + if counterparty_channel_state__.is_some() { + return Err(serde::de::Error::duplicate_field("counterpartyChannelState")); + } + counterparty_channel_state__ = Some(map_.next_value::()? as i32); + } + GeneratedField::ProofChannel => { + if proof_channel__.is_some() { + return Err(serde::de::Error::duplicate_field("proofChannel")); + } + proof_channel__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + } + } + Ok(MsgChannelUpgradeOpen { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + counterparty_channel_state: counterparty_channel_state__.unwrap_or_default(), + proof_channel: proof_channel__.unwrap_or_default(), + proof_height: proof_height__, + signer: signer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelUpgradeOpen", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgChannelUpgradeOpenResponse { + #[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("ibc.core.channel.v1.MsgChannelUpgradeOpenResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgChannelUpgradeOpenResponse { + #[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 = MsgChannelUpgradeOpenResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelUpgradeOpenResponse") + } + + 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(MsgChannelUpgradeOpenResponse { + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelUpgradeOpenResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgChannelUpgradeTimeout { + #[allow(deprecated)] + 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("ibc.core.channel.v1.MsgChannelUpgradeTimeout", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if let Some(v) = self.counterparty_channel.as_ref() { + struct_ser.serialize_field("counterpartyChannel", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proofChannel", pbjson::private::base64::encode(&self.proof_channel).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgChannelUpgradeTimeout { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "counterparty_channel", + "counterpartyChannel", + "proof_channel", + "proofChannel", + "proof_height", + "proofHeight", + "signer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + CounterpartyChannel, + ProofChannel, + ProofHeight, + Signer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "counterpartyChannel" | "counterparty_channel" => Ok(GeneratedField::CounterpartyChannel), + "proofChannel" | "proof_channel" => Ok(GeneratedField::ProofChannel), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + "signer" => Ok(GeneratedField::Signer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgChannelUpgradeTimeout; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelUpgradeTimeout") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut counterparty_channel__ = None; + let mut proof_channel__ = None; + let mut proof_height__ = None; + let mut signer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::CounterpartyChannel => { + if counterparty_channel__.is_some() { + return Err(serde::de::Error::duplicate_field("counterpartyChannel")); + } + counterparty_channel__ = map_.next_value()?; + } + GeneratedField::ProofChannel => { + if proof_channel__.is_some() { + return Err(serde::de::Error::duplicate_field("proofChannel")); + } + proof_channel__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + } + } + Ok(MsgChannelUpgradeTimeout { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + counterparty_channel: counterparty_channel__, + proof_channel: proof_channel__.unwrap_or_default(), + proof_height: proof_height__, + signer: signer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelUpgradeTimeout", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgChannelUpgradeTimeoutResponse { + #[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("ibc.core.channel.v1.MsgChannelUpgradeTimeoutResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgChannelUpgradeTimeoutResponse { + #[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 = MsgChannelUpgradeTimeoutResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelUpgradeTimeoutResponse") + } + + 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(MsgChannelUpgradeTimeoutResponse { + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelUpgradeTimeoutResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgChannelUpgradeTry { + #[allow(deprecated)] + 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("ibc.core.channel.v1.MsgChannelUpgradeTry", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if true { + struct_ser.serialize_field("proposedUpgradeConnectionHops", &self.proposed_upgrade_connection_hops)?; + } + if let Some(v) = self.counterparty_upgrade_fields.as_ref() { + struct_ser.serialize_field("counterpartyUpgradeFields", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("counterpartyUpgradeSequence", ::alloc::string::ToString::to_string(&self.counterparty_upgrade_sequence).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proofChannel", pbjson::private::base64::encode(&self.proof_channel).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proofUpgrade", pbjson::private::base64::encode(&self.proof_upgrade).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgChannelUpgradeTry { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "proposed_upgrade_connection_hops", + "proposedUpgradeConnectionHops", + "counterparty_upgrade_fields", + "counterpartyUpgradeFields", + "counterparty_upgrade_sequence", + "counterpartyUpgradeSequence", + "proof_channel", + "proofChannel", + "proof_upgrade", + "proofUpgrade", + "proof_height", + "proofHeight", + "signer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + ProposedUpgradeConnectionHops, + CounterpartyUpgradeFields, + CounterpartyUpgradeSequence, + ProofChannel, + ProofUpgrade, + ProofHeight, + Signer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "proposedUpgradeConnectionHops" | "proposed_upgrade_connection_hops" => Ok(GeneratedField::ProposedUpgradeConnectionHops), + "counterpartyUpgradeFields" | "counterparty_upgrade_fields" => Ok(GeneratedField::CounterpartyUpgradeFields), + "counterpartyUpgradeSequence" | "counterparty_upgrade_sequence" => Ok(GeneratedField::CounterpartyUpgradeSequence), + "proofChannel" | "proof_channel" => Ok(GeneratedField::ProofChannel), + "proofUpgrade" | "proof_upgrade" => Ok(GeneratedField::ProofUpgrade), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + "signer" => Ok(GeneratedField::Signer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgChannelUpgradeTry; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelUpgradeTry") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut proposed_upgrade_connection_hops__ = None; + let mut counterparty_upgrade_fields__ = None; + let mut counterparty_upgrade_sequence__ = None; + let mut proof_channel__ = None; + let mut proof_upgrade__ = None; + let mut proof_height__ = None; + let mut signer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::ProposedUpgradeConnectionHops => { + if proposed_upgrade_connection_hops__.is_some() { + return Err(serde::de::Error::duplicate_field("proposedUpgradeConnectionHops")); + } + proposed_upgrade_connection_hops__ = Some(map_.next_value()?); + } + GeneratedField::CounterpartyUpgradeFields => { + if counterparty_upgrade_fields__.is_some() { + return Err(serde::de::Error::duplicate_field("counterpartyUpgradeFields")); + } + counterparty_upgrade_fields__ = map_.next_value()?; + } + GeneratedField::CounterpartyUpgradeSequence => { + if counterparty_upgrade_sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("counterpartyUpgradeSequence")); + } + counterparty_upgrade_sequence__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofChannel => { + if proof_channel__.is_some() { + return Err(serde::de::Error::duplicate_field("proofChannel")); + } + proof_channel__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofUpgrade => { + if proof_upgrade__.is_some() { + return Err(serde::de::Error::duplicate_field("proofUpgrade")); + } + proof_upgrade__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + } + } + Ok(MsgChannelUpgradeTry { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + proposed_upgrade_connection_hops: proposed_upgrade_connection_hops__.unwrap_or_default(), + counterparty_upgrade_fields: counterparty_upgrade_fields__, + counterparty_upgrade_sequence: counterparty_upgrade_sequence__.unwrap_or_default(), + proof_channel: proof_channel__.unwrap_or_default(), + proof_upgrade: proof_upgrade__.unwrap_or_default(), + proof_height: proof_height__, + signer: signer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelUpgradeTry", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgChannelUpgradeTryResponse { + #[allow(deprecated)] + 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("ibc.core.channel.v1.MsgChannelUpgradeTryResponse", len)?; + if let Some(v) = self.upgrade.as_ref() { + struct_ser.serialize_field("upgrade", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("upgradeSequence", ::alloc::string::ToString::to_string(&self.upgrade_sequence).as_str())?; + } + if true { + let v = ResponseResultType::try_from(self.result) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.result)))?; + struct_ser.serialize_field("result", &v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgChannelUpgradeTryResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "upgrade", + "upgrade_sequence", + "upgradeSequence", + "result", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Upgrade, + UpgradeSequence, + Result, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "upgrade" => Ok(GeneratedField::Upgrade), + "upgradeSequence" | "upgrade_sequence" => Ok(GeneratedField::UpgradeSequence), + "result" => Ok(GeneratedField::Result), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgChannelUpgradeTryResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelUpgradeTryResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut upgrade__ = None; + let mut upgrade_sequence__ = None; + let mut result__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Upgrade => { + if upgrade__.is_some() { + return Err(serde::de::Error::duplicate_field("upgrade")); + } + upgrade__ = map_.next_value()?; + } + GeneratedField::UpgradeSequence => { + if upgrade_sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("upgradeSequence")); + } + upgrade_sequence__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Result => { + if result__.is_some() { + return Err(serde::de::Error::duplicate_field("result")); + } + result__ = Some(map_.next_value::()? as i32); + } + } + } + Ok(MsgChannelUpgradeTryResponse { + upgrade: upgrade__, + upgrade_sequence: upgrade_sequence__.unwrap_or_default(), + result: result__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelUpgradeTryResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgPruneAcknowledgements { + #[allow(deprecated)] + 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("ibc.core.channel.v1.MsgPruneAcknowledgements", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + 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("signer", &self.signer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgPruneAcknowledgements { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "limit", + "signer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + Limit, + Signer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "limit" => Ok(GeneratedField::Limit), + "signer" => Ok(GeneratedField::Signer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgPruneAcknowledgements; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgPruneAcknowledgements") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut limit__ = None; + let mut signer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::Limit => { + if limit__.is_some() { + return Err(serde::de::Error::duplicate_field("limit")); + } + limit__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + } + } + Ok(MsgPruneAcknowledgements { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + limit: limit__.unwrap_or_default(), + signer: signer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgPruneAcknowledgements", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgPruneAcknowledgementsResponse { + #[allow(deprecated)] + 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("ibc.core.channel.v1.MsgPruneAcknowledgementsResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("totalPrunedSequences", ::alloc::string::ToString::to_string(&self.total_pruned_sequences).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("totalRemainingSequences", ::alloc::string::ToString::to_string(&self.total_remaining_sequences).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgPruneAcknowledgementsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "total_pruned_sequences", + "totalPrunedSequences", + "total_remaining_sequences", + "totalRemainingSequences", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + TotalPrunedSequences, + TotalRemainingSequences, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "totalPrunedSequences" | "total_pruned_sequences" => Ok(GeneratedField::TotalPrunedSequences), + "totalRemainingSequences" | "total_remaining_sequences" => Ok(GeneratedField::TotalRemainingSequences), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgPruneAcknowledgementsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgPruneAcknowledgementsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut total_pruned_sequences__ = None; + let mut total_remaining_sequences__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::TotalPrunedSequences => { + if total_pruned_sequences__.is_some() { + return Err(serde::de::Error::duplicate_field("totalPrunedSequences")); + } + total_pruned_sequences__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::TotalRemainingSequences => { + if total_remaining_sequences__.is_some() { + return Err(serde::de::Error::duplicate_field("totalRemainingSequences")); + } + total_remaining_sequences__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgPruneAcknowledgementsResponse { + total_pruned_sequences: total_pruned_sequences__.unwrap_or_default(), + total_remaining_sequences: total_remaining_sequences__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgPruneAcknowledgementsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgRecvPacket { + #[allow(deprecated)] + 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("ibc.core.channel.v1.MsgRecvPacket", len)?; + if let Some(v) = self.packet.as_ref() { + struct_ser.serialize_field("packet", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proofCommitment", pbjson::private::base64::encode(&self.proof_commitment).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgRecvPacket { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "packet", + "proof_commitment", + "proofCommitment", + "proof_height", + "proofHeight", + "signer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Packet, + ProofCommitment, + ProofHeight, + Signer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "packet" => Ok(GeneratedField::Packet), + "proofCommitment" | "proof_commitment" => Ok(GeneratedField::ProofCommitment), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + "signer" => Ok(GeneratedField::Signer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgRecvPacket; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgRecvPacket") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut packet__ = None; + let mut proof_commitment__ = None; + let mut proof_height__ = None; + let mut signer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Packet => { + if packet__.is_some() { + return Err(serde::de::Error::duplicate_field("packet")); + } + packet__ = map_.next_value()?; + } + GeneratedField::ProofCommitment => { + if proof_commitment__.is_some() { + return Err(serde::de::Error::duplicate_field("proofCommitment")); + } + proof_commitment__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + } + } + Ok(MsgRecvPacket { + packet: packet__, + proof_commitment: proof_commitment__.unwrap_or_default(), + proof_height: proof_height__, + signer: signer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgRecvPacket", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgRecvPacketResponse { + #[allow(deprecated)] + 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("ibc.core.channel.v1.MsgRecvPacketResponse", len)?; + if true { + let v = ResponseResultType::try_from(self.result) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.result)))?; + struct_ser.serialize_field("result", &v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgRecvPacketResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "result", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Result, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "result" => Ok(GeneratedField::Result), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgRecvPacketResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgRecvPacketResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut result__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Result => { + if result__.is_some() { + return Err(serde::de::Error::duplicate_field("result")); + } + result__ = Some(map_.next_value::()? as i32); + } + } + } + Ok(MsgRecvPacketResponse { + result: result__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgRecvPacketResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgTimeout { + #[allow(deprecated)] + 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("ibc.core.channel.v1.MsgTimeout", len)?; + if let Some(v) = self.packet.as_ref() { + struct_ser.serialize_field("packet", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proofUnreceived", pbjson::private::base64::encode(&self.proof_unreceived).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("nextSequenceRecv", ::alloc::string::ToString::to_string(&self.next_sequence_recv).as_str())?; + } + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgTimeout { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "packet", + "proof_unreceived", + "proofUnreceived", + "proof_height", + "proofHeight", + "next_sequence_recv", + "nextSequenceRecv", + "signer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Packet, + ProofUnreceived, + ProofHeight, + NextSequenceRecv, + Signer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "packet" => Ok(GeneratedField::Packet), + "proofUnreceived" | "proof_unreceived" => Ok(GeneratedField::ProofUnreceived), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + "nextSequenceRecv" | "next_sequence_recv" => Ok(GeneratedField::NextSequenceRecv), + "signer" => Ok(GeneratedField::Signer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgTimeout; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgTimeout") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut packet__ = None; + let mut proof_unreceived__ = None; + let mut proof_height__ = None; + let mut next_sequence_recv__ = None; + let mut signer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Packet => { + if packet__.is_some() { + return Err(serde::de::Error::duplicate_field("packet")); + } + packet__ = map_.next_value()?; + } + GeneratedField::ProofUnreceived => { + if proof_unreceived__.is_some() { + return Err(serde::de::Error::duplicate_field("proofUnreceived")); + } + proof_unreceived__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + GeneratedField::NextSequenceRecv => { + if next_sequence_recv__.is_some() { + return Err(serde::de::Error::duplicate_field("nextSequenceRecv")); + } + next_sequence_recv__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + } + } + Ok(MsgTimeout { + packet: packet__, + proof_unreceived: proof_unreceived__.unwrap_or_default(), + proof_height: proof_height__, + next_sequence_recv: next_sequence_recv__.unwrap_or_default(), + signer: signer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgTimeout", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgTimeoutOnClose { + #[allow(deprecated)] + 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("ibc.core.channel.v1.MsgTimeoutOnClose", len)?; + if let Some(v) = self.packet.as_ref() { + struct_ser.serialize_field("packet", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proofUnreceived", pbjson::private::base64::encode(&self.proof_unreceived).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proofClose", pbjson::private::base64::encode(&self.proof_close).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("nextSequenceRecv", ::alloc::string::ToString::to_string(&self.next_sequence_recv).as_str())?; + } + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("counterpartyUpgradeSequence", ::alloc::string::ToString::to_string(&self.counterparty_upgrade_sequence).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgTimeoutOnClose { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "packet", + "proof_unreceived", + "proofUnreceived", + "proof_close", + "proofClose", + "proof_height", + "proofHeight", + "next_sequence_recv", + "nextSequenceRecv", + "signer", + "counterparty_upgrade_sequence", + "counterpartyUpgradeSequence", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Packet, + ProofUnreceived, + ProofClose, + ProofHeight, + NextSequenceRecv, + Signer, + CounterpartyUpgradeSequence, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "packet" => Ok(GeneratedField::Packet), + "proofUnreceived" | "proof_unreceived" => Ok(GeneratedField::ProofUnreceived), + "proofClose" | "proof_close" => Ok(GeneratedField::ProofClose), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + "nextSequenceRecv" | "next_sequence_recv" => Ok(GeneratedField::NextSequenceRecv), + "signer" => Ok(GeneratedField::Signer), + "counterpartyUpgradeSequence" | "counterparty_upgrade_sequence" => Ok(GeneratedField::CounterpartyUpgradeSequence), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgTimeoutOnClose; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgTimeoutOnClose") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut packet__ = None; + let mut proof_unreceived__ = None; + let mut proof_close__ = None; + let mut proof_height__ = None; + let mut next_sequence_recv__ = None; + let mut signer__ = None; + let mut counterparty_upgrade_sequence__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Packet => { + if packet__.is_some() { + return Err(serde::de::Error::duplicate_field("packet")); + } + packet__ = map_.next_value()?; + } + GeneratedField::ProofUnreceived => { + if proof_unreceived__.is_some() { + return Err(serde::de::Error::duplicate_field("proofUnreceived")); + } + proof_unreceived__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofClose => { + if proof_close__.is_some() { + return Err(serde::de::Error::duplicate_field("proofClose")); + } + proof_close__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + GeneratedField::NextSequenceRecv => { + if next_sequence_recv__.is_some() { + return Err(serde::de::Error::duplicate_field("nextSequenceRecv")); + } + next_sequence_recv__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + GeneratedField::CounterpartyUpgradeSequence => { + if counterparty_upgrade_sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("counterpartyUpgradeSequence")); + } + counterparty_upgrade_sequence__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgTimeoutOnClose { + packet: packet__, + proof_unreceived: proof_unreceived__.unwrap_or_default(), + proof_close: proof_close__.unwrap_or_default(), + proof_height: proof_height__, + next_sequence_recv: next_sequence_recv__.unwrap_or_default(), + signer: signer__.unwrap_or_default(), + counterparty_upgrade_sequence: counterparty_upgrade_sequence__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgTimeoutOnClose", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgTimeoutOnCloseResponse { + #[allow(deprecated)] + 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("ibc.core.channel.v1.MsgTimeoutOnCloseResponse", len)?; + if true { + let v = ResponseResultType::try_from(self.result) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.result)))?; + struct_ser.serialize_field("result", &v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgTimeoutOnCloseResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "result", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Result, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "result" => Ok(GeneratedField::Result), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgTimeoutOnCloseResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgTimeoutOnCloseResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut result__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Result => { + if result__.is_some() { + return Err(serde::de::Error::duplicate_field("result")); + } + result__ = Some(map_.next_value::()? as i32); + } + } + } + Ok(MsgTimeoutOnCloseResponse { + result: result__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgTimeoutOnCloseResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgTimeoutResponse { + #[allow(deprecated)] + 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("ibc.core.channel.v1.MsgTimeoutResponse", len)?; + if true { + let v = ResponseResultType::try_from(self.result) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.result)))?; + struct_ser.serialize_field("result", &v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgTimeoutResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "result", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Result, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "result" => Ok(GeneratedField::Result), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgTimeoutResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgTimeoutResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut result__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Result => { + if result__.is_some() { + return Err(serde::de::Error::duplicate_field("result")); + } + result__ = Some(map_.next_value::()? as i32); + } + } + } + Ok(MsgTimeoutResponse { + result: result__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgTimeoutResponse", 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("ibc.core.channel.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 ibc.core.channel.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("ibc.core.channel.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("ibc.core.channel.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 ibc.core.channel.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("ibc.core.channel.v1.MsgUpdateParamsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Order { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::NoneUnspecified => "ORDER_NONE_UNSPECIFIED", + Self::Unordered => "ORDER_UNORDERED", + Self::Ordered => "ORDER_ORDERED", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for Order { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "ORDER_NONE_UNSPECIFIED", + "ORDER_UNORDERED", + "ORDER_ORDERED", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Order; + + 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 { + "ORDER_NONE_UNSPECIFIED" => Ok(Order::NoneUnspecified), + "ORDER_UNORDERED" => Ok(Order::Unordered), + "ORDER_ORDERED" => Ok(Order::Ordered), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for Packet { + #[allow(deprecated)] + 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("ibc.core.channel.v1.Packet", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ::alloc::string::ToString::to_string(&self.sequence).as_str())?; + } + if true { + struct_ser.serialize_field("sourcePort", &self.source_port)?; + } + if true { + struct_ser.serialize_field("sourceChannel", &self.source_channel)?; + } + if true { + struct_ser.serialize_field("destinationPort", &self.destination_port)?; + } + if true { + struct_ser.serialize_field("destinationChannel", &self.destination_channel)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + if let Some(v) = self.timeout_height.as_ref() { + struct_ser.serialize_field("timeoutHeight", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("timeoutTimestamp", ::alloc::string::ToString::to_string(&self.timeout_timestamp).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Packet { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "sequence", + "source_port", + "sourcePort", + "source_channel", + "sourceChannel", + "destination_port", + "destinationPort", + "destination_channel", + "destinationChannel", + "data", + "timeout_height", + "timeoutHeight", + "timeout_timestamp", + "timeoutTimestamp", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sequence, + SourcePort, + SourceChannel, + DestinationPort, + DestinationChannel, + Data, + TimeoutHeight, + TimeoutTimestamp, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "sequence" => Ok(GeneratedField::Sequence), + "sourcePort" | "source_port" => Ok(GeneratedField::SourcePort), + "sourceChannel" | "source_channel" => Ok(GeneratedField::SourceChannel), + "destinationPort" | "destination_port" => Ok(GeneratedField::DestinationPort), + "destinationChannel" | "destination_channel" => Ok(GeneratedField::DestinationChannel), + "data" => Ok(GeneratedField::Data), + "timeoutHeight" | "timeout_height" => Ok(GeneratedField::TimeoutHeight), + "timeoutTimestamp" | "timeout_timestamp" => Ok(GeneratedField::TimeoutTimestamp), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Packet; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.Packet") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sequence__ = None; + let mut source_port__ = None; + let mut source_channel__ = None; + let mut destination_port__ = None; + let mut destination_channel__ = None; + let mut data__ = None; + let mut timeout_height__ = None; + let mut timeout_timestamp__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Sequence => { + if sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("sequence")); + } + sequence__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::SourcePort => { + if source_port__.is_some() { + return Err(serde::de::Error::duplicate_field("sourcePort")); + } + source_port__ = Some(map_.next_value()?); + } + GeneratedField::SourceChannel => { + if source_channel__.is_some() { + return Err(serde::de::Error::duplicate_field("sourceChannel")); + } + source_channel__ = Some(map_.next_value()?); + } + GeneratedField::DestinationPort => { + if destination_port__.is_some() { + return Err(serde::de::Error::duplicate_field("destinationPort")); + } + destination_port__ = Some(map_.next_value()?); + } + GeneratedField::DestinationChannel => { + if destination_channel__.is_some() { + return Err(serde::de::Error::duplicate_field("destinationChannel")); + } + destination_channel__ = Some(map_.next_value()?); + } + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::TimeoutHeight => { + if timeout_height__.is_some() { + return Err(serde::de::Error::duplicate_field("timeoutHeight")); + } + timeout_height__ = map_.next_value()?; + } + GeneratedField::TimeoutTimestamp => { + if timeout_timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timeoutTimestamp")); + } + timeout_timestamp__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(Packet { + sequence: sequence__.unwrap_or_default(), + source_port: source_port__.unwrap_or_default(), + source_channel: source_channel__.unwrap_or_default(), + destination_port: destination_port__.unwrap_or_default(), + destination_channel: destination_channel__.unwrap_or_default(), + data: data__.unwrap_or_default(), + timeout_height: timeout_height__, + timeout_timestamp: timeout_timestamp__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.Packet", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for PacketId { + #[allow(deprecated)] + 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("ibc.core.channel.v1.PacketId", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + 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 PacketId { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "sequence", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + 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 { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "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 = PacketId; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.PacketId") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut sequence__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(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(PacketId { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + sequence: sequence__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.PacketId", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for PacketSequence { + #[allow(deprecated)] + 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("ibc.core.channel.v1.PacketSequence", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + 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 PacketSequence { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "sequence", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + 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 { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "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 = PacketSequence; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.PacketSequence") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut sequence__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(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(PacketSequence { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + sequence: sequence__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.PacketSequence", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for PacketState { + #[allow(deprecated)] + 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("ibc.core.channel.v1.PacketState", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ::alloc::string::ToString::to_string(&self.sequence).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for PacketState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "sequence", + "data", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + Sequence, + Data, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "sequence" => Ok(GeneratedField::Sequence), + "data" => Ok(GeneratedField::Data), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = PacketState; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.PacketState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut sequence__ = None; + let mut data__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(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) + ; + } + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(PacketState { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + sequence: sequence__.unwrap_or_default(), + data: data__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.PacketState", 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; + } + let mut struct_ser = serializer.serialize_struct("ibc.core.channel.v1.Params", len)?; + if let Some(v) = self.upgrade_timeout.as_ref() { + struct_ser.serialize_field("upgradeTimeout", v)?; + } + 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] = &[ + "upgrade_timeout", + "upgradeTimeout", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + UpgradeTimeout, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "upgradeTimeout" | "upgrade_timeout" => Ok(GeneratedField::UpgradeTimeout), + _ => 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 ibc.core.channel.v1.Params") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut upgrade_timeout__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::UpgradeTimeout => { + if upgrade_timeout__.is_some() { + return Err(serde::de::Error::duplicate_field("upgradeTimeout")); + } + upgrade_timeout__ = map_.next_value()?; + } + } + } + Ok(Params { + upgrade_timeout: upgrade_timeout__, + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.Params", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryChannelClientStateRequest { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryChannelClientStateRequest", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryChannelClientStateRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryChannelClientStateRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryChannelClientStateRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + } + } + Ok(QueryChannelClientStateRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryChannelClientStateRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryChannelClientStateResponse { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryChannelClientStateResponse", len)?; + if let Some(v) = self.identified_client_state.as_ref() { + struct_ser.serialize_field("identifiedClientState", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proof", pbjson::private::base64::encode(&self.proof).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryChannelClientStateResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "identified_client_state", + "identifiedClientState", + "proof", + "proof_height", + "proofHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + IdentifiedClientState, + Proof, + ProofHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "identifiedClientState" | "identified_client_state" => Ok(GeneratedField::IdentifiedClientState), + "proof" => Ok(GeneratedField::Proof), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryChannelClientStateResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryChannelClientStateResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut identified_client_state__ = None; + let mut proof__ = None; + let mut proof_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::IdentifiedClientState => { + if identified_client_state__.is_some() { + return Err(serde::de::Error::duplicate_field("identifiedClientState")); + } + identified_client_state__ = map_.next_value()?; + } + GeneratedField::Proof => { + if proof__.is_some() { + return Err(serde::de::Error::duplicate_field("proof")); + } + proof__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + } + } + Ok(QueryChannelClientStateResponse { + identified_client_state: identified_client_state__, + proof: proof__.unwrap_or_default(), + proof_height: proof_height__, + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryChannelClientStateResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryChannelConsensusStateRequest { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryChannelConsensusStateRequest", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("revisionNumber", ::alloc::string::ToString::to_string(&self.revision_number).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("revisionHeight", ::alloc::string::ToString::to_string(&self.revision_height).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryChannelConsensusStateRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "revision_number", + "revisionNumber", + "revision_height", + "revisionHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + RevisionNumber, + RevisionHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "revisionNumber" | "revision_number" => Ok(GeneratedField::RevisionNumber), + "revisionHeight" | "revision_height" => Ok(GeneratedField::RevisionHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryChannelConsensusStateRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryChannelConsensusStateRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut revision_number__ = None; + let mut revision_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::RevisionNumber => { + if revision_number__.is_some() { + return Err(serde::de::Error::duplicate_field("revisionNumber")); + } + revision_number__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::RevisionHeight => { + if revision_height__.is_some() { + return Err(serde::de::Error::duplicate_field("revisionHeight")); + } + revision_height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(QueryChannelConsensusStateRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + revision_number: revision_number__.unwrap_or_default(), + revision_height: revision_height__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryChannelConsensusStateRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryChannelConsensusStateResponse { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryChannelConsensusStateResponse", len)?; + if let Some(v) = self.consensus_state.as_ref() { + struct_ser.serialize_field("consensusState", v)?; + } + if true { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proof", pbjson::private::base64::encode(&self.proof).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryChannelConsensusStateResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "consensus_state", + "consensusState", + "client_id", + "clientId", + "proof", + "proof_height", + "proofHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ConsensusState, + ClientId, + Proof, + ProofHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "consensusState" | "consensus_state" => Ok(GeneratedField::ConsensusState), + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + "proof" => Ok(GeneratedField::Proof), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryChannelConsensusStateResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryChannelConsensusStateResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut consensus_state__ = None; + let mut client_id__ = None; + let mut proof__ = None; + let mut proof_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ConsensusState => { + if consensus_state__.is_some() { + return Err(serde::de::Error::duplicate_field("consensusState")); + } + consensus_state__ = map_.next_value()?; + } + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); + } + client_id__ = Some(map_.next_value()?); + } + GeneratedField::Proof => { + if proof__.is_some() { + return Err(serde::de::Error::duplicate_field("proof")); + } + proof__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + } + } + Ok(QueryChannelConsensusStateResponse { + consensus_state: consensus_state__, + client_id: client_id__.unwrap_or_default(), + proof: proof__.unwrap_or_default(), + proof_height: proof_height__, + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryChannelConsensusStateResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryChannelParamsRequest { + #[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("ibc.core.channel.v1.QueryChannelParamsRequest", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryChannelParamsRequest { + #[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 = QueryChannelParamsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryChannelParamsRequest") + } + + 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(QueryChannelParamsRequest { + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryChannelParamsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryChannelParamsResponse { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryChannelParamsResponse", len)?; + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryChannelParamsResponse { + #[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 = QueryChannelParamsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryChannelParamsResponse") + } + + 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(QueryChannelParamsResponse { + params: params__, + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryChannelParamsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryChannelRequest { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryChannelRequest", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryChannelRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryChannelRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryChannelRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + } + } + Ok(QueryChannelRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryChannelRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryChannelResponse { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryChannelResponse", len)?; + if let Some(v) = self.channel.as_ref() { + struct_ser.serialize_field("channel", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proof", pbjson::private::base64::encode(&self.proof).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryChannelResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "channel", + "proof", + "proof_height", + "proofHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Channel, + Proof, + ProofHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "channel" => Ok(GeneratedField::Channel), + "proof" => Ok(GeneratedField::Proof), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryChannelResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryChannelResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut channel__ = None; + let mut proof__ = None; + let mut proof_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Channel => { + if channel__.is_some() { + return Err(serde::de::Error::duplicate_field("channel")); + } + channel__ = map_.next_value()?; + } + GeneratedField::Proof => { + if proof__.is_some() { + return Err(serde::de::Error::duplicate_field("proof")); + } + proof__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + } + } + Ok(QueryChannelResponse { + channel: channel__, + proof: proof__.unwrap_or_default(), + proof_height: proof_height__, + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryChannelResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryChannelsRequest { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryChannelsRequest", len)?; + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryChannelsRequest { + #[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 = QueryChannelsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryChannelsRequest") + } + + 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(QueryChannelsRequest { + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryChannelsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryChannelsResponse { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryChannelsResponse", len)?; + if true { + struct_ser.serialize_field("channels", &self.channels)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + if let Some(v) = self.height.as_ref() { + struct_ser.serialize_field("height", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryChannelsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "channels", + "pagination", + "height", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Channels, + Pagination, + 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 { + "channels" => Ok(GeneratedField::Channels), + "pagination" => Ok(GeneratedField::Pagination), + "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 = QueryChannelsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryChannelsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut channels__ = None; + let mut pagination__ = None; + let mut height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Channels => { + if channels__.is_some() { + return Err(serde::de::Error::duplicate_field("channels")); + } + channels__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + GeneratedField::Height => { + if height__.is_some() { + return Err(serde::de::Error::duplicate_field("height")); + } + height__ = map_.next_value()?; + } + } + } + Ok(QueryChannelsResponse { + channels: channels__.unwrap_or_default(), + pagination: pagination__, + height: height__, + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryChannelsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryConnectionChannelsRequest { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryConnectionChannelsRequest", len)?; + if true { + struct_ser.serialize_field("connection", &self.connection)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryConnectionChannelsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "connection", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Connection, + 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 { + "connection" => Ok(GeneratedField::Connection), + "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 = QueryConnectionChannelsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryConnectionChannelsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut connection__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Connection => { + if connection__.is_some() { + return Err(serde::de::Error::duplicate_field("connection")); + } + connection__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryConnectionChannelsRequest { + connection: connection__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryConnectionChannelsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryConnectionChannelsResponse { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryConnectionChannelsResponse", len)?; + if true { + struct_ser.serialize_field("channels", &self.channels)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + if let Some(v) = self.height.as_ref() { + struct_ser.serialize_field("height", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryConnectionChannelsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "channels", + "pagination", + "height", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Channels, + Pagination, + 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 { + "channels" => Ok(GeneratedField::Channels), + "pagination" => Ok(GeneratedField::Pagination), + "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 = QueryConnectionChannelsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryConnectionChannelsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut channels__ = None; + let mut pagination__ = None; + let mut height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Channels => { + if channels__.is_some() { + return Err(serde::de::Error::duplicate_field("channels")); + } + channels__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + GeneratedField::Height => { + if height__.is_some() { + return Err(serde::de::Error::duplicate_field("height")); + } + height__ = map_.next_value()?; + } + } + } + Ok(QueryConnectionChannelsResponse { + channels: channels__.unwrap_or_default(), + pagination: pagination__, + height: height__, + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryConnectionChannelsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryNextSequenceReceiveRequest { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryNextSequenceReceiveRequest", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryNextSequenceReceiveRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryNextSequenceReceiveRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryNextSequenceReceiveRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + } + } + Ok(QueryNextSequenceReceiveRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryNextSequenceReceiveRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryNextSequenceReceiveResponse { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryNextSequenceReceiveResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("nextSequenceReceive", ::alloc::string::ToString::to_string(&self.next_sequence_receive).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proof", pbjson::private::base64::encode(&self.proof).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryNextSequenceReceiveResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "next_sequence_receive", + "nextSequenceReceive", + "proof", + "proof_height", + "proofHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + NextSequenceReceive, + Proof, + ProofHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "nextSequenceReceive" | "next_sequence_receive" => Ok(GeneratedField::NextSequenceReceive), + "proof" => Ok(GeneratedField::Proof), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryNextSequenceReceiveResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryNextSequenceReceiveResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut next_sequence_receive__ = None; + let mut proof__ = None; + let mut proof_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::NextSequenceReceive => { + if next_sequence_receive__.is_some() { + return Err(serde::de::Error::duplicate_field("nextSequenceReceive")); + } + next_sequence_receive__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Proof => { + if proof__.is_some() { + return Err(serde::de::Error::duplicate_field("proof")); + } + proof__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + } + } + Ok(QueryNextSequenceReceiveResponse { + next_sequence_receive: next_sequence_receive__.unwrap_or_default(), + proof: proof__.unwrap_or_default(), + proof_height: proof_height__, + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryNextSequenceReceiveResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryNextSequenceSendRequest { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryNextSequenceSendRequest", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryNextSequenceSendRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryNextSequenceSendRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryNextSequenceSendRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + } + } + Ok(QueryNextSequenceSendRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryNextSequenceSendRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryNextSequenceSendResponse { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryNextSequenceSendResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("nextSequenceSend", ::alloc::string::ToString::to_string(&self.next_sequence_send).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proof", pbjson::private::base64::encode(&self.proof).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryNextSequenceSendResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "next_sequence_send", + "nextSequenceSend", + "proof", + "proof_height", + "proofHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + NextSequenceSend, + Proof, + ProofHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "nextSequenceSend" | "next_sequence_send" => Ok(GeneratedField::NextSequenceSend), + "proof" => Ok(GeneratedField::Proof), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryNextSequenceSendResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryNextSequenceSendResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut next_sequence_send__ = None; + let mut proof__ = None; + let mut proof_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::NextSequenceSend => { + if next_sequence_send__.is_some() { + return Err(serde::de::Error::duplicate_field("nextSequenceSend")); + } + next_sequence_send__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Proof => { + if proof__.is_some() { + return Err(serde::de::Error::duplicate_field("proof")); + } + proof__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + } + } + Ok(QueryNextSequenceSendResponse { + next_sequence_send: next_sequence_send__.unwrap_or_default(), + proof: proof__.unwrap_or_default(), + proof_height: proof_height__, + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryNextSequenceSendResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryPacketAcknowledgementRequest { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryPacketAcknowledgementRequest", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + 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 QueryPacketAcknowledgementRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "sequence", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + 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 { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "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 = QueryPacketAcknowledgementRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryPacketAcknowledgementRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut sequence__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(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(QueryPacketAcknowledgementRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + sequence: sequence__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryPacketAcknowledgementRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryPacketAcknowledgementResponse { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryPacketAcknowledgementResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("acknowledgement", pbjson::private::base64::encode(&self.acknowledgement).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proof", pbjson::private::base64::encode(&self.proof).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryPacketAcknowledgementResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "acknowledgement", + "proof", + "proof_height", + "proofHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Acknowledgement, + Proof, + ProofHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "acknowledgement" => Ok(GeneratedField::Acknowledgement), + "proof" => Ok(GeneratedField::Proof), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryPacketAcknowledgementResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryPacketAcknowledgementResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut acknowledgement__ = None; + let mut proof__ = None; + let mut proof_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Acknowledgement => { + if acknowledgement__.is_some() { + return Err(serde::de::Error::duplicate_field("acknowledgement")); + } + acknowledgement__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Proof => { + if proof__.is_some() { + return Err(serde::de::Error::duplicate_field("proof")); + } + proof__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + } + } + Ok(QueryPacketAcknowledgementResponse { + acknowledgement: acknowledgement__.unwrap_or_default(), + proof: proof__.unwrap_or_default(), + proof_height: proof_height__, + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryPacketAcknowledgementResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryPacketAcknowledgementsRequest { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryPacketAcknowledgementsRequest", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + if true { + struct_ser.serialize_field("packetCommitmentSequences", &self.packet_commitment_sequences.iter().map(::alloc::string::ToString::to_string).collect::<::alloc::vec::Vec<_>>())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryPacketAcknowledgementsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "pagination", + "packet_commitment_sequences", + "packetCommitmentSequences", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + Pagination, + PacketCommitmentSequences, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "pagination" => Ok(GeneratedField::Pagination), + "packetCommitmentSequences" | "packet_commitment_sequences" => Ok(GeneratedField::PacketCommitmentSequences), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryPacketAcknowledgementsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryPacketAcknowledgementsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut pagination__ = None; + let mut packet_commitment_sequences__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + GeneratedField::PacketCommitmentSequences => { + if packet_commitment_sequences__.is_some() { + return Err(serde::de::Error::duplicate_field("packetCommitmentSequences")); + } + packet_commitment_sequences__ = + Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::NumberDeserialize<_>>>()? + .into_iter().map(|x| x.0).collect()) + ; + } + } + } + Ok(QueryPacketAcknowledgementsRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + pagination: pagination__, + packet_commitment_sequences: packet_commitment_sequences__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryPacketAcknowledgementsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryPacketAcknowledgementsResponse { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryPacketAcknowledgementsResponse", len)?; + if true { + struct_ser.serialize_field("acknowledgements", &self.acknowledgements)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + if let Some(v) = self.height.as_ref() { + struct_ser.serialize_field("height", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryPacketAcknowledgementsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "acknowledgements", + "pagination", + "height", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Acknowledgements, + Pagination, + 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 { + "acknowledgements" => Ok(GeneratedField::Acknowledgements), + "pagination" => Ok(GeneratedField::Pagination), + "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 = QueryPacketAcknowledgementsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryPacketAcknowledgementsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut acknowledgements__ = None; + let mut pagination__ = None; + let mut height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Acknowledgements => { + if acknowledgements__.is_some() { + return Err(serde::de::Error::duplicate_field("acknowledgements")); + } + acknowledgements__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + GeneratedField::Height => { + if height__.is_some() { + return Err(serde::de::Error::duplicate_field("height")); + } + height__ = map_.next_value()?; + } + } + } + Ok(QueryPacketAcknowledgementsResponse { + acknowledgements: acknowledgements__.unwrap_or_default(), + pagination: pagination__, + height: height__, + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryPacketAcknowledgementsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryPacketCommitmentRequest { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryPacketCommitmentRequest", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + 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 QueryPacketCommitmentRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "sequence", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + 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 { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "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 = QueryPacketCommitmentRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryPacketCommitmentRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut sequence__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(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(QueryPacketCommitmentRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + sequence: sequence__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryPacketCommitmentRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryPacketCommitmentResponse { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryPacketCommitmentResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("commitment", pbjson::private::base64::encode(&self.commitment).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proof", pbjson::private::base64::encode(&self.proof).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryPacketCommitmentResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "commitment", + "proof", + "proof_height", + "proofHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Commitment, + Proof, + ProofHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "commitment" => Ok(GeneratedField::Commitment), + "proof" => Ok(GeneratedField::Proof), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryPacketCommitmentResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryPacketCommitmentResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut commitment__ = None; + let mut proof__ = None; + let mut proof_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Commitment => { + if commitment__.is_some() { + return Err(serde::de::Error::duplicate_field("commitment")); + } + commitment__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Proof => { + if proof__.is_some() { + return Err(serde::de::Error::duplicate_field("proof")); + } + proof__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + } + } + Ok(QueryPacketCommitmentResponse { + commitment: commitment__.unwrap_or_default(), + proof: proof__.unwrap_or_default(), + proof_height: proof_height__, + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryPacketCommitmentResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryPacketCommitmentsRequest { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryPacketCommitmentsRequest", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryPacketCommitmentsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + 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 { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "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 = QueryPacketCommitmentsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryPacketCommitmentsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryPacketCommitmentsRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryPacketCommitmentsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryPacketCommitmentsResponse { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryPacketCommitmentsResponse", len)?; + if true { + struct_ser.serialize_field("commitments", &self.commitments)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + if let Some(v) = self.height.as_ref() { + struct_ser.serialize_field("height", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryPacketCommitmentsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "commitments", + "pagination", + "height", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Commitments, + Pagination, + 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 { + "commitments" => Ok(GeneratedField::Commitments), + "pagination" => Ok(GeneratedField::Pagination), + "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 = QueryPacketCommitmentsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryPacketCommitmentsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut commitments__ = None; + let mut pagination__ = None; + let mut height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Commitments => { + if commitments__.is_some() { + return Err(serde::de::Error::duplicate_field("commitments")); + } + commitments__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + GeneratedField::Height => { + if height__.is_some() { + return Err(serde::de::Error::duplicate_field("height")); + } + height__ = map_.next_value()?; + } + } + } + Ok(QueryPacketCommitmentsResponse { + commitments: commitments__.unwrap_or_default(), + pagination: pagination__, + height: height__, + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryPacketCommitmentsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryPacketReceiptRequest { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryPacketReceiptRequest", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + 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 QueryPacketReceiptRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "sequence", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + 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 { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "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 = QueryPacketReceiptRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryPacketReceiptRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut sequence__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(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(QueryPacketReceiptRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + sequence: sequence__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryPacketReceiptRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryPacketReceiptResponse { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryPacketReceiptResponse", len)?; + if true { + struct_ser.serialize_field("received", &self.received)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proof", pbjson::private::base64::encode(&self.proof).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryPacketReceiptResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "received", + "proof", + "proof_height", + "proofHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Received, + Proof, + ProofHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "received" => Ok(GeneratedField::Received), + "proof" => Ok(GeneratedField::Proof), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryPacketReceiptResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryPacketReceiptResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut received__ = None; + let mut proof__ = None; + let mut proof_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Received => { + if received__.is_some() { + return Err(serde::de::Error::duplicate_field("received")); + } + received__ = Some(map_.next_value()?); + } + GeneratedField::Proof => { + if proof__.is_some() { + return Err(serde::de::Error::duplicate_field("proof")); + } + proof__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + } + } + Ok(QueryPacketReceiptResponse { + received: received__.unwrap_or_default(), + proof: proof__.unwrap_or_default(), + proof_height: proof_height__, + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryPacketReceiptResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryUnreceivedAcksRequest { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryUnreceivedAcksRequest", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if true { + struct_ser.serialize_field("packetAckSequences", &self.packet_ack_sequences.iter().map(::alloc::string::ToString::to_string).collect::<::alloc::vec::Vec<_>>())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryUnreceivedAcksRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "packet_ack_sequences", + "packetAckSequences", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + PacketAckSequences, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "packetAckSequences" | "packet_ack_sequences" => Ok(GeneratedField::PacketAckSequences), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryUnreceivedAcksRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryUnreceivedAcksRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut packet_ack_sequences__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::PacketAckSequences => { + if packet_ack_sequences__.is_some() { + return Err(serde::de::Error::duplicate_field("packetAckSequences")); + } + packet_ack_sequences__ = + Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::NumberDeserialize<_>>>()? + .into_iter().map(|x| x.0).collect()) + ; + } + } + } + Ok(QueryUnreceivedAcksRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + packet_ack_sequences: packet_ack_sequences__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryUnreceivedAcksRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryUnreceivedAcksResponse { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryUnreceivedAcksResponse", len)?; + if true { + struct_ser.serialize_field("sequences", &self.sequences.iter().map(::alloc::string::ToString::to_string).collect::<::alloc::vec::Vec<_>>())?; + } + if let Some(v) = self.height.as_ref() { + struct_ser.serialize_field("height", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryUnreceivedAcksResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "sequences", + "height", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sequences, + 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 { + "sequences" => Ok(GeneratedField::Sequences), + "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 = QueryUnreceivedAcksResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryUnreceivedAcksResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sequences__ = None; + let mut height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Sequences => { + if sequences__.is_some() { + return Err(serde::de::Error::duplicate_field("sequences")); + } + sequences__ = + Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::NumberDeserialize<_>>>()? + .into_iter().map(|x| x.0).collect()) + ; + } + GeneratedField::Height => { + if height__.is_some() { + return Err(serde::de::Error::duplicate_field("height")); + } + height__ = map_.next_value()?; + } + } + } + Ok(QueryUnreceivedAcksResponse { + sequences: sequences__.unwrap_or_default(), + height: height__, + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryUnreceivedAcksResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryUnreceivedPacketsRequest { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryUnreceivedPacketsRequest", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if true { + struct_ser.serialize_field("packetCommitmentSequences", &self.packet_commitment_sequences.iter().map(::alloc::string::ToString::to_string).collect::<::alloc::vec::Vec<_>>())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryUnreceivedPacketsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "packet_commitment_sequences", + "packetCommitmentSequences", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + PacketCommitmentSequences, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "packetCommitmentSequences" | "packet_commitment_sequences" => Ok(GeneratedField::PacketCommitmentSequences), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryUnreceivedPacketsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryUnreceivedPacketsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut packet_commitment_sequences__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::PacketCommitmentSequences => { + if packet_commitment_sequences__.is_some() { + return Err(serde::de::Error::duplicate_field("packetCommitmentSequences")); + } + packet_commitment_sequences__ = + Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::NumberDeserialize<_>>>()? + .into_iter().map(|x| x.0).collect()) + ; + } + } + } + Ok(QueryUnreceivedPacketsRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + packet_commitment_sequences: packet_commitment_sequences__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryUnreceivedPacketsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryUnreceivedPacketsResponse { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryUnreceivedPacketsResponse", len)?; + if true { + struct_ser.serialize_field("sequences", &self.sequences.iter().map(::alloc::string::ToString::to_string).collect::<::alloc::vec::Vec<_>>())?; + } + if let Some(v) = self.height.as_ref() { + struct_ser.serialize_field("height", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryUnreceivedPacketsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "sequences", + "height", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sequences, + 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 { + "sequences" => Ok(GeneratedField::Sequences), + "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 = QueryUnreceivedPacketsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryUnreceivedPacketsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sequences__ = None; + let mut height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Sequences => { + if sequences__.is_some() { + return Err(serde::de::Error::duplicate_field("sequences")); + } + sequences__ = + Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::NumberDeserialize<_>>>()? + .into_iter().map(|x| x.0).collect()) + ; + } + GeneratedField::Height => { + if height__.is_some() { + return Err(serde::de::Error::duplicate_field("height")); + } + height__ = map_.next_value()?; + } + } + } + Ok(QueryUnreceivedPacketsResponse { + sequences: sequences__.unwrap_or_default(), + height: height__, + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryUnreceivedPacketsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryUpgradeErrorRequest { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryUpgradeErrorRequest", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryUpgradeErrorRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryUpgradeErrorRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryUpgradeErrorRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + } + } + Ok(QueryUpgradeErrorRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryUpgradeErrorRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryUpgradeErrorResponse { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryUpgradeErrorResponse", len)?; + if let Some(v) = self.error_receipt.as_ref() { + struct_ser.serialize_field("errorReceipt", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proof", pbjson::private::base64::encode(&self.proof).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryUpgradeErrorResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "error_receipt", + "errorReceipt", + "proof", + "proof_height", + "proofHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ErrorReceipt, + Proof, + ProofHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "errorReceipt" | "error_receipt" => Ok(GeneratedField::ErrorReceipt), + "proof" => Ok(GeneratedField::Proof), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryUpgradeErrorResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryUpgradeErrorResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut error_receipt__ = None; + let mut proof__ = None; + let mut proof_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ErrorReceipt => { + if error_receipt__.is_some() { + return Err(serde::de::Error::duplicate_field("errorReceipt")); + } + error_receipt__ = map_.next_value()?; + } + GeneratedField::Proof => { + if proof__.is_some() { + return Err(serde::de::Error::duplicate_field("proof")); + } + proof__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + } + } + Ok(QueryUpgradeErrorResponse { + error_receipt: error_receipt__, + proof: proof__.unwrap_or_default(), + proof_height: proof_height__, + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryUpgradeErrorResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryUpgradeRequest { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryUpgradeRequest", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryUpgradeRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryUpgradeRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryUpgradeRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + } + } + Ok(QueryUpgradeRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryUpgradeRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryUpgradeResponse { + #[allow(deprecated)] + 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("ibc.core.channel.v1.QueryUpgradeResponse", len)?; + if let Some(v) = self.upgrade.as_ref() { + struct_ser.serialize_field("upgrade", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proof", pbjson::private::base64::encode(&self.proof).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryUpgradeResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "upgrade", + "proof", + "proof_height", + "proofHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Upgrade, + Proof, + ProofHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "upgrade" => Ok(GeneratedField::Upgrade), + "proof" => Ok(GeneratedField::Proof), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryUpgradeResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryUpgradeResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut upgrade__ = None; + let mut proof__ = None; + let mut proof_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Upgrade => { + if upgrade__.is_some() { + return Err(serde::de::Error::duplicate_field("upgrade")); + } + upgrade__ = map_.next_value()?; + } + GeneratedField::Proof => { + if proof__.is_some() { + return Err(serde::de::Error::duplicate_field("proof")); + } + proof__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + } + } + Ok(QueryUpgradeResponse { + upgrade: upgrade__, + proof: proof__.unwrap_or_default(), + proof_height: proof_height__, + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.QueryUpgradeResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ResponseResultType { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unspecified => "RESPONSE_RESULT_TYPE_UNSPECIFIED", + Self::Noop => "RESPONSE_RESULT_TYPE_NOOP", + Self::Success => "RESPONSE_RESULT_TYPE_SUCCESS", + Self::Failure => "RESPONSE_RESULT_TYPE_FAILURE", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for ResponseResultType { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "RESPONSE_RESULT_TYPE_UNSPECIFIED", + "RESPONSE_RESULT_TYPE_NOOP", + "RESPONSE_RESULT_TYPE_SUCCESS", + "RESPONSE_RESULT_TYPE_FAILURE", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ResponseResultType; + + 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 { + "RESPONSE_RESULT_TYPE_UNSPECIFIED" => Ok(ResponseResultType::Unspecified), + "RESPONSE_RESULT_TYPE_NOOP" => Ok(ResponseResultType::Noop), + "RESPONSE_RESULT_TYPE_SUCCESS" => Ok(ResponseResultType::Success), + "RESPONSE_RESULT_TYPE_FAILURE" => Ok(ResponseResultType::Failure), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for State { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::UninitializedUnspecified => "STATE_UNINITIALIZED_UNSPECIFIED", + Self::Init => "STATE_INIT", + Self::Tryopen => "STATE_TRYOPEN", + Self::Open => "STATE_OPEN", + Self::Closed => "STATE_CLOSED", + Self::Flushing => "STATE_FLUSHING", + Self::Flushcomplete => "STATE_FLUSHCOMPLETE", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for State { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "STATE_UNINITIALIZED_UNSPECIFIED", + "STATE_INIT", + "STATE_TRYOPEN", + "STATE_OPEN", + "STATE_CLOSED", + "STATE_FLUSHING", + "STATE_FLUSHCOMPLETE", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = State; + + 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 { + "STATE_UNINITIALIZED_UNSPECIFIED" => Ok(State::UninitializedUnspecified), + "STATE_INIT" => Ok(State::Init), + "STATE_TRYOPEN" => Ok(State::Tryopen), + "STATE_OPEN" => Ok(State::Open), + "STATE_CLOSED" => Ok(State::Closed), + "STATE_FLUSHING" => Ok(State::Flushing), + "STATE_FLUSHCOMPLETE" => Ok(State::Flushcomplete), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for Timeout { + #[allow(deprecated)] + 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("ibc.core.channel.v1.Timeout", len)?; + if let Some(v) = self.height.as_ref() { + struct_ser.serialize_field("height", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("timestamp", ::alloc::string::ToString::to_string(&self.timestamp).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Timeout { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "height", + "timestamp", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Height, + 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 { + "height" => Ok(GeneratedField::Height), + "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 = Timeout; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.Timeout") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut height__ = None; + let mut timestamp__ = 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__ = map_.next_value()?; + } + GeneratedField::Timestamp => { + if timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timestamp")); + } + timestamp__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(Timeout { + height: height__, + timestamp: timestamp__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.Timeout", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Upgrade { + #[allow(deprecated)] + 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("ibc.core.channel.v1.Upgrade", len)?; + if let Some(v) = self.fields.as_ref() { + struct_ser.serialize_field("fields", v)?; + } + if let Some(v) = self.timeout.as_ref() { + struct_ser.serialize_field("timeout", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("nextSequenceSend", ::alloc::string::ToString::to_string(&self.next_sequence_send).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Upgrade { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "fields", + "timeout", + "next_sequence_send", + "nextSequenceSend", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Fields, + Timeout, + NextSequenceSend, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "fields" => Ok(GeneratedField::Fields), + "timeout" => Ok(GeneratedField::Timeout), + "nextSequenceSend" | "next_sequence_send" => Ok(GeneratedField::NextSequenceSend), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Upgrade; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.Upgrade") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut fields__ = None; + let mut timeout__ = None; + let mut next_sequence_send__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Fields => { + if fields__.is_some() { + return Err(serde::de::Error::duplicate_field("fields")); + } + fields__ = map_.next_value()?; + } + GeneratedField::Timeout => { + if timeout__.is_some() { + return Err(serde::de::Error::duplicate_field("timeout")); + } + timeout__ = map_.next_value()?; + } + GeneratedField::NextSequenceSend => { + if next_sequence_send__.is_some() { + return Err(serde::de::Error::duplicate_field("nextSequenceSend")); + } + next_sequence_send__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(Upgrade { + fields: fields__, + timeout: timeout__, + next_sequence_send: next_sequence_send__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.Upgrade", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for UpgradeFields { + #[allow(deprecated)] + 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("ibc.core.channel.v1.UpgradeFields", len)?; + if true { + let v = Order::try_from(self.ordering) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.ordering)))?; + struct_ser.serialize_field("ordering", &v)?; + } + if true { + struct_ser.serialize_field("connectionHops", &self.connection_hops)?; + } + if true { + struct_ser.serialize_field("version", &self.version)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for UpgradeFields { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "ordering", + "connection_hops", + "connectionHops", + "version", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Ordering, + ConnectionHops, + 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 { + "ordering" => Ok(GeneratedField::Ordering), + "connectionHops" | "connection_hops" => Ok(GeneratedField::ConnectionHops), + "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 = UpgradeFields; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.UpgradeFields") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut ordering__ = None; + let mut connection_hops__ = None; + let mut version__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Ordering => { + if ordering__.is_some() { + return Err(serde::de::Error::duplicate_field("ordering")); + } + ordering__ = Some(map_.next_value::()? as i32); + } + GeneratedField::ConnectionHops => { + if connection_hops__.is_some() { + return Err(serde::de::Error::duplicate_field("connectionHops")); + } + connection_hops__ = Some(map_.next_value()?); + } + GeneratedField::Version => { + if version__.is_some() { + return Err(serde::de::Error::duplicate_field("version")); + } + version__ = Some(map_.next_value()?); + } + } + } + Ok(UpgradeFields { + ordering: ordering__.unwrap_or_default(), + connection_hops: connection_hops__.unwrap_or_default(), + version: version__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.UpgradeFields", FIELDS, GeneratedVisitor) + } +} diff --git a/src/prost/ibc.core.client.v1.rs b/src/prost/ibc.core.client.v1.rs index 05dd3b4b..fe2f63e7 100644 --- a/src/prost/ibc.core.client.v1.rs +++ b/src/prost/ibc.core.client.v1.rs @@ -1,6 +1,5 @@ /// IdentifiedClientState defines a client state with an additional client /// identifier field. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IdentifiedClientState { @@ -13,9 +12,15 @@ pub struct IdentifiedClientState { super::super::super::super::google::protobuf::Any, >, } +impl ::prost::Name for IdentifiedClientState { + const NAME: &'static str = "IdentifiedClientState"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// ConsensusStateWithHeight defines a consensus state with an additional height /// field. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConsensusStateWithHeight { @@ -28,9 +33,15 @@ pub struct ConsensusStateWithHeight { super::super::super::super::google::protobuf::Any, >, } +impl ::prost::Name for ConsensusStateWithHeight { + const NAME: &'static str = "ConsensusStateWithHeight"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// ClientConsensusStates defines all the stored consensus states for a given /// client. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ClientConsensusStates { @@ -41,6 +52,13 @@ pub struct ClientConsensusStates { #[prost(message, repeated, tag = "2")] pub consensus_states: ::prost::alloc::vec::Vec, } +impl ::prost::Name for ClientConsensusStates { + const NAME: &'static str = "ClientConsensusStates"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// Height is a monotonically increasing data type /// that can be compared against another Height for the purposes of updating and /// freezing clients @@ -51,7 +69,6 @@ pub struct ClientConsensusStates { /// breaking changes In these cases, the RevisionNumber is incremented so that /// height continues to be monitonically increasing even as the RevisionHeight /// gets reset -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[derive(Eq, PartialOrd, Ord)] #[cfg_attr( all(feature = "json-schema", feature = "serde"), @@ -62,15 +79,19 @@ pub struct ClientConsensusStates { pub struct Height { /// the revision that the client is currently on #[prost(uint64, tag = "1")] - #[cfg_attr(feature = "serde", serde(default))] pub revision_number: u64, /// the height within the given revision #[prost(uint64, tag = "2")] - #[cfg_attr(feature = "serde", serde(default))] pub revision_height: u64, } +impl ::prost::Name for Height { + const NAME: &'static str = "Height"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// Params defines the set of IBC light client parameters. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -80,13 +101,19 @@ pub struct Params { #[prost(string, repeated, tag = "1")] pub allowed_clients: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +impl ::prost::Name for Params { + const NAME: &'static str = "Params"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// ClientUpdateProposal is a legacy governance proposal. If it passes, the substitute /// client's latest consensus state is copied over to the subject client. The proposal /// handler may fail if the subject and the substitute do not match in client and /// chain parameters (with exception to latest height, frozen height, and chain-id). /// /// Deprecated: Please use MsgRecoverClient in favour of this message type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ClientUpdateProposal { @@ -104,11 +131,17 @@ pub struct ClientUpdateProposal { #[prost(string, tag = "4")] pub substitute_client_id: ::prost::alloc::string::String, } +impl ::prost::Name for ClientUpdateProposal { + const NAME: &'static str = "ClientUpdateProposal"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// UpgradeProposal is a gov Content type for initiating an IBC breaking /// upgrade. /// /// Deprecated: Please use MsgIBCSoftwareUpgrade in favour of this message type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UpgradeProposal { @@ -131,8 +164,14 @@ pub struct UpgradeProposal { super::super::super::super::google::protobuf::Any, >, } +impl ::prost::Name for UpgradeProposal { + const NAME: &'static str = "UpgradeProposal"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// GenesisState defines the ibc client submodule's genesis state. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -156,9 +195,15 @@ pub struct GenesisState { #[prost(uint64, tag = "6")] pub next_client_sequence: u64, } +impl ::prost::Name for GenesisState { + const NAME: &'static str = "GenesisState"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// GenesisMetadata defines the genesis type for metadata that clients may return /// with ExportMetadata -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisMetadata { @@ -169,9 +214,15 @@ pub struct GenesisMetadata { #[prost(bytes = "vec", tag = "2")] pub value: ::prost::alloc::vec::Vec, } +impl ::prost::Name for GenesisMetadata { + const NAME: &'static str = "GenesisMetadata"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// IdentifiedGenesisMetadata has the client metadata with the corresponding /// client id. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IdentifiedGenesisMetadata { @@ -180,8 +231,14 @@ pub struct IdentifiedGenesisMetadata { #[prost(message, repeated, tag = "2")] pub client_metadata: ::prost::alloc::vec::Vec, } +impl ::prost::Name for IdentifiedGenesisMetadata { + const NAME: &'static str = "IdentifiedGenesisMetadata"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// MsgCreateClient defines a message to create an IBC client -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateClient { @@ -200,14 +257,26 @@ pub struct MsgCreateClient { #[prost(string, tag = "3")] pub signer: ::prost::alloc::string::String, } +impl ::prost::Name for MsgCreateClient { + const NAME: &'static str = "MsgCreateClient"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// MsgCreateClientResponse defines the Msg/CreateClient response type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateClientResponse {} +impl ::prost::Name for MsgCreateClientResponse { + const NAME: &'static str = "MsgCreateClientResponse"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// MsgUpdateClient defines an sdk.Msg to update a IBC client state using /// the given client message. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateClient { @@ -223,14 +292,26 @@ pub struct MsgUpdateClient { #[prost(string, tag = "3")] pub signer: ::prost::alloc::string::String, } +impl ::prost::Name for MsgUpdateClient { + const NAME: &'static str = "MsgUpdateClient"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// MsgUpdateClientResponse defines the Msg/UpdateClient response type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateClientResponse {} +impl ::prost::Name for MsgUpdateClientResponse { + const NAME: &'static str = "MsgUpdateClientResponse"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client /// state -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpgradeClient { @@ -258,15 +339,27 @@ pub struct MsgUpgradeClient { #[prost(string, tag = "6")] pub signer: ::prost::alloc::string::String, } +impl ::prost::Name for MsgUpgradeClient { + const NAME: &'static str = "MsgUpgradeClient"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpgradeClientResponse {} +impl ::prost::Name for MsgUpgradeClientResponse { + const NAME: &'static str = "MsgUpgradeClientResponse"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for /// light client misbehaviour. /// This message has been deprecated. Use MsgUpdateClient instead. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitMisbehaviour { @@ -282,14 +375,26 @@ pub struct MsgSubmitMisbehaviour { #[prost(string, tag = "3")] pub signer: ::prost::alloc::string::String, } +impl ::prost::Name for MsgSubmitMisbehaviour { + const NAME: &'static str = "MsgSubmitMisbehaviour"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response /// type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitMisbehaviourResponse {} +impl ::prost::Name for MsgSubmitMisbehaviourResponse { + const NAME: &'static str = "MsgSubmitMisbehaviourResponse"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// MsgRecoverClient defines the message used to recover a frozen or expired client. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRecoverClient { @@ -304,13 +409,25 @@ pub struct MsgRecoverClient { #[prost(string, tag = "3")] pub signer: ::prost::alloc::string::String, } +impl ::prost::Name for MsgRecoverClient { + const NAME: &'static str = "MsgRecoverClient"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// MsgRecoverClientResponse defines the Msg/RecoverClient response type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRecoverClientResponse {} +impl ::prost::Name for MsgRecoverClientResponse { + const NAME: &'static str = "MsgRecoverClientResponse"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// MsgIBCSoftwareUpgrade defines the message used to schedule an upgrade of an IBC client using a v1 governance proposal -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgIbcSoftwareUpgrade { @@ -334,13 +451,25 @@ pub struct MsgIbcSoftwareUpgrade { #[prost(string, tag = "3")] pub signer: ::prost::alloc::string::String, } +impl ::prost::Name for MsgIbcSoftwareUpgrade { + const NAME: &'static str = "MsgIBCSoftwareUpgrade"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// MsgIBCSoftwareUpgradeResponse defines the Msg/IBCSoftwareUpgrade response type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgIbcSoftwareUpgradeResponse {} +impl ::prost::Name for MsgIbcSoftwareUpgradeResponse { + const NAME: &'static str = "MsgIBCSoftwareUpgradeResponse"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// MsgUpdateParams defines the sdk.Msg type to update the client parameters. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -353,11 +482,24 @@ pub struct MsgUpdateParams { #[prost(message, optional, tag = "2")] pub params: ::core::option::Option, } +impl ::prost::Name for MsgUpdateParams { + const NAME: &'static str = "MsgUpdateParams"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// MsgUpdateParamsResponse defines the MsgUpdateParams response type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} +impl ::prost::Name for MsgUpdateParamsResponse { + const NAME: &'static str = "MsgUpdateParamsResponse"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod msg_client { @@ -1129,7 +1271,6 @@ pub mod msg_server { } /// QueryClientStateRequest is the request type for the Query/ClientState RPC /// method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientStateRequest { @@ -1137,10 +1278,16 @@ pub struct QueryClientStateRequest { #[prost(string, tag = "1")] pub client_id: ::prost::alloc::string::String, } +impl ::prost::Name for QueryClientStateRequest { + const NAME: &'static str = "QueryClientStateRequest"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// QueryClientStateResponse is the response type for the Query/ClientState RPC /// method. Besides the client state, it includes a proof and the height from /// which the proof was retrieved. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientStateResponse { @@ -1156,9 +1303,15 @@ pub struct QueryClientStateResponse { #[prost(message, optional, tag = "3")] pub proof_height: ::core::option::Option, } +impl ::prost::Name for QueryClientStateResponse { + const NAME: &'static str = "QueryClientStateResponse"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// QueryClientStatesRequest is the request type for the Query/ClientStates RPC /// method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientStatesRequest { @@ -1168,9 +1321,15 @@ pub struct QueryClientStatesRequest { super::super::super::super::cosmos::base::query::v1beta1::PageRequest, >, } +impl ::prost::Name for QueryClientStatesRequest { + const NAME: &'static str = "QueryClientStatesRequest"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// QueryClientStatesResponse is the response type for the Query/ClientStates RPC /// method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientStatesResponse { @@ -1183,10 +1342,16 @@ pub struct QueryClientStatesResponse { super::super::super::super::cosmos::base::query::v1beta1::PageResponse, >, } +impl ::prost::Name for QueryClientStatesResponse { + const NAME: &'static str = "QueryClientStatesResponse"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// QueryConsensusStateRequest is the request type for the Query/ConsensusState /// RPC method. Besides the consensus state, it includes a proof and the height /// from which the proof was retrieved. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConsensusStateRequest { @@ -1199,14 +1364,20 @@ pub struct QueryConsensusStateRequest { /// consensus state revision height #[prost(uint64, tag = "3")] pub revision_height: u64, - /// latest_height overrrides the height field and queries the latest stored + /// latest_height overrides the height field and queries the latest stored /// ConsensusState #[prost(bool, tag = "4")] pub latest_height: bool, } +impl ::prost::Name for QueryConsensusStateRequest { + const NAME: &'static str = "QueryConsensusStateRequest"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// QueryConsensusStateResponse is the response type for the Query/ConsensusState /// RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConsensusStateResponse { @@ -1222,9 +1393,15 @@ pub struct QueryConsensusStateResponse { #[prost(message, optional, tag = "3")] pub proof_height: ::core::option::Option, } +impl ::prost::Name for QueryConsensusStateResponse { + const NAME: &'static str = "QueryConsensusStateResponse"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// QueryConsensusStatesRequest is the request type for the Query/ConsensusStates /// RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConsensusStatesRequest { @@ -1237,9 +1414,15 @@ pub struct QueryConsensusStatesRequest { super::super::super::super::cosmos::base::query::v1beta1::PageRequest, >, } +impl ::prost::Name for QueryConsensusStatesRequest { + const NAME: &'static str = "QueryConsensusStatesRequest"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// QueryConsensusStatesResponse is the response type for the /// Query/ConsensusStates RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConsensusStatesResponse { @@ -1252,9 +1435,15 @@ pub struct QueryConsensusStatesResponse { super::super::super::super::cosmos::base::query::v1beta1::PageResponse, >, } +impl ::prost::Name for QueryConsensusStatesResponse { + const NAME: &'static str = "QueryConsensusStatesResponse"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// QueryConsensusStateHeightsRequest is the request type for Query/ConsensusStateHeights /// RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConsensusStateHeightsRequest { @@ -1267,9 +1456,15 @@ pub struct QueryConsensusStateHeightsRequest { super::super::super::super::cosmos::base::query::v1beta1::PageRequest, >, } +impl ::prost::Name for QueryConsensusStateHeightsRequest { + const NAME: &'static str = "QueryConsensusStateHeightsRequest"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// QueryConsensusStateHeightsResponse is the response type for the /// Query/ConsensusStateHeights RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConsensusStateHeightsResponse { @@ -1282,9 +1477,15 @@ pub struct QueryConsensusStateHeightsResponse { super::super::super::super::cosmos::base::query::v1beta1::PageResponse, >, } +impl ::prost::Name for QueryConsensusStateHeightsResponse { + const NAME: &'static str = "QueryConsensusStateHeightsResponse"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// QueryClientStatusRequest is the request type for the Query/ClientStatus RPC /// method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientStatusRequest { @@ -1292,24 +1493,42 @@ pub struct QueryClientStatusRequest { #[prost(string, tag = "1")] pub client_id: ::prost::alloc::string::String, } +impl ::prost::Name for QueryClientStatusRequest { + const NAME: &'static str = "QueryClientStatusRequest"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// QueryClientStatusResponse is the response type for the Query/ClientStatus RPC /// method. It returns the current status of the IBC client. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientStatusResponse { #[prost(string, tag = "1")] pub status: ::prost::alloc::string::String, } +impl ::prost::Name for QueryClientStatusResponse { + const NAME: &'static str = "QueryClientStatusResponse"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// QueryClientParamsRequest is the request type for the Query/ClientParams RPC /// method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientParamsRequest {} +impl ::prost::Name for QueryClientParamsRequest { + const NAME: &'static str = "QueryClientParamsRequest"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// QueryClientParamsResponse is the response type for the Query/ClientParams RPC /// method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientParamsResponse { @@ -1317,15 +1536,27 @@ pub struct QueryClientParamsResponse { #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } +impl ::prost::Name for QueryClientParamsResponse { + const NAME: &'static str = "QueryClientParamsResponse"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// QueryUpgradedClientStateRequest is the request type for the /// Query/UpgradedClientState RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUpgradedClientStateRequest {} +impl ::prost::Name for QueryUpgradedClientStateRequest { + const NAME: &'static str = "QueryUpgradedClientStateRequest"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// QueryUpgradedClientStateResponse is the response type for the /// Query/UpgradedClientState RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUpgradedClientStateResponse { @@ -1335,15 +1566,27 @@ pub struct QueryUpgradedClientStateResponse { super::super::super::super::google::protobuf::Any, >, } +impl ::prost::Name for QueryUpgradedClientStateResponse { + const NAME: &'static str = "QueryUpgradedClientStateResponse"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// QueryUpgradedConsensusStateRequest is the request type for the /// Query/UpgradedConsensusState RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUpgradedConsensusStateRequest {} +impl ::prost::Name for QueryUpgradedConsensusStateRequest { + const NAME: &'static str = "QueryUpgradedConsensusStateRequest"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// QueryUpgradedConsensusStateResponse is the response type for the /// Query/UpgradedConsensusState RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUpgradedConsensusStateResponse { @@ -1353,6 +1596,13 @@ pub struct QueryUpgradedConsensusStateResponse { super::super::super::super::google::protobuf::Any, >, } +impl ::prost::Name for QueryUpgradedConsensusStateResponse { + const NAME: &'static str = "QueryUpgradedConsensusStateResponse"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod query_client { diff --git a/src/prost/ibc.core.client.v1.serde.rs b/src/prost/ibc.core.client.v1.serde.rs new file mode 100644 index 00000000..f3491f56 --- /dev/null +++ b/src/prost/ibc.core.client.v1.serde.rs @@ -0,0 +1,4467 @@ +impl serde::Serialize for ClientConsensusStates { + #[allow(deprecated)] + 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("ibc.core.client.v1.ClientConsensusStates", len)?; + if true { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + if true { + struct_ser.serialize_field("consensusStates", &self.consensus_states)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ClientConsensusStates { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "client_id", + "clientId", + "consensus_states", + "consensusStates", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClientId, + ConsensusStates, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + "consensusStates" | "consensus_states" => Ok(GeneratedField::ConsensusStates), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ClientConsensusStates; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.ClientConsensusStates") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut client_id__ = None; + let mut consensus_states__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); + } + client_id__ = Some(map_.next_value()?); + } + GeneratedField::ConsensusStates => { + if consensus_states__.is_some() { + return Err(serde::de::Error::duplicate_field("consensusStates")); + } + consensus_states__ = Some(map_.next_value()?); + } + } + } + Ok(ClientConsensusStates { + client_id: client_id__.unwrap_or_default(), + consensus_states: consensus_states__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.ClientConsensusStates", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ClientUpdateProposal { + #[allow(deprecated)] + 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("ibc.core.client.v1.ClientUpdateProposal", len)?; + if true { + struct_ser.serialize_field("title", &self.title)?; + } + if true { + struct_ser.serialize_field("description", &self.description)?; + } + if true { + struct_ser.serialize_field("subjectClientId", &self.subject_client_id)?; + } + if true { + struct_ser.serialize_field("substituteClientId", &self.substitute_client_id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ClientUpdateProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "title", + "description", + "subject_client_id", + "subjectClientId", + "substitute_client_id", + "substituteClientId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Title, + Description, + SubjectClientId, + SubstituteClientId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "subjectClientId" | "subject_client_id" => Ok(GeneratedField::SubjectClientId), + "substituteClientId" | "substitute_client_id" => Ok(GeneratedField::SubstituteClientId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ClientUpdateProposal; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.ClientUpdateProposal") + } + + 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 subject_client_id__ = None; + let mut substitute_client_id__ = 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::SubjectClientId => { + if subject_client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("subjectClientId")); + } + subject_client_id__ = Some(map_.next_value()?); + } + GeneratedField::SubstituteClientId => { + if substitute_client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("substituteClientId")); + } + substitute_client_id__ = Some(map_.next_value()?); + } + } + } + Ok(ClientUpdateProposal { + title: title__.unwrap_or_default(), + description: description__.unwrap_or_default(), + subject_client_id: subject_client_id__.unwrap_or_default(), + substitute_client_id: substitute_client_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.ClientUpdateProposal", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ConsensusStateWithHeight { + #[allow(deprecated)] + 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("ibc.core.client.v1.ConsensusStateWithHeight", len)?; + if let Some(v) = self.height.as_ref() { + struct_ser.serialize_field("height", v)?; + } + if let Some(v) = self.consensus_state.as_ref() { + struct_ser.serialize_field("consensusState", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ConsensusStateWithHeight { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "height", + "consensus_state", + "consensusState", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Height, + ConsensusState, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "consensusState" | "consensus_state" => Ok(GeneratedField::ConsensusState), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ConsensusStateWithHeight; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.ConsensusStateWithHeight") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut height__ = None; + let mut consensus_state__ = 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__ = map_.next_value()?; + } + GeneratedField::ConsensusState => { + if consensus_state__.is_some() { + return Err(serde::de::Error::duplicate_field("consensusState")); + } + consensus_state__ = map_.next_value()?; + } + } + } + Ok(ConsensusStateWithHeight { + height: height__, + consensus_state: consensus_state__, + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.ConsensusStateWithHeight", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GenesisMetadata { + #[allow(deprecated)] + 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("ibc.core.client.v1.GenesisMetadata", 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 GenesisMetadata { + #[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 = GenesisMetadata; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.GenesisMetadata") + } + + 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(GenesisMetadata { + key: key__.unwrap_or_default(), + value: value__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.GenesisMetadata", 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; + } + let mut struct_ser = serializer.serialize_struct("ibc.core.client.v1.GenesisState", len)?; + if true { + struct_ser.serialize_field("clients", &self.clients)?; + } + if true { + struct_ser.serialize_field("clientsConsensus", &self.clients_consensus)?; + } + if true { + struct_ser.serialize_field("clientsMetadata", &self.clients_metadata)?; + } + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + if true { + struct_ser.serialize_field("createLocalhost", &self.create_localhost)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("nextClientSequence", ::alloc::string::ToString::to_string(&self.next_client_sequence).as_str())?; + } + 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] = &[ + "clients", + "clients_consensus", + "clientsConsensus", + "clients_metadata", + "clientsMetadata", + "params", + "create_localhost", + "createLocalhost", + "next_client_sequence", + "nextClientSequence", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Clients, + ClientsConsensus, + ClientsMetadata, + Params, + CreateLocalhost, + NextClientSequence, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "clients" => Ok(GeneratedField::Clients), + "clientsConsensus" | "clients_consensus" => Ok(GeneratedField::ClientsConsensus), + "clientsMetadata" | "clients_metadata" => Ok(GeneratedField::ClientsMetadata), + "params" => Ok(GeneratedField::Params), + "createLocalhost" | "create_localhost" => Ok(GeneratedField::CreateLocalhost), + "nextClientSequence" | "next_client_sequence" => Ok(GeneratedField::NextClientSequence), + _ => 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 ibc.core.client.v1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut clients__ = None; + let mut clients_consensus__ = None; + let mut clients_metadata__ = None; + let mut params__ = None; + let mut create_localhost__ = None; + let mut next_client_sequence__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Clients => { + if clients__.is_some() { + return Err(serde::de::Error::duplicate_field("clients")); + } + clients__ = Some(map_.next_value()?); + } + GeneratedField::ClientsConsensus => { + if clients_consensus__.is_some() { + return Err(serde::de::Error::duplicate_field("clientsConsensus")); + } + clients_consensus__ = Some(map_.next_value()?); + } + GeneratedField::ClientsMetadata => { + if clients_metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("clientsMetadata")); + } + clients_metadata__ = Some(map_.next_value()?); + } + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + GeneratedField::CreateLocalhost => { + if create_localhost__.is_some() { + return Err(serde::de::Error::duplicate_field("createLocalhost")); + } + create_localhost__ = Some(map_.next_value()?); + } + GeneratedField::NextClientSequence => { + if next_client_sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("nextClientSequence")); + } + next_client_sequence__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(GenesisState { + clients: clients__.unwrap_or_default(), + clients_consensus: clients_consensus__.unwrap_or_default(), + clients_metadata: clients_metadata__.unwrap_or_default(), + params: params__, + create_localhost: create_localhost__.unwrap_or_default(), + next_client_sequence: next_client_sequence__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.GenesisState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Height { + #[allow(deprecated)] + 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("ibc.core.client.v1.Height", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("revisionNumber", ::alloc::string::ToString::to_string(&self.revision_number).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("revisionHeight", ::alloc::string::ToString::to_string(&self.revision_height).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Height { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "revision_number", + "revisionNumber", + "revision_height", + "revisionHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + RevisionNumber, + RevisionHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "revisionNumber" | "revision_number" => Ok(GeneratedField::RevisionNumber), + "revisionHeight" | "revision_height" => Ok(GeneratedField::RevisionHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Height; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.Height") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut revision_number__ = None; + let mut revision_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::RevisionNumber => { + if revision_number__.is_some() { + return Err(serde::de::Error::duplicate_field("revisionNumber")); + } + revision_number__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::RevisionHeight => { + if revision_height__.is_some() { + return Err(serde::de::Error::duplicate_field("revisionHeight")); + } + revision_height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(Height { + revision_number: revision_number__.unwrap_or_default(), + revision_height: revision_height__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.Height", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for IdentifiedClientState { + #[allow(deprecated)] + 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("ibc.core.client.v1.IdentifiedClientState", len)?; + if true { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + if let Some(v) = self.client_state.as_ref() { + struct_ser.serialize_field("clientState", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for IdentifiedClientState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "client_id", + "clientId", + "client_state", + "clientState", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClientId, + ClientState, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + "clientState" | "client_state" => Ok(GeneratedField::ClientState), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = IdentifiedClientState; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.IdentifiedClientState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut client_id__ = None; + let mut client_state__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); + } + client_id__ = Some(map_.next_value()?); + } + GeneratedField::ClientState => { + if client_state__.is_some() { + return Err(serde::de::Error::duplicate_field("clientState")); + } + client_state__ = map_.next_value()?; + } + } + } + Ok(IdentifiedClientState { + client_id: client_id__.unwrap_or_default(), + client_state: client_state__, + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.IdentifiedClientState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for IdentifiedGenesisMetadata { + #[allow(deprecated)] + 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("ibc.core.client.v1.IdentifiedGenesisMetadata", len)?; + if true { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + if true { + struct_ser.serialize_field("clientMetadata", &self.client_metadata)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for IdentifiedGenesisMetadata { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "client_id", + "clientId", + "client_metadata", + "clientMetadata", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClientId, + ClientMetadata, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + "clientMetadata" | "client_metadata" => Ok(GeneratedField::ClientMetadata), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = IdentifiedGenesisMetadata; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.IdentifiedGenesisMetadata") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut client_id__ = None; + let mut client_metadata__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); + } + client_id__ = Some(map_.next_value()?); + } + GeneratedField::ClientMetadata => { + if client_metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("clientMetadata")); + } + client_metadata__ = Some(map_.next_value()?); + } + } + } + Ok(IdentifiedGenesisMetadata { + client_id: client_id__.unwrap_or_default(), + client_metadata: client_metadata__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.IdentifiedGenesisMetadata", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgCreateClient { + #[allow(deprecated)] + 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("ibc.core.client.v1.MsgCreateClient", len)?; + if let Some(v) = self.client_state.as_ref() { + struct_ser.serialize_field("clientState", v)?; + } + if let Some(v) = self.consensus_state.as_ref() { + struct_ser.serialize_field("consensusState", v)?; + } + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgCreateClient { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "client_state", + "clientState", + "consensus_state", + "consensusState", + "signer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClientState, + ConsensusState, + Signer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "clientState" | "client_state" => Ok(GeneratedField::ClientState), + "consensusState" | "consensus_state" => Ok(GeneratedField::ConsensusState), + "signer" => Ok(GeneratedField::Signer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgCreateClient; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.MsgCreateClient") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut client_state__ = None; + let mut consensus_state__ = None; + let mut signer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClientState => { + if client_state__.is_some() { + return Err(serde::de::Error::duplicate_field("clientState")); + } + client_state__ = map_.next_value()?; + } + GeneratedField::ConsensusState => { + if consensus_state__.is_some() { + return Err(serde::de::Error::duplicate_field("consensusState")); + } + consensus_state__ = map_.next_value()?; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + } + } + Ok(MsgCreateClient { + client_state: client_state__, + consensus_state: consensus_state__, + signer: signer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.MsgCreateClient", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgCreateClientResponse { + #[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("ibc.core.client.v1.MsgCreateClientResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgCreateClientResponse { + #[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 = MsgCreateClientResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.MsgCreateClientResponse") + } + + 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(MsgCreateClientResponse { + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.MsgCreateClientResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgIbcSoftwareUpgrade { + #[allow(deprecated)] + 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("ibc.core.client.v1.MsgIBCSoftwareUpgrade", len)?; + if let Some(v) = self.plan.as_ref() { + struct_ser.serialize_field("plan", v)?; + } + if let Some(v) = self.upgraded_client_state.as_ref() { + struct_ser.serialize_field("upgradedClientState", v)?; + } + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgIbcSoftwareUpgrade { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "plan", + "upgraded_client_state", + "upgradedClientState", + "signer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Plan, + UpgradedClientState, + Signer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "upgradedClientState" | "upgraded_client_state" => Ok(GeneratedField::UpgradedClientState), + "signer" => Ok(GeneratedField::Signer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgIbcSoftwareUpgrade; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.MsgIBCSoftwareUpgrade") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut plan__ = None; + let mut upgraded_client_state__ = None; + let mut signer__ = 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()?; + } + GeneratedField::UpgradedClientState => { + if upgraded_client_state__.is_some() { + return Err(serde::de::Error::duplicate_field("upgradedClientState")); + } + upgraded_client_state__ = map_.next_value()?; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + } + } + Ok(MsgIbcSoftwareUpgrade { + plan: plan__, + upgraded_client_state: upgraded_client_state__, + signer: signer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.MsgIBCSoftwareUpgrade", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgIbcSoftwareUpgradeResponse { + #[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("ibc.core.client.v1.MsgIBCSoftwareUpgradeResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgIbcSoftwareUpgradeResponse { + #[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 = MsgIbcSoftwareUpgradeResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.MsgIBCSoftwareUpgradeResponse") + } + + 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(MsgIbcSoftwareUpgradeResponse { + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.MsgIBCSoftwareUpgradeResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgRecoverClient { + #[allow(deprecated)] + 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("ibc.core.client.v1.MsgRecoverClient", len)?; + if true { + struct_ser.serialize_field("subjectClientId", &self.subject_client_id)?; + } + if true { + struct_ser.serialize_field("substituteClientId", &self.substitute_client_id)?; + } + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgRecoverClient { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "subject_client_id", + "subjectClientId", + "substitute_client_id", + "substituteClientId", + "signer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + SubjectClientId, + SubstituteClientId, + Signer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "subjectClientId" | "subject_client_id" => Ok(GeneratedField::SubjectClientId), + "substituteClientId" | "substitute_client_id" => Ok(GeneratedField::SubstituteClientId), + "signer" => Ok(GeneratedField::Signer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgRecoverClient; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.MsgRecoverClient") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut subject_client_id__ = None; + let mut substitute_client_id__ = None; + let mut signer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::SubjectClientId => { + if subject_client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("subjectClientId")); + } + subject_client_id__ = Some(map_.next_value()?); + } + GeneratedField::SubstituteClientId => { + if substitute_client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("substituteClientId")); + } + substitute_client_id__ = Some(map_.next_value()?); + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + } + } + Ok(MsgRecoverClient { + subject_client_id: subject_client_id__.unwrap_or_default(), + substitute_client_id: substitute_client_id__.unwrap_or_default(), + signer: signer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.MsgRecoverClient", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgRecoverClientResponse { + #[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("ibc.core.client.v1.MsgRecoverClientResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgRecoverClientResponse { + #[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 = MsgRecoverClientResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.MsgRecoverClientResponse") + } + + 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(MsgRecoverClientResponse { + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.MsgRecoverClientResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgSubmitMisbehaviour { + #[allow(deprecated)] + 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("ibc.core.client.v1.MsgSubmitMisbehaviour", len)?; + if true { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + if let Some(v) = self.misbehaviour.as_ref() { + struct_ser.serialize_field("misbehaviour", v)?; + } + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgSubmitMisbehaviour { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "client_id", + "clientId", + "misbehaviour", + "signer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClientId, + Misbehaviour, + Signer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + "misbehaviour" => Ok(GeneratedField::Misbehaviour), + "signer" => Ok(GeneratedField::Signer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgSubmitMisbehaviour; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.MsgSubmitMisbehaviour") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut client_id__ = None; + let mut misbehaviour__ = None; + let mut signer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); + } + client_id__ = Some(map_.next_value()?); + } + GeneratedField::Misbehaviour => { + if misbehaviour__.is_some() { + return Err(serde::de::Error::duplicate_field("misbehaviour")); + } + misbehaviour__ = map_.next_value()?; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + } + } + Ok(MsgSubmitMisbehaviour { + client_id: client_id__.unwrap_or_default(), + misbehaviour: misbehaviour__, + signer: signer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.MsgSubmitMisbehaviour", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgSubmitMisbehaviourResponse { + #[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("ibc.core.client.v1.MsgSubmitMisbehaviourResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgSubmitMisbehaviourResponse { + #[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 = MsgSubmitMisbehaviourResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.MsgSubmitMisbehaviourResponse") + } + + 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(MsgSubmitMisbehaviourResponse { + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.MsgSubmitMisbehaviourResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgUpdateClient { + #[allow(deprecated)] + 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("ibc.core.client.v1.MsgUpdateClient", len)?; + if true { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + if let Some(v) = self.client_message.as_ref() { + struct_ser.serialize_field("clientMessage", v)?; + } + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgUpdateClient { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "client_id", + "clientId", + "client_message", + "clientMessage", + "signer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClientId, + ClientMessage, + Signer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + "clientMessage" | "client_message" => Ok(GeneratedField::ClientMessage), + "signer" => Ok(GeneratedField::Signer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgUpdateClient; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.MsgUpdateClient") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut client_id__ = None; + let mut client_message__ = None; + let mut signer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); + } + client_id__ = Some(map_.next_value()?); + } + GeneratedField::ClientMessage => { + if client_message__.is_some() { + return Err(serde::de::Error::duplicate_field("clientMessage")); + } + client_message__ = map_.next_value()?; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + } + } + Ok(MsgUpdateClient { + client_id: client_id__.unwrap_or_default(), + client_message: client_message__, + signer: signer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.MsgUpdateClient", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgUpdateClientResponse { + #[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("ibc.core.client.v1.MsgUpdateClientResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgUpdateClientResponse { + #[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 = MsgUpdateClientResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.MsgUpdateClientResponse") + } + + 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(MsgUpdateClientResponse { + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.MsgUpdateClientResponse", 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("ibc.core.client.v1.MsgUpdateParams", len)?; + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + 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] = &[ + "signer", + "params", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Signer, + 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 { + "signer" => Ok(GeneratedField::Signer), + "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 ibc.core.client.v1.MsgUpdateParams") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut signer__ = None; + let mut params__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + } + } + Ok(MsgUpdateParams { + signer: signer__.unwrap_or_default(), + params: params__, + }) + } + } + deserializer.deserialize_struct("ibc.core.client.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("ibc.core.client.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 ibc.core.client.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("ibc.core.client.v1.MsgUpdateParamsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgUpgradeClient { + #[allow(deprecated)] + 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("ibc.core.client.v1.MsgUpgradeClient", len)?; + if true { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + if let Some(v) = self.client_state.as_ref() { + struct_ser.serialize_field("clientState", v)?; + } + if let Some(v) = self.consensus_state.as_ref() { + struct_ser.serialize_field("consensusState", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proofUpgradeClient", pbjson::private::base64::encode(&self.proof_upgrade_client).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proofUpgradeConsensusState", pbjson::private::base64::encode(&self.proof_upgrade_consensus_state).as_str())?; + } + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgUpgradeClient { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "client_id", + "clientId", + "client_state", + "clientState", + "consensus_state", + "consensusState", + "proof_upgrade_client", + "proofUpgradeClient", + "proof_upgrade_consensus_state", + "proofUpgradeConsensusState", + "signer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClientId, + ClientState, + ConsensusState, + ProofUpgradeClient, + ProofUpgradeConsensusState, + Signer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + "clientState" | "client_state" => Ok(GeneratedField::ClientState), + "consensusState" | "consensus_state" => Ok(GeneratedField::ConsensusState), + "proofUpgradeClient" | "proof_upgrade_client" => Ok(GeneratedField::ProofUpgradeClient), + "proofUpgradeConsensusState" | "proof_upgrade_consensus_state" => Ok(GeneratedField::ProofUpgradeConsensusState), + "signer" => Ok(GeneratedField::Signer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgUpgradeClient; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.MsgUpgradeClient") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut client_id__ = None; + let mut client_state__ = None; + let mut consensus_state__ = None; + let mut proof_upgrade_client__ = None; + let mut proof_upgrade_consensus_state__ = None; + let mut signer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); + } + client_id__ = Some(map_.next_value()?); + } + GeneratedField::ClientState => { + if client_state__.is_some() { + return Err(serde::de::Error::duplicate_field("clientState")); + } + client_state__ = map_.next_value()?; + } + GeneratedField::ConsensusState => { + if consensus_state__.is_some() { + return Err(serde::de::Error::duplicate_field("consensusState")); + } + consensus_state__ = map_.next_value()?; + } + GeneratedField::ProofUpgradeClient => { + if proof_upgrade_client__.is_some() { + return Err(serde::de::Error::duplicate_field("proofUpgradeClient")); + } + proof_upgrade_client__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofUpgradeConsensusState => { + if proof_upgrade_consensus_state__.is_some() { + return Err(serde::de::Error::duplicate_field("proofUpgradeConsensusState")); + } + proof_upgrade_consensus_state__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + } + } + Ok(MsgUpgradeClient { + client_id: client_id__.unwrap_or_default(), + client_state: client_state__, + consensus_state: consensus_state__, + proof_upgrade_client: proof_upgrade_client__.unwrap_or_default(), + proof_upgrade_consensus_state: proof_upgrade_consensus_state__.unwrap_or_default(), + signer: signer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.MsgUpgradeClient", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgUpgradeClientResponse { + #[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("ibc.core.client.v1.MsgUpgradeClientResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgUpgradeClientResponse { + #[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 = MsgUpgradeClientResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.MsgUpgradeClientResponse") + } + + 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(MsgUpgradeClientResponse { + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.MsgUpgradeClientResponse", 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; + } + let mut struct_ser = serializer.serialize_struct("ibc.core.client.v1.Params", len)?; + if true { + struct_ser.serialize_field("allowedClients", &self.allowed_clients)?; + } + 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] = &[ + "allowed_clients", + "allowedClients", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AllowedClients, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "allowedClients" | "allowed_clients" => Ok(GeneratedField::AllowedClients), + _ => 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 ibc.core.client.v1.Params") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut allowed_clients__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::AllowedClients => { + if allowed_clients__.is_some() { + return Err(serde::de::Error::duplicate_field("allowedClients")); + } + allowed_clients__ = Some(map_.next_value()?); + } + } + } + Ok(Params { + allowed_clients: allowed_clients__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.Params", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryClientParamsRequest { + #[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("ibc.core.client.v1.QueryClientParamsRequest", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryClientParamsRequest { + #[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 = QueryClientParamsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.QueryClientParamsRequest") + } + + 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(QueryClientParamsRequest { + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.QueryClientParamsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryClientParamsResponse { + #[allow(deprecated)] + 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("ibc.core.client.v1.QueryClientParamsResponse", len)?; + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryClientParamsResponse { + #[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 = QueryClientParamsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.QueryClientParamsResponse") + } + + 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(QueryClientParamsResponse { + params: params__, + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.QueryClientParamsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryClientStateRequest { + #[allow(deprecated)] + 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("ibc.core.client.v1.QueryClientStateRequest", len)?; + if true { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryClientStateRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "client_id", + "clientId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClientId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryClientStateRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.QueryClientStateRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut client_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); + } + client_id__ = Some(map_.next_value()?); + } + } + } + Ok(QueryClientStateRequest { + client_id: client_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.QueryClientStateRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryClientStateResponse { + #[allow(deprecated)] + 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("ibc.core.client.v1.QueryClientStateResponse", len)?; + if let Some(v) = self.client_state.as_ref() { + struct_ser.serialize_field("clientState", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proof", pbjson::private::base64::encode(&self.proof).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryClientStateResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "client_state", + "clientState", + "proof", + "proof_height", + "proofHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClientState, + Proof, + ProofHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "clientState" | "client_state" => Ok(GeneratedField::ClientState), + "proof" => Ok(GeneratedField::Proof), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryClientStateResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.QueryClientStateResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut client_state__ = None; + let mut proof__ = None; + let mut proof_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClientState => { + if client_state__.is_some() { + return Err(serde::de::Error::duplicate_field("clientState")); + } + client_state__ = map_.next_value()?; + } + GeneratedField::Proof => { + if proof__.is_some() { + return Err(serde::de::Error::duplicate_field("proof")); + } + proof__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + } + } + Ok(QueryClientStateResponse { + client_state: client_state__, + proof: proof__.unwrap_or_default(), + proof_height: proof_height__, + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.QueryClientStateResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryClientStatesRequest { + #[allow(deprecated)] + 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("ibc.core.client.v1.QueryClientStatesRequest", len)?; + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryClientStatesRequest { + #[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 = QueryClientStatesRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.QueryClientStatesRequest") + } + + 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(QueryClientStatesRequest { + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.QueryClientStatesRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryClientStatesResponse { + #[allow(deprecated)] + 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("ibc.core.client.v1.QueryClientStatesResponse", len)?; + if true { + struct_ser.serialize_field("clientStates", &self.client_states)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryClientStatesResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "client_states", + "clientStates", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClientStates, + 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 { + "clientStates" | "client_states" => Ok(GeneratedField::ClientStates), + "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 = QueryClientStatesResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.QueryClientStatesResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut client_states__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClientStates => { + if client_states__.is_some() { + return Err(serde::de::Error::duplicate_field("clientStates")); + } + client_states__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryClientStatesResponse { + client_states: client_states__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.QueryClientStatesResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryClientStatusRequest { + #[allow(deprecated)] + 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("ibc.core.client.v1.QueryClientStatusRequest", len)?; + if true { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryClientStatusRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "client_id", + "clientId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClientId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryClientStatusRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.QueryClientStatusRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut client_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); + } + client_id__ = Some(map_.next_value()?); + } + } + } + Ok(QueryClientStatusRequest { + client_id: client_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.QueryClientStatusRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryClientStatusResponse { + #[allow(deprecated)] + 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("ibc.core.client.v1.QueryClientStatusResponse", len)?; + if true { + struct_ser.serialize_field("status", &self.status)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryClientStatusResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "status", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Status, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryClientStatusResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.QueryClientStatusResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut status__ = 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()?); + } + } + } + Ok(QueryClientStatusResponse { + status: status__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.QueryClientStatusResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryConsensusStateHeightsRequest { + #[allow(deprecated)] + 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("ibc.core.client.v1.QueryConsensusStateHeightsRequest", len)?; + if true { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryConsensusStateHeightsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "client_id", + "clientId", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClientId, + 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 { + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + "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 = QueryConsensusStateHeightsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.QueryConsensusStateHeightsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut client_id__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); + } + client_id__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryConsensusStateHeightsRequest { + client_id: client_id__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.QueryConsensusStateHeightsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryConsensusStateHeightsResponse { + #[allow(deprecated)] + 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("ibc.core.client.v1.QueryConsensusStateHeightsResponse", len)?; + if true { + struct_ser.serialize_field("consensusStateHeights", &self.consensus_state_heights)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryConsensusStateHeightsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "consensus_state_heights", + "consensusStateHeights", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ConsensusStateHeights, + 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 { + "consensusStateHeights" | "consensus_state_heights" => Ok(GeneratedField::ConsensusStateHeights), + "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 = QueryConsensusStateHeightsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.QueryConsensusStateHeightsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut consensus_state_heights__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ConsensusStateHeights => { + if consensus_state_heights__.is_some() { + return Err(serde::de::Error::duplicate_field("consensusStateHeights")); + } + consensus_state_heights__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryConsensusStateHeightsResponse { + consensus_state_heights: consensus_state_heights__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.QueryConsensusStateHeightsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryConsensusStateRequest { + #[allow(deprecated)] + 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("ibc.core.client.v1.QueryConsensusStateRequest", len)?; + if true { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("revisionNumber", ::alloc::string::ToString::to_string(&self.revision_number).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("revisionHeight", ::alloc::string::ToString::to_string(&self.revision_height).as_str())?; + } + if true { + struct_ser.serialize_field("latestHeight", &self.latest_height)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryConsensusStateRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "client_id", + "clientId", + "revision_number", + "revisionNumber", + "revision_height", + "revisionHeight", + "latest_height", + "latestHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClientId, + RevisionNumber, + RevisionHeight, + LatestHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + "revisionNumber" | "revision_number" => Ok(GeneratedField::RevisionNumber), + "revisionHeight" | "revision_height" => Ok(GeneratedField::RevisionHeight), + "latestHeight" | "latest_height" => Ok(GeneratedField::LatestHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryConsensusStateRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.QueryConsensusStateRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut client_id__ = None; + let mut revision_number__ = None; + let mut revision_height__ = None; + let mut latest_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); + } + client_id__ = Some(map_.next_value()?); + } + GeneratedField::RevisionNumber => { + if revision_number__.is_some() { + return Err(serde::de::Error::duplicate_field("revisionNumber")); + } + revision_number__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::RevisionHeight => { + if revision_height__.is_some() { + return Err(serde::de::Error::duplicate_field("revisionHeight")); + } + revision_height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::LatestHeight => { + if latest_height__.is_some() { + return Err(serde::de::Error::duplicate_field("latestHeight")); + } + latest_height__ = Some(map_.next_value()?); + } + } + } + Ok(QueryConsensusStateRequest { + client_id: client_id__.unwrap_or_default(), + revision_number: revision_number__.unwrap_or_default(), + revision_height: revision_height__.unwrap_or_default(), + latest_height: latest_height__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.QueryConsensusStateRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryConsensusStateResponse { + #[allow(deprecated)] + 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("ibc.core.client.v1.QueryConsensusStateResponse", len)?; + if let Some(v) = self.consensus_state.as_ref() { + struct_ser.serialize_field("consensusState", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proof", pbjson::private::base64::encode(&self.proof).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryConsensusStateResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "consensus_state", + "consensusState", + "proof", + "proof_height", + "proofHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ConsensusState, + Proof, + ProofHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "consensusState" | "consensus_state" => Ok(GeneratedField::ConsensusState), + "proof" => Ok(GeneratedField::Proof), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryConsensusStateResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.QueryConsensusStateResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut consensus_state__ = None; + let mut proof__ = None; + let mut proof_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ConsensusState => { + if consensus_state__.is_some() { + return Err(serde::de::Error::duplicate_field("consensusState")); + } + consensus_state__ = map_.next_value()?; + } + GeneratedField::Proof => { + if proof__.is_some() { + return Err(serde::de::Error::duplicate_field("proof")); + } + proof__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + } + } + Ok(QueryConsensusStateResponse { + consensus_state: consensus_state__, + proof: proof__.unwrap_or_default(), + proof_height: proof_height__, + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.QueryConsensusStateResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryConsensusStatesRequest { + #[allow(deprecated)] + 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("ibc.core.client.v1.QueryConsensusStatesRequest", len)?; + if true { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryConsensusStatesRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "client_id", + "clientId", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClientId, + 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 { + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + "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 = QueryConsensusStatesRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.QueryConsensusStatesRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut client_id__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); + } + client_id__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryConsensusStatesRequest { + client_id: client_id__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.QueryConsensusStatesRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryConsensusStatesResponse { + #[allow(deprecated)] + 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("ibc.core.client.v1.QueryConsensusStatesResponse", len)?; + if true { + struct_ser.serialize_field("consensusStates", &self.consensus_states)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryConsensusStatesResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "consensus_states", + "consensusStates", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ConsensusStates, + 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 { + "consensusStates" | "consensus_states" => Ok(GeneratedField::ConsensusStates), + "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 = QueryConsensusStatesResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.QueryConsensusStatesResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut consensus_states__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ConsensusStates => { + if consensus_states__.is_some() { + return Err(serde::de::Error::duplicate_field("consensusStates")); + } + consensus_states__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryConsensusStatesResponse { + consensus_states: consensus_states__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.QueryConsensusStatesResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryUpgradedClientStateRequest { + #[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("ibc.core.client.v1.QueryUpgradedClientStateRequest", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryUpgradedClientStateRequest { + #[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 = QueryUpgradedClientStateRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.QueryUpgradedClientStateRequest") + } + + 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(QueryUpgradedClientStateRequest { + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.QueryUpgradedClientStateRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryUpgradedClientStateResponse { + #[allow(deprecated)] + 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("ibc.core.client.v1.QueryUpgradedClientStateResponse", len)?; + 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 QueryUpgradedClientStateResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "upgraded_client_state", + "upgradedClientState", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + 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 { + "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 = QueryUpgradedClientStateResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.QueryUpgradedClientStateResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut upgraded_client_state__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::UpgradedClientState => { + if upgraded_client_state__.is_some() { + return Err(serde::de::Error::duplicate_field("upgradedClientState")); + } + upgraded_client_state__ = map_.next_value()?; + } + } + } + Ok(QueryUpgradedClientStateResponse { + upgraded_client_state: upgraded_client_state__, + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.QueryUpgradedClientStateResponse", 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 len = 0; + let struct_ser = serializer.serialize_struct("ibc.core.client.v1.QueryUpgradedConsensusStateRequest", len)?; + 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] = &[ + ]; + + #[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 = QueryUpgradedConsensusStateRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.QueryUpgradedConsensusStateRequest") + } + + 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(QueryUpgradedConsensusStateRequest { + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.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("ibc.core.client.v1.QueryUpgradedConsensusStateResponse", len)?; + if let Some(v) = self.upgraded_consensus_state.as_ref() { + struct_ser.serialize_field("upgradedConsensusState", v)?; + } + 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 ibc.core.client.v1.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__ = map_.next_value()?; + } + } + } + Ok(QueryUpgradedConsensusStateResponse { + upgraded_consensus_state: upgraded_consensus_state__, + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.QueryUpgradedConsensusStateResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for UpgradeProposal { + #[allow(deprecated)] + 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("ibc.core.client.v1.UpgradeProposal", 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)?; + } + 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 UpgradeProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "title", + "description", + "plan", + "upgraded_client_state", + "upgradedClientState", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Title, + Description, + Plan, + 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 { + "title" => Ok(GeneratedField::Title), + "description" => Ok(GeneratedField::Description), + "plan" => Ok(GeneratedField::Plan), + "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 = UpgradeProposal; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.UpgradeProposal") + } + + 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; + let mut upgraded_client_state__ = 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()?; + } + GeneratedField::UpgradedClientState => { + if upgraded_client_state__.is_some() { + return Err(serde::de::Error::duplicate_field("upgradedClientState")); + } + upgraded_client_state__ = map_.next_value()?; + } + } + } + Ok(UpgradeProposal { + title: title__.unwrap_or_default(), + description: description__.unwrap_or_default(), + plan: plan__, + upgraded_client_state: upgraded_client_state__, + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.UpgradeProposal", FIELDS, GeneratedVisitor) + } +} diff --git a/src/prost/ibc.core.commitment.v1.rs b/src/prost/ibc.core.commitment.v1.rs index 0ad8d2bf..3045d902 100644 --- a/src/prost/ibc.core.commitment.v1.rs +++ b/src/prost/ibc.core.commitment.v1.rs @@ -1,6 +1,5 @@ /// MerkleRoot defines a merkle root hash. /// In the Cosmos SDK, the AppHash of a block header becomes the root. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[cfg_attr( all(feature = "json-schema", feature = "serde"), derive(::schemars::JsonSchema) @@ -9,17 +8,22 @@ #[derive(Clone, PartialEq, ::prost::Message)] pub struct MerkleRoot { #[prost(bytes = "vec", tag = "1")] - #[cfg_attr(feature = "serde", serde(with = "crate::base64"))] #[cfg_attr( all(feature = "json-schema", feature = "serde"), schemars(with = "String") )] pub hash: ::prost::alloc::vec::Vec, } +impl ::prost::Name for MerkleRoot { + const NAME: &'static str = "MerkleRoot"; + const PACKAGE: &'static str = "ibc.core.commitment.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.commitment.v1.{}", Self::NAME) + } +} /// MerklePrefix is merkle path prefixed to the key. /// The constructed key from the Path and the key will be append(Path.KeyPath, /// append(Path.KeyPrefix, key...)) -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[cfg_attr( all(feature = "json-schema", feature = "serde"), derive(::schemars::JsonSchema) @@ -28,29 +32,40 @@ pub struct MerkleRoot { #[derive(Clone, PartialEq, ::prost::Message)] pub struct MerklePrefix { #[prost(bytes = "vec", tag = "1")] - #[cfg_attr(feature = "serde", serde(with = "crate::base64"))] #[cfg_attr( all(feature = "json-schema", feature = "serde"), schemars(with = "String") )] pub key_prefix: ::prost::alloc::vec::Vec, } +impl ::prost::Name for MerklePrefix { + const NAME: &'static str = "MerklePrefix"; + const PACKAGE: &'static str = "ibc.core.commitment.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.commitment.v1.{}", Self::NAME) + } +} /// MerklePath is the path used to verify commitment proofs, which can be an /// arbitrary structured object (defined by a commitment type). /// MerklePath is represented from root-to-leaf -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MerklePath { #[prost(string, repeated, tag = "1")] pub key_path: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +impl ::prost::Name for MerklePath { + const NAME: &'static str = "MerklePath"; + const PACKAGE: &'static str = "ibc.core.commitment.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.commitment.v1.{}", Self::NAME) + } +} /// MerkleProof is a wrapper type over a chain of CommitmentProofs. /// It demonstrates membership or non-membership for an element or set of /// elements, verifiable in conjunction with a known commitment root. Proofs /// should be succinct. /// MerkleProofs are ordered from leaf-to-root -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MerkleProof { @@ -59,3 +74,10 @@ pub struct MerkleProof { super::super::super::super::cosmos::ics23::v1::CommitmentProof, >, } +impl ::prost::Name for MerkleProof { + const NAME: &'static str = "MerkleProof"; + const PACKAGE: &'static str = "ibc.core.commitment.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.commitment.v1.{}", Self::NAME) + } +} diff --git a/src/prost/ibc.core.commitment.v1.serde.rs b/src/prost/ibc.core.commitment.v1.serde.rs new file mode 100644 index 00000000..9173f7e8 --- /dev/null +++ b/src/prost/ibc.core.commitment.v1.serde.rs @@ -0,0 +1,372 @@ +impl serde::Serialize for MerklePath { + #[allow(deprecated)] + 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("ibc.core.commitment.v1.MerklePath", len)?; + if true { + struct_ser.serialize_field("keyPath", &self.key_path)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MerklePath { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "key_path", + "keyPath", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + KeyPath, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "keyPath" | "key_path" => Ok(GeneratedField::KeyPath), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MerklePath; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.commitment.v1.MerklePath") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut key_path__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::KeyPath => { + if key_path__.is_some() { + return Err(serde::de::Error::duplicate_field("keyPath")); + } + key_path__ = Some(map_.next_value()?); + } + } + } + Ok(MerklePath { + key_path: key_path__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.commitment.v1.MerklePath", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MerklePrefix { + #[allow(deprecated)] + 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("ibc.core.commitment.v1.MerklePrefix", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("keyPrefix", pbjson::private::base64::encode(&self.key_prefix).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MerklePrefix { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "key_prefix", + "keyPrefix", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + KeyPrefix, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "keyPrefix" | "key_prefix" => Ok(GeneratedField::KeyPrefix), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MerklePrefix; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.commitment.v1.MerklePrefix") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut key_prefix__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::KeyPrefix => { + if key_prefix__.is_some() { + return Err(serde::de::Error::duplicate_field("keyPrefix")); + } + key_prefix__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(MerklePrefix { + key_prefix: key_prefix__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.commitment.v1.MerklePrefix", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MerkleProof { + #[allow(deprecated)] + 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("ibc.core.commitment.v1.MerkleProof", len)?; + if true { + struct_ser.serialize_field("proofs", &self.proofs)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MerkleProof { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proofs", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Proofs, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proofs" => Ok(GeneratedField::Proofs), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MerkleProof; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.commitment.v1.MerkleProof") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proofs__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Proofs => { + if proofs__.is_some() { + return Err(serde::de::Error::duplicate_field("proofs")); + } + proofs__ = Some(map_.next_value()?); + } + } + } + Ok(MerkleProof { + proofs: proofs__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.commitment.v1.MerkleProof", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MerkleRoot { + #[allow(deprecated)] + 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("ibc.core.commitment.v1.MerkleRoot", len)?; + 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 MerkleRoot { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "hash", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + 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 { + "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 = MerkleRoot; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.commitment.v1.MerkleRoot") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut hash__ = 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::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(MerkleRoot { + hash: hash__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.commitment.v1.MerkleRoot", FIELDS, GeneratedVisitor) + } +} diff --git a/src/prost/ibc.core.connection.v1.rs b/src/prost/ibc.core.connection.v1.rs index 12cc3618..dff9ada1 100644 --- a/src/prost/ibc.core.connection.v1.rs +++ b/src/prost/ibc.core.connection.v1.rs @@ -2,7 +2,6 @@ /// separate one. /// NOTE: there must only be 2 defined ConnectionEnds to establish /// a connection between two chains. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[cfg_attr( all(feature = "json-schema", feature = "serde"), derive(::schemars::JsonSchema) @@ -29,9 +28,15 @@ pub struct ConnectionEnd { #[prost(uint64, tag = "5")] pub delay_period: u64, } +impl ::prost::Name for ConnectionEnd { + const NAME: &'static str = "ConnectionEnd"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} /// IdentifiedConnection defines a connection with additional connection /// identifier field. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IdentifiedConnection { @@ -55,8 +60,14 @@ pub struct IdentifiedConnection { #[prost(uint64, tag = "6")] pub delay_period: u64, } +impl ::prost::Name for IdentifiedConnection { + const NAME: &'static str = "IdentifiedConnection"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} /// Counterparty defines the counterparty chain associated with a connection end. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[cfg_attr( all(feature = "json-schema", feature = "serde"), derive(::schemars::JsonSchema) @@ -76,8 +87,14 @@ pub struct Counterparty { #[prost(message, optional, tag = "3")] pub prefix: ::core::option::Option, } +impl ::prost::Name for Counterparty { + const NAME: &'static str = "Counterparty"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} /// ClientPaths define all the connection paths for a client state. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ClientPaths { @@ -85,8 +102,14 @@ pub struct ClientPaths { #[prost(string, repeated, tag = "1")] pub paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +impl ::prost::Name for ClientPaths { + const NAME: &'static str = "ClientPaths"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} /// ConnectionPaths define all the connection paths for a given client state. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConnectionPaths { @@ -97,9 +120,15 @@ pub struct ConnectionPaths { #[prost(string, repeated, tag = "2")] pub paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } -/// Version defines the versioning scheme used to negotiate the IBC verison in +impl ::prost::Name for ConnectionPaths { + const NAME: &'static str = "ConnectionPaths"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} +/// Version defines the versioning scheme used to negotiate the IBC version in /// the connection handshake. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[cfg_attr( all(feature = "json-schema", feature = "serde"), derive(::schemars::JsonSchema) @@ -114,8 +143,14 @@ pub struct Version { #[prost(string, repeated, tag = "2")] pub features: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +impl ::prost::Name for Version { + const NAME: &'static str = "Version"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} /// Params defines the set of Connection parameters. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -125,9 +160,15 @@ pub struct Params { #[prost(uint64, tag = "1")] pub max_expected_time_per_block: u64, } +impl ::prost::Name for Params { + const NAME: &'static str = "Params"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} /// State defines if a connection is in one of the following states: /// INIT, TRYOPEN, OPEN or UNINITIALIZED. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum State { @@ -166,7 +207,6 @@ impl State { } } /// GenesisState defines the ibc connection submodule's genesis state. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -180,9 +220,15 @@ pub struct GenesisState { #[prost(message, optional, tag = "4")] pub params: ::core::option::Option, } +impl ::prost::Name for GenesisState { + const NAME: &'static str = "GenesisState"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} /// MsgConnectionOpenInit defines the msg sent by an account on Chain A to /// initialize a connection with Chain B. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenInit { @@ -197,15 +243,27 @@ pub struct MsgConnectionOpenInit { #[prost(string, tag = "5")] pub signer: ::prost::alloc::string::String, } +impl ::prost::Name for MsgConnectionOpenInit { + const NAME: &'static str = "MsgConnectionOpenInit"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} /// MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response /// type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenInitResponse {} +impl ::prost::Name for MsgConnectionOpenInitResponse { + const NAME: &'static str = "MsgConnectionOpenInitResponse"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} /// MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a /// connection on Chain B. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenTry { @@ -227,7 +285,7 @@ pub struct MsgConnectionOpenTry { pub counterparty_versions: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "7")] pub proof_height: ::core::option::Option, - /// proof of the initialization the connection on Chain A: `UNITIALIZED -> + /// proof of the initialization the connection on Chain A: `UNINITIALIZED -> /// INIT` #[prost(bytes = "vec", tag = "8")] pub proof_init: ::prost::alloc::vec::Vec, @@ -245,14 +303,26 @@ pub struct MsgConnectionOpenTry { #[prost(bytes = "vec", tag = "13")] pub host_consensus_state_proof: ::prost::alloc::vec::Vec, } +impl ::prost::Name for MsgConnectionOpenTry { + const NAME: &'static str = "MsgConnectionOpenTry"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} /// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenTryResponse {} +impl ::prost::Name for MsgConnectionOpenTryResponse { + const NAME: &'static str = "MsgConnectionOpenTryResponse"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} /// MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to /// acknowledge the change of connection state to TRYOPEN on Chain B. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenAck { @@ -268,7 +338,7 @@ pub struct MsgConnectionOpenAck { >, #[prost(message, optional, tag = "5")] pub proof_height: ::core::option::Option, - /// proof of the initialization the connection on Chain B: `UNITIALIZED -> + /// proof of the initialization the connection on Chain B: `UNINITIALIZED -> /// TRYOPEN` #[prost(bytes = "vec", tag = "6")] pub proof_try: ::prost::alloc::vec::Vec, @@ -286,14 +356,26 @@ pub struct MsgConnectionOpenAck { #[prost(bytes = "vec", tag = "11")] pub host_consensus_state_proof: ::prost::alloc::vec::Vec, } +impl ::prost::Name for MsgConnectionOpenAck { + const NAME: &'static str = "MsgConnectionOpenAck"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} /// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenAckResponse {} +impl ::prost::Name for MsgConnectionOpenAckResponse { + const NAME: &'static str = "MsgConnectionOpenAckResponse"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} /// MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to /// acknowledge the change of connection state to OPEN on Chain A. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenConfirm { @@ -307,14 +389,26 @@ pub struct MsgConnectionOpenConfirm { #[prost(string, tag = "4")] pub signer: ::prost::alloc::string::String, } +impl ::prost::Name for MsgConnectionOpenConfirm { + const NAME: &'static str = "MsgConnectionOpenConfirm"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} /// MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm /// response type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenConfirmResponse {} +impl ::prost::Name for MsgConnectionOpenConfirmResponse { + const NAME: &'static str = "MsgConnectionOpenConfirmResponse"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} /// MsgUpdateParams defines the sdk.Msg type to update the connection parameters. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -327,11 +421,24 @@ pub struct MsgUpdateParams { #[prost(message, optional, tag = "2")] pub params: ::core::option::Option, } +impl ::prost::Name for MsgUpdateParams { + const NAME: &'static str = "MsgUpdateParams"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} /// MsgUpdateParamsResponse defines the MsgUpdateParams response type. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} +impl ::prost::Name for MsgUpdateParamsResponse { + const NAME: &'static str = "MsgUpdateParamsResponse"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod msg_client { @@ -967,7 +1074,6 @@ pub mod msg_server { } /// QueryConnectionRequest is the request type for the Query/Connection RPC /// method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionRequest { @@ -975,10 +1081,16 @@ pub struct QueryConnectionRequest { #[prost(string, tag = "1")] pub connection_id: ::prost::alloc::string::String, } +impl ::prost::Name for QueryConnectionRequest { + const NAME: &'static str = "QueryConnectionRequest"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} /// QueryConnectionResponse is the response type for the Query/Connection RPC /// method. Besides the connection end, it includes a proof and the height from /// which the proof was retrieved. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionResponse { @@ -992,9 +1104,15 @@ pub struct QueryConnectionResponse { #[prost(message, optional, tag = "3")] pub proof_height: ::core::option::Option, } +impl ::prost::Name for QueryConnectionResponse { + const NAME: &'static str = "QueryConnectionResponse"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} /// QueryConnectionsRequest is the request type for the Query/Connections RPC /// method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionsRequest { @@ -1003,9 +1121,15 @@ pub struct QueryConnectionsRequest { super::super::super::super::cosmos::base::query::v1beta1::PageRequest, >, } +impl ::prost::Name for QueryConnectionsRequest { + const NAME: &'static str = "QueryConnectionsRequest"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} /// QueryConnectionsResponse is the response type for the Query/Connections RPC /// method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionsResponse { @@ -1021,9 +1145,15 @@ pub struct QueryConnectionsResponse { #[prost(message, optional, tag = "3")] pub height: ::core::option::Option, } +impl ::prost::Name for QueryConnectionsResponse { + const NAME: &'static str = "QueryConnectionsResponse"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} /// QueryClientConnectionsRequest is the request type for the /// Query/ClientConnections RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientConnectionsRequest { @@ -1031,9 +1161,15 @@ pub struct QueryClientConnectionsRequest { #[prost(string, tag = "1")] pub client_id: ::prost::alloc::string::String, } +impl ::prost::Name for QueryClientConnectionsRequest { + const NAME: &'static str = "QueryClientConnectionsRequest"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} /// QueryClientConnectionsResponse is the response type for the /// Query/ClientConnections RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientConnectionsResponse { @@ -1047,9 +1183,15 @@ pub struct QueryClientConnectionsResponse { #[prost(message, optional, tag = "3")] pub proof_height: ::core::option::Option, } +impl ::prost::Name for QueryClientConnectionsResponse { + const NAME: &'static str = "QueryClientConnectionsResponse"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} /// QueryConnectionClientStateRequest is the request type for the /// Query/ConnectionClientState RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionClientStateRequest { @@ -1057,9 +1199,15 @@ pub struct QueryConnectionClientStateRequest { #[prost(string, tag = "1")] pub connection_id: ::prost::alloc::string::String, } +impl ::prost::Name for QueryConnectionClientStateRequest { + const NAME: &'static str = "QueryConnectionClientStateRequest"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} /// QueryConnectionClientStateResponse is the response type for the /// Query/ConnectionClientState RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionClientStateResponse { @@ -1075,9 +1223,15 @@ pub struct QueryConnectionClientStateResponse { #[prost(message, optional, tag = "3")] pub proof_height: ::core::option::Option, } +impl ::prost::Name for QueryConnectionClientStateResponse { + const NAME: &'static str = "QueryConnectionClientStateResponse"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} /// QueryConnectionConsensusStateRequest is the request type for the /// Query/ConnectionConsensusState RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionConsensusStateRequest { @@ -1089,9 +1243,15 @@ pub struct QueryConnectionConsensusStateRequest { #[prost(uint64, tag = "3")] pub revision_height: u64, } +impl ::prost::Name for QueryConnectionConsensusStateRequest { + const NAME: &'static str = "QueryConnectionConsensusStateRequest"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} /// QueryConnectionConsensusStateResponse is the response type for the /// Query/ConnectionConsensusState RPC method -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionConsensusStateResponse { @@ -1110,13 +1270,25 @@ pub struct QueryConnectionConsensusStateResponse { #[prost(message, optional, tag = "4")] pub proof_height: ::core::option::Option, } +impl ::prost::Name for QueryConnectionConsensusStateResponse { + const NAME: &'static str = "QueryConnectionConsensusStateResponse"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} /// QueryConnectionParamsRequest is the request type for the Query/ConnectionParams RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionParamsRequest {} +impl ::prost::Name for QueryConnectionParamsRequest { + const NAME: &'static str = "QueryConnectionParamsRequest"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} /// QueryConnectionParamsResponse is the response type for the Query/ConnectionParams RPC method. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionParamsResponse { @@ -1124,6 +1296,13 @@ pub struct QueryConnectionParamsResponse { #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } +impl ::prost::Name for QueryConnectionParamsResponse { + const NAME: &'static str = "QueryConnectionParamsResponse"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod query_client { diff --git a/src/prost/ibc.core.connection.v1.serde.rs b/src/prost/ibc.core.connection.v1.serde.rs new file mode 100644 index 00000000..8f45f9be --- /dev/null +++ b/src/prost/ibc.core.connection.v1.serde.rs @@ -0,0 +1,3806 @@ +impl serde::Serialize for ClientPaths { + #[allow(deprecated)] + 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("ibc.core.connection.v1.ClientPaths", len)?; + if true { + struct_ser.serialize_field("paths", &self.paths)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ClientPaths { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "paths", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Paths, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "paths" => Ok(GeneratedField::Paths), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ClientPaths; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.connection.v1.ClientPaths") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut paths__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Paths => { + if paths__.is_some() { + return Err(serde::de::Error::duplicate_field("paths")); + } + paths__ = Some(map_.next_value()?); + } + } + } + Ok(ClientPaths { + paths: paths__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.connection.v1.ClientPaths", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ConnectionEnd { + #[allow(deprecated)] + 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("ibc.core.connection.v1.ConnectionEnd", len)?; + if true { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + if true { + struct_ser.serialize_field("versions", &self.versions)?; + } + if true { + let v = State::try_from(self.state) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.state)))?; + struct_ser.serialize_field("state", &v)?; + } + if let Some(v) = self.counterparty.as_ref() { + struct_ser.serialize_field("counterparty", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("delayPeriod", ::alloc::string::ToString::to_string(&self.delay_period).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ConnectionEnd { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "client_id", + "clientId", + "versions", + "state", + "counterparty", + "delay_period", + "delayPeriod", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClientId, + Versions, + State, + Counterparty, + DelayPeriod, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + "versions" => Ok(GeneratedField::Versions), + "state" => Ok(GeneratedField::State), + "counterparty" => Ok(GeneratedField::Counterparty), + "delayPeriod" | "delay_period" => Ok(GeneratedField::DelayPeriod), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ConnectionEnd; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.connection.v1.ConnectionEnd") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut client_id__ = None; + let mut versions__ = None; + let mut state__ = None; + let mut counterparty__ = None; + let mut delay_period__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); + } + client_id__ = Some(map_.next_value()?); + } + GeneratedField::Versions => { + if versions__.is_some() { + return Err(serde::de::Error::duplicate_field("versions")); + } + versions__ = Some(map_.next_value()?); + } + GeneratedField::State => { + if state__.is_some() { + return Err(serde::de::Error::duplicate_field("state")); + } + state__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Counterparty => { + if counterparty__.is_some() { + return Err(serde::de::Error::duplicate_field("counterparty")); + } + counterparty__ = map_.next_value()?; + } + GeneratedField::DelayPeriod => { + if delay_period__.is_some() { + return Err(serde::de::Error::duplicate_field("delayPeriod")); + } + delay_period__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(ConnectionEnd { + client_id: client_id__.unwrap_or_default(), + versions: versions__.unwrap_or_default(), + state: state__.unwrap_or_default(), + counterparty: counterparty__, + delay_period: delay_period__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.connection.v1.ConnectionEnd", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ConnectionPaths { + #[allow(deprecated)] + 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("ibc.core.connection.v1.ConnectionPaths", len)?; + if true { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + if true { + struct_ser.serialize_field("paths", &self.paths)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ConnectionPaths { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "client_id", + "clientId", + "paths", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClientId, + Paths, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + "paths" => Ok(GeneratedField::Paths), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ConnectionPaths; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.connection.v1.ConnectionPaths") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut client_id__ = None; + let mut paths__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); + } + client_id__ = Some(map_.next_value()?); + } + GeneratedField::Paths => { + if paths__.is_some() { + return Err(serde::de::Error::duplicate_field("paths")); + } + paths__ = Some(map_.next_value()?); + } + } + } + Ok(ConnectionPaths { + client_id: client_id__.unwrap_or_default(), + paths: paths__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.connection.v1.ConnectionPaths", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Counterparty { + #[allow(deprecated)] + 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("ibc.core.connection.v1.Counterparty", len)?; + if true { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + if true { + struct_ser.serialize_field("connectionId", &self.connection_id)?; + } + if let Some(v) = self.prefix.as_ref() { + struct_ser.serialize_field("prefix", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Counterparty { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "client_id", + "clientId", + "connection_id", + "connectionId", + "prefix", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClientId, + ConnectionId, + 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 { + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + "connectionId" | "connection_id" => Ok(GeneratedField::ConnectionId), + "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 = Counterparty; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.connection.v1.Counterparty") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut client_id__ = None; + let mut connection_id__ = None; + let mut prefix__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); + } + client_id__ = Some(map_.next_value()?); + } + GeneratedField::ConnectionId => { + if connection_id__.is_some() { + return Err(serde::de::Error::duplicate_field("connectionId")); + } + connection_id__ = Some(map_.next_value()?); + } + GeneratedField::Prefix => { + if prefix__.is_some() { + return Err(serde::de::Error::duplicate_field("prefix")); + } + prefix__ = map_.next_value()?; + } + } + } + Ok(Counterparty { + client_id: client_id__.unwrap_or_default(), + connection_id: connection_id__.unwrap_or_default(), + prefix: prefix__, + }) + } + } + deserializer.deserialize_struct("ibc.core.connection.v1.Counterparty", 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; + } + let mut struct_ser = serializer.serialize_struct("ibc.core.connection.v1.GenesisState", len)?; + if true { + struct_ser.serialize_field("connections", &self.connections)?; + } + if true { + struct_ser.serialize_field("clientConnectionPaths", &self.client_connection_paths)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("nextConnectionSequence", ::alloc::string::ToString::to_string(&self.next_connection_sequence).as_str())?; + } + 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] = &[ + "connections", + "client_connection_paths", + "clientConnectionPaths", + "next_connection_sequence", + "nextConnectionSequence", + "params", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Connections, + ClientConnectionPaths, + NextConnectionSequence, + 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 { + "connections" => Ok(GeneratedField::Connections), + "clientConnectionPaths" | "client_connection_paths" => Ok(GeneratedField::ClientConnectionPaths), + "nextConnectionSequence" | "next_connection_sequence" => Ok(GeneratedField::NextConnectionSequence), + "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 ibc.core.connection.v1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut connections__ = None; + let mut client_connection_paths__ = None; + let mut next_connection_sequence__ = None; + let mut params__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Connections => { + if connections__.is_some() { + return Err(serde::de::Error::duplicate_field("connections")); + } + connections__ = Some(map_.next_value()?); + } + GeneratedField::ClientConnectionPaths => { + if client_connection_paths__.is_some() { + return Err(serde::de::Error::duplicate_field("clientConnectionPaths")); + } + client_connection_paths__ = Some(map_.next_value()?); + } + GeneratedField::NextConnectionSequence => { + if next_connection_sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("nextConnectionSequence")); + } + next_connection_sequence__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + } + } + Ok(GenesisState { + connections: connections__.unwrap_or_default(), + client_connection_paths: client_connection_paths__.unwrap_or_default(), + next_connection_sequence: next_connection_sequence__.unwrap_or_default(), + params: params__, + }) + } + } + deserializer.deserialize_struct("ibc.core.connection.v1.GenesisState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for IdentifiedConnection { + #[allow(deprecated)] + 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("ibc.core.connection.v1.IdentifiedConnection", len)?; + if true { + struct_ser.serialize_field("id", &self.id)?; + } + if true { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + if true { + struct_ser.serialize_field("versions", &self.versions)?; + } + if true { + let v = State::try_from(self.state) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.state)))?; + struct_ser.serialize_field("state", &v)?; + } + if let Some(v) = self.counterparty.as_ref() { + struct_ser.serialize_field("counterparty", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("delayPeriod", ::alloc::string::ToString::to_string(&self.delay_period).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for IdentifiedConnection { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "id", + "client_id", + "clientId", + "versions", + "state", + "counterparty", + "delay_period", + "delayPeriod", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Id, + ClientId, + Versions, + State, + Counterparty, + DelayPeriod, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + "versions" => Ok(GeneratedField::Versions), + "state" => Ok(GeneratedField::State), + "counterparty" => Ok(GeneratedField::Counterparty), + "delayPeriod" | "delay_period" => Ok(GeneratedField::DelayPeriod), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = IdentifiedConnection; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.connection.v1.IdentifiedConnection") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut id__ = None; + let mut client_id__ = None; + let mut versions__ = None; + let mut state__ = None; + let mut counterparty__ = None; + let mut delay_period__ = 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()?); + } + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); + } + client_id__ = Some(map_.next_value()?); + } + GeneratedField::Versions => { + if versions__.is_some() { + return Err(serde::de::Error::duplicate_field("versions")); + } + versions__ = Some(map_.next_value()?); + } + GeneratedField::State => { + if state__.is_some() { + return Err(serde::de::Error::duplicate_field("state")); + } + state__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Counterparty => { + if counterparty__.is_some() { + return Err(serde::de::Error::duplicate_field("counterparty")); + } + counterparty__ = map_.next_value()?; + } + GeneratedField::DelayPeriod => { + if delay_period__.is_some() { + return Err(serde::de::Error::duplicate_field("delayPeriod")); + } + delay_period__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(IdentifiedConnection { + id: id__.unwrap_or_default(), + client_id: client_id__.unwrap_or_default(), + versions: versions__.unwrap_or_default(), + state: state__.unwrap_or_default(), + counterparty: counterparty__, + delay_period: delay_period__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.connection.v1.IdentifiedConnection", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgConnectionOpenAck { + #[allow(deprecated)] + 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("ibc.core.connection.v1.MsgConnectionOpenAck", len)?; + if true { + struct_ser.serialize_field("connectionId", &self.connection_id)?; + } + if true { + struct_ser.serialize_field("counterpartyConnectionId", &self.counterparty_connection_id)?; + } + if let Some(v) = self.version.as_ref() { + struct_ser.serialize_field("version", v)?; + } + if let Some(v) = self.client_state.as_ref() { + struct_ser.serialize_field("clientState", v)?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proofTry", pbjson::private::base64::encode(&self.proof_try).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proofClient", pbjson::private::base64::encode(&self.proof_client).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proofConsensus", pbjson::private::base64::encode(&self.proof_consensus).as_str())?; + } + if let Some(v) = self.consensus_height.as_ref() { + struct_ser.serialize_field("consensusHeight", v)?; + } + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("hostConsensusStateProof", pbjson::private::base64::encode(&self.host_consensus_state_proof).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgConnectionOpenAck { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "connection_id", + "connectionId", + "counterparty_connection_id", + "counterpartyConnectionId", + "version", + "client_state", + "clientState", + "proof_height", + "proofHeight", + "proof_try", + "proofTry", + "proof_client", + "proofClient", + "proof_consensus", + "proofConsensus", + "consensus_height", + "consensusHeight", + "signer", + "host_consensus_state_proof", + "hostConsensusStateProof", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ConnectionId, + CounterpartyConnectionId, + Version, + ClientState, + ProofHeight, + ProofTry, + ProofClient, + ProofConsensus, + ConsensusHeight, + Signer, + HostConsensusStateProof, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "connectionId" | "connection_id" => Ok(GeneratedField::ConnectionId), + "counterpartyConnectionId" | "counterparty_connection_id" => Ok(GeneratedField::CounterpartyConnectionId), + "version" => Ok(GeneratedField::Version), + "clientState" | "client_state" => Ok(GeneratedField::ClientState), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + "proofTry" | "proof_try" => Ok(GeneratedField::ProofTry), + "proofClient" | "proof_client" => Ok(GeneratedField::ProofClient), + "proofConsensus" | "proof_consensus" => Ok(GeneratedField::ProofConsensus), + "consensusHeight" | "consensus_height" => Ok(GeneratedField::ConsensusHeight), + "signer" => Ok(GeneratedField::Signer), + "hostConsensusStateProof" | "host_consensus_state_proof" => Ok(GeneratedField::HostConsensusStateProof), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgConnectionOpenAck; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.connection.v1.MsgConnectionOpenAck") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut connection_id__ = None; + let mut counterparty_connection_id__ = None; + let mut version__ = None; + let mut client_state__ = None; + let mut proof_height__ = None; + let mut proof_try__ = None; + let mut proof_client__ = None; + let mut proof_consensus__ = None; + let mut consensus_height__ = None; + let mut signer__ = None; + let mut host_consensus_state_proof__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ConnectionId => { + if connection_id__.is_some() { + return Err(serde::de::Error::duplicate_field("connectionId")); + } + connection_id__ = Some(map_.next_value()?); + } + GeneratedField::CounterpartyConnectionId => { + if counterparty_connection_id__.is_some() { + return Err(serde::de::Error::duplicate_field("counterpartyConnectionId")); + } + counterparty_connection_id__ = Some(map_.next_value()?); + } + GeneratedField::Version => { + if version__.is_some() { + return Err(serde::de::Error::duplicate_field("version")); + } + version__ = map_.next_value()?; + } + GeneratedField::ClientState => { + if client_state__.is_some() { + return Err(serde::de::Error::duplicate_field("clientState")); + } + client_state__ = map_.next_value()?; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + GeneratedField::ProofTry => { + if proof_try__.is_some() { + return Err(serde::de::Error::duplicate_field("proofTry")); + } + proof_try__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofClient => { + if proof_client__.is_some() { + return Err(serde::de::Error::duplicate_field("proofClient")); + } + proof_client__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofConsensus => { + if proof_consensus__.is_some() { + return Err(serde::de::Error::duplicate_field("proofConsensus")); + } + proof_consensus__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ConsensusHeight => { + if consensus_height__.is_some() { + return Err(serde::de::Error::duplicate_field("consensusHeight")); + } + consensus_height__ = map_.next_value()?; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + GeneratedField::HostConsensusStateProof => { + if host_consensus_state_proof__.is_some() { + return Err(serde::de::Error::duplicate_field("hostConsensusStateProof")); + } + host_consensus_state_proof__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgConnectionOpenAck { + connection_id: connection_id__.unwrap_or_default(), + counterparty_connection_id: counterparty_connection_id__.unwrap_or_default(), + version: version__, + client_state: client_state__, + proof_height: proof_height__, + proof_try: proof_try__.unwrap_or_default(), + proof_client: proof_client__.unwrap_or_default(), + proof_consensus: proof_consensus__.unwrap_or_default(), + consensus_height: consensus_height__, + signer: signer__.unwrap_or_default(), + host_consensus_state_proof: host_consensus_state_proof__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.connection.v1.MsgConnectionOpenAck", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgConnectionOpenAckResponse { + #[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("ibc.core.connection.v1.MsgConnectionOpenAckResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgConnectionOpenAckResponse { + #[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 = MsgConnectionOpenAckResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.connection.v1.MsgConnectionOpenAckResponse") + } + + 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(MsgConnectionOpenAckResponse { + }) + } + } + deserializer.deserialize_struct("ibc.core.connection.v1.MsgConnectionOpenAckResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgConnectionOpenConfirm { + #[allow(deprecated)] + 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("ibc.core.connection.v1.MsgConnectionOpenConfirm", len)?; + if true { + struct_ser.serialize_field("connectionId", &self.connection_id)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proofAck", pbjson::private::base64::encode(&self.proof_ack).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgConnectionOpenConfirm { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "connection_id", + "connectionId", + "proof_ack", + "proofAck", + "proof_height", + "proofHeight", + "signer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ConnectionId, + ProofAck, + ProofHeight, + Signer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "connectionId" | "connection_id" => Ok(GeneratedField::ConnectionId), + "proofAck" | "proof_ack" => Ok(GeneratedField::ProofAck), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + "signer" => Ok(GeneratedField::Signer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgConnectionOpenConfirm; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.connection.v1.MsgConnectionOpenConfirm") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut connection_id__ = None; + let mut proof_ack__ = None; + let mut proof_height__ = None; + let mut signer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ConnectionId => { + if connection_id__.is_some() { + return Err(serde::de::Error::duplicate_field("connectionId")); + } + connection_id__ = Some(map_.next_value()?); + } + GeneratedField::ProofAck => { + if proof_ack__.is_some() { + return Err(serde::de::Error::duplicate_field("proofAck")); + } + proof_ack__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + } + } + Ok(MsgConnectionOpenConfirm { + connection_id: connection_id__.unwrap_or_default(), + proof_ack: proof_ack__.unwrap_or_default(), + proof_height: proof_height__, + signer: signer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.connection.v1.MsgConnectionOpenConfirm", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgConnectionOpenConfirmResponse { + #[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("ibc.core.connection.v1.MsgConnectionOpenConfirmResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgConnectionOpenConfirmResponse { + #[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 = MsgConnectionOpenConfirmResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.connection.v1.MsgConnectionOpenConfirmResponse") + } + + 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(MsgConnectionOpenConfirmResponse { + }) + } + } + deserializer.deserialize_struct("ibc.core.connection.v1.MsgConnectionOpenConfirmResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgConnectionOpenInit { + #[allow(deprecated)] + 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("ibc.core.connection.v1.MsgConnectionOpenInit", len)?; + if true { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + if let Some(v) = self.counterparty.as_ref() { + struct_ser.serialize_field("counterparty", v)?; + } + if let Some(v) = self.version.as_ref() { + struct_ser.serialize_field("version", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("delayPeriod", ::alloc::string::ToString::to_string(&self.delay_period).as_str())?; + } + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgConnectionOpenInit { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "client_id", + "clientId", + "counterparty", + "version", + "delay_period", + "delayPeriod", + "signer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClientId, + Counterparty, + Version, + DelayPeriod, + Signer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + "counterparty" => Ok(GeneratedField::Counterparty), + "version" => Ok(GeneratedField::Version), + "delayPeriod" | "delay_period" => Ok(GeneratedField::DelayPeriod), + "signer" => Ok(GeneratedField::Signer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgConnectionOpenInit; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.connection.v1.MsgConnectionOpenInit") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut client_id__ = None; + let mut counterparty__ = None; + let mut version__ = None; + let mut delay_period__ = None; + let mut signer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); + } + client_id__ = Some(map_.next_value()?); + } + GeneratedField::Counterparty => { + if counterparty__.is_some() { + return Err(serde::de::Error::duplicate_field("counterparty")); + } + counterparty__ = map_.next_value()?; + } + GeneratedField::Version => { + if version__.is_some() { + return Err(serde::de::Error::duplicate_field("version")); + } + version__ = map_.next_value()?; + } + GeneratedField::DelayPeriod => { + if delay_period__.is_some() { + return Err(serde::de::Error::duplicate_field("delayPeriod")); + } + delay_period__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + } + } + Ok(MsgConnectionOpenInit { + client_id: client_id__.unwrap_or_default(), + counterparty: counterparty__, + version: version__, + delay_period: delay_period__.unwrap_or_default(), + signer: signer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.connection.v1.MsgConnectionOpenInit", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgConnectionOpenInitResponse { + #[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("ibc.core.connection.v1.MsgConnectionOpenInitResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgConnectionOpenInitResponse { + #[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 = MsgConnectionOpenInitResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.connection.v1.MsgConnectionOpenInitResponse") + } + + 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(MsgConnectionOpenInitResponse { + }) + } + } + deserializer.deserialize_struct("ibc.core.connection.v1.MsgConnectionOpenInitResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgConnectionOpenTry { + #[allow(deprecated)] + 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("ibc.core.connection.v1.MsgConnectionOpenTry", len)?; + if true { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + if true { + struct_ser.serialize_field("previousConnectionId", &self.previous_connection_id)?; + } + if let Some(v) = self.client_state.as_ref() { + struct_ser.serialize_field("clientState", v)?; + } + if let Some(v) = self.counterparty.as_ref() { + struct_ser.serialize_field("counterparty", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("delayPeriod", ::alloc::string::ToString::to_string(&self.delay_period).as_str())?; + } + if true { + struct_ser.serialize_field("counterpartyVersions", &self.counterparty_versions)?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proofInit", pbjson::private::base64::encode(&self.proof_init).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proofClient", pbjson::private::base64::encode(&self.proof_client).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proofConsensus", pbjson::private::base64::encode(&self.proof_consensus).as_str())?; + } + if let Some(v) = self.consensus_height.as_ref() { + struct_ser.serialize_field("consensusHeight", v)?; + } + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("hostConsensusStateProof", pbjson::private::base64::encode(&self.host_consensus_state_proof).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgConnectionOpenTry { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "client_id", + "clientId", + "previous_connection_id", + "previousConnectionId", + "client_state", + "clientState", + "counterparty", + "delay_period", + "delayPeriod", + "counterparty_versions", + "counterpartyVersions", + "proof_height", + "proofHeight", + "proof_init", + "proofInit", + "proof_client", + "proofClient", + "proof_consensus", + "proofConsensus", + "consensus_height", + "consensusHeight", + "signer", + "host_consensus_state_proof", + "hostConsensusStateProof", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClientId, + PreviousConnectionId, + ClientState, + Counterparty, + DelayPeriod, + CounterpartyVersions, + ProofHeight, + ProofInit, + ProofClient, + ProofConsensus, + ConsensusHeight, + Signer, + HostConsensusStateProof, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + "previousConnectionId" | "previous_connection_id" => Ok(GeneratedField::PreviousConnectionId), + "clientState" | "client_state" => Ok(GeneratedField::ClientState), + "counterparty" => Ok(GeneratedField::Counterparty), + "delayPeriod" | "delay_period" => Ok(GeneratedField::DelayPeriod), + "counterpartyVersions" | "counterparty_versions" => Ok(GeneratedField::CounterpartyVersions), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + "proofInit" | "proof_init" => Ok(GeneratedField::ProofInit), + "proofClient" | "proof_client" => Ok(GeneratedField::ProofClient), + "proofConsensus" | "proof_consensus" => Ok(GeneratedField::ProofConsensus), + "consensusHeight" | "consensus_height" => Ok(GeneratedField::ConsensusHeight), + "signer" => Ok(GeneratedField::Signer), + "hostConsensusStateProof" | "host_consensus_state_proof" => Ok(GeneratedField::HostConsensusStateProof), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgConnectionOpenTry; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.connection.v1.MsgConnectionOpenTry") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut client_id__ = None; + let mut previous_connection_id__ = None; + let mut client_state__ = None; + let mut counterparty__ = None; + let mut delay_period__ = None; + let mut counterparty_versions__ = None; + let mut proof_height__ = None; + let mut proof_init__ = None; + let mut proof_client__ = None; + let mut proof_consensus__ = None; + let mut consensus_height__ = None; + let mut signer__ = None; + let mut host_consensus_state_proof__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); + } + client_id__ = Some(map_.next_value()?); + } + GeneratedField::PreviousConnectionId => { + if previous_connection_id__.is_some() { + return Err(serde::de::Error::duplicate_field("previousConnectionId")); + } + previous_connection_id__ = Some(map_.next_value()?); + } + GeneratedField::ClientState => { + if client_state__.is_some() { + return Err(serde::de::Error::duplicate_field("clientState")); + } + client_state__ = map_.next_value()?; + } + GeneratedField::Counterparty => { + if counterparty__.is_some() { + return Err(serde::de::Error::duplicate_field("counterparty")); + } + counterparty__ = map_.next_value()?; + } + GeneratedField::DelayPeriod => { + if delay_period__.is_some() { + return Err(serde::de::Error::duplicate_field("delayPeriod")); + } + delay_period__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::CounterpartyVersions => { + if counterparty_versions__.is_some() { + return Err(serde::de::Error::duplicate_field("counterpartyVersions")); + } + counterparty_versions__ = Some(map_.next_value()?); + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + GeneratedField::ProofInit => { + if proof_init__.is_some() { + return Err(serde::de::Error::duplicate_field("proofInit")); + } + proof_init__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofClient => { + if proof_client__.is_some() { + return Err(serde::de::Error::duplicate_field("proofClient")); + } + proof_client__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofConsensus => { + if proof_consensus__.is_some() { + return Err(serde::de::Error::duplicate_field("proofConsensus")); + } + proof_consensus__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ConsensusHeight => { + if consensus_height__.is_some() { + return Err(serde::de::Error::duplicate_field("consensusHeight")); + } + consensus_height__ = map_.next_value()?; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + GeneratedField::HostConsensusStateProof => { + if host_consensus_state_proof__.is_some() { + return Err(serde::de::Error::duplicate_field("hostConsensusStateProof")); + } + host_consensus_state_proof__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgConnectionOpenTry { + client_id: client_id__.unwrap_or_default(), + previous_connection_id: previous_connection_id__.unwrap_or_default(), + client_state: client_state__, + counterparty: counterparty__, + delay_period: delay_period__.unwrap_or_default(), + counterparty_versions: counterparty_versions__.unwrap_or_default(), + proof_height: proof_height__, + proof_init: proof_init__.unwrap_or_default(), + proof_client: proof_client__.unwrap_or_default(), + proof_consensus: proof_consensus__.unwrap_or_default(), + consensus_height: consensus_height__, + signer: signer__.unwrap_or_default(), + host_consensus_state_proof: host_consensus_state_proof__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.connection.v1.MsgConnectionOpenTry", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgConnectionOpenTryResponse { + #[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("ibc.core.connection.v1.MsgConnectionOpenTryResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgConnectionOpenTryResponse { + #[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 = MsgConnectionOpenTryResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.connection.v1.MsgConnectionOpenTryResponse") + } + + 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(MsgConnectionOpenTryResponse { + }) + } + } + deserializer.deserialize_struct("ibc.core.connection.v1.MsgConnectionOpenTryResponse", 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("ibc.core.connection.v1.MsgUpdateParams", len)?; + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + 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] = &[ + "signer", + "params", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Signer, + 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 { + "signer" => Ok(GeneratedField::Signer), + "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 ibc.core.connection.v1.MsgUpdateParams") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut signer__ = None; + let mut params__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + } + } + Ok(MsgUpdateParams { + signer: signer__.unwrap_or_default(), + params: params__, + }) + } + } + deserializer.deserialize_struct("ibc.core.connection.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("ibc.core.connection.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 ibc.core.connection.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("ibc.core.connection.v1.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; + } + let mut struct_ser = serializer.serialize_struct("ibc.core.connection.v1.Params", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("maxExpectedTimePerBlock", ::alloc::string::ToString::to_string(&self.max_expected_time_per_block).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_expected_time_per_block", + "maxExpectedTimePerBlock", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + MaxExpectedTimePerBlock, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "maxExpectedTimePerBlock" | "max_expected_time_per_block" => Ok(GeneratedField::MaxExpectedTimePerBlock), + _ => 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 ibc.core.connection.v1.Params") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut max_expected_time_per_block__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::MaxExpectedTimePerBlock => { + if max_expected_time_per_block__.is_some() { + return Err(serde::de::Error::duplicate_field("maxExpectedTimePerBlock")); + } + max_expected_time_per_block__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(Params { + max_expected_time_per_block: max_expected_time_per_block__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.connection.v1.Params", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryClientConnectionsRequest { + #[allow(deprecated)] + 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("ibc.core.connection.v1.QueryClientConnectionsRequest", len)?; + if true { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryClientConnectionsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "client_id", + "clientId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClientId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryClientConnectionsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.connection.v1.QueryClientConnectionsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut client_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); + } + client_id__ = Some(map_.next_value()?); + } + } + } + Ok(QueryClientConnectionsRequest { + client_id: client_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.connection.v1.QueryClientConnectionsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryClientConnectionsResponse { + #[allow(deprecated)] + 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("ibc.core.connection.v1.QueryClientConnectionsResponse", len)?; + if true { + struct_ser.serialize_field("connectionPaths", &self.connection_paths)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proof", pbjson::private::base64::encode(&self.proof).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryClientConnectionsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "connection_paths", + "connectionPaths", + "proof", + "proof_height", + "proofHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ConnectionPaths, + Proof, + ProofHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "connectionPaths" | "connection_paths" => Ok(GeneratedField::ConnectionPaths), + "proof" => Ok(GeneratedField::Proof), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryClientConnectionsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.connection.v1.QueryClientConnectionsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut connection_paths__ = None; + let mut proof__ = None; + let mut proof_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ConnectionPaths => { + if connection_paths__.is_some() { + return Err(serde::de::Error::duplicate_field("connectionPaths")); + } + connection_paths__ = Some(map_.next_value()?); + } + GeneratedField::Proof => { + if proof__.is_some() { + return Err(serde::de::Error::duplicate_field("proof")); + } + proof__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + } + } + Ok(QueryClientConnectionsResponse { + connection_paths: connection_paths__.unwrap_or_default(), + proof: proof__.unwrap_or_default(), + proof_height: proof_height__, + }) + } + } + deserializer.deserialize_struct("ibc.core.connection.v1.QueryClientConnectionsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryConnectionClientStateRequest { + #[allow(deprecated)] + 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("ibc.core.connection.v1.QueryConnectionClientStateRequest", len)?; + if true { + struct_ser.serialize_field("connectionId", &self.connection_id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryConnectionClientStateRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "connection_id", + "connectionId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ConnectionId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "connectionId" | "connection_id" => Ok(GeneratedField::ConnectionId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryConnectionClientStateRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.connection.v1.QueryConnectionClientStateRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut connection_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ConnectionId => { + if connection_id__.is_some() { + return Err(serde::de::Error::duplicate_field("connectionId")); + } + connection_id__ = Some(map_.next_value()?); + } + } + } + Ok(QueryConnectionClientStateRequest { + connection_id: connection_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.connection.v1.QueryConnectionClientStateRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryConnectionClientStateResponse { + #[allow(deprecated)] + 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("ibc.core.connection.v1.QueryConnectionClientStateResponse", len)?; + if let Some(v) = self.identified_client_state.as_ref() { + struct_ser.serialize_field("identifiedClientState", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proof", pbjson::private::base64::encode(&self.proof).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryConnectionClientStateResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "identified_client_state", + "identifiedClientState", + "proof", + "proof_height", + "proofHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + IdentifiedClientState, + Proof, + ProofHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "identifiedClientState" | "identified_client_state" => Ok(GeneratedField::IdentifiedClientState), + "proof" => Ok(GeneratedField::Proof), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryConnectionClientStateResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.connection.v1.QueryConnectionClientStateResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut identified_client_state__ = None; + let mut proof__ = None; + let mut proof_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::IdentifiedClientState => { + if identified_client_state__.is_some() { + return Err(serde::de::Error::duplicate_field("identifiedClientState")); + } + identified_client_state__ = map_.next_value()?; + } + GeneratedField::Proof => { + if proof__.is_some() { + return Err(serde::de::Error::duplicate_field("proof")); + } + proof__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + } + } + Ok(QueryConnectionClientStateResponse { + identified_client_state: identified_client_state__, + proof: proof__.unwrap_or_default(), + proof_height: proof_height__, + }) + } + } + deserializer.deserialize_struct("ibc.core.connection.v1.QueryConnectionClientStateResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryConnectionConsensusStateRequest { + #[allow(deprecated)] + 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("ibc.core.connection.v1.QueryConnectionConsensusStateRequest", len)?; + if true { + struct_ser.serialize_field("connectionId", &self.connection_id)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("revisionNumber", ::alloc::string::ToString::to_string(&self.revision_number).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("revisionHeight", ::alloc::string::ToString::to_string(&self.revision_height).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryConnectionConsensusStateRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "connection_id", + "connectionId", + "revision_number", + "revisionNumber", + "revision_height", + "revisionHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ConnectionId, + RevisionNumber, + RevisionHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "connectionId" | "connection_id" => Ok(GeneratedField::ConnectionId), + "revisionNumber" | "revision_number" => Ok(GeneratedField::RevisionNumber), + "revisionHeight" | "revision_height" => Ok(GeneratedField::RevisionHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryConnectionConsensusStateRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.connection.v1.QueryConnectionConsensusStateRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut connection_id__ = None; + let mut revision_number__ = None; + let mut revision_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ConnectionId => { + if connection_id__.is_some() { + return Err(serde::de::Error::duplicate_field("connectionId")); + } + connection_id__ = Some(map_.next_value()?); + } + GeneratedField::RevisionNumber => { + if revision_number__.is_some() { + return Err(serde::de::Error::duplicate_field("revisionNumber")); + } + revision_number__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::RevisionHeight => { + if revision_height__.is_some() { + return Err(serde::de::Error::duplicate_field("revisionHeight")); + } + revision_height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(QueryConnectionConsensusStateRequest { + connection_id: connection_id__.unwrap_or_default(), + revision_number: revision_number__.unwrap_or_default(), + revision_height: revision_height__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.connection.v1.QueryConnectionConsensusStateRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryConnectionConsensusStateResponse { + #[allow(deprecated)] + 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("ibc.core.connection.v1.QueryConnectionConsensusStateResponse", len)?; + if let Some(v) = self.consensus_state.as_ref() { + struct_ser.serialize_field("consensusState", v)?; + } + if true { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proof", pbjson::private::base64::encode(&self.proof).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryConnectionConsensusStateResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "consensus_state", + "consensusState", + "client_id", + "clientId", + "proof", + "proof_height", + "proofHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ConsensusState, + ClientId, + Proof, + ProofHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "consensusState" | "consensus_state" => Ok(GeneratedField::ConsensusState), + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + "proof" => Ok(GeneratedField::Proof), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryConnectionConsensusStateResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.connection.v1.QueryConnectionConsensusStateResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut consensus_state__ = None; + let mut client_id__ = None; + let mut proof__ = None; + let mut proof_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ConsensusState => { + if consensus_state__.is_some() { + return Err(serde::de::Error::duplicate_field("consensusState")); + } + consensus_state__ = map_.next_value()?; + } + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); + } + client_id__ = Some(map_.next_value()?); + } + GeneratedField::Proof => { + if proof__.is_some() { + return Err(serde::de::Error::duplicate_field("proof")); + } + proof__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + } + } + Ok(QueryConnectionConsensusStateResponse { + consensus_state: consensus_state__, + client_id: client_id__.unwrap_or_default(), + proof: proof__.unwrap_or_default(), + proof_height: proof_height__, + }) + } + } + deserializer.deserialize_struct("ibc.core.connection.v1.QueryConnectionConsensusStateResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryConnectionParamsRequest { + #[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("ibc.core.connection.v1.QueryConnectionParamsRequest", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryConnectionParamsRequest { + #[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 = QueryConnectionParamsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.connection.v1.QueryConnectionParamsRequest") + } + + 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(QueryConnectionParamsRequest { + }) + } + } + deserializer.deserialize_struct("ibc.core.connection.v1.QueryConnectionParamsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryConnectionParamsResponse { + #[allow(deprecated)] + 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("ibc.core.connection.v1.QueryConnectionParamsResponse", len)?; + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryConnectionParamsResponse { + #[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 = QueryConnectionParamsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.connection.v1.QueryConnectionParamsResponse") + } + + 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(QueryConnectionParamsResponse { + params: params__, + }) + } + } + deserializer.deserialize_struct("ibc.core.connection.v1.QueryConnectionParamsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryConnectionRequest { + #[allow(deprecated)] + 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("ibc.core.connection.v1.QueryConnectionRequest", len)?; + if true { + struct_ser.serialize_field("connectionId", &self.connection_id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryConnectionRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "connection_id", + "connectionId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ConnectionId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "connectionId" | "connection_id" => Ok(GeneratedField::ConnectionId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryConnectionRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.connection.v1.QueryConnectionRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut connection_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ConnectionId => { + if connection_id__.is_some() { + return Err(serde::de::Error::duplicate_field("connectionId")); + } + connection_id__ = Some(map_.next_value()?); + } + } + } + Ok(QueryConnectionRequest { + connection_id: connection_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.connection.v1.QueryConnectionRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryConnectionResponse { + #[allow(deprecated)] + 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("ibc.core.connection.v1.QueryConnectionResponse", len)?; + if let Some(v) = self.connection.as_ref() { + struct_ser.serialize_field("connection", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proof", pbjson::private::base64::encode(&self.proof).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryConnectionResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "connection", + "proof", + "proof_height", + "proofHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Connection, + Proof, + ProofHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "connection" => Ok(GeneratedField::Connection), + "proof" => Ok(GeneratedField::Proof), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryConnectionResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.connection.v1.QueryConnectionResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut connection__ = None; + let mut proof__ = None; + let mut proof_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Connection => { + if connection__.is_some() { + return Err(serde::de::Error::duplicate_field("connection")); + } + connection__ = map_.next_value()?; + } + GeneratedField::Proof => { + if proof__.is_some() { + return Err(serde::de::Error::duplicate_field("proof")); + } + proof__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + } + } + Ok(QueryConnectionResponse { + connection: connection__, + proof: proof__.unwrap_or_default(), + proof_height: proof_height__, + }) + } + } + deserializer.deserialize_struct("ibc.core.connection.v1.QueryConnectionResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryConnectionsRequest { + #[allow(deprecated)] + 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("ibc.core.connection.v1.QueryConnectionsRequest", len)?; + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryConnectionsRequest { + #[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 = QueryConnectionsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.connection.v1.QueryConnectionsRequest") + } + + 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(QueryConnectionsRequest { + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("ibc.core.connection.v1.QueryConnectionsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryConnectionsResponse { + #[allow(deprecated)] + 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("ibc.core.connection.v1.QueryConnectionsResponse", len)?; + if true { + struct_ser.serialize_field("connections", &self.connections)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + if let Some(v) = self.height.as_ref() { + struct_ser.serialize_field("height", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryConnectionsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "connections", + "pagination", + "height", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Connections, + Pagination, + 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 { + "connections" => Ok(GeneratedField::Connections), + "pagination" => Ok(GeneratedField::Pagination), + "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 = QueryConnectionsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.connection.v1.QueryConnectionsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut connections__ = None; + let mut pagination__ = None; + let mut height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Connections => { + if connections__.is_some() { + return Err(serde::de::Error::duplicate_field("connections")); + } + connections__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + GeneratedField::Height => { + if height__.is_some() { + return Err(serde::de::Error::duplicate_field("height")); + } + height__ = map_.next_value()?; + } + } + } + Ok(QueryConnectionsResponse { + connections: connections__.unwrap_or_default(), + pagination: pagination__, + height: height__, + }) + } + } + deserializer.deserialize_struct("ibc.core.connection.v1.QueryConnectionsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for State { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::UninitializedUnspecified => "STATE_UNINITIALIZED_UNSPECIFIED", + Self::Init => "STATE_INIT", + Self::Tryopen => "STATE_TRYOPEN", + Self::Open => "STATE_OPEN", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for State { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "STATE_UNINITIALIZED_UNSPECIFIED", + "STATE_INIT", + "STATE_TRYOPEN", + "STATE_OPEN", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = State; + + 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 { + "STATE_UNINITIALIZED_UNSPECIFIED" => Ok(State::UninitializedUnspecified), + "STATE_INIT" => Ok(State::Init), + "STATE_TRYOPEN" => Ok(State::Tryopen), + "STATE_OPEN" => Ok(State::Open), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for Version { + #[allow(deprecated)] + 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("ibc.core.connection.v1.Version", len)?; + if true { + struct_ser.serialize_field("identifier", &self.identifier)?; + } + if true { + struct_ser.serialize_field("features", &self.features)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Version { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "identifier", + "features", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Identifier, + Features, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "identifier" => Ok(GeneratedField::Identifier), + "features" => Ok(GeneratedField::Features), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Version; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.connection.v1.Version") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut identifier__ = None; + let mut features__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Identifier => { + if identifier__.is_some() { + return Err(serde::de::Error::duplicate_field("identifier")); + } + identifier__ = Some(map_.next_value()?); + } + GeneratedField::Features => { + if features__.is_some() { + return Err(serde::de::Error::duplicate_field("features")); + } + features__ = Some(map_.next_value()?); + } + } + } + Ok(Version { + identifier: identifier__.unwrap_or_default(), + features: features__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.connection.v1.Version", FIELDS, GeneratedVisitor) + } +} diff --git a/src/prost/ibc.core.types.v1.rs b/src/prost/ibc.core.types.v1.rs index cc6a4edf..c85e27ea 100644 --- a/src/prost/ibc.core.types.v1.rs +++ b/src/prost/ibc.core.types.v1.rs @@ -1,5 +1,4 @@ /// GenesisState defines the ibc module's genesis state. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -15,3 +14,10 @@ pub struct GenesisState { #[prost(message, optional, tag = "3")] pub channel_genesis: ::core::option::Option, } +impl ::prost::Name for GenesisState { + const NAME: &'static str = "GenesisState"; + const PACKAGE: &'static str = "ibc.core.types.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.types.v1.{}", Self::NAME) + } +} diff --git a/src/prost/ibc.core.types.v1.serde.rs b/src/prost/ibc.core.types.v1.serde.rs new file mode 100644 index 00000000..dec29a4f --- /dev/null +++ b/src/prost/ibc.core.types.v1.serde.rs @@ -0,0 +1,128 @@ +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; + } + let mut struct_ser = serializer.serialize_struct("ibc.core.types.v1.GenesisState", len)?; + if let Some(v) = self.client_genesis.as_ref() { + struct_ser.serialize_field("clientGenesis", v)?; + } + if let Some(v) = self.connection_genesis.as_ref() { + struct_ser.serialize_field("connectionGenesis", v)?; + } + if let Some(v) = self.channel_genesis.as_ref() { + struct_ser.serialize_field("channelGenesis", 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] = &[ + "client_genesis", + "clientGenesis", + "connection_genesis", + "connectionGenesis", + "channel_genesis", + "channelGenesis", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClientGenesis, + ConnectionGenesis, + ChannelGenesis, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "clientGenesis" | "client_genesis" => Ok(GeneratedField::ClientGenesis), + "connectionGenesis" | "connection_genesis" => Ok(GeneratedField::ConnectionGenesis), + "channelGenesis" | "channel_genesis" => Ok(GeneratedField::ChannelGenesis), + _ => 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 ibc.core.types.v1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut client_genesis__ = None; + let mut connection_genesis__ = None; + let mut channel_genesis__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClientGenesis => { + if client_genesis__.is_some() { + return Err(serde::de::Error::duplicate_field("clientGenesis")); + } + client_genesis__ = map_.next_value()?; + } + GeneratedField::ConnectionGenesis => { + if connection_genesis__.is_some() { + return Err(serde::de::Error::duplicate_field("connectionGenesis")); + } + connection_genesis__ = map_.next_value()?; + } + GeneratedField::ChannelGenesis => { + if channel_genesis__.is_some() { + return Err(serde::de::Error::duplicate_field("channelGenesis")); + } + channel_genesis__ = map_.next_value()?; + } + } + } + Ok(GenesisState { + client_genesis: client_genesis__, + connection_genesis: connection_genesis__, + channel_genesis: channel_genesis__, + }) + } + } + deserializer.deserialize_struct("ibc.core.types.v1.GenesisState", FIELDS, GeneratedVisitor) + } +} diff --git a/src/prost/ibc.lightclients.localhost.v1.rs b/src/prost/ibc.lightclients.localhost.v1.rs index 980676d1..4fe8fe76 100644 --- a/src/prost/ibc.lightclients.localhost.v1.rs +++ b/src/prost/ibc.lightclients.localhost.v1.rs @@ -10,3 +10,10 @@ pub struct ClientState { #[prost(message, optional, tag = "2")] pub height: ::core::option::Option, } +impl ::prost::Name for ClientState { + const NAME: &'static str = "ClientState"; + const PACKAGE: &'static str = "ibc.lightclients.localhost.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.localhost.v1.{}", Self::NAME) + } +} diff --git a/src/prost/ibc.lightclients.localhost.v1.serde.rs b/src/prost/ibc.lightclients.localhost.v1.serde.rs new file mode 100644 index 00000000..8036e7ca --- /dev/null +++ b/src/prost/ibc.lightclients.localhost.v1.serde.rs @@ -0,0 +1,109 @@ +impl serde::Serialize for ClientState { + #[allow(deprecated)] + 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("ibc.lightclients.localhost.v1.ClientState", len)?; + if true { + struct_ser.serialize_field("chainId", &self.chain_id)?; + } + if let Some(v) = self.height.as_ref() { + struct_ser.serialize_field("height", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ClientState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "chain_id", + "chainId", + "height", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ChainId, + 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 { + "chainId" | "chain_id" => Ok(GeneratedField::ChainId), + "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 = ClientState; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.localhost.v1.ClientState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut chain_id__ = None; + let mut height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ChainId => { + if chain_id__.is_some() { + return Err(serde::de::Error::duplicate_field("chainId")); + } + chain_id__ = Some(map_.next_value()?); + } + GeneratedField::Height => { + if height__.is_some() { + return Err(serde::de::Error::duplicate_field("height")); + } + height__ = map_.next_value()?; + } + } + } + Ok(ClientState { + chain_id: chain_id__.unwrap_or_default(), + height: height__, + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.localhost.v1.ClientState", FIELDS, GeneratedVisitor) + } +} diff --git a/src/prost/ibc.lightclients.localhost.v2.rs b/src/prost/ibc.lightclients.localhost.v2.rs index 7e7c61bc..193b746b 100644 --- a/src/prost/ibc.lightclients.localhost.v2.rs +++ b/src/prost/ibc.lightclients.localhost.v2.rs @@ -1,5 +1,4 @@ /// ClientState defines the 09-localhost client state -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ClientState { @@ -9,3 +8,10 @@ pub struct ClientState { super::super::super::core::client::v1::Height, >, } +impl ::prost::Name for ClientState { + const NAME: &'static str = "ClientState"; + const PACKAGE: &'static str = "ibc.lightclients.localhost.v2"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.localhost.v2.{}", Self::NAME) + } +} diff --git a/src/prost/ibc.lightclients.localhost.v2.serde.rs b/src/prost/ibc.lightclients.localhost.v2.serde.rs new file mode 100644 index 00000000..b3e462e0 --- /dev/null +++ b/src/prost/ibc.lightclients.localhost.v2.serde.rs @@ -0,0 +1,92 @@ +impl serde::Serialize for ClientState { + #[allow(deprecated)] + 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("ibc.lightclients.localhost.v2.ClientState", len)?; + if let Some(v) = self.latest_height.as_ref() { + struct_ser.serialize_field("latestHeight", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ClientState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "latest_height", + "latestHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + LatestHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "latestHeight" | "latest_height" => Ok(GeneratedField::LatestHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ClientState; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.localhost.v2.ClientState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut latest_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::LatestHeight => { + if latest_height__.is_some() { + return Err(serde::de::Error::duplicate_field("latestHeight")); + } + latest_height__ = map_.next_value()?; + } + } + } + Ok(ClientState { + latest_height: latest_height__, + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.localhost.v2.ClientState", FIELDS, GeneratedVisitor) + } +} diff --git a/src/prost/ibc.lightclients.solomachine.v2.rs b/src/prost/ibc.lightclients.solomachine.v2.rs index 77f96f9f..d74115f8 100644 --- a/src/prost/ibc.lightclients.solomachine.v2.rs +++ b/src/prost/ibc.lightclients.solomachine.v2.rs @@ -16,6 +16,13 @@ pub struct ClientState { #[prost(bool, tag = "4")] pub allow_update_after_proposal: bool, } +impl ::prost::Name for ClientState { + const NAME: &'static str = "ClientState"; + const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + } +} /// ConsensusState defines a solo machine consensus state. The sequence of a /// consensus state is contained in the "height" key used in storing the /// consensus state. @@ -35,6 +42,13 @@ pub struct ConsensusState { #[prost(uint64, tag = "3")] pub timestamp: u64, } +impl ::prost::Name for ConsensusState { + const NAME: &'static str = "ConsensusState"; + const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + } +} /// Header defines a solo machine consensus header #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -53,6 +67,13 @@ pub struct Header { #[prost(string, tag = "5")] pub new_diversifier: ::prost::alloc::string::String, } +impl ::prost::Name for Header { + const NAME: &'static str = "Header"; + const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + } +} /// Misbehaviour defines misbehaviour for a solo machine which consists /// of a sequence and two signatures over different messages at that sequence. #[allow(clippy::derive_partial_eq_without_eq)] @@ -67,6 +88,13 @@ pub struct Misbehaviour { #[prost(message, optional, tag = "4")] pub signature_two: ::core::option::Option, } +impl ::prost::Name for Misbehaviour { + const NAME: &'static str = "Misbehaviour"; + const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + } +} /// SignatureAndData contains a signature and the data signed over to create that /// signature. #[allow(clippy::derive_partial_eq_without_eq)] @@ -81,6 +109,13 @@ pub struct SignatureAndData { #[prost(uint64, tag = "4")] pub timestamp: u64, } +impl ::prost::Name for SignatureAndData { + const NAME: &'static str = "SignatureAndData"; + const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + } +} /// TimestampedSignatureData contains the signature data and the timestamp of the /// signature. #[allow(clippy::derive_partial_eq_without_eq)] @@ -91,6 +126,13 @@ pub struct TimestampedSignatureData { #[prost(uint64, tag = "2")] pub timestamp: u64, } +impl ::prost::Name for TimestampedSignatureData { + const NAME: &'static str = "TimestampedSignatureData"; + const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + } +} /// SignBytes defines the signed bytes used for signature verification. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -108,6 +150,13 @@ pub struct SignBytes { #[prost(bytes = "vec", tag = "5")] pub data: ::prost::alloc::vec::Vec, } +impl ::prost::Name for SignBytes { + const NAME: &'static str = "SignBytes"; + const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + } +} /// HeaderData returns the SignBytes data for update verification. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -121,6 +170,13 @@ pub struct HeaderData { #[prost(string, tag = "2")] pub new_diversifier: ::prost::alloc::string::String, } +impl ::prost::Name for HeaderData { + const NAME: &'static str = "HeaderData"; + const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + } +} /// ClientStateData returns the SignBytes data for client state verification. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -132,6 +188,13 @@ pub struct ClientStateData { super::super::super::super::google::protobuf::Any, >, } +impl ::prost::Name for ClientStateData { + const NAME: &'static str = "ClientStateData"; + const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + } +} /// ConsensusStateData returns the SignBytes data for consensus state /// verification. #[allow(clippy::derive_partial_eq_without_eq)] @@ -144,6 +207,13 @@ pub struct ConsensusStateData { super::super::super::super::google::protobuf::Any, >, } +impl ::prost::Name for ConsensusStateData { + const NAME: &'static str = "ConsensusStateData"; + const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + } +} /// ConnectionStateData returns the SignBytes data for connection state /// verification. #[allow(clippy::derive_partial_eq_without_eq)] @@ -156,6 +226,13 @@ pub struct ConnectionStateData { super::super::super::core::connection::v1::ConnectionEnd, >, } +impl ::prost::Name for ConnectionStateData { + const NAME: &'static str = "ConnectionStateData"; + const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + } +} /// ChannelStateData returns the SignBytes data for channel state /// verification. #[allow(clippy::derive_partial_eq_without_eq)] @@ -166,6 +243,13 @@ pub struct ChannelStateData { #[prost(message, optional, tag = "2")] pub channel: ::core::option::Option, } +impl ::prost::Name for ChannelStateData { + const NAME: &'static str = "ChannelStateData"; + const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + } +} /// PacketCommitmentData returns the SignBytes data for packet commitment /// verification. #[allow(clippy::derive_partial_eq_without_eq)] @@ -176,6 +260,13 @@ pub struct PacketCommitmentData { #[prost(bytes = "vec", tag = "2")] pub commitment: ::prost::alloc::vec::Vec, } +impl ::prost::Name for PacketCommitmentData { + const NAME: &'static str = "PacketCommitmentData"; + const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + } +} /// PacketAcknowledgementData returns the SignBytes data for acknowledgement /// verification. #[allow(clippy::derive_partial_eq_without_eq)] @@ -186,6 +277,13 @@ pub struct PacketAcknowledgementData { #[prost(bytes = "vec", tag = "2")] pub acknowledgement: ::prost::alloc::vec::Vec, } +impl ::prost::Name for PacketAcknowledgementData { + const NAME: &'static str = "PacketAcknowledgementData"; + const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + } +} /// PacketReceiptAbsenceData returns the SignBytes data for /// packet receipt absence verification. #[allow(clippy::derive_partial_eq_without_eq)] @@ -194,6 +292,13 @@ pub struct PacketReceiptAbsenceData { #[prost(bytes = "vec", tag = "1")] pub path: ::prost::alloc::vec::Vec, } +impl ::prost::Name for PacketReceiptAbsenceData { + const NAME: &'static str = "PacketReceiptAbsenceData"; + const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + } +} /// NextSequenceRecvData returns the SignBytes data for verification of the next /// sequence to be received. #[allow(clippy::derive_partial_eq_without_eq)] @@ -204,6 +309,13 @@ pub struct NextSequenceRecvData { #[prost(uint64, tag = "2")] pub next_seq_recv: u64, } +impl ::prost::Name for NextSequenceRecvData { + const NAME: &'static str = "NextSequenceRecvData"; + const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + } +} /// DataType defines the type of solo machine proof being created. This is done /// to preserve uniqueness of different data sign byte encodings. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] diff --git a/src/prost/ibc.lightclients.solomachine.v2.serde.rs b/src/prost/ibc.lightclients.solomachine.v2.serde.rs new file mode 100644 index 00000000..6bb4f9d7 --- /dev/null +++ b/src/prost/ibc.lightclients.solomachine.v2.serde.rs @@ -0,0 +1,2123 @@ +impl serde::Serialize for ChannelStateData { + #[allow(deprecated)] + 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("ibc.lightclients.solomachine.v2.ChannelStateData", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; + } + if let Some(v) = self.channel.as_ref() { + struct_ser.serialize_field("channel", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ChannelStateData { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "path", + "channel", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Path, + Channel, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "channel" => Ok(GeneratedField::Channel), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ChannelStateData; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v2.ChannelStateData") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut path__ = None; + let mut channel__ = 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::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Channel => { + if channel__.is_some() { + return Err(serde::de::Error::duplicate_field("channel")); + } + channel__ = map_.next_value()?; + } + } + } + Ok(ChannelStateData { + path: path__.unwrap_or_default(), + channel: channel__, + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.solomachine.v2.ChannelStateData", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ClientState { + #[allow(deprecated)] + 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("ibc.lightclients.solomachine.v2.ClientState", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ::alloc::string::ToString::to_string(&self.sequence).as_str())?; + } + if true { + struct_ser.serialize_field("isFrozen", &self.is_frozen)?; + } + if let Some(v) = self.consensus_state.as_ref() { + struct_ser.serialize_field("consensusState", v)?; + } + if true { + struct_ser.serialize_field("allowUpdateAfterProposal", &self.allow_update_after_proposal)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ClientState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "sequence", + "is_frozen", + "isFrozen", + "consensus_state", + "consensusState", + "allow_update_after_proposal", + "allowUpdateAfterProposal", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sequence, + IsFrozen, + ConsensusState, + AllowUpdateAfterProposal, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "sequence" => Ok(GeneratedField::Sequence), + "isFrozen" | "is_frozen" => Ok(GeneratedField::IsFrozen), + "consensusState" | "consensus_state" => Ok(GeneratedField::ConsensusState), + "allowUpdateAfterProposal" | "allow_update_after_proposal" => Ok(GeneratedField::AllowUpdateAfterProposal), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ClientState; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v2.ClientState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sequence__ = None; + let mut is_frozen__ = None; + let mut consensus_state__ = None; + let mut allow_update_after_proposal__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Sequence => { + if sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("sequence")); + } + sequence__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::IsFrozen => { + if is_frozen__.is_some() { + return Err(serde::de::Error::duplicate_field("isFrozen")); + } + is_frozen__ = Some(map_.next_value()?); + } + GeneratedField::ConsensusState => { + if consensus_state__.is_some() { + return Err(serde::de::Error::duplicate_field("consensusState")); + } + consensus_state__ = map_.next_value()?; + } + GeneratedField::AllowUpdateAfterProposal => { + if allow_update_after_proposal__.is_some() { + return Err(serde::de::Error::duplicate_field("allowUpdateAfterProposal")); + } + allow_update_after_proposal__ = Some(map_.next_value()?); + } + } + } + Ok(ClientState { + sequence: sequence__.unwrap_or_default(), + is_frozen: is_frozen__.unwrap_or_default(), + consensus_state: consensus_state__, + allow_update_after_proposal: allow_update_after_proposal__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.solomachine.v2.ClientState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ClientStateData { + #[allow(deprecated)] + 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("ibc.lightclients.solomachine.v2.ClientStateData", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; + } + if let Some(v) = self.client_state.as_ref() { + struct_ser.serialize_field("clientState", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ClientStateData { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "path", + "client_state", + "clientState", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Path, + ClientState, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "clientState" | "client_state" => Ok(GeneratedField::ClientState), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ClientStateData; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v2.ClientStateData") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut path__ = None; + let mut client_state__ = 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::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ClientState => { + if client_state__.is_some() { + return Err(serde::de::Error::duplicate_field("clientState")); + } + client_state__ = map_.next_value()?; + } + } + } + Ok(ClientStateData { + path: path__.unwrap_or_default(), + client_state: client_state__, + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.solomachine.v2.ClientStateData", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ConnectionStateData { + #[allow(deprecated)] + 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("ibc.lightclients.solomachine.v2.ConnectionStateData", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; + } + if let Some(v) = self.connection.as_ref() { + struct_ser.serialize_field("connection", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ConnectionStateData { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "path", + "connection", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Path, + Connection, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "connection" => Ok(GeneratedField::Connection), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ConnectionStateData; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v2.ConnectionStateData") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut path__ = None; + let mut connection__ = 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::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Connection => { + if connection__.is_some() { + return Err(serde::de::Error::duplicate_field("connection")); + } + connection__ = map_.next_value()?; + } + } + } + Ok(ConnectionStateData { + path: path__.unwrap_or_default(), + connection: connection__, + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.solomachine.v2.ConnectionStateData", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ConsensusState { + #[allow(deprecated)] + 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("ibc.lightclients.solomachine.v2.ConsensusState", len)?; + if let Some(v) = self.public_key.as_ref() { + struct_ser.serialize_field("publicKey", v)?; + } + if true { + struct_ser.serialize_field("diversifier", &self.diversifier)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("timestamp", ::alloc::string::ToString::to_string(&self.timestamp).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ConsensusState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "public_key", + "publicKey", + "diversifier", + "timestamp", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PublicKey, + Diversifier, + 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 { + "publicKey" | "public_key" => Ok(GeneratedField::PublicKey), + "diversifier" => Ok(GeneratedField::Diversifier), + "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 = ConsensusState; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v2.ConsensusState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut public_key__ = None; + let mut diversifier__ = None; + let mut timestamp__ = 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::Diversifier => { + if diversifier__.is_some() { + return Err(serde::de::Error::duplicate_field("diversifier")); + } + diversifier__ = Some(map_.next_value()?); + } + GeneratedField::Timestamp => { + if timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timestamp")); + } + timestamp__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(ConsensusState { + public_key: public_key__, + diversifier: diversifier__.unwrap_or_default(), + timestamp: timestamp__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.solomachine.v2.ConsensusState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ConsensusStateData { + #[allow(deprecated)] + 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("ibc.lightclients.solomachine.v2.ConsensusStateData", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; + } + if let Some(v) = self.consensus_state.as_ref() { + struct_ser.serialize_field("consensusState", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ConsensusStateData { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "path", + "consensus_state", + "consensusState", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Path, + ConsensusState, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "consensusState" | "consensus_state" => Ok(GeneratedField::ConsensusState), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ConsensusStateData; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v2.ConsensusStateData") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut path__ = None; + let mut consensus_state__ = 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::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ConsensusState => { + if consensus_state__.is_some() { + return Err(serde::de::Error::duplicate_field("consensusState")); + } + consensus_state__ = map_.next_value()?; + } + } + } + Ok(ConsensusStateData { + path: path__.unwrap_or_default(), + consensus_state: consensus_state__, + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.solomachine.v2.ConsensusStateData", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for DataType { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::UninitializedUnspecified => "DATA_TYPE_UNINITIALIZED_UNSPECIFIED", + Self::ClientState => "DATA_TYPE_CLIENT_STATE", + Self::ConsensusState => "DATA_TYPE_CONSENSUS_STATE", + Self::ConnectionState => "DATA_TYPE_CONNECTION_STATE", + Self::ChannelState => "DATA_TYPE_CHANNEL_STATE", + Self::PacketCommitment => "DATA_TYPE_PACKET_COMMITMENT", + Self::PacketAcknowledgement => "DATA_TYPE_PACKET_ACKNOWLEDGEMENT", + Self::PacketReceiptAbsence => "DATA_TYPE_PACKET_RECEIPT_ABSENCE", + Self::NextSequenceRecv => "DATA_TYPE_NEXT_SEQUENCE_RECV", + Self::Header => "DATA_TYPE_HEADER", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for DataType { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "DATA_TYPE_UNINITIALIZED_UNSPECIFIED", + "DATA_TYPE_CLIENT_STATE", + "DATA_TYPE_CONSENSUS_STATE", + "DATA_TYPE_CONNECTION_STATE", + "DATA_TYPE_CHANNEL_STATE", + "DATA_TYPE_PACKET_COMMITMENT", + "DATA_TYPE_PACKET_ACKNOWLEDGEMENT", + "DATA_TYPE_PACKET_RECEIPT_ABSENCE", + "DATA_TYPE_NEXT_SEQUENCE_RECV", + "DATA_TYPE_HEADER", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = DataType; + + 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 { + "DATA_TYPE_UNINITIALIZED_UNSPECIFIED" => Ok(DataType::UninitializedUnspecified), + "DATA_TYPE_CLIENT_STATE" => Ok(DataType::ClientState), + "DATA_TYPE_CONSENSUS_STATE" => Ok(DataType::ConsensusState), + "DATA_TYPE_CONNECTION_STATE" => Ok(DataType::ConnectionState), + "DATA_TYPE_CHANNEL_STATE" => Ok(DataType::ChannelState), + "DATA_TYPE_PACKET_COMMITMENT" => Ok(DataType::PacketCommitment), + "DATA_TYPE_PACKET_ACKNOWLEDGEMENT" => Ok(DataType::PacketAcknowledgement), + "DATA_TYPE_PACKET_RECEIPT_ABSENCE" => Ok(DataType::PacketReceiptAbsence), + "DATA_TYPE_NEXT_SEQUENCE_RECV" => Ok(DataType::NextSequenceRecv), + "DATA_TYPE_HEADER" => Ok(DataType::Header), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for Header { + #[allow(deprecated)] + 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("ibc.lightclients.solomachine.v2.Header", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ::alloc::string::ToString::to_string(&self.sequence).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("timestamp", ::alloc::string::ToString::to_string(&self.timestamp).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("signature", pbjson::private::base64::encode(&self.signature).as_str())?; + } + if let Some(v) = self.new_public_key.as_ref() { + struct_ser.serialize_field("newPublicKey", v)?; + } + if true { + struct_ser.serialize_field("newDiversifier", &self.new_diversifier)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Header { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "sequence", + "timestamp", + "signature", + "new_public_key", + "newPublicKey", + "new_diversifier", + "newDiversifier", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sequence, + Timestamp, + Signature, + NewPublicKey, + NewDiversifier, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "sequence" => Ok(GeneratedField::Sequence), + "timestamp" => Ok(GeneratedField::Timestamp), + "signature" => Ok(GeneratedField::Signature), + "newPublicKey" | "new_public_key" => Ok(GeneratedField::NewPublicKey), + "newDiversifier" | "new_diversifier" => Ok(GeneratedField::NewDiversifier), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Header; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v2.Header") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sequence__ = None; + let mut timestamp__ = None; + let mut signature__ = None; + let mut new_public_key__ = None; + let mut new_diversifier__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Sequence => { + if sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("sequence")); + } + sequence__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Timestamp => { + if timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timestamp")); + } + timestamp__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Signature => { + if signature__.is_some() { + return Err(serde::de::Error::duplicate_field("signature")); + } + signature__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::NewPublicKey => { + if new_public_key__.is_some() { + return Err(serde::de::Error::duplicate_field("newPublicKey")); + } + new_public_key__ = map_.next_value()?; + } + GeneratedField::NewDiversifier => { + if new_diversifier__.is_some() { + return Err(serde::de::Error::duplicate_field("newDiversifier")); + } + new_diversifier__ = Some(map_.next_value()?); + } + } + } + Ok(Header { + sequence: sequence__.unwrap_or_default(), + timestamp: timestamp__.unwrap_or_default(), + signature: signature__.unwrap_or_default(), + new_public_key: new_public_key__, + new_diversifier: new_diversifier__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.solomachine.v2.Header", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for HeaderData { + #[allow(deprecated)] + 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("ibc.lightclients.solomachine.v2.HeaderData", len)?; + if let Some(v) = self.new_pub_key.as_ref() { + struct_ser.serialize_field("newPubKey", v)?; + } + if true { + struct_ser.serialize_field("newDiversifier", &self.new_diversifier)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for HeaderData { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "new_pub_key", + "newPubKey", + "new_diversifier", + "newDiversifier", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + NewPubKey, + NewDiversifier, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "newPubKey" | "new_pub_key" => Ok(GeneratedField::NewPubKey), + "newDiversifier" | "new_diversifier" => Ok(GeneratedField::NewDiversifier), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = HeaderData; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v2.HeaderData") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut new_pub_key__ = None; + let mut new_diversifier__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::NewPubKey => { + if new_pub_key__.is_some() { + return Err(serde::de::Error::duplicate_field("newPubKey")); + } + new_pub_key__ = map_.next_value()?; + } + GeneratedField::NewDiversifier => { + if new_diversifier__.is_some() { + return Err(serde::de::Error::duplicate_field("newDiversifier")); + } + new_diversifier__ = Some(map_.next_value()?); + } + } + } + Ok(HeaderData { + new_pub_key: new_pub_key__, + new_diversifier: new_diversifier__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.solomachine.v2.HeaderData", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Misbehaviour { + #[allow(deprecated)] + 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("ibc.lightclients.solomachine.v2.Misbehaviour", len)?; + if true { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ::alloc::string::ToString::to_string(&self.sequence).as_str())?; + } + if let Some(v) = self.signature_one.as_ref() { + struct_ser.serialize_field("signatureOne", v)?; + } + if let Some(v) = self.signature_two.as_ref() { + struct_ser.serialize_field("signatureTwo", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Misbehaviour { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "client_id", + "clientId", + "sequence", + "signature_one", + "signatureOne", + "signature_two", + "signatureTwo", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClientId, + Sequence, + SignatureOne, + SignatureTwo, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + "sequence" => Ok(GeneratedField::Sequence), + "signatureOne" | "signature_one" => Ok(GeneratedField::SignatureOne), + "signatureTwo" | "signature_two" => Ok(GeneratedField::SignatureTwo), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Misbehaviour; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v2.Misbehaviour") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut client_id__ = None; + let mut sequence__ = None; + let mut signature_one__ = None; + let mut signature_two__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); + } + client_id__ = Some(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) + ; + } + GeneratedField::SignatureOne => { + if signature_one__.is_some() { + return Err(serde::de::Error::duplicate_field("signatureOne")); + } + signature_one__ = map_.next_value()?; + } + GeneratedField::SignatureTwo => { + if signature_two__.is_some() { + return Err(serde::de::Error::duplicate_field("signatureTwo")); + } + signature_two__ = map_.next_value()?; + } + } + } + Ok(Misbehaviour { + client_id: client_id__.unwrap_or_default(), + sequence: sequence__.unwrap_or_default(), + signature_one: signature_one__, + signature_two: signature_two__, + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.solomachine.v2.Misbehaviour", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for NextSequenceRecvData { + #[allow(deprecated)] + 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("ibc.lightclients.solomachine.v2.NextSequenceRecvData", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("nextSeqRecv", ::alloc::string::ToString::to_string(&self.next_seq_recv).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for NextSequenceRecvData { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "path", + "next_seq_recv", + "nextSeqRecv", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Path, + NextSeqRecv, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "nextSeqRecv" | "next_seq_recv" => Ok(GeneratedField::NextSeqRecv), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = NextSequenceRecvData; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v2.NextSequenceRecvData") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut path__ = None; + let mut next_seq_recv__ = 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::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::NextSeqRecv => { + if next_seq_recv__.is_some() { + return Err(serde::de::Error::duplicate_field("nextSeqRecv")); + } + next_seq_recv__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(NextSequenceRecvData { + path: path__.unwrap_or_default(), + next_seq_recv: next_seq_recv__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.solomachine.v2.NextSequenceRecvData", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for PacketAcknowledgementData { + #[allow(deprecated)] + 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("ibc.lightclients.solomachine.v2.PacketAcknowledgementData", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("acknowledgement", pbjson::private::base64::encode(&self.acknowledgement).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for PacketAcknowledgementData { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "path", + "acknowledgement", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Path, + Acknowledgement, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "acknowledgement" => Ok(GeneratedField::Acknowledgement), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = PacketAcknowledgementData; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v2.PacketAcknowledgementData") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut path__ = None; + let mut acknowledgement__ = 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::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Acknowledgement => { + if acknowledgement__.is_some() { + return Err(serde::de::Error::duplicate_field("acknowledgement")); + } + acknowledgement__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(PacketAcknowledgementData { + path: path__.unwrap_or_default(), + acknowledgement: acknowledgement__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.solomachine.v2.PacketAcknowledgementData", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for PacketCommitmentData { + #[allow(deprecated)] + 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("ibc.lightclients.solomachine.v2.PacketCommitmentData", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("commitment", pbjson::private::base64::encode(&self.commitment).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for PacketCommitmentData { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "path", + "commitment", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Path, + Commitment, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "commitment" => Ok(GeneratedField::Commitment), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = PacketCommitmentData; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v2.PacketCommitmentData") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut path__ = None; + let mut commitment__ = 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::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Commitment => { + if commitment__.is_some() { + return Err(serde::de::Error::duplicate_field("commitment")); + } + commitment__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(PacketCommitmentData { + path: path__.unwrap_or_default(), + commitment: commitment__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.solomachine.v2.PacketCommitmentData", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for PacketReceiptAbsenceData { + #[allow(deprecated)] + 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("ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for PacketReceiptAbsenceData { + #[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 = PacketReceiptAbsenceData; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData") + } + + 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__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(PacketReceiptAbsenceData { + path: path__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SignBytes { + #[allow(deprecated)] + 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("ibc.lightclients.solomachine.v2.SignBytes", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ::alloc::string::ToString::to_string(&self.sequence).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("timestamp", ::alloc::string::ToString::to_string(&self.timestamp).as_str())?; + } + if true { + struct_ser.serialize_field("diversifier", &self.diversifier)?; + } + if true { + let v = DataType::try_from(self.data_type) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.data_type)))?; + struct_ser.serialize_field("dataType", &v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SignBytes { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "sequence", + "timestamp", + "diversifier", + "data_type", + "dataType", + "data", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sequence, + Timestamp, + Diversifier, + DataType, + Data, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "sequence" => Ok(GeneratedField::Sequence), + "timestamp" => Ok(GeneratedField::Timestamp), + "diversifier" => Ok(GeneratedField::Diversifier), + "dataType" | "data_type" => Ok(GeneratedField::DataType), + "data" => Ok(GeneratedField::Data), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SignBytes; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v2.SignBytes") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sequence__ = None; + let mut timestamp__ = None; + let mut diversifier__ = None; + let mut data_type__ = None; + let mut data__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Sequence => { + if sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("sequence")); + } + sequence__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Timestamp => { + if timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timestamp")); + } + timestamp__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Diversifier => { + if diversifier__.is_some() { + return Err(serde::de::Error::duplicate_field("diversifier")); + } + diversifier__ = Some(map_.next_value()?); + } + GeneratedField::DataType => { + if data_type__.is_some() { + return Err(serde::de::Error::duplicate_field("dataType")); + } + data_type__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(SignBytes { + sequence: sequence__.unwrap_or_default(), + timestamp: timestamp__.unwrap_or_default(), + diversifier: diversifier__.unwrap_or_default(), + data_type: data_type__.unwrap_or_default(), + data: data__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.solomachine.v2.SignBytes", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SignatureAndData { + #[allow(deprecated)] + 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("ibc.lightclients.solomachine.v2.SignatureAndData", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("signature", pbjson::private::base64::encode(&self.signature).as_str())?; + } + if true { + let v = DataType::try_from(self.data_type) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.data_type)))?; + struct_ser.serialize_field("dataType", &v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("timestamp", ::alloc::string::ToString::to_string(&self.timestamp).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SignatureAndData { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "signature", + "data_type", + "dataType", + "data", + "timestamp", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Signature, + DataType, + Data, + 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 { + "signature" => Ok(GeneratedField::Signature), + "dataType" | "data_type" => Ok(GeneratedField::DataType), + "data" => Ok(GeneratedField::Data), + "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 = SignatureAndData; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v2.SignatureAndData") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut signature__ = None; + let mut data_type__ = None; + let mut data__ = None; + let mut timestamp__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Signature => { + if signature__.is_some() { + return Err(serde::de::Error::duplicate_field("signature")); + } + signature__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::DataType => { + if data_type__.is_some() { + return Err(serde::de::Error::duplicate_field("dataType")); + } + data_type__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Timestamp => { + if timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timestamp")); + } + timestamp__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(SignatureAndData { + signature: signature__.unwrap_or_default(), + data_type: data_type__.unwrap_or_default(), + data: data__.unwrap_or_default(), + timestamp: timestamp__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.solomachine.v2.SignatureAndData", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for TimestampedSignatureData { + #[allow(deprecated)] + 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("ibc.lightclients.solomachine.v2.TimestampedSignatureData", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("signatureData", pbjson::private::base64::encode(&self.signature_data).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("timestamp", ::alloc::string::ToString::to_string(&self.timestamp).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for TimestampedSignatureData { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "signature_data", + "signatureData", + "timestamp", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + SignatureData, + 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 { + "signatureData" | "signature_data" => Ok(GeneratedField::SignatureData), + "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 = TimestampedSignatureData; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v2.TimestampedSignatureData") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut signature_data__ = None; + let mut timestamp__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::SignatureData => { + if signature_data__.is_some() { + return Err(serde::de::Error::duplicate_field("signatureData")); + } + signature_data__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Timestamp => { + if timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timestamp")); + } + timestamp__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(TimestampedSignatureData { + signature_data: signature_data__.unwrap_or_default(), + timestamp: timestamp__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.solomachine.v2.TimestampedSignatureData", FIELDS, GeneratedVisitor) + } +} diff --git a/src/prost/ibc.lightclients.solomachine.v3.rs b/src/prost/ibc.lightclients.solomachine.v3.rs index 144a4a56..ee2d1987 100644 --- a/src/prost/ibc.lightclients.solomachine.v3.rs +++ b/src/prost/ibc.lightclients.solomachine.v3.rs @@ -1,6 +1,5 @@ /// ClientState defines a solo machine client that tracks the current consensus /// state and if the client is frozen. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ClientState { @@ -13,10 +12,16 @@ pub struct ClientState { #[prost(message, optional, tag = "3")] pub consensus_state: ::core::option::Option, } +impl ::prost::Name for ClientState { + const NAME: &'static str = "ClientState"; + const PACKAGE: &'static str = "ibc.lightclients.solomachine.v3"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.solomachine.v3.{}", Self::NAME) + } +} /// ConsensusState defines a solo machine consensus state. The sequence of a /// consensus state is contained in the "height" key used in storing the /// consensus state. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConsensusState { @@ -33,8 +38,14 @@ pub struct ConsensusState { #[prost(uint64, tag = "3")] pub timestamp: u64, } +impl ::prost::Name for ConsensusState { + const NAME: &'static str = "ConsensusState"; + const PACKAGE: &'static str = "ibc.lightclients.solomachine.v3"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.solomachine.v3.{}", Self::NAME) + } +} /// Header defines a solo machine consensus header -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Header { @@ -49,9 +60,15 @@ pub struct Header { #[prost(string, tag = "4")] pub new_diversifier: ::prost::alloc::string::String, } +impl ::prost::Name for Header { + const NAME: &'static str = "Header"; + const PACKAGE: &'static str = "ibc.lightclients.solomachine.v3"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.solomachine.v3.{}", Self::NAME) + } +} /// Misbehaviour defines misbehaviour for a solo machine which consists /// of a sequence and two signatures over different messages at that sequence. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Misbehaviour { @@ -62,9 +79,15 @@ pub struct Misbehaviour { #[prost(message, optional, tag = "3")] pub signature_two: ::core::option::Option, } +impl ::prost::Name for Misbehaviour { + const NAME: &'static str = "Misbehaviour"; + const PACKAGE: &'static str = "ibc.lightclients.solomachine.v3"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.solomachine.v3.{}", Self::NAME) + } +} /// SignatureAndData contains a signature and the data signed over to create that /// signature. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SignatureAndData { @@ -77,9 +100,15 @@ pub struct SignatureAndData { #[prost(uint64, tag = "4")] pub timestamp: u64, } +impl ::prost::Name for SignatureAndData { + const NAME: &'static str = "SignatureAndData"; + const PACKAGE: &'static str = "ibc.lightclients.solomachine.v3"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.solomachine.v3.{}", Self::NAME) + } +} /// TimestampedSignatureData contains the signature data and the timestamp of the /// signature. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TimestampedSignatureData { @@ -88,8 +117,14 @@ pub struct TimestampedSignatureData { #[prost(uint64, tag = "2")] pub timestamp: u64, } +impl ::prost::Name for TimestampedSignatureData { + const NAME: &'static str = "TimestampedSignatureData"; + const PACKAGE: &'static str = "ibc.lightclients.solomachine.v3"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.solomachine.v3.{}", Self::NAME) + } +} /// SignBytes defines the signed bytes used for signature verification. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SignBytes { @@ -109,8 +144,14 @@ pub struct SignBytes { #[prost(bytes = "vec", tag = "5")] pub data: ::prost::alloc::vec::Vec, } +impl ::prost::Name for SignBytes { + const NAME: &'static str = "SignBytes"; + const PACKAGE: &'static str = "ibc.lightclients.solomachine.v3"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.solomachine.v3.{}", Self::NAME) + } +} /// HeaderData returns the SignBytes data for update verification. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct HeaderData { @@ -123,3 +164,10 @@ pub struct HeaderData { #[prost(string, tag = "2")] pub new_diversifier: ::prost::alloc::string::String, } +impl ::prost::Name for HeaderData { + const NAME: &'static str = "HeaderData"; + const PACKAGE: &'static str = "ibc.lightclients.solomachine.v3"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.solomachine.v3.{}", Self::NAME) + } +} diff --git a/src/prost/ibc.lightclients.solomachine.v3.serde.rs b/src/prost/ibc.lightclients.solomachine.v3.serde.rs new file mode 100644 index 00000000..aab33f1d --- /dev/null +++ b/src/prost/ibc.lightclients.solomachine.v3.serde.rs @@ -0,0 +1,1089 @@ +impl serde::Serialize for ClientState { + #[allow(deprecated)] + 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("ibc.lightclients.solomachine.v3.ClientState", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ::alloc::string::ToString::to_string(&self.sequence).as_str())?; + } + if true { + struct_ser.serialize_field("isFrozen", &self.is_frozen)?; + } + if let Some(v) = self.consensus_state.as_ref() { + struct_ser.serialize_field("consensusState", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ClientState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "sequence", + "is_frozen", + "isFrozen", + "consensus_state", + "consensusState", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sequence, + IsFrozen, + ConsensusState, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "sequence" => Ok(GeneratedField::Sequence), + "isFrozen" | "is_frozen" => Ok(GeneratedField::IsFrozen), + "consensusState" | "consensus_state" => Ok(GeneratedField::ConsensusState), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ClientState; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v3.ClientState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sequence__ = None; + let mut is_frozen__ = None; + let mut consensus_state__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Sequence => { + if sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("sequence")); + } + sequence__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::IsFrozen => { + if is_frozen__.is_some() { + return Err(serde::de::Error::duplicate_field("isFrozen")); + } + is_frozen__ = Some(map_.next_value()?); + } + GeneratedField::ConsensusState => { + if consensus_state__.is_some() { + return Err(serde::de::Error::duplicate_field("consensusState")); + } + consensus_state__ = map_.next_value()?; + } + } + } + Ok(ClientState { + sequence: sequence__.unwrap_or_default(), + is_frozen: is_frozen__.unwrap_or_default(), + consensus_state: consensus_state__, + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.solomachine.v3.ClientState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ConsensusState { + #[allow(deprecated)] + 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("ibc.lightclients.solomachine.v3.ConsensusState", len)?; + if let Some(v) = self.public_key.as_ref() { + struct_ser.serialize_field("publicKey", v)?; + } + if true { + struct_ser.serialize_field("diversifier", &self.diversifier)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("timestamp", ::alloc::string::ToString::to_string(&self.timestamp).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ConsensusState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "public_key", + "publicKey", + "diversifier", + "timestamp", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PublicKey, + Diversifier, + 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 { + "publicKey" | "public_key" => Ok(GeneratedField::PublicKey), + "diversifier" => Ok(GeneratedField::Diversifier), + "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 = ConsensusState; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v3.ConsensusState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut public_key__ = None; + let mut diversifier__ = None; + let mut timestamp__ = 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::Diversifier => { + if diversifier__.is_some() { + return Err(serde::de::Error::duplicate_field("diversifier")); + } + diversifier__ = Some(map_.next_value()?); + } + GeneratedField::Timestamp => { + if timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timestamp")); + } + timestamp__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(ConsensusState { + public_key: public_key__, + diversifier: diversifier__.unwrap_or_default(), + timestamp: timestamp__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.solomachine.v3.ConsensusState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Header { + #[allow(deprecated)] + 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("ibc.lightclients.solomachine.v3.Header", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("timestamp", ::alloc::string::ToString::to_string(&self.timestamp).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("signature", pbjson::private::base64::encode(&self.signature).as_str())?; + } + if let Some(v) = self.new_public_key.as_ref() { + struct_ser.serialize_field("newPublicKey", v)?; + } + if true { + struct_ser.serialize_field("newDiversifier", &self.new_diversifier)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Header { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "timestamp", + "signature", + "new_public_key", + "newPublicKey", + "new_diversifier", + "newDiversifier", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Timestamp, + Signature, + NewPublicKey, + NewDiversifier, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "timestamp" => Ok(GeneratedField::Timestamp), + "signature" => Ok(GeneratedField::Signature), + "newPublicKey" | "new_public_key" => Ok(GeneratedField::NewPublicKey), + "newDiversifier" | "new_diversifier" => Ok(GeneratedField::NewDiversifier), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Header; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v3.Header") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut timestamp__ = None; + let mut signature__ = None; + let mut new_public_key__ = None; + let mut new_diversifier__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Timestamp => { + if timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timestamp")); + } + timestamp__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Signature => { + if signature__.is_some() { + return Err(serde::de::Error::duplicate_field("signature")); + } + signature__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::NewPublicKey => { + if new_public_key__.is_some() { + return Err(serde::de::Error::duplicate_field("newPublicKey")); + } + new_public_key__ = map_.next_value()?; + } + GeneratedField::NewDiversifier => { + if new_diversifier__.is_some() { + return Err(serde::de::Error::duplicate_field("newDiversifier")); + } + new_diversifier__ = Some(map_.next_value()?); + } + } + } + Ok(Header { + timestamp: timestamp__.unwrap_or_default(), + signature: signature__.unwrap_or_default(), + new_public_key: new_public_key__, + new_diversifier: new_diversifier__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.solomachine.v3.Header", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for HeaderData { + #[allow(deprecated)] + 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("ibc.lightclients.solomachine.v3.HeaderData", len)?; + if let Some(v) = self.new_pub_key.as_ref() { + struct_ser.serialize_field("newPubKey", v)?; + } + if true { + struct_ser.serialize_field("newDiversifier", &self.new_diversifier)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for HeaderData { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "new_pub_key", + "newPubKey", + "new_diversifier", + "newDiversifier", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + NewPubKey, + NewDiversifier, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "newPubKey" | "new_pub_key" => Ok(GeneratedField::NewPubKey), + "newDiversifier" | "new_diversifier" => Ok(GeneratedField::NewDiversifier), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = HeaderData; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v3.HeaderData") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut new_pub_key__ = None; + let mut new_diversifier__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::NewPubKey => { + if new_pub_key__.is_some() { + return Err(serde::de::Error::duplicate_field("newPubKey")); + } + new_pub_key__ = map_.next_value()?; + } + GeneratedField::NewDiversifier => { + if new_diversifier__.is_some() { + return Err(serde::de::Error::duplicate_field("newDiversifier")); + } + new_diversifier__ = Some(map_.next_value()?); + } + } + } + Ok(HeaderData { + new_pub_key: new_pub_key__, + new_diversifier: new_diversifier__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.solomachine.v3.HeaderData", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Misbehaviour { + #[allow(deprecated)] + 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("ibc.lightclients.solomachine.v3.Misbehaviour", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ::alloc::string::ToString::to_string(&self.sequence).as_str())?; + } + if let Some(v) = self.signature_one.as_ref() { + struct_ser.serialize_field("signatureOne", v)?; + } + if let Some(v) = self.signature_two.as_ref() { + struct_ser.serialize_field("signatureTwo", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Misbehaviour { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "sequence", + "signature_one", + "signatureOne", + "signature_two", + "signatureTwo", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sequence, + SignatureOne, + SignatureTwo, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "sequence" => Ok(GeneratedField::Sequence), + "signatureOne" | "signature_one" => Ok(GeneratedField::SignatureOne), + "signatureTwo" | "signature_two" => Ok(GeneratedField::SignatureTwo), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Misbehaviour; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v3.Misbehaviour") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sequence__ = None; + let mut signature_one__ = None; + let mut signature_two__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Sequence => { + if sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("sequence")); + } + sequence__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::SignatureOne => { + if signature_one__.is_some() { + return Err(serde::de::Error::duplicate_field("signatureOne")); + } + signature_one__ = map_.next_value()?; + } + GeneratedField::SignatureTwo => { + if signature_two__.is_some() { + return Err(serde::de::Error::duplicate_field("signatureTwo")); + } + signature_two__ = map_.next_value()?; + } + } + } + Ok(Misbehaviour { + sequence: sequence__.unwrap_or_default(), + signature_one: signature_one__, + signature_two: signature_two__, + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.solomachine.v3.Misbehaviour", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SignBytes { + #[allow(deprecated)] + 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("ibc.lightclients.solomachine.v3.SignBytes", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ::alloc::string::ToString::to_string(&self.sequence).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("timestamp", ::alloc::string::ToString::to_string(&self.timestamp).as_str())?; + } + if true { + struct_ser.serialize_field("diversifier", &self.diversifier)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SignBytes { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "sequence", + "timestamp", + "diversifier", + "path", + "data", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sequence, + Timestamp, + Diversifier, + Path, + Data, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "sequence" => Ok(GeneratedField::Sequence), + "timestamp" => Ok(GeneratedField::Timestamp), + "diversifier" => Ok(GeneratedField::Diversifier), + "path" => Ok(GeneratedField::Path), + "data" => Ok(GeneratedField::Data), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SignBytes; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v3.SignBytes") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sequence__ = None; + let mut timestamp__ = None; + let mut diversifier__ = None; + let mut path__ = None; + let mut data__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Sequence => { + if sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("sequence")); + } + sequence__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Timestamp => { + if timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timestamp")); + } + timestamp__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Diversifier => { + if diversifier__.is_some() { + return Err(serde::de::Error::duplicate_field("diversifier")); + } + diversifier__ = Some(map_.next_value()?); + } + GeneratedField::Path => { + if path__.is_some() { + return Err(serde::de::Error::duplicate_field("path")); + } + path__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(SignBytes { + sequence: sequence__.unwrap_or_default(), + timestamp: timestamp__.unwrap_or_default(), + diversifier: diversifier__.unwrap_or_default(), + path: path__.unwrap_or_default(), + data: data__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.solomachine.v3.SignBytes", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SignatureAndData { + #[allow(deprecated)] + 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("ibc.lightclients.solomachine.v3.SignatureAndData", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("signature", pbjson::private::base64::encode(&self.signature).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("timestamp", ::alloc::string::ToString::to_string(&self.timestamp).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SignatureAndData { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "signature", + "path", + "data", + "timestamp", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Signature, + Path, + Data, + 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 { + "signature" => Ok(GeneratedField::Signature), + "path" => Ok(GeneratedField::Path), + "data" => Ok(GeneratedField::Data), + "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 = SignatureAndData; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v3.SignatureAndData") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut signature__ = None; + let mut path__ = None; + let mut data__ = None; + let mut timestamp__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Signature => { + if signature__.is_some() { + return Err(serde::de::Error::duplicate_field("signature")); + } + signature__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Path => { + if path__.is_some() { + return Err(serde::de::Error::duplicate_field("path")); + } + path__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Timestamp => { + if timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timestamp")); + } + timestamp__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(SignatureAndData { + signature: signature__.unwrap_or_default(), + path: path__.unwrap_or_default(), + data: data__.unwrap_or_default(), + timestamp: timestamp__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.solomachine.v3.SignatureAndData", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for TimestampedSignatureData { + #[allow(deprecated)] + 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("ibc.lightclients.solomachine.v3.TimestampedSignatureData", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("signatureData", pbjson::private::base64::encode(&self.signature_data).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("timestamp", ::alloc::string::ToString::to_string(&self.timestamp).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for TimestampedSignatureData { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "signature_data", + "signatureData", + "timestamp", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + SignatureData, + 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 { + "signatureData" | "signature_data" => Ok(GeneratedField::SignatureData), + "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 = TimestampedSignatureData; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v3.TimestampedSignatureData") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut signature_data__ = None; + let mut timestamp__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::SignatureData => { + if signature_data__.is_some() { + return Err(serde::de::Error::duplicate_field("signatureData")); + } + signature_data__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Timestamp => { + if timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timestamp")); + } + timestamp__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(TimestampedSignatureData { + signature_data: signature_data__.unwrap_or_default(), + timestamp: timestamp__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.solomachine.v3.TimestampedSignatureData", FIELDS, GeneratedVisitor) + } +} diff --git a/src/prost/ibc.lightclients.tendermint.v1.rs b/src/prost/ibc.lightclients.tendermint.v1.rs index 8849c261..ff15fefe 100644 --- a/src/prost/ibc.lightclients.tendermint.v1.rs +++ b/src/prost/ibc.lightclients.tendermint.v1.rs @@ -1,6 +1,5 @@ /// ClientState from Tendermint tracks the current validator set, latest height, /// and a possible frozen height. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ClientState { @@ -57,8 +56,14 @@ pub struct ClientState { #[prost(bool, tag = "11")] pub allow_update_after_misbehaviour: bool, } +impl ::prost::Name for ClientState { + const NAME: &'static str = "ClientState"; + const PACKAGE: &'static str = "ibc.lightclients.tendermint.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.tendermint.v1.{}", Self::NAME) + } +} /// ConsensusState defines the consensus state from Tendermint. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConsensusState { @@ -76,9 +81,15 @@ pub struct ConsensusState { #[prost(bytes = "vec", tag = "3")] pub next_validators_hash: ::prost::alloc::vec::Vec, } +impl ::prost::Name for ConsensusState { + const NAME: &'static str = "ConsensusState"; + const PACKAGE: &'static str = "ibc.lightclients.tendermint.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.tendermint.v1.{}", Self::NAME) + } +} /// Misbehaviour is a wrapper over two conflicting Headers /// that implements Misbehaviour interface expected by ICS-02 -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Misbehaviour { @@ -91,6 +102,13 @@ pub struct Misbehaviour { #[prost(message, optional, tag = "3")] pub header_2: ::core::option::Option
, } +impl ::prost::Name for Misbehaviour { + const NAME: &'static str = "Misbehaviour"; + const PACKAGE: &'static str = "ibc.lightclients.tendermint.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.tendermint.v1.{}", Self::NAME) + } +} /// Header defines the Tendermint client consensus Header. /// It encapsulates all the information necessary to update from a trusted /// Tendermint ConsensusState. The inclusion of TrustedHeight and @@ -103,7 +121,6 @@ pub struct Misbehaviour { /// current time in order to correctly verify, and the TrustedValidators must /// hash to TrustedConsensusState.NextValidatorsHash since that is the last /// trusted validator set at the TrustedHeight. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Header { @@ -120,9 +137,15 @@ pub struct Header { ::tendermint_proto::types::ValidatorSet, >, } +impl ::prost::Name for Header { + const NAME: &'static str = "Header"; + const PACKAGE: &'static str = "ibc.lightclients.tendermint.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.tendermint.v1.{}", Self::NAME) + } +} /// Fraction defines the protobuf message type for tmmath.Fraction that only /// supports positive values. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Fraction { @@ -131,3 +154,10 @@ pub struct Fraction { #[prost(uint64, tag = "2")] pub denominator: u64, } +impl ::prost::Name for Fraction { + const NAME: &'static str = "Fraction"; + const PACKAGE: &'static str = "ibc.lightclients.tendermint.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.tendermint.v1.{}", Self::NAME) + } +} diff --git a/src/prost/ibc.lightclients.tendermint.v1.serde.rs b/src/prost/ibc.lightclients.tendermint.v1.serde.rs new file mode 100644 index 00000000..e17df3cf --- /dev/null +++ b/src/prost/ibc.lightclients.tendermint.v1.serde.rs @@ -0,0 +1,789 @@ +impl serde::Serialize for ClientState { + #[allow(deprecated)] + 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("ibc.lightclients.tendermint.v1.ClientState", len)?; + if true { + struct_ser.serialize_field("chainId", &self.chain_id)?; + } + if let Some(v) = self.trust_level.as_ref() { + struct_ser.serialize_field("trustLevel", v)?; + } + if let Some(v) = self.trusting_period.as_ref() { + struct_ser.serialize_field("trustingPeriod", v)?; + } + if let Some(v) = self.unbonding_period.as_ref() { + struct_ser.serialize_field("unbondingPeriod", v)?; + } + if let Some(v) = self.max_clock_drift.as_ref() { + struct_ser.serialize_field("maxClockDrift", v)?; + } + if let Some(v) = self.frozen_height.as_ref() { + struct_ser.serialize_field("frozenHeight", v)?; + } + if let Some(v) = self.latest_height.as_ref() { + struct_ser.serialize_field("latestHeight", v)?; + } + if true { + struct_ser.serialize_field("proofSpecs", &self.proof_specs)?; + } + if true { + struct_ser.serialize_field("upgradePath", &self.upgrade_path)?; + } + if true { + struct_ser.serialize_field("allowUpdateAfterExpiry", &self.allow_update_after_expiry)?; + } + if true { + struct_ser.serialize_field("allowUpdateAfterMisbehaviour", &self.allow_update_after_misbehaviour)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ClientState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "chain_id", + "chainId", + "trust_level", + "trustLevel", + "trusting_period", + "trustingPeriod", + "unbonding_period", + "unbondingPeriod", + "max_clock_drift", + "maxClockDrift", + "frozen_height", + "frozenHeight", + "latest_height", + "latestHeight", + "proof_specs", + "proofSpecs", + "upgrade_path", + "upgradePath", + "allow_update_after_expiry", + "allowUpdateAfterExpiry", + "allow_update_after_misbehaviour", + "allowUpdateAfterMisbehaviour", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ChainId, + TrustLevel, + TrustingPeriod, + UnbondingPeriod, + MaxClockDrift, + FrozenHeight, + LatestHeight, + ProofSpecs, + UpgradePath, + AllowUpdateAfterExpiry, + AllowUpdateAfterMisbehaviour, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "chainId" | "chain_id" => Ok(GeneratedField::ChainId), + "trustLevel" | "trust_level" => Ok(GeneratedField::TrustLevel), + "trustingPeriod" | "trusting_period" => Ok(GeneratedField::TrustingPeriod), + "unbondingPeriod" | "unbonding_period" => Ok(GeneratedField::UnbondingPeriod), + "maxClockDrift" | "max_clock_drift" => Ok(GeneratedField::MaxClockDrift), + "frozenHeight" | "frozen_height" => Ok(GeneratedField::FrozenHeight), + "latestHeight" | "latest_height" => Ok(GeneratedField::LatestHeight), + "proofSpecs" | "proof_specs" => Ok(GeneratedField::ProofSpecs), + "upgradePath" | "upgrade_path" => Ok(GeneratedField::UpgradePath), + "allowUpdateAfterExpiry" | "allow_update_after_expiry" => Ok(GeneratedField::AllowUpdateAfterExpiry), + "allowUpdateAfterMisbehaviour" | "allow_update_after_misbehaviour" => Ok(GeneratedField::AllowUpdateAfterMisbehaviour), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ClientState; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.tendermint.v1.ClientState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut chain_id__ = None; + let mut trust_level__ = None; + let mut trusting_period__ = None; + let mut unbonding_period__ = None; + let mut max_clock_drift__ = None; + let mut frozen_height__ = None; + let mut latest_height__ = None; + let mut proof_specs__ = None; + let mut upgrade_path__ = None; + let mut allow_update_after_expiry__ = None; + let mut allow_update_after_misbehaviour__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ChainId => { + if chain_id__.is_some() { + return Err(serde::de::Error::duplicate_field("chainId")); + } + chain_id__ = Some(map_.next_value()?); + } + GeneratedField::TrustLevel => { + if trust_level__.is_some() { + return Err(serde::de::Error::duplicate_field("trustLevel")); + } + trust_level__ = map_.next_value()?; + } + GeneratedField::TrustingPeriod => { + if trusting_period__.is_some() { + return Err(serde::de::Error::duplicate_field("trustingPeriod")); + } + trusting_period__ = map_.next_value()?; + } + GeneratedField::UnbondingPeriod => { + if unbonding_period__.is_some() { + return Err(serde::de::Error::duplicate_field("unbondingPeriod")); + } + unbonding_period__ = map_.next_value()?; + } + GeneratedField::MaxClockDrift => { + if max_clock_drift__.is_some() { + return Err(serde::de::Error::duplicate_field("maxClockDrift")); + } + max_clock_drift__ = map_.next_value()?; + } + GeneratedField::FrozenHeight => { + if frozen_height__.is_some() { + return Err(serde::de::Error::duplicate_field("frozenHeight")); + } + frozen_height__ = map_.next_value()?; + } + GeneratedField::LatestHeight => { + if latest_height__.is_some() { + return Err(serde::de::Error::duplicate_field("latestHeight")); + } + latest_height__ = map_.next_value()?; + } + GeneratedField::ProofSpecs => { + if proof_specs__.is_some() { + return Err(serde::de::Error::duplicate_field("proofSpecs")); + } + proof_specs__ = Some(map_.next_value()?); + } + GeneratedField::UpgradePath => { + if upgrade_path__.is_some() { + return Err(serde::de::Error::duplicate_field("upgradePath")); + } + upgrade_path__ = Some(map_.next_value()?); + } + GeneratedField::AllowUpdateAfterExpiry => { + if allow_update_after_expiry__.is_some() { + return Err(serde::de::Error::duplicate_field("allowUpdateAfterExpiry")); + } + allow_update_after_expiry__ = Some(map_.next_value()?); + } + GeneratedField::AllowUpdateAfterMisbehaviour => { + if allow_update_after_misbehaviour__.is_some() { + return Err(serde::de::Error::duplicate_field("allowUpdateAfterMisbehaviour")); + } + allow_update_after_misbehaviour__ = Some(map_.next_value()?); + } + } + } + Ok(ClientState { + chain_id: chain_id__.unwrap_or_default(), + trust_level: trust_level__, + trusting_period: trusting_period__, + unbonding_period: unbonding_period__, + max_clock_drift: max_clock_drift__, + frozen_height: frozen_height__, + latest_height: latest_height__, + proof_specs: proof_specs__.unwrap_or_default(), + upgrade_path: upgrade_path__.unwrap_or_default(), + allow_update_after_expiry: allow_update_after_expiry__.unwrap_or_default(), + allow_update_after_misbehaviour: allow_update_after_misbehaviour__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.tendermint.v1.ClientState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ConsensusState { + #[allow(deprecated)] + 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("ibc.lightclients.tendermint.v1.ConsensusState", len)?; + if let Some(v) = self.timestamp.as_ref() { + struct_ser.serialize_field("timestamp", v)?; + } + if let Some(v) = self.root.as_ref() { + struct_ser.serialize_field("root", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("nextValidatorsHash", pbjson::private::base64::encode(&self.next_validators_hash).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ConsensusState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "timestamp", + "root", + "next_validators_hash", + "nextValidatorsHash", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Timestamp, + Root, + NextValidatorsHash, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "timestamp" => Ok(GeneratedField::Timestamp), + "root" => Ok(GeneratedField::Root), + "nextValidatorsHash" | "next_validators_hash" => Ok(GeneratedField::NextValidatorsHash), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ConsensusState; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.tendermint.v1.ConsensusState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut timestamp__ = None; + let mut root__ = None; + let mut next_validators_hash__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Timestamp => { + if timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timestamp")); + } + timestamp__ = map_.next_value()?; + } + GeneratedField::Root => { + if root__.is_some() { + return Err(serde::de::Error::duplicate_field("root")); + } + root__ = map_.next_value()?; + } + GeneratedField::NextValidatorsHash => { + if next_validators_hash__.is_some() { + return Err(serde::de::Error::duplicate_field("nextValidatorsHash")); + } + next_validators_hash__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(ConsensusState { + timestamp: timestamp__, + root: root__, + next_validators_hash: next_validators_hash__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.tendermint.v1.ConsensusState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Fraction { + #[allow(deprecated)] + 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("ibc.lightclients.tendermint.v1.Fraction", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("numerator", ::alloc::string::ToString::to_string(&self.numerator).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("denominator", ::alloc::string::ToString::to_string(&self.denominator).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Fraction { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "numerator", + "denominator", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Numerator, + Denominator, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "numerator" => Ok(GeneratedField::Numerator), + "denominator" => Ok(GeneratedField::Denominator), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Fraction; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.tendermint.v1.Fraction") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut numerator__ = None; + let mut denominator__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Numerator => { + if numerator__.is_some() { + return Err(serde::de::Error::duplicate_field("numerator")); + } + numerator__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Denominator => { + if denominator__.is_some() { + return Err(serde::de::Error::duplicate_field("denominator")); + } + denominator__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(Fraction { + numerator: numerator__.unwrap_or_default(), + denominator: denominator__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.tendermint.v1.Fraction", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Header { + #[allow(deprecated)] + 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("ibc.lightclients.tendermint.v1.Header", len)?; + if let Some(v) = self.signed_header.as_ref() { + struct_ser.serialize_field("signedHeader", v)?; + } + if let Some(v) = self.validator_set.as_ref() { + struct_ser.serialize_field("validatorSet", v)?; + } + if let Some(v) = self.trusted_height.as_ref() { + struct_ser.serialize_field("trustedHeight", v)?; + } + if let Some(v) = self.trusted_validators.as_ref() { + struct_ser.serialize_field("trustedValidators", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Header { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "signed_header", + "signedHeader", + "validator_set", + "validatorSet", + "trusted_height", + "trustedHeight", + "trusted_validators", + "trustedValidators", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + SignedHeader, + ValidatorSet, + TrustedHeight, + TrustedValidators, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "signedHeader" | "signed_header" => Ok(GeneratedField::SignedHeader), + "validatorSet" | "validator_set" => Ok(GeneratedField::ValidatorSet), + "trustedHeight" | "trusted_height" => Ok(GeneratedField::TrustedHeight), + "trustedValidators" | "trusted_validators" => Ok(GeneratedField::TrustedValidators), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Header; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.tendermint.v1.Header") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut signed_header__ = None; + let mut validator_set__ = None; + let mut trusted_height__ = None; + let mut trusted_validators__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::SignedHeader => { + if signed_header__.is_some() { + return Err(serde::de::Error::duplicate_field("signedHeader")); + } + signed_header__ = map_.next_value()?; + } + GeneratedField::ValidatorSet => { + if validator_set__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorSet")); + } + validator_set__ = map_.next_value()?; + } + GeneratedField::TrustedHeight => { + if trusted_height__.is_some() { + return Err(serde::de::Error::duplicate_field("trustedHeight")); + } + trusted_height__ = map_.next_value()?; + } + GeneratedField::TrustedValidators => { + if trusted_validators__.is_some() { + return Err(serde::de::Error::duplicate_field("trustedValidators")); + } + trusted_validators__ = map_.next_value()?; + } + } + } + Ok(Header { + signed_header: signed_header__, + validator_set: validator_set__, + trusted_height: trusted_height__, + trusted_validators: trusted_validators__, + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.tendermint.v1.Header", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Misbehaviour { + #[allow(deprecated)] + 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("ibc.lightclients.tendermint.v1.Misbehaviour", len)?; + if true { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + if let Some(v) = self.header_1.as_ref() { + struct_ser.serialize_field("header1", v)?; + } + if let Some(v) = self.header_2.as_ref() { + struct_ser.serialize_field("header2", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Misbehaviour { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "client_id", + "clientId", + "header_1", + "header1", + "header_2", + "header2", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClientId, + Header1, + Header2, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + "header1" | "header_1" => Ok(GeneratedField::Header1), + "header2" | "header_2" => Ok(GeneratedField::Header2), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Misbehaviour; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.tendermint.v1.Misbehaviour") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut client_id__ = None; + let mut header_1__ = None; + let mut header_2__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); + } + client_id__ = Some(map_.next_value()?); + } + GeneratedField::Header1 => { + if header_1__.is_some() { + return Err(serde::de::Error::duplicate_field("header1")); + } + header_1__ = map_.next_value()?; + } + GeneratedField::Header2 => { + if header_2__.is_some() { + return Err(serde::de::Error::duplicate_field("header2")); + } + header_2__ = map_.next_value()?; + } + } + } + Ok(Misbehaviour { + client_id: client_id__.unwrap_or_default(), + header_1: header_1__, + header_2: header_2__, + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.tendermint.v1.Misbehaviour", FIELDS, GeneratedVisitor) + } +} diff --git a/src/prost/ibc.lightclients.wasm.v1.rs b/src/prost/ibc.lightclients.wasm.v1.rs new file mode 100644 index 00000000..e540fc45 --- /dev/null +++ b/src/prost/ibc.lightclients.wasm.v1.rs @@ -0,0 +1,1100 @@ +/// MsgStoreCode defines the request type for the StoreCode rpc. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgStoreCode { + /// signer address + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// wasm byte code of light client contract. It can be raw or gzip compressed + #[prost(bytes = "vec", tag = "2")] + pub wasm_byte_code: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for MsgStoreCode { + const NAME: &'static str = "MsgStoreCode"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// MsgStoreCodeResponse defines the response type for the StoreCode rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgStoreCodeResponse { + /// checksum is the sha256 hash of the stored code + #[prost(bytes = "vec", tag = "1")] + pub checksum: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for MsgStoreCodeResponse { + const NAME: &'static str = "MsgStoreCodeResponse"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// MsgRemoveChecksum defines the request type for the MsgRemoveChecksum rpc. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgRemoveChecksum { + /// signer address + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// checksum is the sha256 hash to be removed from the store + #[prost(bytes = "vec", tag = "2")] + pub checksum: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for MsgRemoveChecksum { + const NAME: &'static str = "MsgRemoveChecksum"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// MsgStoreChecksumResponse defines the response type for the StoreCode rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgRemoveChecksumResponse {} +impl ::prost::Name for MsgRemoveChecksumResponse { + const NAME: &'static str = "MsgRemoveChecksumResponse"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// MsgMigrateContract defines the request type for the MigrateContract rpc. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgMigrateContract { + /// signer address + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// the client id of the contract + #[prost(string, tag = "2")] + pub client_id: ::prost::alloc::string::String, + /// checksum is the sha256 hash of the new wasm byte code for the contract + #[prost(bytes = "vec", tag = "3")] + pub checksum: ::prost::alloc::vec::Vec, + /// the json encoded message to be passed to the contract on migration + #[prost(bytes = "vec", tag = "4")] + pub msg: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for MsgMigrateContract { + const NAME: &'static str = "MsgMigrateContract"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// MsgMigrateContractResponse defines the response type for the MigrateContract rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgMigrateContractResponse {} +impl ::prost::Name for MsgMigrateContractResponse { + const NAME: &'static str = "MsgMigrateContractResponse"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// 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 ibc/08-wasm 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 + } + /// StoreCode defines a rpc handler method for MsgStoreCode. + pub async fn store_code( + &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( + "/ibc.lightclients.wasm.v1.Msg/StoreCode", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("ibc.lightclients.wasm.v1.Msg", "StoreCode")); + self.inner.unary(req, path, codec).await + } + /// RemoveChecksum defines a rpc handler method for MsgRemoveChecksum. + pub async fn remove_checksum( + &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( + "/ibc.lightclients.wasm.v1.Msg/RemoveChecksum", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("ibc.lightclients.wasm.v1.Msg", "RemoveChecksum"), + ); + self.inner.unary(req, path, codec).await + } + /// MigrateContract defines a rpc handler method for MsgMigrateContract. + pub async fn migrate_contract( + &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( + "/ibc.lightclients.wasm.v1.Msg/MigrateContract", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("ibc.lightclients.wasm.v1.Msg", "MigrateContract"), + ); + 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 { + /// StoreCode defines a rpc handler method for MsgStoreCode. + async fn store_code( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// RemoveChecksum defines a rpc handler method for MsgRemoveChecksum. + async fn remove_checksum( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// MigrateContract defines a rpc handler method for MsgMigrateContract. + async fn migrate_contract( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + /// Msg defines the ibc/08-wasm Msg service. + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/ibc.lightclients.wasm.v1.Msg/StoreCode" => { + #[allow(non_camel_case_types)] + struct StoreCodeSvc(pub Arc); + impl tonic::server::UnaryService + for StoreCodeSvc { + type Response = super::MsgStoreCodeResponse; + 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 { + ::store_code(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = StoreCodeSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/ibc.lightclients.wasm.v1.Msg/RemoveChecksum" => { + #[allow(non_camel_case_types)] + struct RemoveChecksumSvc(pub Arc); + impl tonic::server::UnaryService + for RemoveChecksumSvc { + type Response = super::MsgRemoveChecksumResponse; + 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 { + ::remove_checksum(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = RemoveChecksumSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/ibc.lightclients.wasm.v1.Msg/MigrateContract" => { + #[allow(non_camel_case_types)] + struct MigrateContractSvc(pub Arc); + impl tonic::server::UnaryService + for MigrateContractSvc { + type Response = super::MsgMigrateContractResponse; + 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 { + ::migrate_contract(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = MigrateContractSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "ibc.lightclients.wasm.v1.Msg"; + } +} +/// QueryChecksumsRequest is the request type for the Query/Checksums RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryChecksumsRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, +} +impl ::prost::Name for QueryChecksumsRequest { + const NAME: &'static str = "QueryChecksumsRequest"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// QueryChecksumsResponse is the response type for the Query/Checksums RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryChecksumsResponse { + /// checksums is a list of the hex encoded checksums of all wasm codes stored. + #[prost(string, repeated, tag = "1")] + pub checksums: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, +} +impl ::prost::Name for QueryChecksumsResponse { + const NAME: &'static str = "QueryChecksumsResponse"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// QueryCodeRequest is the request type for the Query/Code RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryCodeRequest { + /// checksum is a hex encoded string of the code stored. + #[prost(string, tag = "1")] + pub checksum: ::prost::alloc::string::String, +} +impl ::prost::Name for QueryCodeRequest { + const NAME: &'static str = "QueryCodeRequest"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// QueryCodeResponse is the response type for the Query/Code RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryCodeResponse { + #[prost(bytes = "vec", tag = "1")] + pub data: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for QueryCodeResponse { + const NAME: &'static str = "QueryCodeResponse"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// 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 service for wasm 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 + } + /// Get all Wasm checksums + pub async fn checksums( + &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( + "/ibc.lightclients.wasm.v1.Query/Checksums", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("ibc.lightclients.wasm.v1.Query", "Checksums")); + self.inner.unary(req, path, codec).await + } + /// Get Wasm code for given checksum + pub async fn code( + &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( + "/ibc.lightclients.wasm.v1.Query/Code", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("ibc.lightclients.wasm.v1.Query", "Code")); + 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 { + /// Get all Wasm checksums + async fn checksums( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Get Wasm code for given checksum + async fn code( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + /// Query service for wasm module + #[derive(Debug)] + pub struct QueryServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/ibc.lightclients.wasm.v1.Query/Checksums" => { + #[allow(non_camel_case_types)] + struct ChecksumsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ChecksumsSvc { + type Response = super::QueryChecksumsResponse; + 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 { + ::checksums(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ChecksumsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/ibc.lightclients.wasm.v1.Query/Code" => { + #[allow(non_camel_case_types)] + struct CodeSvc(pub Arc); + impl tonic::server::UnaryService + for CodeSvc { + type Response = super::QueryCodeResponse; + 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 { + ::code(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CodeSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "ibc.lightclients.wasm.v1.Query"; + } +} +/// GenesisState defines 08-wasm's keeper genesis state +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + /// uploaded light client wasm contracts + #[prost(message, repeated, tag = "1")] + pub contracts: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for GenesisState { + const NAME: &'static str = "GenesisState"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// Contract stores contract code +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Contract { + /// contract byte code + #[prost(bytes = "vec", tag = "1")] + pub code_bytes: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for Contract { + const NAME: &'static str = "Contract"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// Wasm light client's Client state +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ClientState { + /// bytes encoding the client state of the underlying light client + /// implemented as a Wasm contract. + #[prost(bytes = "vec", tag = "1")] + pub data: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "2")] + pub checksum: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "3")] + pub latest_height: ::core::option::Option< + super::super::super::core::client::v1::Height, + >, +} +impl ::prost::Name for ClientState { + const NAME: &'static str = "ClientState"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// Wasm light client's ConsensusState +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConsensusState { + /// bytes encoding the consensus state of the underlying light client + /// implemented as a Wasm contract. + #[prost(bytes = "vec", tag = "1")] + pub data: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for ConsensusState { + const NAME: &'static str = "ConsensusState"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// Wasm light client message (either header(s) or misbehaviour) +#[cfg_attr( + all(feature = "json-schema", feature = "serde"), + derive(::schemars::JsonSchema) +)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ClientMessage { + #[prost(bytes = "vec", tag = "1")] + pub data: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for ClientMessage { + const NAME: &'static str = "ClientMessage"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// Checksums defines a list of all checksums that are stored +/// +/// Deprecated: This message is deprecated in favor of storing the checksums +/// using a Collections.KeySet. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Checksums { + #[prost(bytes = "vec", repeated, tag = "1")] + pub checksums: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} +impl ::prost::Name for Checksums { + const NAME: &'static str = "Checksums"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} diff --git a/src/prost/ibc.lightclients.wasm.v1.serde.rs b/src/prost/ibc.lightclients.wasm.v1.serde.rs new file mode 100644 index 00000000..1cb03d5a --- /dev/null +++ b/src/prost/ibc.lightclients.wasm.v1.serde.rs @@ -0,0 +1,1592 @@ +impl serde::Serialize for Checksums { + #[allow(deprecated)] + 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("ibc.lightclients.wasm.v1.Checksums", len)?; + if true { + struct_ser.serialize_field("checksums", &self.checksums.iter().map(pbjson::private::base64::encode).collect::<::alloc::vec::Vec<_>>())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Checksums { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "checksums", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Checksums, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "checksums" => Ok(GeneratedField::Checksums), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Checksums; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.Checksums") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut checksums__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Checksums => { + if checksums__.is_some() { + return Err(serde::de::Error::duplicate_field("checksums")); + } + checksums__ = + Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::BytesDeserialize<_>>>()? + .into_iter().map(|x| x.0).collect()) + ; + } + } + } + Ok(Checksums { + checksums: checksums__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.Checksums", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ClientMessage { + #[allow(deprecated)] + 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("ibc.lightclients.wasm.v1.ClientMessage", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ClientMessage { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "data", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Data, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "data" => Ok(GeneratedField::Data), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ClientMessage; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.ClientMessage") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut data__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(ClientMessage { + data: data__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.ClientMessage", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ClientState { + #[allow(deprecated)] + 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("ibc.lightclients.wasm.v1.ClientState", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("checksum", pbjson::private::base64::encode(&self.checksum).as_str())?; + } + if let Some(v) = self.latest_height.as_ref() { + struct_ser.serialize_field("latestHeight", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ClientState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "data", + "checksum", + "latest_height", + "latestHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Data, + Checksum, + LatestHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "data" => Ok(GeneratedField::Data), + "checksum" => Ok(GeneratedField::Checksum), + "latestHeight" | "latest_height" => Ok(GeneratedField::LatestHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ClientState; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.ClientState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut data__ = None; + let mut checksum__ = None; + let mut latest_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Checksum => { + if checksum__.is_some() { + return Err(serde::de::Error::duplicate_field("checksum")); + } + checksum__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::LatestHeight => { + if latest_height__.is_some() { + return Err(serde::de::Error::duplicate_field("latestHeight")); + } + latest_height__ = map_.next_value()?; + } + } + } + Ok(ClientState { + data: data__.unwrap_or_default(), + checksum: checksum__.unwrap_or_default(), + latest_height: latest_height__, + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.ClientState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ConsensusState { + #[allow(deprecated)] + 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("ibc.lightclients.wasm.v1.ConsensusState", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ConsensusState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "data", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Data, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "data" => Ok(GeneratedField::Data), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ConsensusState; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.ConsensusState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut data__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(ConsensusState { + data: data__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.ConsensusState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Contract { + #[allow(deprecated)] + 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("ibc.lightclients.wasm.v1.Contract", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeBytes", pbjson::private::base64::encode(&self.code_bytes).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Contract { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "code_bytes", + "codeBytes", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CodeBytes, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "codeBytes" | "code_bytes" => Ok(GeneratedField::CodeBytes), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Contract; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.Contract") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut code_bytes__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::CodeBytes => { + if code_bytes__.is_some() { + return Err(serde::de::Error::duplicate_field("codeBytes")); + } + code_bytes__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(Contract { + code_bytes: code_bytes__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.Contract", 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; + } + let mut struct_ser = serializer.serialize_struct("ibc.lightclients.wasm.v1.GenesisState", len)?; + if true { + struct_ser.serialize_field("contracts", &self.contracts)?; + } + 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] = &[ + "contracts", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Contracts, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "contracts" => Ok(GeneratedField::Contracts), + _ => 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 ibc.lightclients.wasm.v1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut contracts__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Contracts => { + if contracts__.is_some() { + return Err(serde::de::Error::duplicate_field("contracts")); + } + contracts__ = Some(map_.next_value()?); + } + } + } + Ok(GenesisState { + contracts: contracts__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.GenesisState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgMigrateContract { + #[allow(deprecated)] + 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("ibc.lightclients.wasm.v1.MsgMigrateContract", len)?; + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + if true { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("checksum", pbjson::private::base64::encode(&self.checksum).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("msg", pbjson::private::base64::encode(&self.msg).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgMigrateContract { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "signer", + "client_id", + "clientId", + "checksum", + "msg", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Signer, + ClientId, + Checksum, + Msg, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "signer" => Ok(GeneratedField::Signer), + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + "checksum" => Ok(GeneratedField::Checksum), + "msg" => Ok(GeneratedField::Msg), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgMigrateContract; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.MsgMigrateContract") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut signer__ = None; + let mut client_id__ = None; + let mut checksum__ = None; + let mut msg__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); + } + client_id__ = Some(map_.next_value()?); + } + GeneratedField::Checksum => { + if checksum__.is_some() { + return Err(serde::de::Error::duplicate_field("checksum")); + } + checksum__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Msg => { + if msg__.is_some() { + return Err(serde::de::Error::duplicate_field("msg")); + } + msg__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgMigrateContract { + signer: signer__.unwrap_or_default(), + client_id: client_id__.unwrap_or_default(), + checksum: checksum__.unwrap_or_default(), + msg: msg__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.MsgMigrateContract", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgMigrateContractResponse { + #[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("ibc.lightclients.wasm.v1.MsgMigrateContractResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgMigrateContractResponse { + #[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 = MsgMigrateContractResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.MsgMigrateContractResponse") + } + + 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(MsgMigrateContractResponse { + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.MsgMigrateContractResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgRemoveChecksum { + #[allow(deprecated)] + 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("ibc.lightclients.wasm.v1.MsgRemoveChecksum", len)?; + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("checksum", pbjson::private::base64::encode(&self.checksum).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgRemoveChecksum { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "signer", + "checksum", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Signer, + Checksum, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "signer" => Ok(GeneratedField::Signer), + "checksum" => Ok(GeneratedField::Checksum), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgRemoveChecksum; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.MsgRemoveChecksum") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut signer__ = None; + let mut checksum__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + GeneratedField::Checksum => { + if checksum__.is_some() { + return Err(serde::de::Error::duplicate_field("checksum")); + } + checksum__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgRemoveChecksum { + signer: signer__.unwrap_or_default(), + checksum: checksum__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.MsgRemoveChecksum", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgRemoveChecksumResponse { + #[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("ibc.lightclients.wasm.v1.MsgRemoveChecksumResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgRemoveChecksumResponse { + #[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 = MsgRemoveChecksumResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.MsgRemoveChecksumResponse") + } + + 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(MsgRemoveChecksumResponse { + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.MsgRemoveChecksumResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgStoreCode { + #[allow(deprecated)] + 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("ibc.lightclients.wasm.v1.MsgStoreCode", len)?; + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("wasmByteCode", pbjson::private::base64::encode(&self.wasm_byte_code).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgStoreCode { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "signer", + "wasm_byte_code", + "wasmByteCode", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Signer, + WasmByteCode, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "signer" => Ok(GeneratedField::Signer), + "wasmByteCode" | "wasm_byte_code" => Ok(GeneratedField::WasmByteCode), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgStoreCode; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.MsgStoreCode") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut signer__ = None; + let mut wasm_byte_code__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + GeneratedField::WasmByteCode => { + if wasm_byte_code__.is_some() { + return Err(serde::de::Error::duplicate_field("wasmByteCode")); + } + wasm_byte_code__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgStoreCode { + signer: signer__.unwrap_or_default(), + wasm_byte_code: wasm_byte_code__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.MsgStoreCode", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgStoreCodeResponse { + #[allow(deprecated)] + 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("ibc.lightclients.wasm.v1.MsgStoreCodeResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("checksum", pbjson::private::base64::encode(&self.checksum).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgStoreCodeResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "checksum", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Checksum, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "checksum" => Ok(GeneratedField::Checksum), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgStoreCodeResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.MsgStoreCodeResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut checksum__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Checksum => { + if checksum__.is_some() { + return Err(serde::de::Error::duplicate_field("checksum")); + } + checksum__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgStoreCodeResponse { + checksum: checksum__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.MsgStoreCodeResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryChecksumsRequest { + #[allow(deprecated)] + 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("ibc.lightclients.wasm.v1.QueryChecksumsRequest", len)?; + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryChecksumsRequest { + #[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 = QueryChecksumsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.QueryChecksumsRequest") + } + + 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(QueryChecksumsRequest { + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.QueryChecksumsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryChecksumsResponse { + #[allow(deprecated)] + 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("ibc.lightclients.wasm.v1.QueryChecksumsResponse", len)?; + if true { + struct_ser.serialize_field("checksums", &self.checksums)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryChecksumsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "checksums", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Checksums, + 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 { + "checksums" => Ok(GeneratedField::Checksums), + "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 = QueryChecksumsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.QueryChecksumsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut checksums__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Checksums => { + if checksums__.is_some() { + return Err(serde::de::Error::duplicate_field("checksums")); + } + checksums__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryChecksumsResponse { + checksums: checksums__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.QueryChecksumsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryCodeRequest { + #[allow(deprecated)] + 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("ibc.lightclients.wasm.v1.QueryCodeRequest", len)?; + if true { + struct_ser.serialize_field("checksum", &self.checksum)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryCodeRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "checksum", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Checksum, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "checksum" => Ok(GeneratedField::Checksum), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryCodeRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.QueryCodeRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut checksum__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Checksum => { + if checksum__.is_some() { + return Err(serde::de::Error::duplicate_field("checksum")); + } + checksum__ = Some(map_.next_value()?); + } + } + } + Ok(QueryCodeRequest { + checksum: checksum__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.QueryCodeRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryCodeResponse { + #[allow(deprecated)] + 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("ibc.lightclients.wasm.v1.QueryCodeResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryCodeResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "data", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Data, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "data" => Ok(GeneratedField::Data), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryCodeResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.QueryCodeResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut data__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(QueryCodeResponse { + data: data__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.QueryCodeResponse", FIELDS, GeneratedVisitor) + } +} diff --git a/src/prost/ibc.mock.rs b/src/prost/ibc.mock.rs index f37cedbd..d47fadf7 100644 --- a/src/prost/ibc.mock.rs +++ b/src/prost/ibc.mock.rs @@ -6,18 +6,39 @@ pub struct Header { #[prost(uint64, tag = "2")] pub timestamp: u64, } +impl ::prost::Name for Header { + const NAME: &'static str = "Header"; + const PACKAGE: &'static str = "ibc.mock"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.mock.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ClientState { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option
, } +impl ::prost::Name for ClientState { + const NAME: &'static str = "ClientState"; + const PACKAGE: &'static str = "ibc.mock"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.mock.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConsensusState { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option
, } +impl ::prost::Name for ConsensusState { + const NAME: &'static str = "ConsensusState"; + const PACKAGE: &'static str = "ibc.mock"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.mock.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Misbehaviour { @@ -28,3 +49,10 @@ pub struct Misbehaviour { #[prost(message, optional, tag = "3")] pub header2: ::core::option::Option
, } +impl ::prost::Name for Misbehaviour { + const NAME: &'static str = "Misbehaviour"; + const PACKAGE: &'static str = "ibc.mock"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.mock.{}", Self::NAME) + } +} diff --git a/src/prost/ibc.mock.serde.rs b/src/prost/ibc.mock.serde.rs new file mode 100644 index 00000000..0e279efd --- /dev/null +++ b/src/prost/ibc.mock.serde.rs @@ -0,0 +1,419 @@ +impl serde::Serialize for ClientState { + #[allow(deprecated)] + 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("ibc.mock.ClientState", len)?; + if let Some(v) = self.header.as_ref() { + struct_ser.serialize_field("header", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ClientState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "header", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Header, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ClientState; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.mock.ClientState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut header__ = 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()?; + } + } + } + Ok(ClientState { + header: header__, + }) + } + } + deserializer.deserialize_struct("ibc.mock.ClientState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ConsensusState { + #[allow(deprecated)] + 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("ibc.mock.ConsensusState", len)?; + if let Some(v) = self.header.as_ref() { + struct_ser.serialize_field("header", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ConsensusState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "header", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Header, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ConsensusState; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.mock.ConsensusState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut header__ = 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()?; + } + } + } + Ok(ConsensusState { + header: header__, + }) + } + } + deserializer.deserialize_struct("ibc.mock.ConsensusState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Header { + #[allow(deprecated)] + 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("ibc.mock.Header", len)?; + if let Some(v) = self.height.as_ref() { + struct_ser.serialize_field("height", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("timestamp", ::alloc::string::ToString::to_string(&self.timestamp).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Header { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "height", + "timestamp", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Height, + 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 { + "height" => Ok(GeneratedField::Height), + "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 = Header; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.mock.Header") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut height__ = None; + let mut timestamp__ = 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__ = map_.next_value()?; + } + GeneratedField::Timestamp => { + if timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timestamp")); + } + timestamp__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(Header { + height: height__, + timestamp: timestamp__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.mock.Header", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Misbehaviour { + #[allow(deprecated)] + 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("ibc.mock.Misbehaviour", len)?; + if true { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + if let Some(v) = self.header1.as_ref() { + struct_ser.serialize_field("header1", v)?; + } + if let Some(v) = self.header2.as_ref() { + struct_ser.serialize_field("header2", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Misbehaviour { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "client_id", + "clientId", + "header1", + "header2", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClientId, + Header1, + Header2, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + "header1" => Ok(GeneratedField::Header1), + "header2" => Ok(GeneratedField::Header2), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Misbehaviour; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.mock.Misbehaviour") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut client_id__ = None; + let mut header1__ = None; + let mut header2__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); + } + client_id__ = Some(map_.next_value()?); + } + GeneratedField::Header1 => { + if header1__.is_some() { + return Err(serde::de::Error::duplicate_field("header1")); + } + header1__ = map_.next_value()?; + } + GeneratedField::Header2 => { + if header2__.is_some() { + return Err(serde::de::Error::duplicate_field("header2")); + } + header2__ = map_.next_value()?; + } + } + } + Ok(Misbehaviour { + client_id: client_id__.unwrap_or_default(), + header1: header1__, + header2: header2__, + }) + } + } + deserializer.deserialize_struct("ibc.mock.Misbehaviour", FIELDS, GeneratedVisitor) + } +} diff --git a/src/prost/interchain_security.ccv.consumer.v1.rs b/src/prost/interchain_security.ccv.consumer.v1.rs index 53f9f670..b9e93f4d 100644 --- a/src/prost/interchain_security.ccv.consumer.v1.rs +++ b/src/prost/interchain_security.ccv.consumer.v1.rs @@ -17,6 +17,13 @@ pub struct CrossChainValidator { super::super::super::super::google::protobuf::Any, >, } +impl ::prost::Name for CrossChainValidator { + const NAME: &'static str = "CrossChainValidator"; + const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.consumer.v1.{}", Self::NAME) + } +} /// A record storing the state of a slash packet sent to the provider chain /// which may bounce back and forth until handled by the provider. /// @@ -31,6 +38,13 @@ pub struct SlashRecord { super::super::super::super::google::protobuf::Timestamp, >, } +impl ::prost::Name for SlashRecord { + const NAME: &'static str = "SlashRecord"; + const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.consumer.v1.{}", Self::NAME) + } +} /// NextFeeDistributionEstimate holds information about next fee distribution #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -57,18 +71,46 @@ pub struct NextFeeDistributionEstimate { #[prost(string, tag = "7")] pub to_consumer: ::prost::alloc::string::String, } +impl ::prost::Name for NextFeeDistributionEstimate { + const NAME: &'static str = "NextFeeDistributionEstimate"; + const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.consumer.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryNextFeeDistributionEstimateRequest {} +impl ::prost::Name for QueryNextFeeDistributionEstimateRequest { + const NAME: &'static str = "QueryNextFeeDistributionEstimateRequest"; + const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.consumer.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryNextFeeDistributionEstimateResponse { #[prost(message, optional, tag = "1")] pub data: ::core::option::Option, } +impl ::prost::Name for QueryNextFeeDistributionEstimateResponse { + const NAME: &'static str = "QueryNextFeeDistributionEstimateResponse"; + const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.consumer.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} +impl ::prost::Name for QueryParamsRequest { + const NAME: &'static str = "QueryParamsRequest"; + const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.consumer.v1.{}", Self::NAME) + } +} /// QueryParamsResponse is response type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -77,9 +119,23 @@ 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 = "interchain_security.ccv.consumer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.consumer.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProviderInfoRequest {} +impl ::prost::Name for QueryProviderInfoRequest { + const NAME: &'static str = "QueryProviderInfoRequest"; + const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.consumer.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProviderInfoResponse { @@ -88,6 +144,13 @@ pub struct QueryProviderInfoResponse { #[prost(message, optional, tag = "2")] pub provider: ::core::option::Option, } +impl ::prost::Name for QueryProviderInfoResponse { + const NAME: &'static str = "QueryProviderInfoResponse"; + const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.consumer.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ChainInfo { @@ -100,6 +163,13 @@ pub struct ChainInfo { #[prost(string, tag = "4")] pub channel_id: ::prost::alloc::string::String, } +impl ::prost::Name for ChainInfo { + const NAME: &'static str = "ChainInfo"; + const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.consumer.v1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod query_client { diff --git a/src/prost/interchain_security.ccv.provider.v1.rs b/src/prost/interchain_security.ccv.provider.v1.rs index 2f65ca07..f0561dee 100644 --- a/src/prost/interchain_security.ccv.provider.v1.rs +++ b/src/prost/interchain_security.ccv.provider.v1.rs @@ -13,9 +13,23 @@ pub struct MsgAssignConsumerKey { #[prost(string, tag = "3")] pub consumer_key: ::prost::alloc::string::String, } +impl ::prost::Name for MsgAssignConsumerKey { + const NAME: &'static str = "MsgAssignConsumerKey"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgAssignConsumerKeyResponse {} +impl ::prost::Name for MsgAssignConsumerKeyResponse { + const NAME: &'static str = "MsgAssignConsumerKeyResponse"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} /// MsgSubmitConsumerMisbehaviour defines a message that reports a light client attack, /// also known as a misbehaviour, observed on a consumer chain #[allow(clippy::derive_partial_eq_without_eq)] @@ -30,9 +44,23 @@ pub struct MsgSubmitConsumerMisbehaviour { super::super::super::super::ibc::lightclients::tendermint::v1::Misbehaviour, >, } +impl ::prost::Name for MsgSubmitConsumerMisbehaviour { + const NAME: &'static str = "MsgSubmitConsumerMisbehaviour"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitConsumerMisbehaviourResponse {} +impl ::prost::Name for MsgSubmitConsumerMisbehaviourResponse { + const NAME: &'static str = "MsgSubmitConsumerMisbehaviourResponse"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} /// MsgSubmitConsumerDoubleVoting defines a message that reports /// a double signing infraction observed on a consumer chain #[allow(clippy::derive_partial_eq_without_eq)] @@ -52,9 +80,23 @@ pub struct MsgSubmitConsumerDoubleVoting { super::super::super::super::ibc::lightclients::tendermint::v1::Header, >, } +impl ::prost::Name for MsgSubmitConsumerDoubleVoting { + const NAME: &'static str = "MsgSubmitConsumerDoubleVoting"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitConsumerDoubleVotingResponse {} +impl ::prost::Name for MsgSubmitConsumerDoubleVotingResponse { + const NAME: &'static str = "MsgSubmitConsumerDoubleVotingResponse"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod msg_client { @@ -606,6 +648,13 @@ pub struct ConsumerAdditionProposal { #[prost(string, tag = "14")] pub distribution_transmission_channel: ::prost::alloc::string::String, } +impl ::prost::Name for ConsumerAdditionProposal { + const NAME: &'static str = "ConsumerAdditionProposal"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} /// ConsumerRemovalProposal is a governance proposal on the provider chain to /// remove (and stop) a consumer chain. If it passes, all the consumer chain's /// state is removed from the provider chain. The outstanding unbonding operation @@ -629,6 +678,13 @@ pub struct ConsumerRemovalProposal { super::super::super::super::google::protobuf::Timestamp, >, } +impl ::prost::Name for ConsumerRemovalProposal { + const NAME: &'static str = "ConsumerRemovalProposal"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} /// ChangeRewardDenomsProposal is a governance proposal on the provider chain to /// mutate the set of denoms accepted by the provider as rewards. #[allow(clippy::derive_partial_eq_without_eq)] @@ -647,6 +703,13 @@ pub struct ChangeRewardDenomsProposal { #[prost(string, repeated, tag = "4")] pub denoms_to_remove: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +impl ::prost::Name for ChangeRewardDenomsProposal { + const NAME: &'static str = "ChangeRewardDenomsProposal"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} /// A persisted queue entry indicating that a slash packet data instance needs to /// be handled. This type belongs in the "global" queue, to coordinate slash /// packet handling times between consumers. @@ -674,6 +737,13 @@ pub struct GlobalSlashEntry { #[prost(bytes = "vec", tag = "4")] pub provider_val_cons_addr: ::prost::alloc::vec::Vec, } +impl ::prost::Name for GlobalSlashEntry { + const NAME: &'static str = "GlobalSlashEntry"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} /// Params defines the parameters for CCV Provider module #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -725,6 +795,13 @@ pub struct Params { super::super::super::super::cosmos::base::v1beta1::Coin, >, } +impl ::prost::Name for Params { + const NAME: &'static str = "Params"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} /// SlashAcks contains cons addresses of consumer chain validators /// successfully slashed on the provider chain. #[allow(clippy::derive_partial_eq_without_eq)] @@ -733,6 +810,13 @@ pub struct SlashAcks { #[prost(string, repeated, tag = "1")] pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +impl ::prost::Name for SlashAcks { + const NAME: &'static str = "SlashAcks"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} /// ConsumerAdditionProposals holds pending governance proposals on the provider /// chain to spawn a new chain. #[allow(clippy::derive_partial_eq_without_eq)] @@ -742,6 +826,13 @@ pub struct ConsumerAdditionProposals { #[prost(message, repeated, tag = "1")] pub pending: ::prost::alloc::vec::Vec, } +impl ::prost::Name for ConsumerAdditionProposals { + const NAME: &'static str = "ConsumerAdditionProposals"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} /// ConsumerRemovalProposals holds pending governance proposals on the provider /// chain to remove (and stop) a consumer chain. #[allow(clippy::derive_partial_eq_without_eq)] @@ -751,6 +842,13 @@ pub struct ConsumerRemovalProposals { #[prost(message, repeated, tag = "1")] pub pending: ::prost::alloc::vec::Vec, } +impl ::prost::Name for ConsumerRemovalProposals { + const NAME: &'static str = "ConsumerRemovalProposals"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} /// AddressList contains a list of consensus addresses #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -758,6 +856,13 @@ pub struct AddressList { #[prost(bytes = "vec", repeated, tag = "1")] pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, } +impl ::prost::Name for AddressList { + const NAME: &'static str = "AddressList"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ChannelToChain { @@ -766,6 +871,13 @@ pub struct ChannelToChain { #[prost(string, tag = "2")] pub chain_id: ::prost::alloc::string::String, } +impl ::prost::Name for ChannelToChain { + const NAME: &'static str = "ChannelToChain"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} /// VscUnbondingOps contains the IDs of unbonding operations that are waiting for /// at least one VSCMaturedPacket with vscID from a consumer chain #[allow(clippy::derive_partial_eq_without_eq)] @@ -776,6 +888,13 @@ pub struct VscUnbondingOps { #[prost(uint64, repeated, tag = "2")] pub unbonding_op_ids: ::prost::alloc::vec::Vec, } +impl ::prost::Name for VscUnbondingOps { + const NAME: &'static str = "VscUnbondingOps"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} /// UnbondingOp contains the ids of consumer chains that need to unbond before /// the unbonding operation with the given ID can unbond #[allow(clippy::derive_partial_eq_without_eq)] @@ -789,6 +908,13 @@ pub struct UnbondingOp { ::prost::alloc::string::String, >, } +impl ::prost::Name for UnbondingOp { + const NAME: &'static str = "UnbondingOp"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InitTimeoutTimestamp { @@ -797,6 +923,13 @@ pub struct InitTimeoutTimestamp { #[prost(uint64, tag = "2")] pub timestamp: u64, } +impl ::prost::Name for InitTimeoutTimestamp { + const NAME: &'static str = "InitTimeoutTimestamp"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct VscSendTimestamp { @@ -807,6 +940,13 @@ pub struct VscSendTimestamp { super::super::super::super::google::protobuf::Timestamp, >, } +impl ::prost::Name for VscSendTimestamp { + const NAME: &'static str = "VscSendTimestamp"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} /// ValidatorSetChangePackets is a pb list of ccv.ValidatorSetChangePacketData. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -814,6 +954,13 @@ pub struct ValidatorSetChangePackets { #[prost(message, repeated, tag = "1")] pub list: ::prost::alloc::vec::Vec, } +impl ::prost::Name for ValidatorSetChangePackets { + const NAME: &'static str = "ValidatorSetChangePackets"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} /// MaturedUnbondingOps defines a list of ids corresponding to ids of matured /// unbonding operations. #[allow(clippy::derive_partial_eq_without_eq)] @@ -822,6 +969,13 @@ pub struct MaturedUnbondingOps { #[prost(uint64, repeated, tag = "1")] pub ids: ::prost::alloc::vec::Vec, } +impl ::prost::Name for MaturedUnbondingOps { + const NAME: &'static str = "MaturedUnbondingOps"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} /// ExportedVscSendTimestamps is VscSendTimestamp with chainID info for exporting to genesis #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -831,6 +985,13 @@ pub struct ExportedVscSendTimestamp { #[prost(message, repeated, tag = "2")] pub vsc_send_timestamps: ::prost::alloc::vec::Vec, } +impl ::prost::Name for ExportedVscSendTimestamp { + const NAME: &'static str = "ExportedVscSendTimestamp"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct KeyAssignmentReplacement { @@ -841,6 +1002,13 @@ pub struct KeyAssignmentReplacement { #[prost(int64, tag = "3")] pub power: i64, } +impl ::prost::Name for KeyAssignmentReplacement { + const NAME: &'static str = "KeyAssignmentReplacement"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} /// Used to serialize the ValidatorConsumerPubKey index from key assignment /// ValidatorConsumerPubKey: (chainID, providerAddr consAddr) -> consumerKey /// tmprotocrypto.PublicKey @@ -854,6 +1022,13 @@ pub struct ValidatorConsumerPubKey { #[prost(message, optional, tag = "3")] pub consumer_key: ::core::option::Option<::tendermint_proto::crypto::PublicKey>, } +impl ::prost::Name for ValidatorConsumerPubKey { + const NAME: &'static str = "ValidatorConsumerPubKey"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} /// Used to serialize the ValidatorConsumerAddr index from key assignment /// ValidatorByConsumerAddr: (chainID, consumerAddr consAddr) -> providerAddr /// consAddr @@ -867,6 +1042,13 @@ pub struct ValidatorByConsumerAddr { #[prost(bytes = "vec", tag = "3")] pub provider_addr: ::prost::alloc::vec::Vec, } +impl ::prost::Name for ValidatorByConsumerAddr { + const NAME: &'static str = "ValidatorByConsumerAddr"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} /// Used to serialize the ConsumerAddrsToPrune index from key assignment /// ConsumerAddrsToPrune: (chainID, vscID uint64) -> consumerAddrs AddressList #[allow(clippy::derive_partial_eq_without_eq)] @@ -879,45 +1061,108 @@ pub struct ConsumerAddrsToPrune { #[prost(message, optional, tag = "3")] pub consumer_addrs: ::core::option::Option, } +impl ::prost::Name for ConsumerAddrsToPrune { + const NAME: &'static str = "ConsumerAddrsToPrune"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConsumerGenesisRequest { #[prost(string, tag = "1")] pub chain_id: ::prost::alloc::string::String, } +impl ::prost::Name for QueryConsumerGenesisRequest { + const NAME: &'static str = "QueryConsumerGenesisRequest"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConsumerGenesisResponse { #[prost(message, optional, tag = "1")] pub genesis_state: ::core::option::Option, } +impl ::prost::Name for QueryConsumerGenesisResponse { + const NAME: &'static str = "QueryConsumerGenesisResponse"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConsumerChainsRequest {} +impl ::prost::Name for QueryConsumerChainsRequest { + const NAME: &'static str = "QueryConsumerChainsRequest"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConsumerChainsResponse { #[prost(message, repeated, tag = "1")] pub chains: ::prost::alloc::vec::Vec, } +impl ::prost::Name for QueryConsumerChainsResponse { + const NAME: &'static str = "QueryConsumerChainsResponse"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConsumerChainStartProposalsRequest {} +impl ::prost::Name for QueryConsumerChainStartProposalsRequest { + const NAME: &'static str = "QueryConsumerChainStartProposalsRequest"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConsumerChainStartProposalsResponse { #[prost(message, optional, tag = "1")] pub proposals: ::core::option::Option, } +impl ::prost::Name for QueryConsumerChainStartProposalsResponse { + const NAME: &'static str = "QueryConsumerChainStartProposalsResponse"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConsumerChainStopProposalsRequest {} +impl ::prost::Name for QueryConsumerChainStopProposalsRequest { + const NAME: &'static str = "QueryConsumerChainStopProposalsRequest"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConsumerChainStopProposalsResponse { #[prost(message, optional, tag = "1")] pub proposals: ::core::option::Option, } +impl ::prost::Name for QueryConsumerChainStopProposalsResponse { + const NAME: &'static str = "QueryConsumerChainStopProposalsResponse"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Chain { @@ -926,6 +1171,13 @@ pub struct Chain { #[prost(string, tag = "2")] pub client_id: ::prost::alloc::string::String, } +impl ::prost::Name for Chain { + const NAME: &'static str = "Chain"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorConsumerAddrRequest { @@ -936,6 +1188,13 @@ pub struct QueryValidatorConsumerAddrRequest { #[prost(string, tag = "2")] pub provider_address: ::prost::alloc::string::String, } +impl ::prost::Name for QueryValidatorConsumerAddrRequest { + const NAME: &'static str = "QueryValidatorConsumerAddrRequest"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorConsumerAddrResponse { @@ -943,6 +1202,13 @@ pub struct QueryValidatorConsumerAddrResponse { #[prost(string, tag = "1")] pub consumer_address: ::prost::alloc::string::String, } +impl ::prost::Name for QueryValidatorConsumerAddrResponse { + const NAME: &'static str = "QueryValidatorConsumerAddrResponse"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorProviderAddrRequest { @@ -953,6 +1219,13 @@ pub struct QueryValidatorProviderAddrRequest { #[prost(string, tag = "2")] pub consumer_address: ::prost::alloc::string::String, } +impl ::prost::Name for QueryValidatorProviderAddrRequest { + const NAME: &'static str = "QueryValidatorProviderAddrRequest"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorProviderAddrResponse { @@ -960,9 +1233,23 @@ pub struct QueryValidatorProviderAddrResponse { #[prost(string, tag = "1")] pub provider_address: ::prost::alloc::string::String, } +impl ::prost::Name for QueryValidatorProviderAddrResponse { + const NAME: &'static str = "QueryValidatorProviderAddrResponse"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryThrottleStateRequest {} +impl ::prost::Name for QueryThrottleStateRequest { + const NAME: &'static str = "QueryThrottleStateRequest"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryThrottleStateResponse { @@ -983,12 +1270,26 @@ pub struct QueryThrottleStateResponse { #[prost(message, repeated, tag = "4")] pub packets: ::prost::alloc::vec::Vec, } +impl ::prost::Name for QueryThrottleStateResponse { + const NAME: &'static str = "QueryThrottleStateResponse"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryThrottledConsumerPacketDataRequest { #[prost(string, tag = "1")] pub chain_id: ::prost::alloc::string::String, } +impl ::prost::Name for QueryThrottledConsumerPacketDataRequest { + const NAME: &'static str = "QueryThrottledConsumerPacketDataRequest"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryThrottledConsumerPacketDataResponse { @@ -999,6 +1300,13 @@ pub struct QueryThrottledConsumerPacketDataResponse { #[prost(message, repeated, tag = "3")] pub packet_data_instances: ::prost::alloc::vec::Vec, } +impl ::prost::Name for QueryThrottledConsumerPacketDataResponse { + const NAME: &'static str = "QueryThrottledConsumerPacketDataResponse"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} /// A query wrapper type for the global entry and data relevant to a throttled /// slash packet. #[allow(clippy::derive_partial_eq_without_eq)] @@ -1009,6 +1317,13 @@ pub struct ThrottledSlashPacket { #[prost(message, optional, tag = "2")] pub data: ::core::option::Option, } +impl ::prost::Name for ThrottledSlashPacket { + const NAME: &'static str = "ThrottledSlashPacket"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} /// ThrottledPacketDataWrapper contains either SlashPacketData or /// VSCMaturedPacketData #[allow(clippy::derive_partial_eq_without_eq)] @@ -1028,15 +1343,36 @@ pub mod throttled_packet_data_wrapper { VscMaturedPacket(super::super::super::v1::VscMaturedPacketData), } } +impl ::prost::Name for ThrottledPacketDataWrapper { + const NAME: &'static str = "ThrottledPacketDataWrapper"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryRegisteredConsumerRewardDenomsRequest {} +impl ::prost::Name for QueryRegisteredConsumerRewardDenomsRequest { + const NAME: &'static str = "QueryRegisteredConsumerRewardDenomsRequest"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryRegisteredConsumerRewardDenomsResponse { #[prost(string, repeated, tag = "1")] pub denoms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +impl ::prost::Name for QueryRegisteredConsumerRewardDenomsResponse { + const NAME: &'static str = "QueryRegisteredConsumerRewardDenomsResponse"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod query_client { @@ -2112,6 +2448,13 @@ pub struct GenesisState { #[prost(message, repeated, tag = "13")] pub exported_vsc_send_timestamps: ::prost::alloc::vec::Vec, } +impl ::prost::Name for GenesisState { + const NAME: &'static str = "GenesisState"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} /// The provider CCV module's knowledge of consumer state. /// /// Note this type is only used internally to the provider CCV module. @@ -2146,6 +2489,13 @@ pub struct ConsumerState { #[prost(message, repeated, tag = "8")] pub unbonding_ops_index: ::prost::alloc::vec::Vec, } +impl ::prost::Name for ConsumerState { + const NAME: &'static str = "ConsumerState"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} /// ValsetUpdateIdToHeight defines the genesis information for the mapping /// of each valset udpate id to a block height #[allow(clippy::derive_partial_eq_without_eq)] @@ -2156,3 +2506,10 @@ pub struct ValsetUpdateIdToHeight { #[prost(uint64, tag = "2")] pub height: u64, } +impl ::prost::Name for ValsetUpdateIdToHeight { + const NAME: &'static str = "ValsetUpdateIdToHeight"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} diff --git a/src/prost/interchain_security.ccv.v1.rs b/src/prost/interchain_security.ccv.v1.rs index 1ded3981..c072c5f1 100644 --- a/src/prost/interchain_security.ccv.v1.rs +++ b/src/prost/interchain_security.ccv.v1.rs @@ -17,6 +17,13 @@ pub struct ValidatorSetChangePacketData { #[prost(string, repeated, tag = "3")] pub slash_acks: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +impl ::prost::Name for ValidatorSetChangePacketData { + const NAME: &'static str = "ValidatorSetChangePacketData"; + const PACKAGE: &'static str = "interchain_security.ccv.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.v1.{}", Self::NAME) + } +} /// This packet is sent from the consumer chain to the provider chain /// to notify that a VSC packet reached maturity on the consumer chain. #[allow(clippy::derive_partial_eq_without_eq)] @@ -26,6 +33,13 @@ pub struct VscMaturedPacketData { #[prost(uint64, tag = "1")] pub valset_update_id: u64, } +impl ::prost::Name for VscMaturedPacketData { + const NAME: &'static str = "VSCMaturedPacketData"; + const PACKAGE: &'static str = "interchain_security.ccv.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.v1.{}", Self::NAME) + } +} /// This packet is sent from the consumer chain to the provider chain /// to request the slashing of a validator as a result of an infraction /// committed on the consumer chain. @@ -44,6 +58,13 @@ pub struct SlashPacketData { )] pub infraction: i32, } +impl ::prost::Name for SlashPacketData { + const NAME: &'static str = "SlashPacketData"; + const PACKAGE: &'static str = "interchain_security.ccv.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.v1.{}", Self::NAME) + } +} /// ConsumerPacketData contains a consumer packet data and a type tag #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -64,6 +85,13 @@ pub mod consumer_packet_data { VscMaturedPacketData(super::VscMaturedPacketData), } } +impl ::prost::Name for ConsumerPacketData { + const NAME: &'static str = "ConsumerPacketData"; + const PACKAGE: &'static str = "interchain_security.ccv.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.v1.{}", Self::NAME) + } +} /// Note this type is used during IBC handshake methods for both the consumer and provider #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -73,6 +101,13 @@ pub struct HandshakeMetadata { #[prost(string, tag = "2")] pub version: ::prost::alloc::string::String, } +impl ::prost::Name for HandshakeMetadata { + const NAME: &'static str = "HandshakeMetadata"; + const PACKAGE: &'static str = "interchain_security.ccv.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.v1.{}", Self::NAME) + } +} /// ConsumerPacketData contains a consumer packet data and a type tag /// that is compatible with ICS v1 and v2 over the wire. It is not used for internal storage. #[allow(clippy::derive_partial_eq_without_eq)] @@ -94,6 +129,13 @@ pub mod consumer_packet_data_v1 { VscMaturedPacketData(super::VscMaturedPacketData), } } +impl ::prost::Name for ConsumerPacketDataV1 { + const NAME: &'static str = "ConsumerPacketDataV1"; + const PACKAGE: &'static str = "interchain_security.ccv.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.v1.{}", Self::NAME) + } +} /// This packet is sent from the consumer chain to the provider chain /// It is backward compatible with the ICS v1 and v2 version of the packet. #[allow(clippy::derive_partial_eq_without_eq)] @@ -108,6 +150,13 @@ pub struct SlashPacketDataV1 { #[prost(enumeration = "InfractionType", tag = "3")] pub infraction: i32, } +impl ::prost::Name for SlashPacketDataV1 { + const NAME: &'static str = "SlashPacketDataV1"; + const PACKAGE: &'static str = "interchain_security.ccv.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.v1.{}", Self::NAME) + } +} /// ConsumerPacketType indicates interchain security specific packet types. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] @@ -250,6 +299,13 @@ pub struct ConsumerParams { #[prost(string, repeated, tag = "12")] pub provider_reward_denoms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +impl ::prost::Name for ConsumerParams { + const NAME: &'static str = "ConsumerParams"; + const PACKAGE: &'static str = "interchain_security.ccv.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.v1.{}", Self::NAME) + } +} /// ConsumerGenesisState defines the CCV consumer chain genesis state. /// /// Note this type is referenced in both the consumer and provider CCV modules, @@ -304,6 +360,13 @@ pub struct ConsumerGenesisState { #[prost(bool, tag = "13")] pub pre_ccv: bool, } +impl ::prost::Name for ConsumerGenesisState { + const NAME: &'static str = "ConsumerGenesisState"; + const PACKAGE: &'static str = "interchain_security.ccv.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.v1.{}", Self::NAME) + } +} /// HeightValsetUpdateID represents a mapping internal to the consumer CCV module /// AND used in shared consumer genesis state, which links a block height to each recv valset update id. #[allow(clippy::derive_partial_eq_without_eq)] @@ -314,6 +377,13 @@ pub struct HeightToValsetUpdateId { #[prost(uint64, tag = "2")] pub valset_update_id: u64, } +impl ::prost::Name for HeightToValsetUpdateId { + const NAME: &'static str = "HeightToValsetUpdateID"; + const PACKAGE: &'static str = "interchain_security.ccv.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.v1.{}", Self::NAME) + } +} /// OutstandingDowntime defines the type used internally to the consumer CCV module, /// AND used in shared consumer genesis state, in order to not send multiple slashing /// requests for the same downtime infraction. @@ -323,6 +393,13 @@ pub struct OutstandingDowntime { #[prost(string, tag = "1")] pub validator_consensus_address: ::prost::alloc::string::String, } +impl ::prost::Name for OutstandingDowntime { + const NAME: &'static str = "OutstandingDowntime"; + const PACKAGE: &'static str = "interchain_security.ccv.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.v1.{}", Self::NAME) + } +} /// LastTransmissionBlockHeight is the last time validator holding /// pools were transmitted to the provider chain. This type is used internally /// to the consumer CCV module AND used in shared consumer genesis state. @@ -332,6 +409,13 @@ pub struct LastTransmissionBlockHeight { #[prost(int64, tag = "1")] pub height: i64, } +impl ::prost::Name for LastTransmissionBlockHeight { + const NAME: &'static str = "LastTransmissionBlockHeight"; + const PACKAGE: &'static str = "interchain_security.ccv.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.v1.{}", Self::NAME) + } +} /// MaturingVSCPacket represents a vsc packet that is maturing internal to the /// consumer CCV module, where the consumer has not yet relayed a VSCMatured packet /// back to the provider. This type is used internally to the consumer CCV module @@ -346,6 +430,13 @@ pub struct MaturingVscPacket { super::super::super::google::protobuf::Timestamp, >, } +impl ::prost::Name for MaturingVscPacket { + const NAME: &'static str = "MaturingVSCPacket"; + const PACKAGE: &'static str = "interchain_security.ccv.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.v1.{}", Self::NAME) + } +} /// ConsumerPacketDataList is a list of consumer packet data packets. /// /// Note this type is is used internally to the consumer CCV module @@ -358,3 +449,10 @@ pub struct ConsumerPacketDataList { #[prost(message, repeated, tag = "1")] pub list: ::prost::alloc::vec::Vec, } +impl ::prost::Name for ConsumerPacketDataList { + const NAME: &'static str = "ConsumerPacketDataList"; + const PACKAGE: &'static str = "interchain_security.ccv.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.v1.{}", Self::NAME) + } +} diff --git a/src/prost/proto_descriptor.bin b/src/prost/proto_descriptor.bin index bb1bdf04..32bdddd2 100644 Binary files a/src/prost/proto_descriptor.bin and b/src/prost/proto_descriptor.bin differ diff --git a/src/prost/stride.interchainquery.v1.rs b/src/prost/stride.interchainquery.v1.rs index 97ad0555..b13204f6 100644 --- a/src/prost/stride.interchainquery.v1.rs +++ b/src/prost/stride.interchainquery.v1.rs @@ -15,11 +15,25 @@ pub struct MsgSubmitQueryResponse { #[prost(string, tag = "6")] pub from_address: ::prost::alloc::string::String, } +impl ::prost::Name for MsgSubmitQueryResponse { + const NAME: &'static str = "MsgSubmitQueryResponse"; + const PACKAGE: &'static str = "stride.interchainquery.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("stride.interchainquery.v1.{}", Self::NAME) + } +} /// MsgSubmitQueryResponseResponse defines the MsgSubmitQueryResponse response /// type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitQueryResponseResponse {} +impl ::prost::Name for MsgSubmitQueryResponseResponse { + const NAME: &'static str = "MsgSubmitQueryResponseResponse"; + const PACKAGE: &'static str = "stride.interchainquery.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("stride.interchainquery.v1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod msg_client { diff --git a/tests/test_proto_json.rs b/tests/test_proto_json.rs new file mode 100644 index 00000000..153f18d3 --- /dev/null +++ b/tests/test_proto_json.rs @@ -0,0 +1,13 @@ +#[cfg(feature = "serde")] +use ibc_proto::ibc::core::client::v1::Height; + +#[cfg(feature = "serde")] +#[test] +fn test_proto_json_deserialization() { + let data = r#" + { "revisionNumber": "5", "revisionHeight": "3928271" } + "#; + let height: Height = serde_json::from_str(data).unwrap(); + assert_eq!(height.revision_number, 5u64); + assert_eq!(height.revision_height, 3928271u64); +} diff --git a/tests/test_serde_default.rs b/tests/test_serde_default.rs new file mode 100644 index 00000000..410e3580 --- /dev/null +++ b/tests/test_serde_default.rs @@ -0,0 +1,44 @@ +#[cfg(feature = "serde")] +#[test] +fn test_serde_can_deserialize_defaults() { + use ibc_proto::ibc::core::client::v1::Height; + + let data = r#"{}"#; + let height: Height = serde_json::from_str(data).unwrap(); + assert_eq!(height.revision_number, 0u64); + assert_eq!(height.revision_height, 0u64); +} + +// This enables ibc-rs to keep supporting chains on different proto versions +// where some fields may or may not be present +#[cfg(feature = "serde")] +#[test] +fn test_serde_can_serialize_defaults() { + use ibc_proto::ibc::core::client::v1::Height; + + let height = Height { + revision_number: 0u64, + revision_height: 0u64, + }; + let str = serde_json::to_string(&height).unwrap(); + assert_eq!(str, r#"{"revisionNumber":"0","revisionHeight":"0"}"#); +} + +#[cfg(feature = "serde")] +#[test] +fn test_serde_can_serialize_packet_data() { + use ibc_proto::ibc::applications::transfer::v2::FungibleTokenPacketData; + + let packet_data = FungibleTokenPacketData { + denom: "uatom".to_string(), + amount: "10".to_string(), + sender: "cosmos1wxeyh7zgn4tctjzs0vtqpc6p5cxq5t2muzl7ng".to_string(), + receiver: "cosmos1wxeyh7zgn4tctjzs0vtqpc6p5cxq5t2muzl7ng".to_string(), + memo: "".to_string(), + }; + let str = serde_json::to_string(&packet_data).unwrap(); + assert_eq!( + str, + r#"{"denom":"uatom","amount":"10","sender":"cosmos1wxeyh7zgn4tctjzs0vtqpc6p5cxq5t2muzl7ng","receiver":"cosmos1wxeyh7zgn4tctjzs0vtqpc6p5cxq5t2muzl7ng","memo":""}"# + ); +} diff --git a/tools/proto-compiler/Cargo.toml b/tools/proto-compiler/Cargo.toml index 7e50bbe4..b0f8c69c 100644 --- a/tools/proto-compiler/Cargo.toml +++ b/tools/proto-compiler/Cargo.toml @@ -7,10 +7,11 @@ publish = false rust-version = "1.60" [dependencies] -git2 = "0.18" -prost-build = "0.12" -walkdir = "2.3" -argh = "0.1" -tonic = "0.10" -tonic-build = "0.10" -similar = "2.2" +git2 = "0.18" +prost-build = "0.12" +walkdir = "2.3" +argh = "0.1" +tonic = "0.10" +tonic-build = "0.10" +similar = "2.2" +informalsystems-pbjson-build = "0.7.0" diff --git a/tools/proto-compiler/src/cmd/clone.rs b/tools/proto-compiler/src/cmd/clone.rs index 79dbaa03..b7c742f2 100644 --- a/tools/proto-compiler/src/cmd/clone.rs +++ b/tools/proto-compiler/src/cmd/clone.rs @@ -24,6 +24,10 @@ pub struct CloneCmd { #[argh(option, short = 's')] ics_commit: Option, + /// commit to checkout for the nft-transfer repo + #[argh(option, short = 'n')] + nft_commit: Option, + /// where to checkout the repository #[argh(option, short = 'o')] out: PathBuf, @@ -32,6 +36,7 @@ pub struct CloneCmd { pub const COSMOS_SDK_URL: &str = "https://github.com/cosmos/cosmos-sdk"; pub const IBC_GO_URL: &str = "https://github.com/cosmos/ibc-go"; pub const ICS_URL: &str = "https://github.com/cosmos/interchain-security"; +pub const NFT_TRANSFER_URL: &str = "https://github.com/bianjieai/nft-transfer"; impl CloneCmd { pub fn validate(&self) { @@ -59,6 +64,12 @@ impl CloneCmd { ics_path } + pub fn nft_subdir(&self) -> PathBuf { + let mut nft_path = self.out.clone(); + nft_path.push("nft/"); + nft_path + } + pub fn run(&self) { self.validate(); @@ -164,6 +175,42 @@ impl CloneCmd { println!("[info ] No `-i`/`--ics_commit` option passed. Skipping the ICS repo.") } } + + match &self.nft_commit { + Some(nft_commit) => { + let nft_path = self.nft_subdir(); + let nft_repo = if nft_path.exists() { + println!( + "[info ] Found nft-transfer source at '{}'", + nft_path.display() + ); + + Repository::open(&nft_path).unwrap_or_else(|e| { + println!("[error] Failed to open repository: {}", e); + process::exit(1) + }) + } else { + Repository::clone(NFT_TRANSFER_URL, &nft_path).unwrap_or_else(|e| { + println!("[error] Failed to clone the nft-transfer repository: {}", e); + process::exit(1) + }) + }; + + println!("[info ] Cloned at '{}'", nft_path.display()); + checkout_commit(&nft_repo, nft_commit).unwrap_or_else(|e| { + println!( + "[error] Failed to checkout nft-transfer commit {}: {}", + nft_commit, e + ); + process::exit(1) + }); + } + None => { + println!( + "[info ] No `-n`/`--nft-commit` option passed. Skipping the nft-transfer repo." + ) + } + } } } diff --git a/tools/proto-compiler/src/cmd/compile.rs b/tools/proto-compiler/src/cmd/compile.rs index d819b5cd..4e021e14 100644 --- a/tools/proto-compiler/src/cmd/compile.rs +++ b/tools/proto-compiler/src/cmd/compile.rs @@ -21,6 +21,10 @@ pub struct CompileCmd { /// path to the Cosmos ICS proto files ics: PathBuf, + #[argh(option, short = 'n')] + /// path to the nft-transfer proto files + nft: PathBuf, + #[argh(option, short = 'o')] /// path to output the generated Rust sources into out: PathBuf, @@ -32,6 +36,7 @@ impl CompileCmd { self.ibc.as_ref(), self.sdk.as_ref(), self.ics.as_ref(), + self.nft.as_ref(), self.out.as_ref(), ) .unwrap_or_else(|e| { @@ -44,6 +49,11 @@ impl CompileCmd { process::exit(1); }); + Self::build_pbjson_impls(self.out.as_ref()).unwrap_or_else(|e| { + eprintln!("[error] failed to build pbjson impls: {}", e); + process::exit(1); + }); + println!("[info ] Done!"); } @@ -51,6 +61,7 @@ impl CompileCmd { ibc_dir: &Path, sdk_dir: &Path, ics_dir: &Path, + nft_dir: &Path, out_dir: &Path, ) -> Result<(), Box> { println!( @@ -77,12 +88,14 @@ impl CompileCmd { format!("{}/interchain_security/ccv/v1", ics_dir.display()), format!("{}/interchain_security/ccv/provider", ics_dir.display()), format!("{}/interchain_security/ccv/consumer", ics_dir.display()), + format!("{}/ibc", nft_dir.display()), ]; let proto_includes_paths = [ format!("{}", sdk_dir.display()), format!("{}", ibc_dir.display()), format!("{}", ics_dir.display()), + format!("{}", nft_dir.display()), format!("{}/../../definitions/mock", root), format!("{}/../../definitions/ibc/lightclients/localhost/v1", root), format!("{}/../../definitions/stride/interchainquery/v1", root), @@ -116,15 +129,15 @@ impl CompileCmd { // List available paths for dependencies let includes: Vec = proto_includes_paths.iter().map(PathBuf::from).collect(); - let attrs_serde = - r#"#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]"#; - let attrs_serde_default = r#"#[cfg_attr(feature = "serde", serde(default))]"#; 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)]"; - let attrs_serde_base64 = r#"#[cfg_attr(feature = "serde", serde(with = "crate::base64"))]"#; - let attrs_jsonschema_str = r#"#[cfg_attr(all(feature = "json-schema", feature = "serde"), schemars(with = "String"))]"#; + + // Automatically derive a `prost::Name` implementation. + let mut config = prost_build::Config::new(); + config.enable_type_names(); tonic_build::configure() .build_client(true) @@ -136,81 +149,68 @@ impl CompileCmd { .file_descriptor_set_path(out_dir.join("proto_descriptor.bin")) .extern_path(".tendermint", "::tendermint_proto") .extern_path(".ics23", "::ics23") - .type_attribute(".google.protobuf.Any", attrs_serde) .type_attribute(".google.protobuf.Any", attrs_eq) .type_attribute(".google.protobuf.Any", attrs_jsonschema) - .type_attribute(".google.protobuf.Timestamp", attrs_serde) - .type_attribute(".google.protobuf.Duration", attrs_serde) .type_attribute(".google.protobuf.Duration", attrs_eq) - .type_attribute(".ibc.core.client.v1", attrs_serde) .type_attribute(".ibc.core.client.v1.Height", attrs_ord) .type_attribute(".ibc.core.client.v1.Height", attrs_jsonschema) - .field_attribute(".ibc.core.client.v1.Height", attrs_serde_default) - .type_attribute(".ibc.core.commitment.v1", attrs_serde) .type_attribute(".ibc.core.commitment.v1.MerkleRoot", attrs_jsonschema) - .field_attribute( - ".ibc.core.commitment.v1.MerkleRoot.hash", - attrs_serde_base64, - ) .field_attribute( ".ibc.core.commitment.v1.MerkleRoot.hash", attrs_jsonschema_str, ) .type_attribute(".ibc.core.commitment.v1.MerklePrefix", attrs_jsonschema) - .field_attribute( - ".ibc.core.commitment.v1.MerklePrefix.key_prefix", - attrs_serde_base64, - ) .field_attribute( ".ibc.core.commitment.v1.MerklePrefix.key_prefix", attrs_jsonschema_str, ) - .type_attribute(".ibc.core.channel.v1", attrs_serde) .type_attribute(".ibc.core.channel.v1.Channel", attrs_jsonschema) .type_attribute(".ibc.core.channel.v1.Counterparty", attrs_jsonschema) - .type_attribute(".ibc.core.connection.v1", attrs_serde) .type_attribute(".ibc.core.connection.v1.ConnectionEnd", attrs_jsonschema) .type_attribute(".ibc.core.connection.v1.Counterparty", attrs_jsonschema) .type_attribute(".ibc.core.connection.v1.Version", attrs_jsonschema) - .type_attribute(".ibc.core.types.v1", attrs_serde) - .type_attribute(".ibc.applications.transfer.v1", attrs_serde) - .field_attribute( - ".ibc.applications.transfer.v1.MsgTransfer.memo", - attrs_serde_default, - ) - .type_attribute(".ibc.applications.transfer.v2", attrs_serde) - .field_attribute( - ".ibc.applications.transfer.v2.FungibleTokenPacketData.memo", - attrs_serde_default, - ) - .type_attribute( - ".ibc.applications.interchain_accounts.controller.v1", - attrs_serde, - ) - .type_attribute( - ".ibc.applications.interchain_accounts.genesis.v1", - attrs_serde, - ) - .type_attribute(".ibc.applications.interchain_accounts.host.v1", attrs_serde) - .type_attribute(".ibc.applications.interchain_accounts.v1", attrs_serde) - .type_attribute(".ibc.lightclients.tendermint.v1", attrs_serde) - .type_attribute(".ibc.lightclients.localhost.v2", attrs_serde) - .type_attribute(".ibc.lightclients.solomachine.v3", attrs_serde) - .type_attribute(".cosmos.app.v1alpha1", attrs_serde) - .type_attribute(".cosmos.auth.v1beta1", attrs_serde) - .type_attribute(".cosmos.bank.v1beta1", attrs_serde) - .type_attribute(".cosmos.base.v1beta1", attrs_serde) - .type_attribute(".cosmos.base.query.v1beta1", attrs_serde) - .type_attribute(".cosmos.config.v1", attrs_serde) - .type_attribute(".cosmos.tx.config.v1", attrs_serde) - .type_attribute(".cosmos.upgrade.v1beta1", attrs_serde) - .compile(&protos, &includes)?; + .type_attribute(".ibc.lightclients.wasm.v1.ClientMessage", attrs_jsonschema) + .compile_with_config(config, &protos, &includes)?; println!("[info ] Protos compiled successfully"); Ok(()) } + fn build_pbjson_impls(out_dir: &Path) -> Result<(), Box> { + 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) + .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", + ])?; + + Ok(()) + } + fn patch_generated_files(out_dir: &Path) -> Result<(), Box> { println!( "[info ] Patching generated files in '{}'...", @@ -222,6 +222,10 @@ impl CompileCmd { "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)"), ], @@ -233,6 +237,13 @@ impl CompileCmd { "The denomination trace `([port_id]/[channel_id])+/[denom]`", )], ), + ( + "ibc.applications.nft_transfer.v1.rs", + &[( + "The class trace (\\[port_id\\]/[channel_id])+/\\[denom\\]", + "The class trace `([port_id]/[channel_id])+/[class]`", + )], + ), ]; for (file, patches) in PATCHES {