From 419e3a39ac69e7a615dbd9603439953d8f4381a7 Mon Sep 17 00:00:00 2001 From: Gabe Rodriguez Date: Thu, 28 Dec 2023 11:47:07 -0500 Subject: [PATCH] Serde Protojson support (#166) * Add protobuild support * In progress * update compile.rs * working example * in progress * update deps * Add eq/ord type attrs back * Using informal pbjson fork * Re-add json schema * Emit default fields * Update changelog * Add FungibleTokenPacketData test --- .../breaking-changes/166-protojson-support.md | 2 + Cargo.toml | 24 +- src/google.rs | 2 + src/lib.rs | 115 +- src/prost/cosmos.app.v1alpha1.rs | 3 - src/prost/cosmos.app.v1alpha1.serde.rs | 329 + src/prost/cosmos.auth.module.v1.serde.rs | 235 + src/prost/cosmos.auth.v1beta1.rs | 27 - src/prost/cosmos.auth.v1beta1.serde.rs | 2657 ++++++ src/prost/cosmos.bank.module.v1.serde.rs | 109 + src/prost/cosmos.bank.v1beta1.rs | 41 - src/prost/cosmos.bank.v1beta1.serde.rs | 4293 +++++++++ src/prost/cosmos.base.kv.v1beta1.serde.rs | 203 + src/prost/cosmos.base.node.v1beta1.serde.rs | 163 + src/prost/cosmos.base.query.v1beta1.rs | 2 - src/prost/cosmos.base.query.v1beta1.serde.rs | 279 + .../cosmos.base.reflection.v1beta1.serde.rs | 347 + .../cosmos.base.reflection.v2alpha1.serde.rs | 2515 ++++++ .../cosmos.base.snapshots.v1beta1.serde.rs | 1074 +++ src/prost/cosmos.base.store.v1beta1.serde.rs | 786 ++ src/prost/cosmos.base.v1beta1.rs | 4 - src/prost/cosmos.base.v1beta1.serde.rs | 398 + src/prost/cosmos.crypto.ed25519.serde.rs | 186 + src/prost/cosmos.crypto.hd.v1.serde.rs | 169 + src/prost/cosmos.crypto.keyring.v1.serde.rs | 495 ++ src/prost/cosmos.crypto.multisig.serde.rs | 111 + .../cosmos.crypto.multisig.v1beta1.serde.rs | 207 + src/prost/cosmos.crypto.secp256k1.serde.rs | 186 + src/prost/cosmos.crypto.secp256r1.serde.rs | 186 + src/prost/cosmos.gov.module.v1.serde.rs | 111 + src/prost/cosmos.gov.v1.serde.rs | 4761 ++++++++++ src/prost/cosmos.gov.v1beta1.serde.rs | 4078 +++++++++ src/prost/cosmos.ics23.v1.serde.rs | 1930 ++++ src/prost/cosmos.staking.module.v1.serde.rs | 109 + src/prost/cosmos.staking.v1beta1.serde.rs | 7748 ++++++++++++++++ src/prost/cosmos.tx.config.v1.rs | 1 - src/prost/cosmos.tx.config.v1.serde.rs | 110 + src/prost/cosmos.tx.signing.v1beta1.serde.rs | 633 ++ src/prost/cosmos.upgrade.module.v1.serde.rs | 91 + src/prost/cosmos.upgrade.v1beta1.rs | 18 - src/prost/cosmos.upgrade.v1beta1.serde.rs | 1726 ++++ src/prost/google.api.serde.rs | 443 + src/prost/google.protobuf.rs | 666 +- src/prost/google.protobuf.serde.rs | 5091 +++++++++++ src/prost/ibc.applications.fee.v1.serde.rs | 4232 +++++++++ ...tions.interchain_accounts.controller.v1.rs | 11 - ...interchain_accounts.controller.v1.serde.rs | 1109 +++ ...ications.interchain_accounts.genesis.v1.rs | 5 - ...ns.interchain_accounts.genesis.v1.serde.rs | 672 ++ ...pplications.interchain_accounts.host.v1.rs | 5 - ...tions.interchain_accounts.host.v1.serde.rs | 451 + ...ibc.applications.interchain_accounts.v1.rs | 5 - ...plications.interchain_accounts.v1.serde.rs | 582 ++ src/prost/ibc.applications.transfer.v1.rs | 22 - .../ibc.applications.transfer.v1.serde.rs | 2200 +++++ src/prost/ibc.applications.transfer.v2.rs | 2 - .../ibc.applications.transfer.v2.serde.rs | 159 + src/prost/ibc.core.channel.v1.rs | 62 - src/prost/ibc.core.channel.v1.serde.rs | 7779 +++++++++++++++++ src/prost/ibc.core.client.v1.rs | 44 - src/prost/ibc.core.client.v1.serde.rs | 4456 ++++++++++ src/prost/ibc.core.commitment.v1.rs | 6 - src/prost/ibc.core.commitment.v1.serde.rs | 370 + src/prost/ibc.core.connection.v1.rs | 31 - src/prost/ibc.core.connection.v1.serde.rs | 3787 ++++++++ src/prost/ibc.core.types.v1.rs | 1 - src/prost/ibc.core.types.v1.serde.rs | 128 + .../ibc.lightclients.localhost.v1.serde.rs | 109 + src/prost/ibc.lightclients.localhost.v2.rs | 1 - .../ibc.lightclients.localhost.v2.serde.rs | 92 + .../ibc.lightclients.solomachine.v2.serde.rs | 2100 +++++ src/prost/ibc.lightclients.solomachine.v3.rs | 8 - .../ibc.lightclients.solomachine.v3.serde.rs | 1074 +++ src/prost/ibc.lightclients.tendermint.v1.rs | 5 - .../ibc.lightclients.tendermint.v1.serde.rs | 786 ++ src/prost/ibc.mock.serde.rs | 418 + src/prost/proto_descriptor.bin | Bin 716903 -> 702918 bytes tests/test_proto_json.rs | 13 + tests/test_serde_default.rs | 44 + tools/proto-compiler/Cargo.toml | 15 +- tools/proto-compiler/src/cmd/compile.rs | 93 +- 81 files changed, 72500 insertions(+), 1041 deletions(-) create mode 100644 .changelog/unreleased/breaking-changes/166-protojson-support.md create mode 100644 src/prost/cosmos.app.v1alpha1.serde.rs create mode 100644 src/prost/cosmos.auth.module.v1.serde.rs create mode 100644 src/prost/cosmos.auth.v1beta1.serde.rs create mode 100644 src/prost/cosmos.bank.module.v1.serde.rs create mode 100644 src/prost/cosmos.bank.v1beta1.serde.rs create mode 100644 src/prost/cosmos.base.kv.v1beta1.serde.rs create mode 100644 src/prost/cosmos.base.node.v1beta1.serde.rs create mode 100644 src/prost/cosmos.base.query.v1beta1.serde.rs create mode 100644 src/prost/cosmos.base.reflection.v1beta1.serde.rs create mode 100644 src/prost/cosmos.base.reflection.v2alpha1.serde.rs create mode 100644 src/prost/cosmos.base.snapshots.v1beta1.serde.rs create mode 100644 src/prost/cosmos.base.store.v1beta1.serde.rs create mode 100644 src/prost/cosmos.base.v1beta1.serde.rs create mode 100644 src/prost/cosmos.crypto.ed25519.serde.rs create mode 100644 src/prost/cosmos.crypto.hd.v1.serde.rs create mode 100644 src/prost/cosmos.crypto.keyring.v1.serde.rs create mode 100644 src/prost/cosmos.crypto.multisig.serde.rs create mode 100644 src/prost/cosmos.crypto.multisig.v1beta1.serde.rs create mode 100644 src/prost/cosmos.crypto.secp256k1.serde.rs create mode 100644 src/prost/cosmos.crypto.secp256r1.serde.rs create mode 100644 src/prost/cosmos.gov.module.v1.serde.rs create mode 100644 src/prost/cosmos.gov.v1.serde.rs create mode 100644 src/prost/cosmos.gov.v1beta1.serde.rs create mode 100644 src/prost/cosmos.ics23.v1.serde.rs create mode 100644 src/prost/cosmos.staking.module.v1.serde.rs create mode 100644 src/prost/cosmos.staking.v1beta1.serde.rs create mode 100644 src/prost/cosmos.tx.config.v1.serde.rs create mode 100644 src/prost/cosmos.tx.signing.v1beta1.serde.rs create mode 100644 src/prost/cosmos.upgrade.module.v1.serde.rs create mode 100644 src/prost/cosmos.upgrade.v1beta1.serde.rs create mode 100644 src/prost/google.api.serde.rs create mode 100644 src/prost/google.protobuf.serde.rs create mode 100644 src/prost/ibc.applications.fee.v1.serde.rs create mode 100644 src/prost/ibc.applications.interchain_accounts.controller.v1.serde.rs create mode 100644 src/prost/ibc.applications.interchain_accounts.genesis.v1.serde.rs create mode 100644 src/prost/ibc.applications.interchain_accounts.host.v1.serde.rs create mode 100644 src/prost/ibc.applications.interchain_accounts.v1.serde.rs create mode 100644 src/prost/ibc.applications.transfer.v1.serde.rs create mode 100644 src/prost/ibc.applications.transfer.v2.serde.rs create mode 100644 src/prost/ibc.core.channel.v1.serde.rs create mode 100644 src/prost/ibc.core.client.v1.serde.rs create mode 100644 src/prost/ibc.core.commitment.v1.serde.rs create mode 100644 src/prost/ibc.core.connection.v1.serde.rs create mode 100644 src/prost/ibc.core.types.v1.serde.rs create mode 100644 src/prost/ibc.lightclients.localhost.v1.serde.rs create mode 100644 src/prost/ibc.lightclients.localhost.v2.serde.rs create mode 100644 src/prost/ibc.lightclients.solomachine.v2.serde.rs create mode 100644 src/prost/ibc.lightclients.solomachine.v3.serde.rs create mode 100644 src/prost/ibc.lightclients.tendermint.v1.serde.rs create mode 100644 src/prost/ibc.mock.serde.rs create mode 100644 tests/test_proto_json.rs create mode 100644 tests/test_serde_default.rs diff --git a/.changelog/unreleased/breaking-changes/166-protojson-support.md b/.changelog/unreleased/breaking-changes/166-protojson-support.md new file mode 100644 index 00000000..98671c29 --- /dev/null +++ b/.changelog/unreleased/breaking-changes/166-protojson-support.md @@ -0,0 +1,2 @@ +- Added protojson support + ([#166](https://github.com/cosmos/ibc-proto-rs/pull/166)). Feature flag `serde` now abides by [protobuf json rules](https://protobuf.dev/programming-guides/proto3/#json) when it comes to json serialization/deserialization. diff --git a/Cargo.toml b/Cargo.toml index 8f0cdc56..d7ae3649 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,15 +28,16 @@ doctest = false all-features = true [dependencies] -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 } +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.6.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"] +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/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..3a821998 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,8 +3,10 @@ // 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)] +#![cfg_attr( + not(feature = "serde"), + deny(warnings, trivial_casts, trivial_numeric_casts, unused_import_braces) +)] #![allow(clippy::large_enum_variant, clippy::derive_partial_eq_without_eq)] #![allow(rustdoc::bare_urls)] #![forbid(unsafe_code)] @@ -43,11 +45,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 +70,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 +112,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 +143,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 +159,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 +200,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 +218,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,28 +262,40 @@ 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"); } } } @@ -236,26 +304,36 @@ pub mod ibc { 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 +341,34 @@ 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 mock { include_proto!("ibc.mock.rs"); + #[cfg(feature = "serde")] + include_proto!("ibc.mock.serde.rs"); } } @@ -313,26 +401,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 4098c8ce..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 { @@ -32,7 +31,6 @@ impl ::prost::Name for ModuleDescriptor { } } /// 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 { @@ -86,7 +84,6 @@ impl ::prost::Name for PackageReference { } /// 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 { diff --git a/src/prost/cosmos.app.v1alpha1.serde.rs b/src/prost/cosmos.app.v1alpha1.serde.rs new file mode 100644 index 00000000..a9f35d02 --- /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.serde.rs b/src/prost/cosmos.auth.module.v1.serde.rs new file mode 100644 index 00000000..1c3fc79e --- /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 15ed107b..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 { @@ -22,7 +21,6 @@ impl ::prost::Name for BaseAccount { } } /// 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 { @@ -43,7 +41,6 @@ impl ::prost::Name for ModuleAccount { /// 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 { @@ -63,7 +60,6 @@ impl ::prost::Name for ModuleCredential { } } /// 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 { @@ -88,7 +84,6 @@ impl ::prost::Name for Params { /// 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 { @@ -112,7 +107,6 @@ impl ::prost::Name for MsgUpdateParams { /// 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 {} @@ -429,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 { @@ -449,7 +442,6 @@ impl ::prost::Name for QueryAccountsRequest { /// 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 { @@ -470,7 +462,6 @@ impl ::prost::Name for QueryAccountsResponse { } } /// 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 { @@ -486,7 +477,6 @@ impl ::prost::Name for QueryAccountRequest { } } /// 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 { @@ -502,7 +492,6 @@ impl ::prost::Name for QueryAccountResponse { } } /// 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 {} @@ -514,7 +503,6 @@ impl ::prost::Name for QueryParamsRequest { } } /// 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 { @@ -532,7 +520,6 @@ impl ::prost::Name for QueryParamsResponse { /// 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 {} @@ -546,7 +533,6 @@ impl ::prost::Name for QueryModuleAccountsRequest { /// 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 { @@ -561,7 +547,6 @@ impl ::prost::Name for QueryModuleAccountsResponse { } } /// 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 { @@ -576,7 +561,6 @@ impl ::prost::Name for QueryModuleAccountByNameRequest { } } /// 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 { @@ -593,7 +577,6 @@ impl ::prost::Name for QueryModuleAccountByNameResponse { /// 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 {} @@ -607,7 +590,6 @@ impl ::prost::Name for Bech32PrefixRequest { /// 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 { @@ -624,7 +606,6 @@ impl ::prost::Name for Bech32PrefixResponse { /// 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 { @@ -641,7 +622,6 @@ impl ::prost::Name for AddressBytesToStringRequest { /// 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 { @@ -658,7 +638,6 @@ impl ::prost::Name for AddressBytesToStringResponse { /// 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 { @@ -675,7 +654,6 @@ impl ::prost::Name for AddressStringToBytesRequest { /// 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 { @@ -692,7 +670,6 @@ impl ::prost::Name for AddressStringToBytesResponse { /// 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 { @@ -720,7 +697,6 @@ impl ::prost::Name for QueryAccountAddressByIdRequest { /// 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 { @@ -737,7 +713,6 @@ impl ::prost::Name for QueryAccountAddressByIdResponse { /// 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 { @@ -755,7 +730,6 @@ impl ::prost::Name for QueryAccountInfoRequest { /// 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 { @@ -1834,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 { diff --git a/src/prost/cosmos.auth.v1beta1.serde.rs b/src/prost/cosmos.auth.v1beta1.serde.rs new file mode 100644 index 00000000..810635b8 --- /dev/null +++ b/src/prost/cosmos.auth.v1beta1.serde.rs @@ -0,0 +1,2657 @@ +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 { + 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 { + 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 { + struct_ser.serialize_field("accountNumber", ::alloc::string::ToString::to_string(&self.account_number).as_str())?; + } + if true { + 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 { + struct_ser.serialize_field("maxMemoCharacters", ::alloc::string::ToString::to_string(&self.max_memo_characters).as_str())?; + } + if true { + struct_ser.serialize_field("txSigLimit", ::alloc::string::ToString::to_string(&self.tx_sig_limit).as_str())?; + } + if true { + struct_ser.serialize_field("txSizeCostPerByte", ::alloc::string::ToString::to_string(&self.tx_size_cost_per_byte).as_str())?; + } + if true { + struct_ser.serialize_field("sigVerifyCostEd25519", ::alloc::string::ToString::to_string(&self.sig_verify_cost_ed25519).as_str())?; + } + if true { + 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 { + struct_ser.serialize_field("id", ::alloc::string::ToString::to_string(&self.id).as_str())?; + } + if true { + 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.serde.rs b/src/prost/cosmos.bank.module.v1.serde.rs new file mode 100644 index 00000000..e31ada9f --- /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 46725f94..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 { @@ -23,7 +22,6 @@ impl ::prost::Name for Params { } /// 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 { @@ -40,7 +38,6 @@ impl ::prost::Name for SendEnabled { } } /// 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 { @@ -57,7 +54,6 @@ impl ::prost::Name for Input { } } /// 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 { @@ -76,7 +72,6 @@ impl ::prost::Name for Output { /// 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 { @@ -92,7 +87,6 @@ impl ::prost::Name for Supply { } /// 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 { @@ -119,7 +113,6 @@ impl ::prost::Name for DenomUnit { } /// 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 { @@ -166,7 +159,6 @@ impl ::prost::Name for Metadata { } } /// 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 { @@ -185,7 +177,6 @@ impl ::prost::Name for MsgSend { } } /// 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 {} @@ -197,7 +188,6 @@ impl ::prost::Name for MsgSendResponse { } } /// 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 { @@ -216,7 +206,6 @@ impl ::prost::Name for MsgMultiSend { } } /// 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 {} @@ -230,7 +219,6 @@ impl ::prost::Name for MsgMultiSendResponse { /// 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 { @@ -254,7 +242,6 @@ impl ::prost::Name for MsgUpdateParams { /// 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 {} @@ -272,7 +259,6 @@ impl ::prost::Name for 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 { @@ -298,7 +284,6 @@ impl ::prost::Name for MsgSetSendEnabled { /// 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 {} @@ -854,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 { @@ -873,7 +857,6 @@ impl ::prost::Name for QueryBalanceRequest { } } /// 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 { @@ -889,7 +872,6 @@ impl ::prost::Name for QueryBalanceResponse { } } /// 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 { @@ -911,7 +893,6 @@ impl ::prost::Name for QueryAllBalancesRequest { } /// 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 { @@ -935,7 +916,6 @@ impl ::prost::Name for QueryAllBalancesResponse { /// 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 { @@ -959,7 +939,6 @@ impl ::prost::Name for QuerySpendableBalancesRequest { /// 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 { @@ -983,7 +962,6 @@ impl ::prost::Name for QuerySpendableBalancesResponse { /// 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 { @@ -1005,7 +983,6 @@ impl ::prost::Name for QuerySpendableBalanceByDenomRequest { /// 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 { @@ -1022,7 +999,6 @@ impl ::prost::Name for QuerySpendableBalanceByDenomResponse { } /// 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 { @@ -1043,7 +1019,6 @@ impl ::prost::Name for QueryTotalSupplyRequest { } /// 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 { @@ -1066,7 +1041,6 @@ impl ::prost::Name for QueryTotalSupplyResponse { } } /// 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 { @@ -1082,7 +1056,6 @@ impl ::prost::Name for QuerySupplyOfRequest { } } /// 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 { @@ -1098,7 +1071,6 @@ impl ::prost::Name for QuerySupplyOfResponse { } } /// 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 {} @@ -1110,7 +1082,6 @@ impl ::prost::Name for QueryParamsRequest { } } /// 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 { @@ -1125,7 +1096,6 @@ impl ::prost::Name for QueryParamsResponse { } } /// 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 { @@ -1144,7 +1114,6 @@ impl ::prost::Name for QueryDenomsMetadataRequest { } /// 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 { @@ -1165,7 +1134,6 @@ impl ::prost::Name for QueryDenomsMetadataResponse { } } /// 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 { @@ -1182,7 +1150,6 @@ impl ::prost::Name for QueryDenomMetadataRequest { } /// 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 { @@ -1200,7 +1167,6 @@ impl ::prost::Name for QueryDenomMetadataResponse { /// 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 { @@ -1225,7 +1191,6 @@ impl ::prost::Name for QueryDenomOwnersRequest { /// 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 { @@ -1246,7 +1211,6 @@ impl ::prost::Name for DenomOwner { /// 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 { @@ -1268,7 +1232,6 @@ impl ::prost::Name for QueryDenomOwnersResponse { /// 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 { @@ -1292,7 +1255,6 @@ impl ::prost::Name for QuerySendEnabledRequest { /// 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 { @@ -2492,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 { @@ -2513,7 +2474,6 @@ impl ::prost::Name for SendAuthorization { } } /// 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 { @@ -2545,7 +2505,6 @@ impl ::prost::Name for GenesisState { } /// 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 { diff --git a/src/prost/cosmos.bank.v1beta1.serde.rs b/src/prost/cosmos.bank.v1beta1.serde.rs new file mode 100644 index 00000000..9b130395 --- /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.kv.v1beta1.serde.rs b/src/prost/cosmos.base.kv.v1beta1.serde.rs new file mode 100644 index 00000000..c0e3f4dd --- /dev/null +++ b/src/prost/cosmos.base.kv.v1beta1.serde.rs @@ -0,0 +1,203 @@ +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 { + struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + if true { + 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.serde.rs b/src/prost/cosmos.base.node.v1beta1.serde.rs new file mode 100644 index 00000000..dd84a00c --- /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 9ed79dc7..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 { @@ -49,7 +48,6 @@ impl ::prost::Name for 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 { 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..f76fdfdb --- /dev/null +++ b/src/prost/cosmos.base.query.v1beta1.serde.rs @@ -0,0 +1,279 @@ +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 { + struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + if true { + struct_ser.serialize_field("offset", ::alloc::string::ToString::to_string(&self.offset).as_str())?; + } + if true { + 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 { + struct_ser.serialize_field("nextKey", pbjson::private::base64::encode(&self.next_key).as_str())?; + } + if true { + 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.serde.rs b/src/prost/cosmos.base.reflection.v1beta1.serde.rs new file mode 100644 index 00000000..8e5e0a93 --- /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.serde.rs b/src/prost/cosmos.base.reflection.v2alpha1.serde.rs new file mode 100644 index 00000000..ae40c496 --- /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.serde.rs b/src/prost/cosmos.base.snapshots.v1beta1.serde.rs new file mode 100644 index 00000000..a92ff6a9 --- /dev/null +++ b/src/prost/cosmos.base.snapshots.v1beta1.serde.rs @@ -0,0 +1,1074 @@ +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 { + 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 { + 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 { + 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 { + struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + if true { + struct_ser.serialize_field("value", pbjson::private::base64::encode(&self.value).as_str())?; + } + if true { + 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 { + struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + if true { + 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..2bc33f54 --- /dev/null +++ b/src/prost/cosmos.base.store.v1beta1.serde.rs @@ -0,0 +1,786 @@ +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 { + struct_ser.serialize_field("version", ::alloc::string::ToString::to_string(&self.version).as_str())?; + } + if true { + 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 { + 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 { + struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + if true { + 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.v1beta1.rs b/src/prost/cosmos.base.v1beta1.rs index 739a6fc9..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 { @@ -22,7 +21,6 @@ impl ::prost::Name for Coin { /// /// 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 { @@ -39,7 +37,6 @@ impl ::prost::Name for DecCoin { } } /// 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 { @@ -54,7 +51,6 @@ impl ::prost::Name for IntProto { } } /// 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 { diff --git a/src/prost/cosmos.base.v1beta1.serde.rs b/src/prost/cosmos.base.v1beta1.serde.rs new file mode 100644 index 00000000..84e7cc70 --- /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.serde.rs b/src/prost/cosmos.crypto.ed25519.serde.rs new file mode 100644 index 00000000..47ffcbe0 --- /dev/null +++ b/src/prost/cosmos.crypto.ed25519.serde.rs @@ -0,0 +1,186 @@ +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 { + 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 { + 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.serde.rs b/src/prost/cosmos.crypto.hd.v1.serde.rs new file mode 100644 index 00000000..4789d36c --- /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.serde.rs b/src/prost/cosmos.crypto.keyring.v1.serde.rs new file mode 100644 index 00000000..7c16ab34 --- /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.serde.rs b/src/prost/cosmos.crypto.multisig.serde.rs new file mode 100644 index 00000000..c12a7061 --- /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.serde.rs b/src/prost/cosmos.crypto.multisig.v1beta1.serde.rs new file mode 100644 index 00000000..3277ba0f --- /dev/null +++ b/src/prost/cosmos.crypto.multisig.v1beta1.serde.rs @@ -0,0 +1,207 @@ +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 { + 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.serde.rs b/src/prost/cosmos.crypto.secp256k1.serde.rs new file mode 100644 index 00000000..93ed7dec --- /dev/null +++ b/src/prost/cosmos.crypto.secp256k1.serde.rs @@ -0,0 +1,186 @@ +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 { + 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 { + 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.serde.rs b/src/prost/cosmos.crypto.secp256r1.serde.rs new file mode 100644 index 00000000..78159b52 --- /dev/null +++ b/src/prost/cosmos.crypto.secp256r1.serde.rs @@ -0,0 +1,186 @@ +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 { + 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 { + 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.serde.rs b/src/prost/cosmos.gov.module.v1.serde.rs new file mode 100644 index 00000000..21f5de59 --- /dev/null +++ b/src/prost/cosmos.gov.module.v1.serde.rs @@ -0,0 +1,111 @@ +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 { + 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.serde.rs b/src/prost/cosmos.gov.v1.serde.rs new file mode 100644 index 00000000..0c06a74b --- /dev/null +++ b/src/prost/cosmos.gov.v1.serde.rs @@ -0,0 +1,4761 @@ +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 { + 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 { + 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 { + 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 { + 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 { + 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::from_i32(self.option) + .ok_or_else(|| 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 { + 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 { + 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::from_i32(self.status) + .ok_or_else(|| 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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(ProposalStatus::from_i32) + .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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(ProposalStatus::from_i32) + .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 { + 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 { + 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 { + 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::from_i32(self.proposal_status) + .ok_or_else(|| 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 { + 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 { + 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 { + 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 { + 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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(VoteOption::from_i32) + .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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(VoteOption::from_i32) + .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::from_i32(self.option) + .ok_or_else(|| 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.serde.rs b/src/prost/cosmos.gov.v1beta1.serde.rs new file mode 100644 index 00000000..5ed64cf5 --- /dev/null +++ b/src/prost/cosmos.gov.v1beta1.serde.rs @@ -0,0 +1,4078 @@ +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 { + 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 { + 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 { + 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 { + 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 { + 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::from_i32(self.option) + .ok_or_else(|| 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 { + 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 { + 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::from_i32(self.status) + .ok_or_else(|| 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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(ProposalStatus::from_i32) + .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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(ProposalStatus::from_i32) + .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 { + 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 { + 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 { + 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::from_i32(self.proposal_status) + .ok_or_else(|| 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 { + 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 { + 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 { + 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 { + struct_ser.serialize_field("quorum", pbjson::private::base64::encode(&self.quorum).as_str())?; + } + if true { + struct_ser.serialize_field("threshold", pbjson::private::base64::encode(&self.threshold).as_str())?; + } + if true { + 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 { + 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::from_i32(self.option) + .ok_or_else(|| 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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(VoteOption::from_i32) + .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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(VoteOption::from_i32) + .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::from_i32(self.option) + .ok_or_else(|| 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..283820a8 --- /dev/null +++ b/src/prost/cosmos.ics23.v1.serde.rs @@ -0,0 +1,1930 @@ +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 { + struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + if true { + 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 { + 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 { + struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + if true { + 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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(HashOp::from_i32) + .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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(HashOp::from_i32) + .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::from_i32(self.hash) + .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.hash)))?; + struct_ser.serialize_field("hash", &v)?; + } + if true { + struct_ser.serialize_field("prefix", pbjson::private::base64::encode(&self.prefix).as_str())?; + } + if true { + 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 { + struct_ser.serialize_field("emptyChild", pbjson::private::base64::encode(&self.empty_child).as_str())?; + } + if true { + let v = HashOp::from_i32(self.hash) + .ok_or_else(|| 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::from_i32(self.hash) + .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.hash)))?; + struct_ser.serialize_field("hash", &v)?; + } + if true { + let v = HashOp::from_i32(self.prehash_key) + .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.prehash_key)))?; + struct_ser.serialize_field("prehashKey", &v)?; + } + if true { + let v = HashOp::from_i32(self.prehash_value) + .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.prehash_value)))?; + struct_ser.serialize_field("prehashValue", &v)?; + } + if true { + let v = LengthOp::from_i32(self.length) + .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.length)))?; + struct_ser.serialize_field("length", &v)?; + } + if true { + 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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(LengthOp::from_i32) + .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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(LengthOp::from_i32) + .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 { + 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.serde.rs b/src/prost/cosmos.staking.module.v1.serde.rs new file mode 100644 index 00000000..07c37646 --- /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.serde.rs b/src/prost/cosmos.staking.v1beta1.serde.rs new file mode 100644 index 00000000..a7baa70b --- /dev/null +++ b/src/prost/cosmos.staking.v1beta1.serde.rs @@ -0,0 +1,7748 @@ +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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(AuthorizationType::from_i32) + .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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(AuthorizationType::from_i32) + .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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(BondStatus::from_i32) + .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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(BondStatus::from_i32) + .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 { + 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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(Infraction::from_i32) + .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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(Infraction::from_i32) + .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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(InfractionType::from_i32) + .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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(InfractionType::from_i32) + .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 { + 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 { + 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 { + 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 { + 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 { + struct_ser.serialize_field("unbondingId", ::alloc::string::ToString::to_string(&self.unbonding_id).as_str())?; + } + if true { + 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 { + 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 { + struct_ser.serialize_field("unbondingId", ::alloc::string::ToString::to_string(&self.unbonding_id).as_str())?; + } + if true { + 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::from_i32(self.status) + .ok_or_else(|| 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 { + 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 { + 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 ee76c8a2..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 { 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..3dd5af54 --- /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.serde.rs b/src/prost/cosmos.tx.signing.v1beta1.serde.rs new file mode 100644 index 00000000..2b4a2462 --- /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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(SignMode::from_i32) + .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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(SignMode::from_i32) + .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 { + 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::from_i32(self.mode) + .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.mode)))?; + struct_ser.serialize_field("mode", &v)?; + } + if true { + 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.upgrade.module.v1.serde.rs b/src/prost/cosmos.upgrade.module.v1.serde.rs new file mode 100644 index 00000000..6134b8dd --- /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 dc8d6aec..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 { @@ -45,7 +44,6 @@ impl ::prost::Name for Plan { /// 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 { @@ -70,7 +68,6 @@ impl ::prost::Name for SoftwareUpgradeProposal { /// 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 { @@ -91,7 +88,6 @@ impl ::prost::Name for CancelSoftwareUpgradeProposal { /// 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 { @@ -112,7 +108,6 @@ impl ::prost::Name for ModuleVersion { /// 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 { @@ -133,7 +128,6 @@ impl ::prost::Name for MsgSoftwareUpgrade { /// 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 {} @@ -147,7 +141,6 @@ impl ::prost::Name for MsgSoftwareUpgradeResponse { /// 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 { @@ -165,7 +158,6 @@ impl ::prost::Name for MsgCancelUpgrade { /// 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 {} @@ -565,7 +557,6 @@ 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 {} @@ -578,7 +569,6 @@ impl ::prost::Name for QueryCurrentPlanRequest { } /// 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 { @@ -595,7 +585,6 @@ impl ::prost::Name for QueryCurrentPlanResponse { } /// 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 { @@ -612,7 +601,6 @@ impl ::prost::Name for QueryAppliedPlanRequest { } /// 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 { @@ -629,7 +617,6 @@ impl ::prost::Name for QueryAppliedPlanResponse { } /// 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 { @@ -647,7 +634,6 @@ impl ::prost::Name for QueryUpgradedConsensusStateRequest { } /// 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 { @@ -666,7 +652,6 @@ impl ::prost::Name for QueryUpgradedConsensusStateResponse { /// 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 { @@ -687,7 +672,6 @@ impl ::prost::Name for QueryModuleVersionsRequest { /// 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 { @@ -705,7 +689,6 @@ impl ::prost::Name for QueryModuleVersionsResponse { /// 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 {} @@ -719,7 +702,6 @@ impl ::prost::Name for QueryAuthorityRequest { /// 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 { diff --git a/src/prost/cosmos.upgrade.v1beta1.serde.rs b/src/prost/cosmos.upgrade.v1beta1.serde.rs new file mode 100644 index 00000000..3514e308 --- /dev/null +++ b/src/prost/cosmos.upgrade.v1beta1.serde.rs @@ -0,0 +1,1726 @@ +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 { + 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 { + 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 { + 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 { + 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 { + 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/google.api.serde.rs b/src/prost/google.api.serde.rs new file mode 100644 index 00000000..ec0bc7a2 --- /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 bb1c65dd..d58b594a 100644 --- a/src/prost/google.protobuf.rs +++ b/src/prost/google.protobuf.rs @@ -22,12 +22,8 @@ /// 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() @@ -37,7 +33,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) @@ -56,8 +52,9 @@ /// 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: @@ -84,7 +81,6 @@ /// "value": "1.212s" /// } /// -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[derive(Eq)] #[cfg_attr( all(feature = "json-schema", feature = "serde"), @@ -116,8 +112,7 @@ 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. As of May 2023, there are no widely used type server - /// implementations and no plans to implement one. + /// type.googleapis.com. /// /// Schemes other than `http`, `https` (or the empty scheme) might be /// used with implementation specific semantics. @@ -188,14 +183,9 @@ 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", "proto3", and "editions". - /// - /// If `edition` is present, this value must be "editions". + /// The supported values are "proto2" and "proto3". #[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"; @@ -286,99 +276,6 @@ 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"; @@ -847,9 +744,6 @@ 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")] @@ -944,10 +838,6 @@ 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. /// @@ -965,24 +855,12 @@ 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, @@ -999,10 +877,8 @@ impl ::prost::Name for MessageOptions { 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 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! + /// options below. This option is not yet implemented in the open source + /// release -- sorry, we'll try to include it in a future version! #[prost( enumeration = "field_options::CType", optional, @@ -1052,6 +928,7 @@ 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. @@ -1063,8 +940,11 @@ pub struct FieldOptions { /// check its required fields, regardless of whether or not the message has /// been parsed. /// - /// 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. + /// 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. #[prost(bool, optional, tag = "5", default = "false")] pub lazy: ::core::option::Option, /// unverified_lazy does no correctness checks on the byte stream. This should @@ -1081,46 +961,12 @@ 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, @@ -1136,12 +982,6 @@ 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, } @@ -1209,114 +1049,6 @@ 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"; @@ -1328,9 +1060,6 @@ impl ::prost::Name for FieldOptions { #[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, @@ -1355,18 +1084,6 @@ 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, @@ -1387,14 +1104,6 @@ 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, @@ -1409,9 +1118,6 @@ impl ::prost::Name for EnumValueOptions { #[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, @@ -1445,9 +1151,6 @@ 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, @@ -1562,280 +1265,6 @@ impl ::prost::Name for UninterpretedOption { ::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. #[allow(clippy::derive_partial_eq_without_eq)] @@ -2023,59 +1452,10 @@ 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 object. The end offset should be one past + /// relates to the identified offset. 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"; @@ -2142,6 +1522,7 @@ impl ::prost::Name for GeneratedCodeInfo { /// 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(); @@ -2150,6 +1531,7 @@ impl ::prost::Name for GeneratedCodeInfo { /// Timestamp.newBuilder().setSeconds(now.getEpochSecond()) /// .setNanos(now.getNano()).build(); /// +/// /// Example 6: Compute Timestamp from current time in Python. /// /// timestamp = Timestamp() @@ -2179,10 +1561,10 @@ impl ::prost::Name for GeneratedCodeInfo { /// [`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 { @@ -2264,7 +1646,7 @@ impl ::prost::Name for 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)] diff --git a/src/prost/google.protobuf.serde.rs b/src/prost/google.protobuf.serde.rs new file mode 100644 index 00000000..34f08208 --- /dev/null +++ b/src/prost/google.protobuf.serde.rs @@ -0,0 +1,5091 @@ +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 { + 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 { + 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; + } + 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 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", + "uninterpreted_option", + "uninterpretedOption", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AllowAlias, + 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 { + "allowAlias" | "allow_alias" => Ok(GeneratedField::AllowAlias), + "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 = 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 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::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__, + 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; + } + 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 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", + "uninterpreted_option", + "uninterpretedOption", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + 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 { + "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 = 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 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::UninterpretedOption => { + if uninterpreted_option__.is_some() { + return Err(serde::de::Error::duplicate_field("uninterpretedOption")); + } + uninterpreted_option__ = Some(map.next_value()?); + } + } + } + Ok(EnumValueOptions { + deprecated: deprecated__, + 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; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.ExtensionRangeOptions", len)?; + if true { + struct_ser.serialize_field("uninterpretedOption", &self.uninterpreted_option)?; + } + 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", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + 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 { + "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 = 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; + 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()?); + } + } + } + Ok(ExtensionRangeOptions { + uninterpreted_option: uninterpreted_option__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("google.protobuf.ExtensionRangeOptions", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for FieldDescriptorProto { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.FieldDescriptorProto", len)?; + if let Some(v) = self.name.as_ref() { + struct_ser.serialize_field("name", v)?; + } + if let Some(v) = self.number.as_ref() { + struct_ser.serialize_field("number", v)?; + } + if let Some(v) = self.label.as_ref() { + let v = field_descriptor_proto::Label::from_i32(*v) + .ok_or_else(|| 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::from_i32(*v) + .ok_or_else(|| 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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(field_descriptor_proto::Label::from_i32) + .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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(field_descriptor_proto::Label::from_i32) + .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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(field_descriptor_proto::Type::from_i32) + .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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(field_descriptor_proto::Type::from_i32) + .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; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.FieldOptions", len)?; + if let Some(v) = self.ctype.as_ref() { + let v = field_options::CType::from_i32(*v) + .ok_or_else(|| 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::from_i32(*v) + .ok_or_else(|| 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 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", + "uninterpreted_option", + "uninterpretedOption", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Ctype, + Packed, + Jstype, + Lazy, + UnverifiedLazy, + Deprecated, + Weak, + 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), + "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 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::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__, + 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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(field_options::CType::from_i32) + .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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(field_options::CType::from_i32) + .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::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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(field_options::JsType::from_i32) + .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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(field_options::JsType::from_i32) + .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 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; + } + 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)?; + } + 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", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Package, + Dependency, + PublicDependency, + WeakDependency, + MessageType, + EnumType, + Service, + Extension, + Options, + SourceCodeInfo, + Syntax, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + _ => 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; + 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()?; + } + } + } + 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__, + }) + } + } + deserializer.deserialize_struct("google.protobuf.FileDescriptorProto", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for FileDescriptorSet { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.FileDescriptorSet", len)?; + if true { + struct_ser.serialize_field("file", &self.file)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for FileDescriptorSet { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "file", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + File, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "file" => Ok(GeneratedField::File), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = FileDescriptorSet; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.FileDescriptorSet") + } + + fn visit_map(self, mut map: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut file__ = None; + while let Some(k) = map.next_key()? { + match k { + GeneratedField::File => { + if file__.is_some() { + return Err(serde::de::Error::duplicate_field("file")); + } + file__ = Some(map.next_value()?); + } + } + } + Ok(FileDescriptorSet { + file: file__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("google.protobuf.FileDescriptorSet", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for FileOptions { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.FileOptions", len)?; + if let Some(v) = self.java_package.as_ref() { + struct_ser.serialize_field("javaPackage", v)?; + } + if let Some(v) = self.java_outer_classname.as_ref() { + struct_ser.serialize_field("javaOuterClassname", v)?; + } + if let Some(v) = self.java_multiple_files.as_ref() { + struct_ser.serialize_field("javaMultipleFiles", v)?; + } + if let Some(v) = self.java_generate_equals_and_hash.as_ref() { + struct_ser.serialize_field("javaGenerateEqualsAndHash", v)?; + } + if let Some(v) = self.java_string_check_utf8.as_ref() { + struct_ser.serialize_field("javaStringCheckUtf8", v)?; + } + if let Some(v) = self.optimize_for.as_ref() { + let v = file_options::OptimizeMode::from_i32(*v) + .ok_or_else(|| 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 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", + "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, + 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), + "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 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::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__, + 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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(file_options::OptimizeMode::from_i32) + .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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(file_options::OptimizeMode::from_i32) + .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; + } + 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)?; + } + 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", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Path, + SourceFile, + Begin, + 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 { + "path" => Ok(GeneratedField::Path), + "sourceFile" | "source_file" => Ok(GeneratedField::SourceFile), + "begin" => Ok(GeneratedField::Begin), + "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 = 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; + 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) + ; + } + } + } + Ok(generated_code_info::Annotation { + path: path__.unwrap_or_default(), + source_file: source_file__, + begin: begin__, + end: end__, + }) + } + } + deserializer.deserialize_struct("google.protobuf.GeneratedCodeInfo.Annotation", FIELDS, 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; + } + 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 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", + "uninterpreted_option", + "uninterpretedOption", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + MessageSetWireFormat, + NoStandardDescriptorAccessor, + Deprecated, + MapEntry, + 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), + "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 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::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__, + 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; + } + 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::from_i32(*v) + .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("idempotencyLevel", &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", + "uninterpreted_option", + "uninterpretedOption", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Deprecated, + IdempotencyLevel, + 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), + "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 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::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__, + 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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(method_options::IdempotencyLevel::from_i32) + .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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(method_options::IdempotencyLevel::from_i32) + .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; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.OneofOptions", len)?; + 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] = &[ + "uninterpreted_option", + "uninterpretedOption", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + 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 { + "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 uninterpreted_option__ = 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()?); + } + } + } + Ok(OneofOptions { + 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; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.ServiceOptions", len)?; + 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] = &[ + "deprecated", + "uninterpreted_option", + "uninterpretedOption", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + 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 { + "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 deprecated__ = 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::UninterpretedOption => { + if uninterpreted_option__.is_some() { + return Err(serde::de::Error::duplicate_field("uninterpretedOption")); + } + uninterpreted_option__ = Some(map.next_value()?); + } + } + } + Ok(ServiceOptions { + 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 { + 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() { + struct_ser.serialize_field("positiveIntValue", ::alloc::string::ToString::to_string(&v).as_str())?; + } + if let Some(v) = self.negative_int_value.as_ref() { + 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() { + 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.serde.rs b/src/prost/ibc.applications.fee.v1.serde.rs new file mode 100644 index 00000000..e0fe7f52 --- /dev/null +++ b/src/prost/ibc.applications.fee.v1.serde.rs @@ -0,0 +1,4232 @@ +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 { + 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 { + 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 { + 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 { + 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 { + 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 8b04ebb3..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 { @@ -18,7 +17,6 @@ impl ::prost::Name for Params { } } /// 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 { @@ -39,7 +37,6 @@ impl ::prost::Name for MsgRegisterInterchainAccount { } } /// 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 { @@ -58,7 +55,6 @@ impl ::prost::Name for MsgRegisterInterchainAccountResponse { } } /// 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 { @@ -85,7 +81,6 @@ impl ::prost::Name for MsgSendTx { } } /// 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 { @@ -102,7 +97,6 @@ impl ::prost::Name for MsgSendTxResponse { } } /// 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 { @@ -125,7 +119,6 @@ impl ::prost::Name for MsgUpdateParams { } } /// 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 {} @@ -610,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 { @@ -629,7 +621,6 @@ impl ::prost::Name for QueryInterchainAccountRequest { } } /// 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 { @@ -646,7 +637,6 @@ impl ::prost::Name for QueryInterchainAccountResponse { } } /// 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 {} @@ -660,7 +650,6 @@ impl ::prost::Name for QueryParamsRequest { } } /// 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 { 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..50d9444b --- /dev/null +++ b/src/prost/ibc.applications.interchain_accounts.controller.v1.serde.rs @@ -0,0 +1,1109 @@ +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 { + 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 { + 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 30c698e9..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 { @@ -18,7 +17,6 @@ impl ::prost::Name for GenesisState { } } /// 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 { @@ -41,7 +39,6 @@ impl ::prost::Name for ControllerGenesisState { } } /// 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 { @@ -65,7 +62,6 @@ impl ::prost::Name for HostGenesisState { } /// 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 { @@ -88,7 +84,6 @@ impl ::prost::Name for ActiveChannel { } } /// 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 { 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..f02aca11 --- /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 a7e9981f..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 { @@ -21,7 +20,6 @@ impl ::prost::Name for Params { } } /// 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 { @@ -44,7 +42,6 @@ impl ::prost::Name for MsgUpdateParams { } } /// 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 {} @@ -360,7 +357,6 @@ 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 {} @@ -374,7 +370,6 @@ impl ::prost::Name for QueryParamsRequest { } } /// 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 { 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..8be94e1b --- /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 0b76048e..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 { @@ -18,7 +17,6 @@ impl ::prost::Name for InterchainAccount { } } /// 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 { @@ -37,7 +35,6 @@ impl ::prost::Name for InterchainAccountPacketData { } } /// 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 { @@ -55,7 +52,6 @@ impl ::prost::Name for CosmosTx { } /// 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 { @@ -86,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 { 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..50da6b1e --- /dev/null +++ b/src/prost/ibc.applications.interchain_accounts.v1.serde.rs @@ -0,0 +1,582 @@ +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::from_i32(self.r#type) + .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.r#type)))?; + struct_ser.serialize_field("type", &v)?; + } + if true { + 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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(Type::from_i32) + .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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(Type::from_i32) + .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.transfer.v1.rs b/src/prost/ibc.applications.transfer.v1.rs index 8f83b743..0c84ba34 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 { @@ -23,7 +22,6 @@ impl ::prost::Name for DenomTrace { /// 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 { @@ -46,7 +44,6 @@ impl ::prost::Name for Params { /// 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 { @@ -79,7 +76,6 @@ 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 { @@ -90,7 +86,6 @@ impl ::prost::Name for MsgTransfer { } } /// 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 { @@ -106,7 +101,6 @@ impl ::prost::Name for MsgTransferResponse { } } /// 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 { @@ -128,7 +122,6 @@ impl ::prost::Name for MsgUpdateParams { } /// 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 {} @@ -518,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 { @@ -535,7 +527,6 @@ impl ::prost::Name for QueryDenomTraceRequest { } /// 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 { @@ -552,7 +543,6 @@ impl ::prost::Name for QueryDenomTraceResponse { } /// 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 { @@ -571,7 +561,6 @@ impl ::prost::Name for QueryDenomTracesRequest { } /// 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 { @@ -592,7 +581,6 @@ impl ::prost::Name for QueryDenomTracesResponse { } } /// 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 {} @@ -604,7 +592,6 @@ impl ::prost::Name for QueryParamsRequest { } } /// 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 { @@ -621,7 +608,6 @@ impl ::prost::Name for QueryParamsResponse { } /// 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 { @@ -638,7 +624,6 @@ impl ::prost::Name for QueryDenomHashRequest { } /// 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 { @@ -654,7 +639,6 @@ impl ::prost::Name for QueryDenomHashResponse { } } /// 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 { @@ -673,7 +657,6 @@ impl ::prost::Name for QueryEscrowAddressRequest { } } /// 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 { @@ -689,7 +672,6 @@ impl ::prost::Name for QueryEscrowAddressResponse { } } /// 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 { @@ -704,7 +686,6 @@ impl ::prost::Name for QueryTotalEscrowForDenomRequest { } } /// 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 { @@ -1436,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 { @@ -1464,7 +1444,6 @@ impl ::prost::Name for Allocation { } /// 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 { @@ -1480,7 +1459,6 @@ impl ::prost::Name for TransferAuthorization { } } /// 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 { 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..846c4f9b --- /dev/null +++ b/src/prost/ibc.applications.transfer.v1.serde.rs @@ -0,0 +1,2200 @@ +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; + } + 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)?; + } + 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", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + SourcePort, + SourceChannel, + 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 { + "sourcePort" | "source_port" => Ok(GeneratedField::SourcePort), + "sourceChannel" | "source_channel" => Ok(GeneratedField::SourceChannel), + "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 = 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; + 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()?); + } + } + } + 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(), + }) + } + } + 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 { + 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 { + 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 9e9c6280..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,7 +18,6 @@ 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 { 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..e5631f1d --- /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 8de7d7c9..b354e656 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) @@ -35,7 +34,6 @@ impl ::prost::Name for Channel { } /// 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 { @@ -70,7 +68,6 @@ impl ::prost::Name for IdentifiedChannel { } } /// 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) @@ -93,7 +90,6 @@ impl ::prost::Name for Counterparty { } } /// 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 { @@ -135,7 +131,6 @@ impl ::prost::Name for Packet { /// 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 { @@ -162,7 +157,6 @@ impl ::prost::Name for PacketState { /// PacketId is an identifer 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 { @@ -190,7 +184,6 @@ impl ::prost::Name for 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 { @@ -201,7 +194,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 { @@ -221,7 +213,6 @@ impl ::prost::Name for Acknowledgement { /// 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 { @@ -241,7 +232,6 @@ impl ::prost::Name for Timeout { } /// State defines if a channel is in one of the following states: /// CLOSED, 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 { @@ -285,7 +275,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 { @@ -320,7 +309,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 { @@ -351,7 +339,6 @@ impl ::prost::Name for GenesisState { } /// 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 { @@ -371,7 +358,6 @@ impl ::prost::Name for PacketSequence { } /// 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 { @@ -390,7 +376,6 @@ impl ::prost::Name for MsgChannelOpenInit { } } /// 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 { @@ -409,7 +394,6 @@ impl ::prost::Name for MsgChannelOpenInitResponse { /// 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 { @@ -439,7 +423,6 @@ impl ::prost::Name for MsgChannelOpenTry { } } /// 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 { @@ -457,7 +440,6 @@ impl ::prost::Name for MsgChannelOpenTryResponse { } /// 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 { @@ -484,7 +466,6 @@ impl ::prost::Name for MsgChannelOpenAck { } } /// 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 {} @@ -497,7 +478,6 @@ impl ::prost::Name for MsgChannelOpenAckResponse { } /// 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 { @@ -521,7 +501,6 @@ impl ::prost::Name for MsgChannelOpenConfirm { } /// 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 {} @@ -534,7 +513,6 @@ impl ::prost::Name for MsgChannelOpenConfirmResponse { } /// 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 { @@ -553,7 +531,6 @@ impl ::prost::Name for MsgChannelCloseInit { } } /// 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 {} @@ -566,7 +543,6 @@ impl ::prost::Name for MsgChannelCloseInitResponse { } /// 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 { @@ -590,7 +566,6 @@ impl ::prost::Name for MsgChannelCloseConfirm { } /// 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 {} @@ -602,7 +577,6 @@ impl ::prost::Name for MsgChannelCloseConfirmResponse { } } /// 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 { @@ -623,7 +597,6 @@ impl ::prost::Name for MsgRecvPacket { } } /// 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 { @@ -638,7 +611,6 @@ impl ::prost::Name for MsgRecvPacketResponse { } } /// 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 { @@ -661,7 +633,6 @@ impl ::prost::Name for MsgTimeout { } } /// 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 { @@ -676,7 +647,6 @@ impl ::prost::Name for MsgTimeoutResponse { } } /// 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 { @@ -701,7 +671,6 @@ impl ::prost::Name for MsgTimeoutOnClose { } } /// 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 { @@ -716,7 +685,6 @@ impl ::prost::Name for MsgTimeoutOnCloseResponse { } } /// 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 { @@ -739,7 +707,6 @@ impl ::prost::Name for MsgAcknowledgement { } } /// 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 { @@ -754,7 +721,6 @@ impl ::prost::Name for MsgAcknowledgementResponse { } } /// 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 { @@ -1797,7 +1763,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 { @@ -1818,7 +1783,6 @@ impl ::prost::Name for QueryChannelRequest { /// 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 { @@ -1840,7 +1804,6 @@ impl ::prost::Name for QueryChannelResponse { } } /// 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 { @@ -1858,7 +1821,6 @@ impl ::prost::Name for QueryChannelsRequest { } } /// 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 { @@ -1883,7 +1845,6 @@ impl ::prost::Name for QueryChannelsResponse { } /// 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 { @@ -1905,7 +1866,6 @@ impl ::prost::Name for QueryConnectionChannelsRequest { } /// 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 { @@ -1930,7 +1890,6 @@ impl ::prost::Name for QueryConnectionChannelsResponse { } /// 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 { @@ -1950,7 +1909,6 @@ impl ::prost::Name for QueryChannelClientStateRequest { } /// 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 { @@ -1975,7 +1933,6 @@ impl ::prost::Name for QueryChannelClientStateResponse { } /// 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 { @@ -2001,7 +1958,6 @@ impl ::prost::Name for QueryChannelConsensusStateRequest { } /// 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 { @@ -2029,7 +1985,6 @@ impl ::prost::Name for QueryChannelConsensusStateResponse { } /// 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 { @@ -2053,7 +2008,6 @@ impl ::prost::Name for QueryPacketCommitmentRequest { /// 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 { @@ -2076,7 +2030,6 @@ impl ::prost::Name for QueryPacketCommitmentResponse { } /// 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 { @@ -2101,7 +2054,6 @@ impl ::prost::Name for QueryPacketCommitmentsRequest { } /// 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 { @@ -2125,7 +2077,6 @@ impl ::prost::Name for QueryPacketCommitmentsResponse { } /// 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 { @@ -2149,7 +2100,6 @@ impl ::prost::Name for QueryPacketReceiptRequest { /// 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 { @@ -2172,7 +2122,6 @@ impl ::prost::Name for QueryPacketReceiptResponse { } /// 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 { @@ -2196,7 +2145,6 @@ impl ::prost::Name for QueryPacketAcknowledgementRequest { /// 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 { @@ -2219,7 +2167,6 @@ impl ::prost::Name for QueryPacketAcknowledgementResponse { } /// 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 { @@ -2247,7 +2194,6 @@ impl ::prost::Name for QueryPacketAcknowledgementsRequest { } /// 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 { @@ -2271,7 +2217,6 @@ impl ::prost::Name for QueryPacketAcknowledgementsResponse { } /// 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 { @@ -2294,7 +2239,6 @@ impl ::prost::Name for QueryUnreceivedPacketsRequest { } /// 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 { @@ -2314,7 +2258,6 @@ impl ::prost::Name for QueryUnreceivedPacketsResponse { } /// 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 { @@ -2337,7 +2280,6 @@ impl ::prost::Name for QueryUnreceivedAcksRequest { } /// 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 { @@ -2357,7 +2299,6 @@ impl ::prost::Name for QueryUnreceivedAcksResponse { } /// 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 { @@ -2377,7 +2318,6 @@ impl ::prost::Name for QueryNextSequenceReceiveRequest { } /// QuerySequenceResponse is the request 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 { @@ -2400,7 +2340,6 @@ impl ::prost::Name for QueryNextSequenceReceiveResponse { } /// 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 { @@ -2420,7 +2359,6 @@ impl ::prost::Name for QueryNextSequenceSendRequest { } /// 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 { 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..8f746f11 --- /dev/null +++ b/src/prost/ibc.core.channel.v1.serde.rs @@ -0,0 +1,7779 @@ +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) => { + 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; + } + let mut struct_ser = serializer.serialize_struct("ibc.core.channel.v1.Channel", len)?; + if true { + let v = State::from_i32(self.state) + .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.state)))?; + struct_ser.serialize_field("state", &v)?; + } + if true { + let v = Order::from_i32(self.ordering) + .ok_or_else(|| 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)?; + } + 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", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + State, + Ordering, + Counterparty, + 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 { + "state" => Ok(GeneratedField::State), + "ordering" => Ok(GeneratedField::Ordering), + "counterparty" => Ok(GeneratedField::Counterparty), + "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 = 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; + 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()?); + } + } + } + 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(), + }) + } + } + 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 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("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 { + struct_ser.serialize_field("nextChannelSequence", ::alloc::string::ToString::to_string(&self.next_channel_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] = &[ + "channels", + "acknowledgements", + "commitments", + "receipts", + "send_sequences", + "sendSequences", + "recv_sequences", + "recvSequences", + "ack_sequences", + "ackSequences", + "next_channel_sequence", + "nextChannelSequence", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Channels, + Acknowledgements, + Commitments, + Receipts, + SendSequences, + RecvSequences, + AckSequences, + NextChannelSequence, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + _ => 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; + 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) + ; + } + } + } + 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(), + }) + } + } + 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; + } + let mut struct_ser = serializer.serialize_struct("ibc.core.channel.v1.IdentifiedChannel", len)?; + if true { + let v = State::from_i32(self.state) + .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.state)))?; + struct_ser.serialize_field("state", &v)?; + } + if true { + let v = Order::from_i32(self.ordering) + .ok_or_else(|| 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)?; + } + 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", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + State, + Ordering, + Counterparty, + ConnectionHops, + Version, + 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 { + "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), + _ => 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; + 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()?); + } + } + } + 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(), + }) + } + } + 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 { + struct_ser.serialize_field("acknowledgement", pbjson::private::base64::encode(&self.acknowledgement).as_str())?; + } + if true { + 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::from_i32(self.result) + .ok_or_else(|| 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; + } + 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 { + 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 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", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + 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), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "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 = 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; + 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()?); + } + } + } + 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(), + }) + } + } + 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 { + 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 { + 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 { + 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 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 { + 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::from_i32(self.result) + .ok_or_else(|| 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 { + 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 { + 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; + } + 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 { + struct_ser.serialize_field("proofUnreceived", pbjson::private::base64::encode(&self.proof_unreceived).as_str())?; + } + if true { + 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 { + 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 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", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Packet, + ProofUnreceived, + ProofClose, + 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), + "proofClose" | "proof_close" => Ok(GeneratedField::ProofClose), + "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 = 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; + 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()?); + } + } + } + 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(), + }) + } + } + 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::from_i32(self.result) + .ok_or_else(|| 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::from_i32(self.result) + .ok_or_else(|| 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 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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(Order::from_i32) + .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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(Order::from_i32) + .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 { + 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 { + 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 { + 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 { + 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 { + 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 { + struct_ser.serialize_field("sequence", ::alloc::string::ToString::to_string(&self.sequence).as_str())?; + } + if true { + 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 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 { + 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 { + struct_ser.serialize_field("revisionNumber", ::alloc::string::ToString::to_string(&self.revision_number).as_str())?; + } + if true { + 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 { + 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 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 { + 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 { + struct_ser.serialize_field("nextSequenceReceive", ::alloc::string::ToString::to_string(&self.next_sequence_receive).as_str())?; + } + if true { + 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 { + struct_ser.serialize_field("nextSequenceSend", ::alloc::string::ToString::to_string(&self.next_sequence_send).as_str())?; + } + if true { + 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 { + 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 { + struct_ser.serialize_field("acknowledgement", pbjson::private::base64::encode(&self.acknowledgement).as_str())?; + } + if true { + 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 { + 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 { + struct_ser.serialize_field("commitment", pbjson::private::base64::encode(&self.commitment).as_str())?; + } + if true { + 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 { + 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 { + 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 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", + }; + 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", + ]; + + 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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(ResponseResultType::from_i32) + .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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(ResponseResultType::from_i32) + .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), + _ => 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", + }; + 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", + ]; + + 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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(State::from_i32) + .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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(State::from_i32) + .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), + _ => 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 { + 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) + } +} diff --git a/src/prost/ibc.core.client.v1.rs b/src/prost/ibc.core.client.v1.rs index d899bc68..fc33ec80 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 { @@ -22,7 +21,6 @@ impl ::prost::Name for IdentifiedClientState { } /// 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 { @@ -44,7 +42,6 @@ impl ::prost::Name for ConsensusStateWithHeight { } /// 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 { @@ -72,7 +69,6 @@ impl ::prost::Name for 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"), @@ -83,11 +79,9 @@ impl ::prost::Name for 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 { @@ -98,7 +92,6 @@ impl ::prost::Name for Height { } } /// 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 { @@ -121,7 +114,6 @@ impl ::prost::Name for Params { /// 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 { @@ -150,7 +142,6 @@ impl ::prost::Name for ClientUpdateProposal { /// 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 { @@ -181,7 +172,6 @@ impl ::prost::Name for UpgradeProposal { } } /// 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 { @@ -214,7 +204,6 @@ impl ::prost::Name for GenesisState { } /// 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 { @@ -234,7 +223,6 @@ impl ::prost::Name for GenesisMetadata { } /// 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 { @@ -251,7 +239,6 @@ impl ::prost::Name for IdentifiedGenesisMetadata { } } /// 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 { @@ -278,7 +265,6 @@ impl ::prost::Name for MsgCreateClient { } } /// 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 {} @@ -291,7 +277,6 @@ impl ::prost::Name for MsgCreateClientResponse { } /// 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 { @@ -315,7 +300,6 @@ impl ::prost::Name for MsgUpdateClient { } } /// 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 {} @@ -328,7 +312,6 @@ impl ::prost::Name for MsgUpdateClientResponse { } /// 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 { @@ -364,7 +347,6 @@ impl ::prost::Name for MsgUpgradeClient { } } /// 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 {} @@ -378,7 +360,6 @@ impl ::prost::Name for MsgUpgradeClientResponse { /// 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 { @@ -403,7 +384,6 @@ impl ::prost::Name for MsgSubmitMisbehaviour { } /// 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 {} @@ -415,7 +395,6 @@ impl ::prost::Name for MsgSubmitMisbehaviourResponse { } } /// 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 { @@ -438,7 +417,6 @@ impl ::prost::Name for MsgRecoverClient { } } /// 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 {} @@ -450,7 +428,6 @@ impl ::prost::Name for MsgRecoverClientResponse { } } /// 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 { @@ -482,7 +459,6 @@ impl ::prost::Name for MsgIbcSoftwareUpgrade { } } /// 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 {} @@ -494,7 +470,6 @@ impl ::prost::Name for MsgIbcSoftwareUpgradeResponse { } } /// 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 { @@ -515,7 +490,6 @@ impl ::prost::Name for MsgUpdateParams { } } /// 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 {} @@ -1297,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 { @@ -1315,7 +1288,6 @@ impl ::prost::Name for QueryClientStateRequest { /// 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 { @@ -1340,7 +1312,6 @@ impl ::prost::Name for QueryClientStateResponse { } /// 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 { @@ -1359,7 +1330,6 @@ impl ::prost::Name for QueryClientStatesRequest { } /// 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 { @@ -1382,7 +1352,6 @@ impl ::prost::Name for QueryClientStatesResponse { /// 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 { @@ -1409,7 +1378,6 @@ impl ::prost::Name for QueryConsensusStateRequest { } /// 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 { @@ -1434,7 +1402,6 @@ impl ::prost::Name for QueryConsensusStateResponse { } /// 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 { @@ -1456,7 +1423,6 @@ impl ::prost::Name for QueryConsensusStatesRequest { } /// 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 { @@ -1478,7 +1444,6 @@ impl ::prost::Name for QueryConsensusStatesResponse { } /// 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 { @@ -1500,7 +1465,6 @@ impl ::prost::Name for QueryConsensusStateHeightsRequest { } /// 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 { @@ -1522,7 +1486,6 @@ impl ::prost::Name for QueryConsensusStateHeightsResponse { } /// 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 { @@ -1539,7 +1502,6 @@ impl ::prost::Name for QueryClientStatusRequest { } /// 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 { @@ -1555,7 +1517,6 @@ impl ::prost::Name for QueryClientStatusResponse { } /// 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 {} @@ -1568,7 +1529,6 @@ impl ::prost::Name for QueryClientParamsRequest { } /// 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 { @@ -1585,7 +1545,6 @@ impl ::prost::Name for QueryClientParamsResponse { } /// 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 {} @@ -1598,7 +1557,6 @@ impl ::prost::Name for QueryUpgradedClientStateRequest { } /// 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 { @@ -1617,7 +1575,6 @@ impl ::prost::Name for QueryUpgradedClientStateResponse { } /// 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 {} @@ -1630,7 +1587,6 @@ impl ::prost::Name for QueryUpgradedConsensusStateRequest { } /// 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 { 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..2de34110 --- /dev/null +++ b/src/prost/ibc.core.client.v1.serde.rs @@ -0,0 +1,4456 @@ +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 { + struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + if true { + 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 { + 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 { + struct_ser.serialize_field("revisionNumber", ::alloc::string::ToString::to_string(&self.revision_number).as_str())?; + } + if true { + 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 { + struct_ser.serialize_field("proofUpgradeClient", pbjson::private::base64::encode(&self.proof_upgrade_client).as_str())?; + } + if true { + 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 { + 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 { + struct_ser.serialize_field("revisionNumber", ::alloc::string::ToString::to_string(&self.revision_number).as_str())?; + } + if true { + 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 { + 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 9214a828..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,7 +8,6 @@ #[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") @@ -26,7 +24,6 @@ impl ::prost::Name for MerkleRoot { /// 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) @@ -35,7 +32,6 @@ impl ::prost::Name for 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") @@ -52,7 +48,6 @@ impl ::prost::Name for MerklePrefix { /// 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 { @@ -71,7 +66,6 @@ impl ::prost::Name for MerklePath { /// 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 { 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..845674d6 --- /dev/null +++ b/src/prost/ibc.core.commitment.v1.serde.rs @@ -0,0 +1,370 @@ +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 { + 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 { + 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 3d889e58..01a54671 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) @@ -38,7 +37,6 @@ impl ::prost::Name for ConnectionEnd { } /// 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 { @@ -70,7 +68,6 @@ impl ::prost::Name for IdentifiedConnection { } } /// 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) @@ -98,7 +95,6 @@ impl ::prost::Name for Counterparty { } } /// 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 { @@ -114,7 +110,6 @@ impl ::prost::Name for ClientPaths { } } /// 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 { @@ -134,7 +129,6 @@ impl ::prost::Name for ConnectionPaths { } /// Version defines the versioning scheme used to negotiate the IBC verison in /// the connection handshake. -#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[cfg_attr( all(feature = "json-schema", feature = "serde"), derive(::schemars::JsonSchema) @@ -157,7 +151,6 @@ impl ::prost::Name for Version { } } /// 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 { @@ -176,7 +169,6 @@ impl ::prost::Name for Params { } /// 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 { @@ -215,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 { @@ -238,7 +229,6 @@ impl ::prost::Name for GenesisState { } /// 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 { @@ -262,7 +252,6 @@ impl ::prost::Name for MsgConnectionOpenInit { } /// 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 {} @@ -275,7 +264,6 @@ impl ::prost::Name for MsgConnectionOpenInitResponse { } /// 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 { @@ -323,7 +311,6 @@ impl ::prost::Name for MsgConnectionOpenTry { } } /// 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 {} @@ -336,7 +323,6 @@ impl ::prost::Name for MsgConnectionOpenTryResponse { } /// 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 { @@ -378,7 +364,6 @@ impl ::prost::Name for MsgConnectionOpenAck { } } /// 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 {} @@ -391,7 +376,6 @@ impl ::prost::Name for MsgConnectionOpenAckResponse { } /// 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 { @@ -414,7 +398,6 @@ impl ::prost::Name for MsgConnectionOpenConfirm { } /// 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 {} @@ -426,7 +409,6 @@ impl ::prost::Name for MsgConnectionOpenConfirmResponse { } } /// 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 { @@ -447,7 +429,6 @@ impl ::prost::Name for MsgUpdateParams { } } /// 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 {} @@ -1093,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 { @@ -1111,7 +1091,6 @@ impl ::prost::Name for QueryConnectionRequest { /// 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 { @@ -1134,7 +1113,6 @@ impl ::prost::Name for QueryConnectionResponse { } /// 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 { @@ -1152,7 +1130,6 @@ impl ::prost::Name for QueryConnectionsRequest { } /// 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 { @@ -1177,7 +1154,6 @@ impl ::prost::Name for QueryConnectionsResponse { } /// 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 { @@ -1194,7 +1170,6 @@ impl ::prost::Name for QueryClientConnectionsRequest { } /// 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 { @@ -1217,7 +1192,6 @@ impl ::prost::Name for QueryClientConnectionsResponse { } /// 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 { @@ -1234,7 +1208,6 @@ impl ::prost::Name for QueryConnectionClientStateRequest { } /// 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 { @@ -1259,7 +1232,6 @@ impl ::prost::Name for QueryConnectionClientStateResponse { } /// 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 { @@ -1280,7 +1252,6 @@ impl ::prost::Name for QueryConnectionConsensusStateRequest { } /// 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 { @@ -1307,7 +1278,6 @@ impl ::prost::Name for QueryConnectionConsensusStateResponse { } } /// 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 {} @@ -1319,7 +1289,6 @@ impl ::prost::Name for QueryConnectionParamsRequest { } } /// 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 { 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..34a80641 --- /dev/null +++ b/src/prost/ibc.core.connection.v1.serde.rs @@ -0,0 +1,3787 @@ +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::from_i32(self.state) + .ok_or_else(|| 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 { + 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 { + 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::from_i32(self.state) + .ok_or_else(|| 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 { + 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 { + struct_ser.serialize_field("proofTry", pbjson::private::base64::encode(&self.proof_try).as_str())?; + } + if true { + struct_ser.serialize_field("proofClient", pbjson::private::base64::encode(&self.proof_client).as_str())?; + } + if true { + 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 { + 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 { + 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 { + 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 { + 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 { + struct_ser.serialize_field("proofInit", pbjson::private::base64::encode(&self.proof_init).as_str())?; + } + if true { + struct_ser.serialize_field("proofClient", pbjson::private::base64::encode(&self.proof_client).as_str())?; + } + if true { + 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 { + 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 { + 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 { + 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 { + 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 { + struct_ser.serialize_field("revisionNumber", ::alloc::string::ToString::to_string(&self.revision_number).as_str())?; + } + if true { + 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 { + 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 { + 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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(State::from_i32) + .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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(State::from_i32) + .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 62b09848..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 { 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..d7464c83 --- /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.serde.rs b/src/prost/ibc.lightclients.localhost.v1.serde.rs new file mode 100644 index 00000000..18d291f0 --- /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 d157ac26..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 { 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..4ba8c043 --- /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.serde.rs b/src/prost/ibc.lightclients.solomachine.v2.serde.rs new file mode 100644 index 00000000..471b0cb6 --- /dev/null +++ b/src/prost/ibc.lightclients.solomachine.v2.serde.rs @@ -0,0 +1,2100 @@ +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 { + 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 { + 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 { + 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 { + 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 { + 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 { + 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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(DataType::from_i32) + .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, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(DataType::from_i32) + .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 { + struct_ser.serialize_field("sequence", ::alloc::string::ToString::to_string(&self.sequence).as_str())?; + } + if true { + struct_ser.serialize_field("timestamp", ::alloc::string::ToString::to_string(&self.timestamp).as_str())?; + } + if true { + 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 { + 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 { + struct_ser.serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; + } + if true { + 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 { + struct_ser.serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; + } + if true { + 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 { + struct_ser.serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; + } + if true { + 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 { + 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 { + struct_ser.serialize_field("sequence", ::alloc::string::ToString::to_string(&self.sequence).as_str())?; + } + if true { + 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::from_i32(self.data_type) + .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.data_type)))?; + struct_ser.serialize_field("dataType", &v)?; + } + if true { + 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 { + struct_ser.serialize_field("signature", pbjson::private::base64::encode(&self.signature).as_str())?; + } + if true { + let v = DataType::from_i32(self.data_type) + .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.data_type)))?; + struct_ser.serialize_field("dataType", &v)?; + } + if true { + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + if true { + 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 { + struct_ser.serialize_field("signatureData", pbjson::private::base64::encode(&self.signature_data).as_str())?; + } + if true { + 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 20c25cba..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 { @@ -23,7 +22,6 @@ impl ::prost::Name for ClientState { /// 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 { @@ -48,7 +46,6 @@ impl ::prost::Name for ConsensusState { } } /// 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 { @@ -72,7 +69,6 @@ impl ::prost::Name for Header { } /// 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 { @@ -92,7 +88,6 @@ impl ::prost::Name for Misbehaviour { } /// 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 { @@ -114,7 +109,6 @@ impl ::prost::Name for SignatureAndData { } /// 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 { @@ -131,7 +125,6 @@ impl ::prost::Name for TimestampedSignatureData { } } /// 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 { @@ -159,7 +152,6 @@ impl ::prost::Name for SignBytes { } } /// 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 { 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..3f1b5c23 --- /dev/null +++ b/src/prost/ibc.lightclients.solomachine.v3.serde.rs @@ -0,0 +1,1074 @@ +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 { + 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 { + 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 { + struct_ser.serialize_field("timestamp", ::alloc::string::ToString::to_string(&self.timestamp).as_str())?; + } + if true { + 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 { + 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 { + struct_ser.serialize_field("sequence", ::alloc::string::ToString::to_string(&self.sequence).as_str())?; + } + if true { + 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 { + struct_ser.serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; + } + if true { + 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 { + struct_ser.serialize_field("signature", pbjson::private::base64::encode(&self.signature).as_str())?; + } + if true { + struct_ser.serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; + } + if true { + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + if true { + 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 { + struct_ser.serialize_field("signatureData", pbjson::private::base64::encode(&self.signature_data).as_str())?; + } + if true { + 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 d10d16bc..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 { @@ -65,7 +64,6 @@ impl ::prost::Name for ClientState { } } /// 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 { @@ -92,7 +90,6 @@ impl ::prost::Name for ConsensusState { } /// 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 { @@ -124,7 +121,6 @@ impl ::prost::Name for 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 { @@ -150,7 +146,6 @@ impl ::prost::Name for Header { } /// 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 { 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..02b4b24e --- /dev/null +++ b/src/prost/ibc.lightclients.tendermint.v1.serde.rs @@ -0,0 +1,786 @@ +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 { + 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 { + struct_ser.serialize_field("numerator", ::alloc::string::ToString::to_string(&self.numerator).as_str())?; + } + if true { + 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.mock.serde.rs b/src/prost/ibc.mock.serde.rs new file mode 100644 index 00000000..b2d4822c --- /dev/null +++ b/src/prost/ibc.mock.serde.rs @@ -0,0 +1,418 @@ +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 { + 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/proto_descriptor.bin b/src/prost/proto_descriptor.bin index 37d138a3feac695480a9bb672886f91dd763ff02..bb1bdf04b84fa0804aba2499b430697819814b7f 100644 GIT binary patch delta 19298 zcmb7r349b)wtnAROLtXwl1^uXkfjNGNLbYYWDx|BO%xCX5onSo1Ve&J0P&&iiYzLI z0tyib-~!@|GSgz~EV#`)VMbJ35ocgTXIPXaDmtPJ?>o1ux>|7l|M&Qz^mp$)-#Pc( zbI)C>>d4=_{`c3Vvi@S(+Kh5*Ga#5g*C_!ZhPZzUGp4>I~ZBXa3C!{O_7t22yjKAltju{!Dz4KZkqu@W}CFuhHY{)4EAHi+q0lBVCte5BG%RM;Xt}->t_F1>cvAR=Kfq z6!`QsU7>15^;)I_C4$*G`VB%DmFtZ^=1%Iqoe*n{{=ptuZGr!ak3`ofqZtYw`z3Y?1L$;jPAo-hucB#iP8eDc-izmy)sal1WB$ z*K7D^+&IiJgOz(+C<7Jf^nkYfFWFs@qU(ydH(aiNsPahwxpI==O9Xq$Nx~|q3b=kxG z@7(z0vhAcKp4aCG7VkBvl<|Gcn0iG8n`69w#T?_=!FT6;vX|3PcJi$CGJSi7&H^E+ zQ{w)he3cqsc6F4+x_DaI1KQOy)EQ9vX^nE3r%V*GkVHSN!g5bfXQ1h)RoKn*3sHz5 zp`TV^cTZbU*ghoDPphzpr&tsghol}k_-&P5;wjK$2r?}sU1Hoj@-C^5r=OvYnmxXc zueI*C148P{JL>^!_~j6g?jRM&U*sT|+qbx#gCwAio%HSqMMS^=&t&8EQQgxA_}b`w z!OIY6(!iCYFYhzZrbCH>B7deJ00P~>P_BbOH?VcSUMgf!HOOcfUDjt%QkX$_P*NB{ zCk+ar*%WM*FNE*$%#cUQYSVkvVykHsaZ|l^7Wpqgw2Z3dDS-H)E zL^XzYv#Wd{8IvUOfnN$tlFPD)0ZAJmgVt!!#Ps3)~4)H`9i z@Q{47=MH1txK6Q~eR;xdoTkfE-bST~?O~F#prPMYBa+P*m!xDik-vfcA(vE8& zkW|`n4FrBM!;Lq1LZZz zaaX`qlN>V2L^bxT;hZv2O};gAfk0A|9CtLV<=ySUq)b$sB%w@Hn+zVxM3uE+Ct4{L z)h10rDw@lkkf2O7H_1YoXl~LJFIeX0TX~6dFG%LL@1Sp|=}&P@q!d`8rKCWdqnR!Qs^RM z{|&cKv3MwnE=uxfuxL>-r%)1I6tWUC7fEzcNqa;EO(Z4eSyk_}HRdbSDMd@P zlf0W5=iVJ@{QE}r^1B(hX-9|(m1;0GZHQsGn-%wVAU241v&;JGlZjCY$@d#qM5c7V zpQW|3S}3#!1+?~{lHx(Wyr1Q?(tE=mIixOSo)gUYOQdIyrOa1=V3zU66H=Ek{xp*W z2QWC6F|S`AkEsGk);?sE&A5KTLrl)lGcdhHDYzeEp)9ai%^>zLle3ZyFj7>I?iN7e zVU`)v7uXWOO~wZ^7EWkNZHB2SH&HW(7`IV7(J@d)FK ziXO4mspPbRtWG6|7uPU3CrOS8N(Di;01|6hR(8@H43U{Cf!Rm}u7nB+Gbs^+2fZPA zEdo2qiK#~gX>I{T)?(|QRN@Qa@Q~7Hgew)eefB}(QR?$yW_wc$$r~Y(zmJ6{M5@Xw zqczoYsvDz5>*zl0-c!awgXl(=yQ*?ZP~-L}2+^(7BS$ndByTfnsyYnIgqCfoO*7GSo7H)m zd@Q6s!}yNm+RiGA{mKm>l!E0~EXU~`CqFoEJ-!N>o zY=|lR8-^q;s7Oi#{uXCK0D`~8nGgyE=2uR4fxralFyZ(CXm_^*szqzNzks0niuz0E zBQ>Oc%RG-5`uvWuZy7EW$WoOo{m!uz2>gH+KOijq&ao5_^xrv_0)qZK$5NFn{hnc` zOQ8b^_biCT(OyDf)jO#}+eL0A=@aY+#cGPeRJ$4| zrQM&Rp^Na${T#=WqzqKt&ykG8{#&JFw4C!EMtEYb(SM=QAHZ=9<)r1@Z%sb5gfYu` zVOQHVl924yU9S-%4^vhc{@ZH@tZ)e^Bdy?eu2#hz)Cz8=13(b0;E1Q5h$nAIHMnQ3 z@xtvrVg~nF)6+|iT*d9B00>F|E&BjLzsjKpgng^Hy%Yd~eie0;g1}4hw3^#X0T7q~ z9VYVIYHsK67^+31t!OJ9EAuFr~n-*iYJr%t+b0;Fqyo-3O+zE znH*Pg?a^mnNPUcZHgT4p8y*^MsHm@=fz>}^eEwfqvB$WN?n`9ZM?P5Z_y7p%04;TZ zuzbDa13;)-@Av=^>ef3x@R2PWI1VjjI1rcs9VVJn8@N9#YGbGtt=o2TT7zl>$H~Pq z3O;D&IQ>~vUZ^q(06)zlIM=e&T~Oi;5>d z&T)<*bsG8L3C9OOPzPwK1B4HraC`s=bx$}x0ED_H$Ok5^85%iZn^Akmqp@u+1C9SS zmw~#zjpO!_42A?4wsEXFmM!S|)0~&smDF`W#}?dT0@@+3iQ#{mhYFp>V0xN|=_o8; z2WG%$IPYNB;s%DGLq*f?8IE(LWd%*YXLxICd>|@h+qKt+iC#hUS>vNShfjXiC7|i| zEVuU*nwWmi@}NUN)9+ah0*fBe2-x8=2V!x4miM^SrU%mwhg}XD`NJ*; zjr?IAvf>&t;5f{2)Af`jI570bd3?aKt?Z`bE(eYIamNw581v&iXia%Qa2)3yt#knh zM;zx}`UyV+!V$;$C4KcSLIK*I;KrZ_OK(2m^3wtQgv(EXaDoTRZ3YU26TC++2ZH|u z?>$r;M|3XHe&+K$ZU^N*a%1d@tK0p^?XwxRql3kd97k8D9q>7B{C36Fv2)x$6;nIP&*wPK z(KKCk8l3Z-Uv3+VD>H)D9784M*m-Vmc>tmMJa1*q2|)DwJn!TT9mVi@cjzdF&(qKy z)-Bh9YjJ$}Bb98xVkxPCw#17iJ0a+Fw-0Ei7C>lNEETua--m}_EGSpU%T`Y0vDGdG z?TJ@Q_B=)#P^^}c@kM*$)lxFPyfAXLl#DMgF-kDfat12bNZc7YTw4)zoIxAsHMX7@ zjG>+L8YyU{CqO7#BXusdJ?Rr%UHdx_iq=S%U2ZGFzS@+MUZ;IEprZ&ETY$+9;bsdk z*&*6jn=!XX8Wfpsk2EMU-5z1ny;kCm6*?3FI*MrTz1CGkd+)VU&>3FZd#{x`S-VDz zA@r=3O07uA1%{%v(xv_MuW8}XIc_C38aZpuOy1}!z~cmYqpJYV699wOnF$h5uu&?s z_WFQOuu%&4v_0kr|3;~64?O%MdfaAgF)GcwZ`$J02SC5YrKbyyEs~wVAp!a=5*|)b z1_uQF7OA6^!2v+zt!bW1OHYxIO#fMs}yoFR~q=Y(m0F| z2I3}UyAgbJ)PU_SK{^Pwy99JOvRw*UYopH7L9kuIqc?G8)H!ZOcEr~{n#KC>a49lC zvBRaH+manpGK*(`Vu#eWojA7Y95*G;8%NgNHRO4hAP9ozU4kG8o_B2sg5Y_wVVC6w zT$sEh@ecXV8P9D98+#smYyhAWFPWfv$)%z@m6s%Y!>aR4P`xDKtoCP%Dio4;8JpL? zIbfH|5CX$4mmvg(T~f%&AR#d9lDd}buUQOPI8z(jH~ew%>n=kU7+!Z7vcT}V>yIoj zyiWdDB*r8=B=44Zzx-N*y?3cGt@(;8vM~ctDHXrkl){u{MJhb zx<<=!Dukeb0W2W?kh)Lu7%~$yG;8)rzFd93f=>Cx_U>~j{>7$``IOI{uAms^eeO&K zKuCQq1+D!lAiDCog#9T^20%=P&n0_}0>otaT*4al1v%bNn}K7J5q{#!DaTv|v==z$ zDxkfxhQ;auZ4^#P#XTGd1*fFa?v}^k_!fz03CH`%@hy@+V6_yEcVSGU zArqLE06!($7Af7jXac$binge=+6sgVa$%9!I=4tJbZR%L!l&@h5*ZI;o7C_Pv!ac& zqV-|?FW$0sHaA9WT|dm~7Hx9T%!*Gxr@hS**j6hyhxY3J~g7%9vC% zHv%Dbwe0!9o*R_%SIfR^{c+l31ZWSnPUhY6S8=1?bHD0TTh|y~7;Ow!&zV~jofEBX zj8=xLYsv57y1CKXa6{d^`iiJ-H0vN|6>O%_q&s(N0lZnZAFc=t z2^3h5N<@KZflc87@}n9c9oypd@hNP;HrF5G9Oy(N+E61oXx$9~!XMknAL}Sj1xV@6 zxPRw*9^2_s(AjsVZ14Bb1{6DGykcPakPZVoWnA#s5H8&*7g~FFG=@ue%AI@KF2$Ao z3o?H>=~6Q11=*V>F8>48mHmr|&wQifiycbv%X*F>YGB)oGWN<{goDJj{qKx9FLo{Y zU1~G(haM`i3H zECqD#J}TSiZq!1-Q5gs0qm}|tos^BbSC36Q=_;U;_eoa)omx)H_O3G^PAw;8dmRCU zf|IhnjsQZzNg3;16HJS%jZQEvuD|F6(<0|t z89TsLXls%4tz{Sx+FIlerQ&gPfa3d%m00l`TF$sy@X7$7omf!|EoYp>3J5J{oWx4I z;(v+6+ABbb^lF@^P(?<@f&?P@AL%_eL3&+1rUPgoxT8~FXx@U&<^|_ zWAk5b7?Va_xks_r2p~uST3rEzVfQHZ8j&7S?^ir)ZNq5SeZPXslIbukoeW!QY<_FT zfTfB(hA4xYrHZ}G0zzV`60|NU0b$Wn1O0z z?3jZD7*;5D%mE?_Rw#DN0b<-&D2O>)mD4c{O~zgCv@LH^>}5P%j6y0zX9Xlzr&Ib_ zW!$=V)L{ICr&qaFQMO&B*inO8ShY&Amt#O!wMwy+ssEDr`GRV`-iqY-;e@$+7OhO^_G&_z0giN#JC_tFh z>^KS#j%s!s1qeqqlcT8L8PuCCqTl$5es6J=&}Howr{AchmQKF`p=68GZ#rK+N&Oz1 zK@s+(({Uh30a_ggM8}_WIvxzE+Z4}l?T*u#YMX)``p0w+7Nm~Hm3Vyrhioc^e%vt( zHP9A!dJhP}xYK(;7#3IT12G_aA6M)HF(7&$S8yPv-Uq4oFNogbCzQP4Dxu!L;Pf7~ z)Y9oaAe6k|^qvlfFNxjk1J1wD#xX=s0FNsC3nl)$&qlD=QAM}j6+s1!%`rtT5o04T ztVV(Lcuo|+m}5$s_2!Z&fDOl#>_S%rwjWdQfPgl()B+8TD{{MJ1M)WtY|a?90O@h+ z2R-2vB0>f?D9Hkl9#?P^PKUY>nfax{tw$0-AOy4q5D>2YQt@Yr-3cJLzErZU-4Gy{ zzErS%6>l$#qj=fL+rH6K^C1>>@9Fe1i@*=z7zrk$7!Vly*NnL!0jyxx9;G8 zU=5&S4IP+UTqg2HixRT7PG}6K76sR{V8UCP1iw=3=W;-x0(7Y8p!t#7S-$l|%2WfVleR_rInA#nr*beL#+_qA&jZSTHTV)l&{T7&9q*V}0Pjl!)PF*pp& zfDRRHY8l(<+{m(J3K|X3BPzpHr<9Auw8RS216fdJ){fr0O*_{^_}U zq?mwE_8QJ}B5*|k`t+J=KQI>spm8lR4W+0MYo5ncrsvHfr7KD+$Db%UTU6+6FZJeiH#Bqs=^AI2&i_gps8?HwQ~pc zlqSPjHM@PX>lFWIRZIuU9n=E&2URXjHlP`S0+*BK#1E;QG%J3Hso5P|89{>A&K**4 z{HV&kk_|A2slX+r>G5MKDNT?c)$DRt1e`yrJ$lkz8JDv|>b+k2N+UK%xws!YzmddUbETH8lnKux!7w*B_N`5vDcp?auy&Y7khK9=bV7hw%Cj3 zoD`MW6qOHnx#_i{5*V!?@aoz63VOW}m{cwEnhOGKNlZW}TjsSpC<@TQWnMcfMFA+5 zdF`ka1yH%nYe%IhKs+q-+EHm0VEC7L5f5W+t>AdbE4R-d6dqBDdz@+lO5_DiuIulh>5f+1zUc1Z7hyB}G_M zYQHGLn!NVwDMAF4Oi&Xv@ZVr@+-JH^_XRCbEB zHD3G86d@wWaJ}+q1)kN{$vKIZOm<&S>5ZPc*`rAbn`^IRAL)PUZhfJ*(*8m(_OoB; zCBL(3m;B7Cy=R2@_zItl&`;~zs}Am0Ui8x{?C9w(TH+ON`e_w*@|1`|e6B)2t-{Wp zwgsZJeMrJ@{a_&inj(yOR^qF_w-XCSvH4!}%W>?uU&rSK5xS-eUuI^GWvvt6k7rLQ zxeFF7=r+5qGSaQCzN$O@C~vHu6E$C)#0IDxdJV;2^SeoG41EbEiA%Kym@iY`K>I`y zs>{tOlUZ}O&${778@P2jy}v6CcVb7;WOliU9Vu>dWhkXJ{qzIDrbPEC zY(m)g$f07k`(UxhT)v1sP_XRCj?#>Zx`sJ*4do4$w{*X@CQ^HJQ!!h+2`#$a!B(56 zLu!e6;ttl%mn;w7$);N6Ywu)T-11lNWP<~CD>kIp|wSwPrk;p3rN%tn&&^@UtFZQ zST8i&e#mpo&`12%3yI8?AMw){6*leX-(SQtRnIXq5A)na{9}IgMY+M zPrtY{;~>8^c9GT5WCo=3;hqQ)1pB>HSc~;e*BAAvJXsw~QDn0^!E5q@C=d(t>ZK1oLfsqKGYdyvSpI zaz=VL;GiLwPVQ}H9Fe*uj(jVvZYAySpqsDmSBuS!8S?wu0ldf_l8ZbI)B6n-UB1s!u!}##bPP^+^e&6{#Md9a|FECZWx! z68V9G*6%)Fu3KrO+lbo60|$#G{3FuL7X#(1QmcnXE2tX(i0YApVEmaGsj?b8J@ar+I3@f2>XPZKY0O=FXG8GPA~1 zI+{mXtNmSnnZxtd$rjw4ueLE?$ya-%xT~m*+A{^-(MIhrU>bGf_`%{<^P`P*)6Bcu zsM!g*K)s#o`#&x6+;zCfv-{J;k|I@Vm+G)xuPDQKzkz1<5Vc!24Ii!Ycl|XiR`rr` zdTX=jDmCAnK1AJX4!BZnD^~o}Hs;hT)xVjehN@jIu6pc`N`d*vQ1#gqjhY&nLm}O- zkGXW1+W8`(#IJ{`v$O3;3QtyZnEkuoP3oN;gP2Obq0zZ@4b_ce#+keCR{N!)RGC=U zXiY*h;~sSo6=~Pj*P&&krop@wM2WfgsGHx*Lq*2mAyDv}CyEgc`T6kiE??3?pwGI8UMe>bQR@TE8V(yaYZFlX^^3q$K)JPx|sjQY*`&xhi63+)uol7Oy&yG$f0xjxbu4c(yo=0t9rM!$b1O*s-)A}T-UYyWe6g@P{)JhU;dijD(WKQ~~W zI_I0<20Z__Z%nZh>TH}oZ!RAEMknC7lp<35Z{OA=L89=yFPo(*{z>*+JxBXltAx#~ z_iDS76U*Gdv^)PJk9h;vZqsP|DCn1%`?+>nK#Ie)iG7lGB}>7DiWc~ZQI4;Qg*ViO zSrN>He#w9!(vl@y&oU#AYFTDRL|b8&c(ofdorn<)UX>6YqQNw;rkIa=wMy6g44+o^ zpUq$3)7t%9t;pr$yfY#=vN)_9t^gnpPyju}C;9b53>bm34FGR5vu>H2@Jpohdc7F`H&; zIq6n9g0HMY>c7&oZ6cSiHJ?n^9!)jtC&7`pJp*q%{akfx(uyT66K~&4n^A{NTIICH zx?7^P4d&jU*8S&1y4xaYKWT1Fy?|9VK``|5ora-D6BU`-<->oDNw_R=;6|+zGq0Jh z<(kElwLZyEDJjtN&EHpO`R2UI+MZN-$K~eyn||KJoN?sG@zI)@L!&j(D)CAMR%FoU zn;%>!XXFg4tZtlWy=_rf?}VP&V~Tc`49Pb~->l`)Fp4CWsJL0XPFR?4_MNO{nE#ln zWw>U}g_&n7wKnEs)3ttX6kR_}Yaz1UNgng=>Dq*3gT&vaYh9R`K0_OlY>~KjhIV;} zBH>Fcn^~^)|INc|@C@(3WVuxxJ1LUZ%BUe#hLBdfoi>pWw~&Q7vFL zE!WQ5%~n6Ct#+3F?hk8)j`($tXv>`Pzc*CvN(O_VORsrwjGnN6zBLvT`^2?+AhGKj-R~$u>7jrtyK@R2 zP$i+cWSV{^i4ylu*BezAvMT+HJ~nwvv;Lv`Gsir(9gE(XP5O^+^Y1t7-~Yl)JD|5} r^VPxPyoHfDHT_B|$g#Bz^BShjoj2o_=)w}S!vVeC6>2`9@6P!j&X7Hd delta 32749 zcmd_Td3aPs_CB7w_U)Uk(@7u(LYfX+AcV~Y5YPYt!V)mV1zcj2G!O~tm`+r1oQsMJ zZZKZ;GAbj=xFG5%!D*Lq5JtzSs3?n|h=@8Mqk}#=xQsLNeNR>0zD>mW&3yj-`8;Z$ zQ&n%BI(6z))v2nRKYu;&(1Ag!`BJ&*JULe@{8g{5{twDbUr_6ncK=hKHR#p^({IW~ zdQb_cO)w2pGJ;A;S{Y+X{3mDjNh@Vcq|;B%?3)&5Of#s^PtNR@)|)Z=1Qq(pnf=pF zXUx7qg?|2+W6Ek;P_uk#_e)aY-*P&3_+qjZqJM@A3B_7N<>lojBOB+321J^dlsCp_ zM;1qGm$XDH;sYkdV&w~>Z4;yOBkfIXRn76XNOOI3Kxt`d=t^EJ6q+B4g~o=cXnS)@ zq<+!Q7do96xk@q3kUhanbbN1ilhZ>}XV0uQLu2tzN4Ly!CEqgA%|E1@s+uOJ1=Tf@ z+^z8O^o}`!ooYjt)eaGt{`ar75~N+T0dtYm7C=A#4NXZ)u8vXp4F2p;&X&F3Vpw7_}N^rm2w( z5((kYaY=>9ynORqCLt2n+I#co3|=eAK9NNtretKgBucE60y*>ameyEXY=n91-|f0? z%hi9WX09E1HP@~S<#%LvA1xOL3rt_Mp^=0v$P7sX{538aepWZL?OCBd9jzzjDe^0- zeM8Sny9ei(=?&5PrbsJmSb-c;2BZ%kZWs0JXO&O%62>bxN^(tV*5GNTF+Un`w=LWSwL7YlybAMxp*_LtRsJL8N|3-6io@bKU&LXj4O7 zeXMzYQ)7Kwyda&LGhQx`YQkQL>8!w1{U8RuCXLMr-pUP4OrhA(CoXN^qL#Z;iHLT#~`( zAY0b(!OoWcQc-#N%obwSxT!T>#^4mw*A{7oTZ$Lt!r-%pm$NdbiZZnY3+~IUdKZIUC6{ zDgzR*177agGtaJ>P#KWJx5#FI<9fOab~kftD{3ZJ*4EX|nN>;9mcRx`YRaUl=>%PD z_DJPco(G|3lTbAk)ss<6SHKySvu9TzK_OXFOTslwpBPZPvS(IXl`|&=G-^X?_R8wB zX9RSN<8EEKbV~>HjpKeLpYT&kX35gMISV zvb}on=y|E0i~Q|>+sI&7M?g;bgpL3%Wd77$l9@FdPP(x^dLs3P|NENlDdo4xzgFx$ z<&Pfcc1!+yhynZ=zf{BJypl~93X|FUnv?BqOI&YbEjkvhKT zjgqulQddjT15&_LX~_~aD$koWy=p>LZA~V_ax(|dH~mpecy(<4lI<4<7FZr`B~r+x zjW1x3I)ls*km}4?mDM!{m8Lww>m;*#Ym`r7Vpf2#v4+Ox1#Du>8a}M+be%HSm)D4* zlPsDcDn-fhg(;265;g0yDke|8&qZgK zvWEBjxr(V?Owm^JB$i#+k+NFi{hleR)heb>pLuSLNyt2BaH5&f8o9hKxwJdR+Elm!qVg63(QPXpVg2wPPkX*m#K-fE2}542|>&U8D`R^F%N*Mn!zm`PCwU# zZYEbum{V6%dDhugHI)+sN*E5swP*73CrqC?8ztrNIc9#+ zI#Z1^SYj5}RL-ibsI8n>#|4FuGbdJ6PfnQ>fyC{Vi-~~@a)CW;G_c@N6@?izNknngwDK#7y-QVWByz zi&+60HBGFXUNxf%4TV0Ym?m4wF*Bigj`mV@lV;Y;sHjb8xZmWa0su^TqC>`4&aSPi zoP^AfbfAv)YTz>;{{NXTaD@JUbF~s!Ro$^`*dR&XF5B{mdik%CJ%7aFykL!K#G{KN zShv-)1$EZ&Q|&<`29GVDEx0ww^zZ=FaJfl!qy>GZGP|-C@-We=DrN^{d&h{Y^B=lT zp%ud^FpXGO)W%e2^(k(mQ@PIx1NM(h9^@cVOB?w$;U+ntt;A?;vkaO+Pua zENvLei9I#_Pe>1l> zcPSLE8aRmcq9h~ZRC%yS(jmvxB#2IFq8E`7AXAHZe}e+Z)Inte#1~Yi$>o+n@d0I8 z62%9UY3aS)G@wiim%0>Crj-pAC@|pZa=Az{05UxZVgO`%da;`Zkm(^8!~n>20-4FQ z0gJ7cxv@#IA1KvH6hBa^(_O>y1Esn9B>lNpnqyjB|rlfeZBpE!kgB=x;@g z?#u{e8vXO+9t;@-kmm_xP(Yq1kU^nw^Mn@w1>kw`0_2)x8m0|0?;8*RX-I-d=*0$M zNl2rdp}yR5K?0>=K&e21JBSKWd0{L{5N2g;6tNfjmgGM*+x! zB!~i#1#FO78iXeQu%JgjH!DyUlnxZ4pxi<+N+AiOxb{H-WuX|Qpa8N^j8aelSvaT+ zkkE>PaN{L%OyLzMq`ynd0<(vys|FHD^NZ~JDvQosq-K~|rjJT6oiEA^dNfKc$}R9{ z)Uc>WPliJIk=$gjoYLLGPl(x+0!4nfDFupj-;~=e2}R0pLKkL2AcBJWo7Ex7Wa@zC z6gcXF=FG5{4!Gu$fr3W;)DO)VliVawc}uc0HDI+Q`+=Ngix}9lOwO{UkUJMp0BK2f zCNj3lLqrdevusU*kh5$}T7+%^r8VT5AbHEyq$u!~ZL-_Xo zUL=#d2Ln(P+Xkr-36CL2sB9U9as-LM^)e~k2U5^L(XW-#elHL{2bP%!-T8zlKRlERZ| z0ID}gX1+NM29IQ_W`(5oa$WKj2pz@|B@FR6afpY)qgDe>0x&l;Gfy2&=4vG)fKSfG z$Yp5I1>iC~2DGt4LKh`-K!6oe?nxd40w0!JHHT8h$7r6^1@wEWuCmSC@?ay zQxGkJNr9191ct@i2%`cg)Z4sY5)#Wn^>#@uDqJO{hS{DIFedi_<}@Bh_=>tNZHujKnE959Q!Pc zv@rt_#)J7g=^RdMI%Ql~oOFe{D23TuD%jZnGhMxdJ8k}Vz`rVMC7EF%RB2O(?K7)~&lhgtYOGiR5G}{s;p)f5J^)hdA z4FDkbkXn}hN3D1*bS)Nv^TuXaNQ4x{gG)F%oJl8emp8_vtodFk>jcGOET$i6N@)^i zYLdol5*GDfq%?`PK=-gFi59^Vfq@qFA(x`0!NskS)a-CR#9AD~84s3Xb*+{V(S&bd z&cn~n5;L=0UHQqotdUX~7#fW66gf|YOl+MbPbz#s3L(0}x~R1|(nRNrt?|*Ji8Djh zGiyU<&#o*Foy*T4h23CrSZ^V0L_;Xnf{u>I+FR?{SoajfyPn0u_!zh%THoG=Ot8_m zD66O*E~2@;C60wH#!NKS*cPhC8gm{7A3NhDFv{4p1RCWImV5++Hcd;=@W1OMtmp;F z+SEPll2GM3sc%1*G>Gh9$yFvxMh?*fCYocJKA@h5B)L!FkWdANfE!|hopQSnjgPlP z>)}eQdUwg3l#NC;09;YAJOP=WFDfT>KO}W?X9^m<4@tdC%rmKOoMG$hCHZklDICh& zR_YNXR@)fSUHlbdHzC*Iv$m_$-|Hn`fjNN;f*&q#kkq`w5upkUR$A33dxv!$aTr9> zX}iPKHDGZ%43uncR>XjsHb_A$munFm)ccsE3NKAGX9!Cq28ui;DMyw#>8^*- zqT$iSEp1D9L&+V}92IF@#0R=}Sexucazc>K?L{onL8kWkmEX(_+J9Dx;y z8q}Ya($>g!&uPPkJ}VhL*)jsx27>x?lDtYVVt;h|jnSOJ`;9SB;*ZpCmx~ghx7hurFR9%ksa`g$)734M%>{-| zw!-k3$q)`H4GeBWjDZqcNfZ|tI)53!RrZ(}L#>xn!LdnHUrq&w7XK`%`AKlB)`=1D z7%1^)DK{@E4tnsF)Dnne5W_2>qr@x85*8#zzjeaZBr&lLCq|~nK#@+|c}P}*j(;_^ z%~-Y)!)vpF60cI557I-iICDt&t<+|i$o7_$n{SqgZ0SMu9s7xyeXVy=(bAFa9YS-vDn%B&AOV*wW^ zA4vIbOK7{K?)O>(nloJU0s|%XrfA89(uaqUjN&3q{l8Cms~l`-zm}3Psc7CnVIpG-Y738&nV5((K=i zJ?tTnYd$QcXN$_o%N&*hc`ivsr0xY~LS_i4{bHPD=q^B{=OsYoLp(_ z_a1}}i0?fJ@=o8odsLOetRTZB=5nqGc&2~a7oB_kxPN*GJ|O(lQzbd8e@Z!S7b0o^ z5>e_OI08J?wXz*P?;qB+aGmr^tRU07yQx6BPA=eEZWIO5buyaM;Wzz+1y^>j-0|R?P3pLNJrEP(+$$%$7NJ&< z0T%?ZR*=}YhcQcPL4B>9wobO4i$c~~8M7n_snLkIUlt<*6odrHg#-!w``zY(1pfW9 z7!e?Wf4?k7ghrP6fZJS9KmzF^A({wMG`BC3S#Hr@kbruC+S?zZ>OuV>IqgOJ{JMVD zLo$v#NK&07eb|*06!1ZEe2|dzVOLU+fPdJP6eQpub|uwG()BW8Tx5NqfCSP-B1zZF z=_M@HLNd$Ur_{|2sP!^dGF&K(-3>CL=p2g1E=U)O#_k4Lth#kXO^HMxU1SE*1{sm` z-;vep6!z$l<=@Ln;csL&Qe|H=uaCX%;(z9J$OusNgg-?-(!?hFsYowtlPtDOj0+WP zl112pF;L$o8SyEK3or(1+$3Xj>;fUf)3VwloDr&Ou5W6OH(urj8Ynv{2FZL=#u%vK z>69A!G37ihBYNdlK^^%tX_^J!baF_~+imk68}q!U7IH|>%VMpFERf=PxoD733oR9& zm&=EkO{~`;!)E(}`sT5lJpgh?o4w8^ceGg+;VPX%R3KqX!(dCkp#CR0t<&~347L6w z8+>T`NP{oAwgd{5faKi<67Vm%@E`&Il50yK0soR~OFrt;mt`>zfC3Uo7m4P9mt`>z zSV(5MbNHYK38Xu zL7R=B{<@sDU6u;FAsiF0Z*821Ku5$rC7Nr!E*o@^qauR0_iOoao?fPfj_A4kkdYb4#LOjVAA~JxjSS8 zEU7v_>0qa;15l_AB(Dx6bgGCnfB$H_!jIwZ}uC{@>#v zP}BFwI2I*=Q342iWXw2R7BqdYEb~3NpLIV-R~CwV?e&nTw!Lz&NFY)7@0AhW1JYSQ z2Kl}$_Z6wMRRifl(eQg;M&OuBLBsET`6S*yD9Xx~^f4=0t59^mJz(MFx%)i;8h-oT zS;x-~r}xVN7l4M}ei;B99@Yr5@2M_{iFv;~^b`RPqyzS=3nyQ2z=Nl?!T}GS)(Qta zcv>qQ@ZdGTAMoHcz#ky^-(|rFOvI{{v>!T}8q0k-*D6LXKeRNd+gB*|hL*pNTcHTO zfQfonC}M60iF#KkLGGy!BV)txf8HRZ7SHOIxLJt2_+q@KqiLb@(bJ$jupL zfU!!!S=B=d!$6O(RyuBrKP;WU+QXo(Uag2p-DD$uwG!YX9V9STEB&~a0EzamR!T=R z^@2qES1TuvGD}$n$a{}suWBE7;XNKcZLsh0@TvdrQ38BxZnFNrM;SU?04l)0M;S4Z zZ8wlgOPqU@lP8#e;c9?=tW!F=U$#KHXq{IDS;#uC3Ubivlz^)SvXFI3DR=nHUx6$e zD{6$x26@^Tb2>GFcJU7>@&?7;clp%dLy9lgoQPQveCou96?^0rl_d`=s-Mk3j18?m ztYl=GlSMvMzFx7{UNNO)y(0Erl#ezO>lJKG-F%=QRqXU7Q>;f7vFoLL*uurB@ zYEtJsrpTuYVR1f2Bp+Hx#L#+75vv@KsQNLbfDZ+bX!m1Ef4A$%bRYA&j!gG4>bip_ zS1qtQI`%DTkj8d+HP9-!!!s~i1$QXIqnK@3Lvb64;1R9ZWhrgG@VIfHZu8(NfU!*xjvFNazfHkq8FJhp z0l!V@#~n9Fz;9EAonqe3#Yb#oyZx)H?-;Y)!_Nf%cF#B|+_7E3)j1BB3HP+ zL^^iZk!z-n-QfXb0bqv*K*5h4N{~;9rkn+U9SW`jv2CI$Bl5AgBFRZ~VJZcUz}+;ENf~fY9VBGk4lD1X-=KZ;}Ipu9O!$d?Cic2p5jek7yrql$>~gGAj& zsqSB}y7LhZu>Wzx(#m|GeC;(LA0S^V;uP7G^8xa;B2JM(0_1B2r^q-fR#Y0R-zr$2 zEwytxD(rvUIKlc>5%FY`#gjqucrr-%_-_@&lj%&`gtPfxk+Zn#q4T2em301y%VeiT zsU!+Al8(mHgZht3+BTIRjnm-$Q8Buido(mEoh>d`svTQa?3FKAi48qd4A_u!r7C87 zkSMiM4e-@5NVI9Ciq$doGDwWcm8zI3L1IjRM>y^9J;-M~y3hq`14q=Kd@ zbUNm%#Ccx~ZwBrAZ(r3>yy`N!k~fQ%*vRH~DlM@(JeANAt3wU&eM>r9Vs)svJjzRd1d_O#bnDv(M-CPo&E0>8IA?cUb!y#lntN+nT%kw<8unNHiNt*Sh$@O>pz z*&LbI#7}AYqp{FJJcDea14kTF(!F6^XTwDWcIyB~*5Vaec?joiIE`+KT^?<%kHn*K z(_-h9bj1xvlkLq7I1R1G@nk~?Hy9SPBPRwFcaJUU_&d_th)e2p&4FL^!|@ZHTC%ge z=IG_fii-k`IAv{%EW)1kVs=@ct|8#YUo%dwBK7sLc3h93mz!3krKPEnj_~n>lkVXS z$C)&a)T2#wvdqPeFO0RLEmRAz`Ee-@t|Or~9CyW9Bdtqt1tAj0TeeVSL8K86TSN0& zV~cQBJFmU5sUaR}XvZllDxgEadT43^j$i5M6=GT>CtYIrd8LsU;!N(;VW*ukbl9k& zrCcylC3}MBHTiN}C&Wuss*Rsu^Ru~z*yRwbH5yqALGa%=It+Iy7DjNtrL7ScG?0IB z;{rVWq}UBNM>8`TPJ9m0jG+Fen)b2A-8?O#-c*e|^L83)8MG_erD7VtRV{Q z<892xAx9)MA=cV}SLGOEP7`3bX4&aH?@~-^}esOeR$s zz3D$Lm9D}8s4>FwM%gUTfNR!t11cJ_2n5ziEyB6~5@I&v769dE8Dg!C3mWOx3m$~e zkG6`N57b#S*P?F>wgG1h^xgrQn&^a*7@!ZT;wYNYC;Rcd={mipXTF89ndNJgoOlp9ign@)@enz%=H!Zg^sM2E{{eFF~Y#s9;$b%eH zMTiG^0C7yk8(ePBv{X5!B0MfgnD;TYh(|(@8RmUV9WYFoHx50&Rpn)xYu+Tzx2i9b z9iL|KL(lKwhYRhBd;5m*i=XXl%p#N>} zx_40jf2U@nmj0Wv{TuJW&~P+jttJmD{4%qn|C&E49e-K7UhY2wU5aOi!^>cfOP7TB zRT6gl4bvL#8{+LXxezt<}V$7OBw9T1^}|f@C7%$dT)rLQHG5lLopZ^t?8p;lSm0wCK#B#mj@5 zz3aD6Uhtq-14Wn~^lG3f?LkePe4z+xcu>RMiq}9>+Jl;iK_V43Jg6Z^c$ilJs12I^ z(Sx6zzrm}3qL3TB3TR^5povv&2Ah~RXkt|h5*2LF#Htn~D%hZ5ReJ_&0F3Sl&F=f~ znbs2?J_T}~@bGD#dcso?%~MZk-T8_!L)L-+gjUG60U&|@gw}T;4?Sm)Wp32ulkqYW z=Q#XgBYI8TYvijr_B_IJ{a7=un!=a0;7KN~7KUQ&ZQNPl1PG3VJ>kxq4g5Jt%19@Z8$gz)x)FF8-BQ~q+Q_BHi;(e!jdWWw9#ud#hx~50e8ev z>}jKh@D=Yiial-A!hCOnR5%s-r zLF->?nU6F7j^U~QNt541*WD|N^>E4r43|S|6Y2o6r#806Ki-_#)QIIjCMtaIg)Y(3 zO-M{w;`I%EGy-$ze7Y-%UTSZKag>EDn$?&;<3>yXljq7SQN$pgCD0;FVdB^H#Dqj_!va~?V8LZ%o*$v2S|4e(v6bsnm8dw zDzLU|;)EC^y2jeBA^ggg=XBfP9ZlZlu3y+Ai+40Ub7IX=*z$abriQp|M5Cj?;I{!X zh=G3Cp^3}*jDZ?=XnCSJlmm6{&~Py*ObZ<)%_0NZsj0of!B8zO*|J?bf4S!_C{c>e zkCDl%h!%c3Q!66N-KpgX-$g}G(M}B!6|N=(@po%7k1=Jy<1i9xve>o-&l8a>PLYue zu-zISD00_DQT*N7;2~_gn?X_fz1sgZ42t5Y8|6h84VTkV_g+nGcae;`_iAFh3leqj z)x>r;gF^WG>}4CLRp2LZ_9b!T48ZKu#3mQ1fZ3;sO)f~l?9;?1mty`O+D|@nu9ZQ1 z+z&Oe#|4E_Ao(5_Buwo?4SU?4*cxZR(mvAU%y4${HvJ{!l<6%UCIgDieWZ!l94H{A zl0ahQD1mfPle5Bj-6PgZ|R#5*^OS?_y(F!_I`BK9{_{ESdi}do1 z-T3IdvER57fro0oahGTyQQ{jd!0(-aghb!akp7ewVOi9=A8cd8p*cTz2sB=Q@DQj? zKe$V0lmNmH?$Q|~+~yDN(itTD?hmwdrch@Vtnf#B%45B)A6;Y1V#bzAqOpwJMN5k; z+6^t&<(Y+lmjC|}>O4V+v4*{X;fvI+VMcc0-wP_H#1v`0dg7QOp4~#Tuw1B?TP{fS z@^W45@j#-Nm+K;^2ok-#Tpz{nC4fXPFV|16X0r>CEP2cfHa@c`^9}lc7@imNRhxKI z(sg{IJVXP4D;nK!xj`3R7O4>J23>erkgPT_KC`G*H|g|daXfxAB8h{Wh)5G|7OB9w zNf(0?Byeuhg`1_5%UgAdCC<#E(Rr&b{46LG1Ib4xNLc8tx)`0=L4B2;_FFMJ>9BH@ zZWNf`(%{Ob;d!TScRv1|b*I}nFj3Q;uHHeS%$>T}n1X~*cj{te3KDw1Qx_XkkQiNe z>KI+*7PG0#R{tlpC$(GI*hOkdSP(4z)kQ8wWM4 z(d7|^_jTR0ic^C~Gv)#WwdoZn7Vg}b>4l(p>MufawAb>svRJvFU@!Z>Ze`7`d)Wpo z9J1K}fXHrhX#lM8I)b#hMi+ZoWJYt>=(yZP%Lj##6Y4P$deHjCMC z8^muYb*)zm+45S~29b(d*19$b61A*#ZIF(>*D)KkvdIS5xi$z2#Xxc!1PSG@b8Rqy z8#a2{^TGz{y!#;?$ChLw0W!h$`v1KCnI`tOD38_vfa?q-TC?6Y5s;{Cy*n~NqBZMv ztbg`WEImLP-K2L+e{#1}N2a#P!=Wi=ldF4VWI4qk012E;y0|C-61v}{i;EH-OQN|2FXrU2HGGr@G(N#rBfXs0Iwa zmthRF<4qmg%RX4z69XCE((S@T-;%d<@yLy_k?$?NTX*v`kq`8C-JX{iX>HfV+a1bB z-LPF}kE5vVh_1e)%R6*_WehaB1`KXSAkj7N=whn_5|zKB_v8l=AfbeJba90ZB$Tj2 z*ZI8`kWj)7J*SVwEIfxQ-u=H@xG-=Ohh!-4N=8Pr+cj{cLbBbifrEr(yUD;|dIp*a zaxWkE_zj@F9uSTDy{`2k6+nAk>jTM3in)jGnd~F$JAddt*YI+f;eq6a2NLbvM}~K^ zf>mJ=J5^6oFr{^-a3=&vJb-W)Z zFAWk%M|GS4u;(;Eb{zS&Zufm*jrFyMK@xqfi&KOkv%ar&aYG0sFuvCDn3hWewSS|F zEqjnz3rJTQnnJ$ukVqTf=s_MfLuMd-qvO6HkSs_C^6$F19}Wr)1L;Ch$o=oSIJrYA zp#HAs@Vi$aSy|i<=R%?AF--iT)wJpX=^{~R{g@{dt$L2>mbeHTWXqmop0<(sTV3W? zw4g9RfpnoLi2ki76a{L&)pOjgq0`-O$r!j$=$Y?yarHaMj&(u0NEXG*zw@M`0M2)M zkcWzq8&KcrxchyWtUEWTFZZSG_DO{|;=Is(6npZir<^kEH|Xahylu?KEl)EkxKACz0;$kr3L3%L&70+AWQfEcf$*CcE@Qx6qa& z(hrZIs<|{JUFVZ;^6_Ie&`7?{=i_fGLDJ~H-X}tkj7A19cwCM#FygNFiMSjwkl_ZO zcn=90K`74QK8EE$ksEy30p^v60s6+2BFv40;g#SyQcA%7R`^u@)P@jf{DHw=douH_=4_Q|F)Ul!`Fa_W4 zlkZCQ1ZnMdpD$Y|iM{HyJ;j4Y1~7OSHkVF7(PY~vPAQ0i40re}aT3ZHj3dsD83RS` z@QJfyVt~HWC*IgH8YRHscLf-O<-lD5u2x9x_~d(&YNh!E3|FmKI9Q;C|IcNn;P@~> zalMl7c6{(iT(4L;04;oPQm^b&2&+B4N=&c6_Ou8F1iU+yL2A9nr}B^6-g!eH90SrDzvJ7bQeLgsIw*)e*^^^o_F%)&7)LFwy!@*_#T(y|8(SFg0}S?3dve2^Ogtn>Be zmp?&5t?PWJk6~)HKtr$Vd}AL;>QyFt{jH~0nd$YxUS(#k5Bt>9dB@X{ z(xX24cS*I<0DRO_D?2gSKx(yU*^o;oB*+1dt5<$xvcc0UJ2H6;YYx#9{KNzdev(fR zq}RuM;(0qUKtGa~w17zX#PMb>Rx;$npGj7M$F0;8VDQtdTwFo_ojd;QPC!hREQm?d{`jgMczpa2|QtL~e7Ws2sF!-j8 zWk8ExvV7uDkT`&N*(bJPjOGmfnuak@ubj`AmHnsS~bhag@oHuI84!R_|(yCA(~6RY`agc5_1CGF9hkzOZN-6 zd-Bpcbi1z`U;m;gv@YcbAh{Gwc*iF;aiCCJDv5?LGK63`f$bo$+~dKfMlOrEXehqJ^5AF`?MNX3 z$H)=^x63CNhP$z=Y{`!i;cg*)oybK*kzKw_eorNr*%L^<=LE@8^G`D0ldvk!3+f;E z()LS+9pAh&pI!ib;6t408hpE3%_HMoVRT&Z;#Ecz1a!W_5IP45ov$#&qzw{9R~UKx z)(A-Ge1*ZB1%PM+dy^r5VDJ?rXym@hz&3V;4-+hCs_FrwW8ACPC>A48*#m}{`WOS6 ze83P7sTl(h4;Z<8ATb82e89jsqPc`I(9sVVJqMWq(+~`_{Q;wBp!tq0ss+e;LoF-Z zBI83tmq(W1B5%hTZ;X|g5VTG~DxZG|kv5s@Q-z?;TAwNeEmqd23PFL6^{GNg^f8t7 zB*cRmLI^P4Gt|<;JMiS2wkWt9(eaNr13D9eCUvBGLeT#7Jwt5hNh%uc?-_agN&sU( zi1!TaQOQ3L1N8fbIxwjjnx4S$FlnRuekvwSQSVzu9u0D?P1>!#Z{YKyE+{be8S3z4 z2J+2dc%Zar-IoeV{&}B~H`prz%zehtVf2(iR`Y}U#|C{|y6{6OL~o>R|Lza-=t0TH z2EN;T1xzxZ?Bp+o{p0Sqh2N<0FRn#`ghl?v5MB!;3jW3D#)G{eQP*D#Jb@(_m`@gY z$dIq~bBhFx+=mP^&s<5LxB*Qy9U;@OLRIVv6++;&nZ$02{kBy-KH^#lV?dT8u9YwbtmKGmC7c1HI6_u3Q-}kMFATL$;Tb97*zfNdHG{IV z2u-RCEI{Mxp5kLAW-wZt3oi28Fuk|_3FG!qV@Lm?=5B;BlA0!icRKsEESu~@0cMzVL;eq zea8$;V3%-dX;1otp75dQ;9xKD>q0`jFgYG)hX9}N7NsY&o8j6v4%qoHRPo=kV2vCGDo#b2!w zcgomZG#CoMVa9HxVFOQZ{w;dw0puKfK|}zdsX#i8g|7I~z|LSyvN~k?m!W4B4rEuY zxdpOYRCK`()v>?``_$j!c6LB>Tpi@5P~30kSjl>6arQ3*i-?iQO2Ap>N8Gv}J|gE{ zGv==>QYyqB1!`|aB;vRV$QDpEJ*8b_Ps{vx-$VX_x)7ayjen|G+A{{@qzoKd&Ryfr z-^@0j-f@?p}Sob4IX_x>$I_+NEfNq^O? zck;vV;pBJWOVX;`&(h_G4+>J~1s^nRjpy4;t7r59FKZ~E- z=G@RnI#hg{SBARzw&VY{*=>ni`%1MTqjP_8+NuwWCFiqB=>}u<+TygsYeBV4lJcBe zCP{bt1j`vVM=EyCm@M^onkP#a9nU^8SsLsVPmwAzkXs^v@x$kqIUk*_6(??lO*xxD zt~vDNK%GU)S`&|+EzkQ2*XePdyq^~jn<3}S^W*~OjF@aVWpm_3T_K#SFEV;0w#<=- zjAuoDf3N(6#C|3IxJF*Ze>xZ4Cm-f|N8QN`8%HNA~WBK zZIHVqa@NUH1YYBB%7i#EZ`>8zla7`3uV9l5yj@UTKf~ zwwL6L+N`{j;ZoyInLEN+wMi;ZRKBR(S)jbz*L3cGz$|ut+@tLD@5LwFf@-g{)~Alt z|I8?y;*G*7Y!sGzqp+MtVaW+c;hF#&g=#ddRVrMS*mXe3GxFJZQldt{+~*D_rP2BK zVP*fIMvNxzut@&CM(zRXqA(v5o@u(K!8ay5`to5YAI^V@BfjU#TDV%sM`g^UM?K z_0Cn()nSR)@6-{7^Fl%$(4(si<0J8C1%I;We40@2G)U&xHVqCtfoIe_=eFTmmb3I3 zwJ5RW8Tz8{VT=;zyyw&+XYI2_$z5Z#^u)u@sUv!xSakJW^>9X(s|5|u1f#8qA3j#A zq%KV7tWVX=C&X~RSgH9F6aJ!(o2n7e;l%YrwRJI8~15FofZ4EyPR(hYGv9Z=n*L~>jQ0$p{i_Fcxt~^l|srN zYBN%@JIg-QCZ{C7Maf>_J_oc>T$;@Xw1ERtq=AvwC`+R8;5nu*G7q1EZEWU$6>|I- z>N$tX{#DJ%2VevHBzJ0?7$|texasJzX8_jQ&`g;_1zK=woee z@sa(--7kyLcDW9(wi;s%W%TTTeQ1@G>lA;Y4fS;ET=j`IEQQ?ni8jU~{QxVtEZP>U za}Io>F*&ST)70e{1x}VtSH0 zdgM>4+modaNCdL=OY($qStWYDB!2(8kN(Sk0WqkIiP4rAjFaYM21A}LR#X3S=<@+vQ* zb$jCbknfnpRw>)}qZ87reG?O>m-u3r`Gl3`#sb#`w|C>8B}WIj65&_FLzoOdT1F_t;^xXjEA9d@ppVvJ*{Jw<98E?hN@E-jD* zm;_hV!+GjzBQH^0WlYOunY;7MZnqD0D|Q~dz!>1{y1;mt{8*aviwlkZYPg%3=bU*l z05)G}#DyI=r?nbKGTn0FwYbBUl~WbvR}1My>O&xN)DC`CSRiwKFUu z-&yu+!+)X@f6hoEpN|;`d3!lMFEiG1yK}Z&W}L<9$Q13MS3ONjocpJ$QxkVyZVW#? zMS{e48;t_Z`SPGPG;!uLMj`wdex68~i8ap}7iM_FwJgOoVS=qu>3uf-{-}W?+&cPw zoO3#nYrW;qMjsEae;2$=;7nle(Q5!U+OrSs6{FTO?#L^~jAGBM&Gr^NXN}gvxKoO} z@rvyEP5j84O?&-w8+Bx^*?;VlYmk7fAhcB9dgy!maT?B^xl{kBo!rFKsdg=Qh&ya;X$)JN~yY1Ajx z>a2gqSo+`M+dGVY9REay@%J4@a}qbPXs0nLMNiIiyNt;O%`Rl#j(@lDvWMinx!dSf zRFku~v3Wvl@#4lf{nZR+KLdoyBxlIGM#wq$UE`6=q!#x}CMLPP#z{`!J;oJY!&5sS z4NvUdLm&SmpUY<363kdRbf14-4C}Lox;FZ*Li~7TIc4t|L%brRP$cs|WamRRgXgGa zc%zNOST%i_*!rGv`eYBOt8Amf{{GlwpwE##&AGV5U#*6FnuSh}!Tv&LXNmt+hji^v zisx+a<3E|TV^EUEmflQ#v!hM(Cn8d@fPJ{1PqhsAtiJwJot1t4KO9$AH|M^7{vL^~ z{rqPgFGM%zmJ(R!m;wH5HQWMm=9K$;I6sv7M|-xiX@LK$E@;n}`iqC(gXY3`o4hoJHn$r#X%5%pQ*PDy;vyb>^i!<=^YfSMvWK6MPpO 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..5e1b3b67 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.6.0" diff --git a/tools/proto-compiler/src/cmd/compile.rs b/tools/proto-compiler/src/cmd/compile.rs index 3b97d062..90164458 100644 --- a/tools/proto-compiler/src/cmd/compile.rs +++ b/tools/proto-compiler/src/cmd/compile.rs @@ -44,6 +44,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!"); } @@ -116,15 +121,11 @@ 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(); @@ -140,74 +141,26 @@ 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_with_config(config, &protos, &includes)?; println!("[info ] Protos compiled successfully"); @@ -215,6 +168,40 @@ impl CompileCmd { 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 '{}'...",